SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
DGaus.hh
1 #ifndef DGAUS_HH
2 #define DGAUS_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 // Other includes
14 #include "DFunction.hh"
15 #include "Matrix.hh"
16 
19 class DGaus : public DFunction {
20  public:
21 
26  DGaus(const size_t n=1);
27 
33  DGaus(const double mu,
34  const double sigma);
35 
41  DGaus(const std::vector<double>& mu,
42  const std::vector<double>& sigma);
43 
49  DGaus(const std::vector<double>& mu,
50  const Matrix<double>& cov);
51 
53  DGaus(const DGaus& df);
54 
56  DGaus& operator=(const DGaus& df);
57 
59  ~DGaus();
60 
65  double CDF(const double& v) const;
66 
71  double CDFRadial(const double& R) const;
72 
77  std::vector<TLine*> Contour1D(const double alpha) const;
78 
83  std::vector<TObject*> Contour2D(const double alpha) const;
84 
89  TF3* Contour3D(const double alpha) const;
90 
95  std::vector<TLine*> ContourRadial(const double alpha) const;
96 
101  double ContourVolume(const double alpha) const;
102 
107  double Evaluate(const std::vector<double>& v) const;
108 
113  double Level(const double alpha) const;
114 
116  double Norm() const;
117 
122  double Radial(const double R) const;
123 
128  double Radius(const double alpha) const;
129 
131  double Random();
132 
134  std::vector<double> RandomVector();
135 
136  private:
137 
139  bool Initialize();
140 
145  double Norm1D(const size_t i) const;
146 
148  std::vector<double> Parameters() const;
149 
154  std::vector<double> OffsetParameters(const double C) const;
155 
156  std::vector<double> _mean;
160  double _det;
161 };
162 
163 #endif
std::vector< double > OffsetParameters(const double C) const
Returns the parameters necessary to produce a ROOT 3D contour.
Definition: DGaus.cc:387
double Evaluate(const std::vector< double > &v) const
Returns the value of the distribution in v.
Definition: DGaus.cc:222
std::vector< TLine * > ContourRadial(const double alpha) const
Segment that encompass a certain p-value in radius.
Definition: DGaus.cc:196
std::vector< double > RandomVector()
Returns a random vector sampled from the Gaussian distribution.
Definition: DGaus.cc:302
std::vector< double > Parameters() const
Returns the parameters to produce a ROOT type Gaussian function.
Definition: DGaus.cc:369
bool Initialize()
Initializes the distribution.
Definition: DGaus.cc:320
std::vector< TLine * > Contour1D(const double alpha) const
Segment that encompass a certain p-value in 1 dimension.
Definition: DGaus.cc:136
double _det
Determinant of the covariance matrix.
Definition: DGaus.hh:160
double Norm() const
Returns the probability content within the defined interval.
Definition: DGaus.cc:244
std::vector< double > _mean
Vector mean.
Definition: DGaus.hh:156
~DGaus()
Destructor.
Definition: DGaus.cc:120
Defines the methods associated with the Gaussian distribution in any dimension.
Definition: DGaus.hh:19
Matrix< double > _cov
Covariance matrix.
Definition: DGaus.hh:157
double CDF(const double &v) const
Cumulative distribution function at v.
Definition: DGaus.cc:122
Matrix< double > _J
Jacobian of variable change.
Definition: DGaus.hh:159
DGaus & operator=(const DGaus &df)
Equality operator.
Definition: DGaus.cc:107
Matrix< double > _invcov
Inverse covariance matrix.
Definition: DGaus.hh:158
double CDFRadial(const double &R) const
If the function has an L1, L2 or Linf symmetry, returns its CDF at radius R.
Definition: DGaus.cc:129
double Radius(const double alpha) const
Returns the radius of the alpha-contour, following an L2 symmetry.
Definition: DGaus.cc:289
double Norm1D(const size_t i) const
Retuns the 1D normalisation for an arbitrary interval.
Definition: DGaus.cc:359
DGaus(const size_t n=1)
Normal constructor, initilizes a normal distribution of dimension n.
Definition: DGaus.cc:29
double Random()
Returns a random value sampled from the Gaussian distribution.
Definition: DGaus.cc:297
Parent class for all the probability density functions D*.
Definition: DFunction.hh:27
double Radial(const double R) const
Return the value of the Gaussian for an R following the L2 symmetry.
Definition: DGaus.cc:283
double Level(const double alpha) const
Returns the level of the alpha-contour of the distribution.
Definition: DGaus.cc:237
std::vector< TObject * > Contour2D(const double alpha) const
Ellipse that encompasses a certain p-value in 2 dimensions.
Definition: DGaus.cc:147
double ContourVolume(const double alpha) const
Volume of the smallest contour of a given p-value.
Definition: DGaus.cc:206
TF3 * Contour3D(const double alpha) const
Ellipsoid that encompasses a certain p-value in 3 dimensions.
Definition: DGaus.cc:179