SynAPSE  0.6.0
Synergistic Analysis of Phase Space Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Protected Attributes
DFunction Class Referenceabstract

Parent class for all the probability density functions D*. More...

#include <DFunction.hh>

Inheritance diagram for DFunction:
DCauchy DChiSquared DExponential DGaus DMaxwell DMultiGaus DPoisson DSpiral DTriangular DUniform

Public Member Functions

 DFunction ()
 Default constructor, initilizes everything to 0. More...
 
 DFunction (const DFunction &df)
 Copy constructor. More...
 
DFunction & operator= (const DFunction &df)
 Equality operator. More...
 
double operator() (const std::vector< double > &v) const
 Overloaded function operator, calls Evaluate. More...
 
double operator() (const double &v) const
 Overloaded function operator, calls Evaluate. More...
 
double operator() (const double *v) const
 Overloaded function operator, calls Evaluate. More...
 
 ~DFunction ()
 Destructor. More...
 
virtual double CDF (const double &v) const =0
 Cumulative distribution function at v. More...
 
virtual double CDFRadial (const double &R) const =0
 If the function has an L1, L2 or Linf symmetry, returns its CDF at radius R. More...
 
virtual std::vector< TLine * > Contour1D (const double alpha) const =0
 Segments that encompass a certain p-value in 1 dimension. More...
 
virtual std::vector< TObject * > Contour2D (const double alpha) const =0
 Geometrical objects that encompass a certain p-value in 2 dimensions. More...
 
virtual TF3 * Contour3D (const double alpha) const =0
 TF3 contour that encompasses a certain p-value in 3 dimensions. More...
 
virtual std::vector< TLine * > ContourRadial (const double alpha) const =0
 Segments that encompass a certain p-value in radius. More...
 
virtual double ContourVolume (const double alpha) const =0
 Volume of the smallest contour of a given p-value. More...
 
size_t Dimension () const
 Returns the dimension of the space. More...
 
virtual double Evaluate (const std::vector< double > &v) const =0
 Returns the value of the PDF. More...
 
double Evaluate (const double &v) const
 Returns the value of the PDF. More...
 
double Evaluate (const double *v) const
 Returns the value of the PDF. More...
 
virtual double Level (const double alpha) const =0
 Returns the level of the alpha-contour. More...
 
void SetLowerBound (const double lower, const size_t i=0)
 Sets the lower bound of axis i. More...
 
double LowerBound (const size_t i=0) const
 Returns the lower bound of axis i. More...
 
void SetLowerBounds (std::vector< double > lower)
 Sets the vector of lower bounds. More...
 
std::vector< double > LowerBounds () const
 Returns the array of lower bounds. More...
 
void SetName (const std::string &name)
 Returns the name of the function. More...
 
std::string Name () const
 Returns the name of the function. More...
 
virtual double Norm () const =0
 Returns the probability content within the defined interval. More...
 
virtual double Radial (const double R) const =0
 If the function has an L1, L2 or Linf symmetry, returns its value at radius R. More...
 
virtual double Random ()=0
 Returns a random value sampled from the distribution. More...
 
virtual std::vector< double > RandomVector ()=0
 Returns a random vector sampled from the distribution. More...
 
void SetRange (const double lower, const double upper, const size_t i=0)
 Returns the upper bound of axis i. More...
 
void SetRange (const std::vector< double > &lower, const std::vector< double > &upper)
 Returns the upper bound of axis i. More...
 
void Range (std::vector< double > &lower, std::vector< double > &upper) const
 Returns the upper bound of axis i. More...
 
void SetTitle (const std::string &title)
 Returns the name of the function. More...
 
std::string Title () const
 Returns the name of the function. More...
 
void SetUpperBound (const double upper, const size_t i=0)
 Sets the upper bound of axis i. More...
 
double UpperBound (const size_t i=0) const
 Returns the upper bound of axis i. More...
 
void SetUpperBounds (std::vector< double > upper)
 Sets the vector of upper bounds. More...
 
std::vector< double > UpperBounds () const
 Returns the array of upper bounds. More...
 
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. More...
 
TGraph * GraphRadial () const
 Returns a radial graph of the function. More...
 
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. More...
 
TGraph * GraphCDFRadial () const
 Returns a radial graph of the cummulative density function. More...
 
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) More...
 
void DrawRadial (const std::string opt="") const
 Draws the radial function on whichever TCanvas is currently being used (ROOT) More...
 
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. More...
 
void PrintRadial (const std::string opt="") const
 Creates a canvas, draws the radial function on it and save it to a file. More...
 

Protected Attributes

size_t _dim
 Dimension of the space the function lives in. More...
 
std::vector< double > _lower
 Array of lower bounds. More...
 
std::vector< double > _upper
 Array of upper bounds. More...
 
std::string _name
 Name of the function. More...
 
std::string _title
 Title of the function. More...
 
TRandom3 _rdmzer
 Pseudorandom number generator. More...
 

Detailed Description

Parent class for all the probability density functions D*.

Sets up common and virtual functions and members that may be called by all of the child function classes

Constructor & Destructor Documentation

DFunction::DFunction ( )

Default constructor, initilizes everything to 0.

DFunction::DFunction ( const DFunction &  df)

Copy constructor.

DFunction::~DFunction ( )

Destructor.

Member Function Documentation

virtual double DFunction::CDF ( const double &  v) const
pure virtual

Cumulative distribution function at v.

Parameters
vValue in which to evaluate the CDF

Implemented in DSpiral, DMultiGaus, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual double DFunction::CDFRadial ( const double &  R) const
pure virtual

If the function has an L1, L2 or Linf symmetry, returns its CDF at radius R.

Parameters
RRadius to evaluate at

Implemented in DSpiral, DMultiGaus, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual std::vector<TLine*> DFunction::Contour1D ( const double  alpha) const
pure virtual

Segments that encompass a certain p-value in 1 dimension.

Parameters
alphaP-value

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual std::vector<TObject*> DFunction::Contour2D ( const double  alpha) const
pure virtual

Geometrical objects that encompass a certain p-value in 2 dimensions.

Parameters
alphaP-value

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual TF3* DFunction::Contour3D ( const double  alpha) const
pure virtual

TF3 contour that encompasses a certain p-value in 3 dimensions.

Parameters
alphaP-value

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual std::vector<TLine*> DFunction::ContourRadial ( const double  alpha) const
pure virtual

Segments that encompass a certain p-value in radius.

Parameters
alphaP-value

Implemented in DSpiral, DMultiGaus, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual double DFunction::ContourVolume ( const double  alpha) const
pure virtual

Volume of the smallest contour of a given p-value.

Parameters
alphaP-value

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

size_t DFunction::Dimension ( ) const
inline

Returns the dimension of the space.

void DFunction::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)

Parameters
optDrawing options
idxID of the first coordinate to represent
idyID of the second coordinate to represent
xPoint that the projection intersects
void DFunction::DrawRadial ( const std::string  opt = "") const

Draws the radial function on whichever TCanvas is currently being used (ROOT)

Parameters
optDrawing options
virtual double DFunction::Evaluate ( const std::vector< double > &  v) const
pure virtual

Returns the value of the PDF.

Parameters
vVector of coordinates

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

double DFunction::Evaluate ( const double &  v) const

Returns the value of the PDF.

Parameters
vOne dimensional value
double DFunction::Evaluate ( const double *  v) const

Returns the value of the PDF.

Parameters
vPointer to an array of coordinates
TGraph * DFunction::Graph ( size_t  idx = 0,
std::vector< double >  x = std::vector<double>() 
) const

Returns a 1D graph of the function in the requested axis.

Parameters
idxID of the first coordinate to represent
xPoint included in the line (fixes the remaining coordinates)
TH2F * DFunction::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.

Parameters
idxID of the first coordinate to represent
idyID of the second coordinate to represent
xPoint included in the plane (fixes the remaining coordinates)
TGraph * DFunction::GraphCDFRadial ( ) const

Returns a radial graph of the cummulative density function.

TGraph * DFunction::GraphRadial ( ) const

Returns a radial graph of the function.

virtual double DFunction::Level ( const double  alpha) const
pure virtual

Returns the level of the alpha-contour.

Parameters
alphaP-value

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

double DFunction::LowerBound ( const size_t  i = 0) const
inline

Returns the lower bound of axis i.

std::vector<double> DFunction::LowerBounds ( ) const
inline

Returns the array of lower bounds.

std::string DFunction::Name ( ) const
inline

Returns the name of the function.

virtual double DFunction::Norm ( ) const
pure virtual

Returns the probability content within the defined interval.

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

double DFunction::operator() ( const std::vector< double > &  v) const
inline

Overloaded function operator, calls Evaluate.

Parameters
vVector of coordinates
double DFunction::operator() ( const double &  v) const
inline

Overloaded function operator, calls Evaluate.

Parameters
vOne dimensional value
double DFunction::operator() ( const double *  v) const
inline

Overloaded function operator, calls Evaluate.

Parameters
vPointer to an array of coordinates
DFunction & DFunction::operator= ( const DFunction &  df)

Equality operator.

void DFunction::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.

Parameters
optDrawing options
idxID of the first coordinate to represent
idyID of the second coordinate to represent
xPoint that the projection intersects
void DFunction::PrintRadial ( const std::string  opt = "") const

Creates a canvas, draws the radial function on it and save it to a file.

Parameters
optDrawing options
virtual double DFunction::Radial ( const double  R) const
pure virtual

If the function has an L1, L2 or Linf symmetry, returns its value at radius R.

Parameters
RRadius to evaluate at

Implemented in DSpiral, DMultiGaus, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DCauchy, DPoisson, and DChiSquared.

virtual double DFunction::Random ( )
pure virtual

Returns a random value sampled from the distribution.

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DPoisson, DCauchy, and DChiSquared.

virtual std::vector<double> DFunction::RandomVector ( )
pure virtual

Returns a random vector sampled from the distribution.

Implemented in DMultiGaus, DSpiral, DMaxwell, DGaus, DTriangular, DExponential, DUniform, DPoisson, DCauchy, and DChiSquared.

void DFunction::Range ( std::vector< double > &  lower,
std::vector< double > &  upper 
) const

Returns the upper bound of axis i.

void DFunction::SetLowerBound ( const double  lower,
const size_t  i = 0 
)

Sets the lower bound of axis i.

void DFunction::SetLowerBounds ( std::vector< double >  lower)
inline

Sets the vector of lower bounds.

void DFunction::SetName ( const std::string &  name)
inline

Returns the name of the function.

void DFunction::SetRange ( const double  lower,
const double  upper,
const size_t  i = 0 
)

Returns the upper bound of axis i.

void DFunction::SetRange ( const std::vector< double > &  lower,
const std::vector< double > &  upper 
)

Returns the upper bound of axis i.

void DFunction::SetTitle ( const std::string &  title)
inline

Returns the name of the function.

void DFunction::SetUpperBound ( const double  upper,
const size_t  i = 0 
)

Sets the upper bound of axis i.

void DFunction::SetUpperBounds ( std::vector< double >  upper)
inline

Sets the vector of upper bounds.

std::string DFunction::Title ( ) const
inline

Returns the name of the function.

double DFunction::UpperBound ( const size_t  i = 0) const
inline

Returns the upper bound of axis i.

std::vector<double> DFunction::UpperBounds ( ) const
inline

Returns the array of upper bounds.

Field Documentation

size_t DFunction::_dim
protected

Dimension of the space the function lives in.

std::vector<double> DFunction::_lower
protected

Array of lower bounds.

std::string DFunction::_name
protected

Name of the function.

TRandom3 DFunction::_rdmzer
protected

Pseudorandom number generator.

std::string DFunction::_title
protected

Title of the function.

std::vector<double> DFunction::_upper
protected

Array of upper bounds.


The documentation for this class was generated from the following files: