65 x(
"x",
"x", this, _x),
66 k(
"k",
"k", this, _k),
67 lambda(
"lambda",
"lambda", this, _lambda),
71 fHasIssuedConvWarning(false),
72 fHasIssuedSumWarning(false)
74 ccoutD(InputArguments) <<
"RooNonCentralChiSquare::ctor(" <<
GetName() <<
75 "MathMore Available, will use Bessel function expressions unless SetForceSum(true) "<< endl ;
82 x(
"x", this, other.
x),
83 k(
"k", this, other.k),
84 lambda(
"lambda", this, other.lambda),
85 fErrorTol(other.fErrorTol),
86 fMaxIters(other.fMaxIters),
87 fForceSum(other.fForceSum),
88 fHasIssuedConvWarning(false),
89 fHasIssuedSumWarning(false)
91 ccoutD(InputArguments) <<
"RooNonCentralChiSquare::ctor(" <<
GetName() <<
92 "MathMore Available, will use Bessel function expressions unless SetForceSum(true) "<< endl ;
110 double xmin =
x.min();
111 double xmax =
x.max();
132 coutI(InputArguments) <<
"RooNonCentralChiSquare sum being forced" << endl ;
139 int iDominant = (
int) std::floor(
lambda/2);
144 for(
int i = iDominant; ; ++i){
148 if(ithTerm/
sum < errorTol)
151 if( i>iDominant+MaxIters){
154 coutW(Eval) <<
"RooNonCentralChiSquare did not converge: for x=" <<
x <<
" k="<<
k
155 <<
", lambda="<<
lambda <<
" fractional error = " << ithTerm/
sum
156 <<
"\n either adjust tolerance with SetErrorTolerance(tol) or max_iter with SetMaxIter(max_it)"
163 for(
int i = iDominant - 1; i >= 0; --i){
192 double xmin =
x.min(rangeName);
193 double xmax =
x.max(rangeName);
213 int iDominant = (
int) std::floor(
lambda/2);
216 for(
int i = iDominant; ; ++i){
222 if(ithTerm/
sum < errorTol)
225 if( i>iDominant+MaxIters){
228 coutW(Eval) <<
"RooNonCentralChiSquare Normalization did not converge: for k="<<
k
229 <<
", lambda="<<
lambda <<
" fractional error = " << ithTerm/
sum
230 <<
"\n either adjust tolerance with SetErrorTolerance(tol) or max_iter with SetMaxIter(max_it)"
237 for(
int i = iDominant - 1; i >= 0; --i){
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
bool matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
The PDF of the Non-Central Chi Square distribution for n degrees of freedom.
double evaluate() const override
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
bool fHasIssuedConvWarning
void SetForceSum(bool flag)
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
bool fHasIssuedSumWarning
const char * GetName() const override
Returns name of object.
double chisquared_pdf(double x, double r, double x0=0)
Probability density function of the distribution with degrees of freedom.
double noncentral_chisquared_pdf(double x, double r, double lambda)
Probability density function of the non central distribution with degrees of freedom and the noon-c...
double chisquared_cdf(double x, double r, double x0=0)
Cumulative distribution function of the distribution with degrees of freedom (lower tail).
Double_t Gamma(Double_t z)
Computation of gamma(z) for all z.
static uint64_t sum(uint64_t i)