SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
DMaxwell.hh
1 #ifndef DMAXWELL_HH
2 #define DMAXWELL_HH
3 
4 // C++ includes
5 #include <iostream>
6 #include <vector>
7 #include <cmath>
8 
9 // ROOT includes
10 #include "TMath.h"
11 #include "TEllipse.h"
12 
13 #include "TCanvas.h"
14 #include "TH1F.h"
15 
16 // Other includes
17 #include "DFunction.hh"
18 #include "Matrix.hh"
19 
23 class DMaxwell : public DFunction {
24  public:
25 
30  DMaxwell(const size_t n=1);
31 
37  DMaxwell(const double mu,
38  const double sigma);
39 
45  DMaxwell(const std::vector<double>& mu,
46  const std::vector<double>& sigma);
47 
53  DMaxwell(const std::vector<double>& mu,
54  const Matrix<double>& cov);
55 
57  DMaxwell(const DMaxwell& df);
58 
60  DMaxwell& operator=(const DMaxwell& df);
61 
63  ~DMaxwell();
64 
69  double CDF(const double& v) const;
70 
75  double CDFRadial(const double& R) const;
76 
81  std::vector<TLine*> Contour1D(const double alpha) const;
82 
87  std::vector<TObject*> Contour2D(const double alpha) const;
88 
93  TF3* Contour3D(const double alpha) const;
94 
99  std::vector<TLine*> ContourRadial(const double alpha) const;
100 
105  double ContourVolume(const double alpha) const;
106 
111  double Evaluate(const std::vector<double>& v) const;
112 
117  double Level(const double alpha) const;
118 
120  double Norm() const;
121 
126  double Radial(const double R) const;
127 
135  void Radii(const double alpha, double& r, double& R, double& l) const;
136 
138  double Random();
139 
141  std::vector<double> RandomVector();
142 
143  private:
144 
146  bool Initialize();
147 
152  double Norm1D(const size_t i) const;
153 
155  std::vector<double> Parameters() const;
156 
161  std::vector<double> OffsetParameters(const double C) const;
162 
163  std::vector<double> _mean;
167  double _det;
168  TF1 _frand;
169 };
170 
171 #endif
Matrix< double > _J
Jacobian of variable change.
Definition: DMaxwell.hh:166
double Level(const double alpha) const
Returns the level of the alpha-contour of the distribution.
Definition: DMaxwell.cc:272
bool Initialize()
Initializes the distribution.
Definition: DMaxwell.cc:389
Matrix< double > _invcov
Inverse covariance matrix.
Definition: DMaxwell.hh:165
std::vector< double > OffsetParameters(const double C) const
Returns the parameters necessary to produce a ROOT 3D contour.
Definition: DMaxwell.cc:464
TF1 _frand
Function used to generate random 1D samples.
Definition: DMaxwell.hh:168
void Radii(const double alpha, double &r, double &R, double &l) const
Returns the radii of the alpha-contour, following an L2 symmetry.
Definition: DMaxwell.cc:326
~DMaxwell()
Destructor.
Definition: DMaxwell.cc:146
double Evaluate(const std::vector< double > &v) const
Returns the value of the distribution in v.
Definition: DMaxwell.cc:256
std::vector< double > RandomVector()
Returns a random vector sampled from the Maxwell distribution.
Definition: DMaxwell.cc:346
double ContourVolume(const double alpha) const
Volume of the smallest contour of a given p-value.
Definition: DMaxwell.cc:240
double Norm1D(const size_t i) const
Retuns the 1D normalisation for an arbitrary interval.
Definition: DMaxwell.cc:435
double _det
Determinant of the covariance matrix.
Definition: DMaxwell.hh:167
std::vector< TLine * > ContourRadial(const double alpha) const
Segment that encompass a certain p-value in radius.
Definition: DMaxwell.cc:230
std::vector< double > Parameters() const
Returns the parameters to produce a ROOT type Gaussian function.
Definition: DMaxwell.cc:448
std::vector< double > _mean
Vector mean.
Definition: DMaxwell.hh:163
DMaxwell(const size_t n=1)
Normal constructor, initilizes a normal distribution of dimension n.
Definition: DMaxwell.cc:54
double Random()
Returns a random value sampled from the Maxwell distribution.
Definition: DMaxwell.cc:339
double CDFRadial(const double &R) const
If the function has an L1, L2 or Linf symmetry, returns its CDF at radius R.
Definition: DMaxwell.cc:156
DMaxwell & operator=(const DMaxwell &df)
Equality operator.
Definition: DMaxwell.cc:132
Defines the methods associated with the the Maxwell-Bolztmann distribution in any dimension...
Definition: DMaxwell.hh:23
TF3 * Contour3D(const double alpha) const
Concentric ellipsoids that encompasses a certain p-value in 3 dimensions.
Definition: DMaxwell.cc:213
double CDF(const double &v) const
Cumulative distribution function at v.
Definition: DMaxwell.cc:148
Parent class for all the probability density functions D*.
Definition: DFunction.hh:27
double Norm() const
Returns the probability content within the defined interval.
Definition: DMaxwell.cc:280
std::vector< TLine * > Contour1D(const double alpha) const
Segments that encompass a certain p-value in 1 dimension.
Definition: DMaxwell.cc:163
std::vector< TObject * > Contour2D(const double alpha) const
Concentric ellipses that encompass a certain p-value in 2 dimensions.
Definition: DMaxwell.cc:175
Matrix< double > _cov
Covariance matrix.
Definition: DMaxwell.hh:164
double Radial(const double R) const
Return the value of the Maxwell distribution for an R following the L2 symmetry.
Definition: DMaxwell.cc:320