CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

CumulativeChiSquare.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: CumulativeChiSquare.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
3 // ---------------------------------------------------------------------------
4 
8 
9 namespace Genfun {
10 FUNCTION_OBJECT_IMP(CumulativeChiSquare)
11 
12 //---------------------------------------------------------------------------------//
13 // Implementation notes: The Cumulative Chi Square function is implemented in //
14 // terms of the incomplete gamma function. //
15 //---------------------------------------------------------------------------------//
16 
18  _nDof(ndf)
19 {
20  create();
21 }
22 
24  delete _function;
25 }
26 
28 AbsFunction(right),
29 _nDof(right._nDof)
30 {
31  create();
32 }
33 
34 double CumulativeChiSquare::operator() (double x) const {
35  return (*_function)(x);
36 }
37 
38 unsigned int CumulativeChiSquare::nDof() const {
39  return _nDof;
40 }
41 
42 void CumulativeChiSquare::create() {
43  Variable x;
44  IncompleteGamma incompleteGamma;
45  incompleteGamma.a().setValue(_nDof/2.0);
46  _function = (incompleteGamma(x/2.0)).clone();
47 }
48 } // namespace Genfun
Genfun::AbsFunction
Definition: CLHEP/GenericFunctions/AbsFunction.hh:48
Genfun::Variable
Definition: CLHEP/GenericFunctions/Variable.hh:19
Genfun::CumulativeChiSquare
Definition: CLHEP/GenericFunctions/CumulativeChiSquare.hh:19
Genfun::IncompleteGamma
Definition: CLHEP/GenericFunctions/IncompleteGamma.hh:20
Variable.hh
Genfun::AbsFunction::clone
virtual AbsFunction * clone() const =0
CumulativeChiSquare.hh
Genfun::IncompleteGamma::a
Parameter & a()
Definition: IncompleteGamma.cc:38
Genfun::CumulativeChiSquare::CumulativeChiSquare
CumulativeChiSquare(unsigned int nDof)
Definition: CumulativeChiSquare.cc:17
IncompleteGamma.hh
Genfun::CumulativeChiSquare::~CumulativeChiSquare
virtual ~CumulativeChiSquare()
Definition: CumulativeChiSquare.cc:23
x
any side effects of that construction would occur twice The semantics of throw x
Definition: whyZMthrowRethrows.txt:37
Genfun::Parameter::setValue
void setValue(double value)
Definition: Parameter.cc:57
Genfun::CumulativeChiSquare::nDof
unsigned int nDof() const
Definition: CumulativeChiSquare.cc:38
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition: CLHEP/GenericFunctions/AbsFunction.hh:156
Genfun::CumulativeChiSquare::operator()
virtual double operator()(double argument) const
Definition: CumulativeChiSquare.cc:34
Genfun
Definition: CLHEP/GenericFunctions/Abs.hh:14