Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:06

0001 #ifndef ChiSquared_H
0002 #define ChiSquared_H
0003 
0004 /** \class ChiSquared
0005  *  Constructed with total chi-squared value `value` and number of degrees 
0006  *  of freedom `ndf`. <BR>
0007  *
0008  *  Computes chi-squared upper tail probability, 
0009  *  i.e. the probability that an observation, correctly described by
0010  *  a model with nrDOF, will give rise to a chi-squared larger than the one
0011  *  observed. From this, one can interpret this probability as how likely
0012  *  it is to observe as high (or higher) a chi-squared. <BR>
0013  *
0014  *  Also computes the natural logarithm of that probability, 
0015  *  useful to compare very unlikely events, for which the probability 
0016  *  is rounded off to 0.
0017  */
0018 
0019 class ChiSquared {
0020 public:
0021   ChiSquared(float value, float ndf) : theValue(value), theNDF(ndf) {}
0022 
0023   float value() const;
0024   float degreesOfFreedom() const;
0025   float probability() const;
0026   float lnProbability() const;
0027 
0028 private:
0029   float theValue, theNDF;
0030 };
0031 
0032 #endif