19 #include "Exception.hh"
64 virtual double CDF(
const double& v)
const = 0;
70 virtual double CDFRadial(
const double& R)
const = 0;
76 virtual std::vector<TLine*>
Contour1D(
const double alpha)
const = 0;
82 virtual std::vector<TObject*>
Contour2D(
const double alpha)
const = 0;
88 virtual TF3*
Contour3D(
const double alpha)
const = 0;
94 virtual std::vector<TLine*>
ContourRadial(
const double alpha)
const = 0;
109 virtual double Evaluate(
const std::vector<double>& v)
const = 0;
115 double Evaluate(
const double& v)
const;
121 double Evaluate(
const double* v)
const;
127 virtual double Level(
const double alpha)
const = 0;
148 virtual double Norm()
const = 0;
154 virtual double Radial(
const double R)
const = 0;
157 virtual double Random() = 0;
168 void SetRange(
const std::vector<double>& lower,
169 const std::vector<double>& upper);
172 void Range(std::vector<double>& lower,
173 std::vector<double>& upper)
const;
198 TGraph*
Graph(
size_t idx=0, std::vector<double> x=std::vector<double>())
const;
209 TH2F*
Graph2D(
size_t idx=0,
size_t idy=1, std::vector<double> x=std::vector<double>())
const;
221 void Draw(
const std::string opt=
"",
int idx=0,
int idy=1,
222 std::vector<double> x=std::vector<double>())
const;
228 void DrawRadial(
const std::string opt=
"")
const;
237 void Print(
const std::string opt=
"",
int idx=0,
int idy=1,
238 std::vector<double> x=std::vector<double>())
const;
virtual std::vector< TObject * > Contour2D(const double alpha) const =0
Geometrical objects that encompass a certain p-value in 2 dimensions.
void SetLowerBound(const double lower, const size_t i=0)
Sets the lower bound of axis i.
Definition: DFunction.cc:38
virtual std::vector< double > RandomVector()=0
Returns a random vector sampled from the distribution.
TRandom3 _rdmzer
Pseudorandom number generator.
Definition: DFunction.hh:253
TGraph * GraphRadial() const
Returns a radial graph of the function.
Definition: DFunction.cc:115
double operator()(const std::vector< double > &v) const
Overloaded function operator, calls Evaluate.
Definition: DFunction.hh:42
double operator()(const double *v) const
Overloaded function operator, calls Evaluate.
Definition: DFunction.hh:55
void PrintRadial(const std::string opt="") const
Creates a canvas, draws the radial function on it and save it to a file.
Definition: DFunction.cc:244
double LowerBound(const size_t i=0) const
Returns the lower bound of axis i.
Definition: DFunction.hh:133
void SetName(const std::string &name)
Returns the name of the function.
Definition: DFunction.hh:142
virtual double Evaluate(const std::vector< double > &v) const =0
Returns the value of the PDF.
double UpperBound(const size_t i=0) const
Returns the upper bound of axis i.
Definition: DFunction.hh:185
DFunction()
Default constructor, initilizes everything to 0.
Definition: DFunction.cc:3
virtual double Random()=0
Returns a random value sampled from the distribution.
virtual double CDF(const double &v) const =0
Cumulative distribution function at v.
double operator()(const double &v) const
Overloaded function operator, calls Evaluate.
Definition: DFunction.hh:49
DFunction & operator=(const DFunction &df)
Equality operator.
Definition: DFunction.cc:11
~DFunction()
Destructor.
Definition: DFunction.cc:25
virtual double Radial(const double R) const =0
If the function has an L1, L2 or Linf symmetry, returns its value at radius R.
std::string _name
Name of the function.
Definition: DFunction.hh:251
size_t _dim
Dimension of the space the function lives in.
Definition: DFunction.hh:248
std::string Title() const
Returns the name of the function.
Definition: DFunction.hh:179
std::vector< double > _upper
Array of upper bounds.
Definition: DFunction.hh:250
void DrawRadial(const std::string opt="") const
Draws the radial function on whichever TCanvas is currently being used (ROOT)
Definition: DFunction.cc:217
virtual double Norm() const =0
Returns the probability content within the defined interval.
std::vector< double > LowerBounds() const
Returns the array of lower bounds.
Definition: DFunction.hh:139
void SetLowerBounds(std::vector< double > lower)
Sets the vector of lower bounds.
Definition: DFunction.hh:136
size_t Dimension() const
Returns the dimension of the space.
Definition: DFunction.hh:103
void Range(std::vector< double > &lower, std::vector< double > &upper) const
Returns the upper bound of axis i.
Definition: DFunction.cc:50
std::vector< double > _lower
Array of lower bounds.
Definition: DFunction.hh:249
void SetRange(const double lower, const double upper, const size_t i=0)
Returns the upper bound of axis i.
Definition: DFunction.cc:57
void SetUpperBound(const double upper, const size_t i=0)
Sets the upper bound of axis i.
Definition: DFunction.cc:44
std::vector< double > UpperBounds() const
Returns the array of upper bounds.
Definition: DFunction.hh:191
void Print(const std::string opt="", int idx=0, int idy=1, std::vector< double > x=std::vector< double >()) const
Creates a canvas, draws the function on it and save it to a file.
Definition: DFunction.cc:229
TGraph * GraphCDFRadial() const
Returns a radial graph of the cummulative density function.
Definition: DFunction.cc:173
TGraph * Graph(size_t idx=0, std::vector< double > x=std::vector< double >()) const
Returns a 1D graph of the function in the requested axis.
Definition: DFunction.cc:86
void SetTitle(const std::string &title)
Returns the name of the function.
Definition: DFunction.hh:176
virtual double CDFRadial(const double &R) const =0
If the function has an L1, L2 or Linf symmetry, returns its CDF at radius R.
TH2F * Graph2D(size_t idx=0, size_t idy=1, std::vector< double > x=std::vector< double >()) const
Returns a 2D histogram of the function in the requested axis.
Definition: DFunction.cc:143
void Draw(const std::string opt="", int idx=0, int idy=1, std::vector< double > x=std::vector< double >()) const
Draws the function on whichever TCanvas is currently being used (ROOT)
Definition: DFunction.cc:201
std::string Name() const
Returns the name of the function.
Definition: DFunction.hh:145
virtual std::vector< TLine * > Contour1D(const double alpha) const =0
Segments that encompass a certain p-value in 1 dimension.
Parent class for all the probability density functions D*.
Definition: DFunction.hh:27
std::string _title
Title of the function.
Definition: DFunction.hh:252
virtual double ContourVolume(const double alpha) const =0
Volume of the smallest contour of a given p-value.
void SetUpperBounds(std::vector< double > upper)
Sets the vector of upper bounds.
Definition: DFunction.hh:188
virtual double Level(const double alpha) const =0
Returns the level of the alpha-contour.
virtual std::vector< TLine * > ContourRadial(const double alpha) const =0
Segments that encompass a certain p-value in radius.
virtual TF3 * Contour3D(const double alpha) const =0
TF3 contour that encompasses a certain p-value in 3 dimensions.