43 _x(
"x",
"Dependent", this,
x),
44 _ndof(
"ndof",
"ndof", this, ndof)
52 _x(
"x", this, other._x),
53 _ndof(
"ndof",this,other._ndof)
71template<
class T_x,
class T_ndof>
72void compute(
size_t batchSize,
73 double * __restrict
output,
77 for (
size_t i=0; i<batchSize; i++) {
86 for (
size_t i=0; i<batchSize; i++) {
91 constexpr double ln2 = 0.693147180559945309417232121458;
93 for (
size_t i=0; i<batchSize; i++) {
98 double arg = (
N[i]-2)*lnx -X[i] -
N[i]*ln2;
108 const bool batch_x = !_xData.empty();
109 const bool batch_ndof = !_ndofData.empty();
111 if (!batch_x && !batch_ndof) {
114 batchSize =
findSize({ _xData, _ndofData });
117 if (batch_x && !batch_ndof ) {
120 else if (!batch_x && batch_ndof ) {
123 else if (batch_x && batch_ndof ) {
124 compute(batchSize,
output.data(), _xData, _ndofData);
135 if (rangeName && strlen(rangeName)) {
147 assert(1 == code); (
void)code;
double pow(double, double)
typedef void((*Func_t)())
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize, const RooArgSet *const normSet=nullptr, Tag_t ownerTag=kUnspecified)
Make a batch and return a span pointing to the pdf-local memory.
Little adapter that gives a bracket operator to types that don't have one.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
BatchHelpers::BatchData _batchData
RooArgSet is a container object that can hold multiple RooAbsArg objects.
The PDF of the Chi Square distribution for n degrees of freedom.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
No analytical calculation available (yet) of integrals over subranges.
RooSpan< double > evaluateBatch(std::size_t begin, std::size_t batchSize) const
Evaluate function for a batch of input data points.
A simple container to hold a batch of data values.
double min(const char *rname=0) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
double max(const char *rname=0) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
RooSpan< const typename T::value_type > getValBatch(std::size_t begin, std::size_t batchSize) const
Retrieve a batch of real or category data.
double tgamma(double x)
The gamma function is defined to be the extension of the factorial to real numbers.
size_t findSize(std::vector< RooSpan< const double > > parameters)
This function returns the minimum size of the non-zero-sized batches.
Double_t Gamma(Double_t z)
Computation of gamma(z) for all z.
static void output(int code)