68#include <unordered_set>
75std::string doubleToString(
double val)
78 ss << std::setprecision(std::numeric_limits<double>::max_digits10) << val;
82std::string mathFunc(std::string
const &
name)
84 return "RooFit::Detail::MathFuncs::" +
name;
87void rooHistTranslateImpl(RooAbsArg
const &arg,
CodegenContext &ctx,
int intOrder, RooDataHist
const &dataHist,
88 const RooArgSet &obs,
bool correctForBinSize,
bool cdfBoundaries)
90 if (intOrder != 0 && !(!cdfBoundaries && !correctForBinSize && intOrder == 1 && obs.
size() == 1)) {
92 <<
") ERROR: codegen currently only supports non-interpolation cases."
98 RooAbsBinning
const &binning = *dataHist.
getBinnings()[0];
100 ctx.addResult(&arg, ctx.buildCall(mathFunc(
"interpolate1d"), binning.
lowBound(), binning.
highBound(), *obs[0],
101 binning.
numBins(), weightArr));
106 ctx.addResult(&arg,
"(" + weightArr +
")[" + offset +
"]");
109std::string realSumPdfTranslateImpl(
CodegenContext &ctx, RooAbsArg
const &arg, RooArgList
const &funcList,
110 RooArgList
const &coefList,
bool normalize)
112 bool noLastCoeff = funcList.
size() != coefList.
size();
114 std::string
const &funcName = ctx.buildArg(funcList);
115 std::string
const &coeffName = ctx.buildArg(coefList);
116 std::string
const &coeffSize = std::to_string(coefList.
size());
118 std::string
sum = ctx.getTmpVarName();
119 std::string coeffSum = ctx.getTmpVarName();
120 ctx.addToCodeBody(&arg,
"double " +
sum +
" = 0;\ndouble " + coeffSum +
"= 0;\n");
122 std::string iterator =
"i_" + ctx.getTmpVarName();
123 std::string subscriptExpr =
"[" + iterator +
"]";
125 std::string code =
"for(int " + iterator +
" = 0; " + iterator +
" < " + coeffSize +
"; " + iterator +
"++) {\n" +
126 sum +
" += " + funcName + subscriptExpr +
" * " + coeffName + subscriptExpr +
";\n";
127 code += coeffSum +
" += " + coeffName + subscriptExpr +
";\n";
131 code +=
sum +
" += " + funcName +
"[" + coeffSize +
"]" +
" * (1 - " + coeffSum +
");\n";
132 }
else if (normalize) {
133 code +=
sum +
" /= " + coeffSum +
";\n";
135 ctx.addToCodeBody(&arg, code);
156 ctx.
addResult(&arg, paramNames +
"[" + idx +
"]");
163 std::size_t
n = interpCodes.size();
166 for (std::size_t i = 0; i <
n; ++i) {
167 if (interpCodes[i] != interpCodes[0]) {
169 <<
"FlexibleInterpVar::evaluate ERROR: Code Squashing AD does not yet support having "
170 "different interpolation codes for the same class object "
186 std::vector<double> valsNominal;
187 std::vector<double> valsLow;
188 std::vector<double> valsHigh;
189 for (
int i = 0; i < nBins; ++i) {
190 valsNominal.push_back(nomHist.
weight(i));
192 for (
int i = 0; i < nBins; ++i) {
193 for (std::size_t iParam = 0; iParam <
n; ++iParam) {
199 std::string valsNominalStr = ctx.
buildArg(valsNominal);
200 std::string valsLowStr = ctx.
buildArg(valsLow);
201 std::string valsHighStr = ctx.
buildArg(valsHigh);
202 std::string nStr = std::to_string(
n);
209 "unsigned int " + idxName +
" = " +
212 code +=
"double const* " + lowName +
" = " + valsLowStr +
" + " + nStr +
" * " + idxName +
";\n";
213 code +=
"double const* " + highName +
" = " + valsHighStr +
" + " + nStr +
" * " + idxName +
";\n";
214 code +=
"double " + nominalName +
" = *(" + valsNominalStr +
" + " + idxName +
");\n";
216 std::string funcCall = ctx.
buildCall(mathFunc(
"flexibleInterp"), interpCodes[0], arg.
paramList(),
n, lowName,
217 highName, 1.0, nominalName, 0.0);
218 code +=
"double " + resName +
" = " + funcCall +
";\n";
221 code += resName +
" = " + resName +
" < 0 ? 0 : " + resName +
";\n";
239 std::stringstream errorMsg;
240 errorMsg <<
"Translate function for class \"" << arg.
ClassName() <<
"\" has not yet been implemented.";
253 std::span<const double> covISpan{covI.GetMatrixArray(),
static_cast<size_t>(covI.GetNoElements())};
269 std::cout <<
"MathFunc call used\n";
279 for (
int i = 0; i < numPdfs; ++i) {
281 std::string pdfExpr = ctx.
getResult(*pdf);
283 expr +=
"(" + indexExpr +
" == " + std::to_string(i) +
" ? (" + pdfExpr +
") : ";
287 expr += std::string(numPdfs,
')');
290 std::cout <<
"Ternary expression call used \n";
320 if (!
dynamic_cast<RooFit::Detail::RooNLLVarNew *
>(component) || arg.
list().
size() == 1) {
381template <
class RooArg_t>
384 if (!arg.function()->HasGradient()) {
385 std::stringstream errorMsg;
386 errorMsg <<
"Functor wrapped by \"" << arg.GetName() <<
"\" doesn't provide a gradient function."
387 <<
" RooFit codegen is therefore not supported.";
389 throw std::runtime_error(errorMsg.str());
392 std::string funcAddrStr =
TString::Format(
"0x%zx",
reinterpret_cast<std::size_t
>(arg.function())).
Data();
393 std::string wrapperName =
"roo_functor_" + funcAddrStr;
395 static std::unordered_set<std::string> wrapperNames;
397 if (wrapperNames.find(wrapperName) == wrapperNames.end()) {
399 wrapperNames.insert(wrapperName);
401 std::string pullbackName = wrapperName +
"_pullback";
402 std::string nStr = std::to_string(std::size(variables));
405 if constexpr (std::is_same_v<RooArg_t, RooFunctor1DBinding> || std::is_same_v<RooArg_t, RooFunctor1DPdfBinding>)
406 type =
"::ROOT::Math::IGradientFunctionOneDim";
408 type =
"::ROOT::Math::IGradientFunctionMultiDim";
410 std::string funcAddrCasted =
"reinterpret_cast<" + type +
" const *>(" + funcAddrStr +
")";
414 code +=
"double " + wrapperName +
415 "(double const *x) {\n"
420 "namespace clad::custom_derivatives {\n\n"
423 "(double const* x, double d_y, double *d_x) {\n"
429 "->Gradient(x, output);\n"
430 " for (int i = 0; i < " +
433 " d_x[i] += output[i] * d_y;\n"
436 "} // namespace clad::custom_derivatives\n";
477 ctx.
addResult(&arg, funcName +
"(" + inputVar +
")");
523 ctx.
addResult(&arg, funcName +
"(" + inputVar +
")");
551void codegenChi2(RooFit::Detail::RooNLLVarNew &arg, CodegenContext &ctx)
553 using FuncMode = RooFit::Detail::RooNLLVarNew::FuncMode;
556 ctx.addResult(&arg, resName);
557 ctx.addToGlobalScope(
"double " + resName +
" = 0.0;\n");
566 std::string normFactor;
567 if (arg.funcMode() == FuncMode::Function) {
569 }
else if (arg.funcMode() == FuncMode::ExtendedPdf) {
570 normFactor = ctx.getResult(*arg.expectedEvents());
573 ctx.addToGlobalScope(
"double " + weightSumName +
" = 0.0;\n");
575 auto scope = ctx.beginLoop(&arg);
576 ctx.addToCodeBody(weightSumName +
" += " + ctx.getResult(arg.weightVar()) +
";\n");
578 normFactor = weightSumName;
581 auto scope = ctx.beginLoop(&arg);
582 const std::string mu =
583 "(" + ctx.getResult(arg.func()) +
" * " + ctx.getResult(*arg.binVolumes()) +
" * " + normFactor +
")";
586 switch (arg.chi2ErrorType()) {
587 case RooDataHist::Expected: term = ctx.buildCall(mathFunc(
"chi2Expected"), mu, arg.weightVar());
break;
589 term = ctx.buildCall(mathFunc(
"chi2Symmetric"), mu, arg.weightVar(), arg.weightSquaredVar());
592 term = ctx.buildCall(mathFunc(
"chi2Asymmetric"), mu, arg.weightVar(), *arg.weightErrLo(), *arg.weightErrHi());
596 ctx.addToCodeBody(&arg, resName +
" += " + term +
";");
603 if (arg.statistic() == RooFit::Detail::RooNLLVarNew::Statistic::Chi2) {
604 return codegenChi2(arg, ctx);
607 if (arg.binnedL() && !arg.func().getAttribute(
"BinnedLikelihoodActiveYields")) {
608 std::stringstream errorMsg;
609 errorMsg <<
"codegen: binned likelihood optimization is only supported when raw pdf "
610 "values can be interpreted as yields."
611 <<
" This is not the case for HistFactory models written with ROOT versions before 6.26.00";
613 throw std::runtime_error(errorMsg.str());
622 const bool needWeightSum = arg.expectedEvents() || arg.simCount() > 1;
628 if (arg.simCount() > 1) {
629 std::string simCountStr = std::to_string(
static_cast<double>(arg.simCount()));
630 ctx.
addToCodeBody(resName +
" += " + weightSumName +
" * std::log(" + simCountStr +
");\n");
638 std::string term = ctx.
buildCall(mathFunc(
"nll"), arg.func(), arg.weightVar(), arg.binnedL(), 0);
641 if (arg.expectedEvents()) {
642 std::string expected = ctx.
getResult(*arg.expectedEvents());
643 ctx.
addToCodeBody(resName +
" += " + expected +
" - " + weightSumName +
" * std::log(" + expected +
");\n");
657 std::stringstream result;
658 result << arrName <<
"[" << idx <<
"]";
664 result <<
" * *(" << weightArr <<
" + " << idx +
") * " << doubleToString(binV);
673 xName =
"std::floor(" + xName +
")";
712std::string codegenIntegral(
RooAbsReal &arg,
int code,
const char *rangeName, CodegenContext &ctx)
714 using Func = std::string (*)(
RooAbsReal &,
int,
const char *, CodegenContext &);
721 static std::unordered_map<TClass *, Func> dispatchMap;
723 auto found = dispatchMap.find(tclass);
725 if (found != dispatchMap.end()) {
726 func = found->second;
729 std::stringstream cmd;
730 cmd <<
"&RooFit::Experimental::CodegenIntegralImplCaller<" << tclass->
GetName() <<
">::call;";
731 func =
reinterpret_cast<Func
>(
gInterpreter->ProcessLine(cmd.str().c_str()));
732 dispatchMap[tclass] = func;
735 return func(arg, code, rangeName, ctx);
748 std::stringstream errorMsg;
749 errorMsg <<
"Only analytical integrals and 1D numeric integrals are supported for AD for class"
752 throw std::runtime_error(errorMsg.str().c_str());
758 std::string oldIntVarResult = ctx.
getResult(intVar);
763 std::stringstream ss;
765 ss <<
"double " << obsName <<
"[1];\n";
775 <<
" const int n = 1000; // number of sampling points\n"
776 <<
" double d = " << intVar.getMax(arg.
intRange()) <<
" - " << intVar.getMin(arg.
intRange()) <<
";\n"
777 <<
" double eps = d / n;\n"
778 <<
" #pragma clad checkpoint loop\n"
779 <<
" for (int i = 0; i < n; ++i) {\n"
780 <<
" " << obsName <<
"[0] = " << intVar.getMin(arg.
intRange()) <<
" + eps * i;\n"
781 <<
" double tmpA = " << funcName <<
"(params, " << obsName <<
", xlArr);\n"
782 <<
" " << obsName <<
"[0] = " << intVar.getMin(arg.
intRange()) <<
" + eps * (i + 1);\n"
783 <<
" double tmpB = " << funcName <<
"(params, " << obsName <<
", xlArr);\n"
784 <<
" " << resName <<
" += (tmpA + tmpB) * 0.5 * eps;\n"
820 unsigned int n = interpCodes.size();
822 int interpCode = interpCodes[0];
824 if (interpCode == 4) {
828 for (
unsigned int i = 1; i <
n; i++) {
829 if (interpCodes[i] != interpCodes[0]) {
831 <<
"FlexibleInterpVar::evaluate ERROR: Code Squashing AD does not yet support having "
832 "different interpolation codes for the same class object "
837 std::string
const &resName = ctx.
buildCall(mathFunc(
"flexibleInterp"), interpCode, arg.
variables(),
n, arg.
low(),
862 std::stringstream errorMsg;
863 errorMsg <<
"An analytical integral function for class \"" << arg.
ClassName() <<
"\" has not yet been implemented.";
865 throw std::runtime_error(errorMsg.str().c_str());
872 return ctx.
buildCall(mathFunc(
"bernsteinIntegral"),
x.getMin(rangeName),
x.getMax(rangeName), arg.
xmin(), arg.
xmax(),
878 auto &constant = code == 1 ? arg.
getMean() : arg.
getX();
881 return ctx.
buildCall(mathFunc(
"bifurGaussIntegral"), integrand.getMin(rangeName), integrand.getMax(rangeName),
888 return ctx.
buildCall(mathFunc(
"cbShapeIntegral"),
m.getMin(rangeName),
m.getMax(rangeName), arg.
getM0(),
900 x.getMax(rangeName));
910 bool isOverX = code == 1;
912 std::string constant;
920 double min = integrand.
getMin(rangeName);
921 double max = integrand.getMax(rangeName);
929 return ctx.
buildCall(mathFunc(
"exponentialIntegral"), min, max, constant);
935 const std::string
a =
937 const std::string
b =
939 return a +
" - " +
b;
944 auto &constant = code == 1 ? arg.
getMean() : arg.
getX();
947 return ctx.
buildCall(mathFunc(
"gaussianIntegral"), integrand.getMin(rangeName), integrand.getMax(rangeName),
953std::string rooHistIntegralTranslateImpl(
int code,
RooAbsArg const &arg,
RooDataHist const &dataHist,
956 if (((2 << obs.
size()) - 1) != code) {
958 <<
") ERROR: AD currently only supports integrating over all histogram observables."
962 return doubleToString(dataHist.
sum(histFuncMode));
969 return rooHistIntegralTranslateImpl(code, arg, arg.
dataHist(), arg.
variables(),
true);
974 return rooHistIntegralTranslateImpl(code, arg, arg.
dataHist(), arg.
variables(),
false);
997 std::stringstream errorMsg;
998 errorMsg <<
"Partial integrals over RooMultiVarGaussian are not supported.";
1000 throw std::runtime_error(errorMsg.str().c_str());
1008 std::stringstream ss;
1023 assert(code == 1 || code == 2);
1026 xName =
"std::floor(" + xName +
")";
1031 xName = code == 1 ?
"0" : xName;
1032 return ctx.
buildCall(mathFunc(
"poissonIntegral"), code, arg.
getMean(), xName, integrand.getMin(rangeName),
1039 const double xmin =
x.getMin(rangeName);
1040 const double xmax =
x.getMax(rangeName);
1051 const double xmin =
x.getMin(rangeName);
1052 const double xmax =
x.getMax(rangeName);
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
const RooArgList & paramList() const
const RooArgList & dataVars() const
RooDataHist const & dataHist() const
The PiecewiseInterpolation is a class that can morph distributions into each other,...
const RooArgList & highList() const
const RooAbsReal * nominalHist() const
Return pointer to the nominal hist function.
bool positiveDefinite() const
const RooArgList & lowList() const
const RooArgList & paramList() const
const std::vector< int > & interpolationCodes() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
bool isConstant() const
Check if the "Constant" attribute is set.
Int_t numBins() const
Return number of bins.
virtual double highBound() const =0
virtual double lowBound() const =0
A space to attach TBranches.
value_type lookupIndex(const std::string &stateName) const
Find the index number corresponding to the state name.
Storage_t::size_type size() const
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
TClass * IsA() const override
Efficient implementation of a sum of PDFs of the form.
const RooArgList & coefList() const
const RooArgList & pdfList() const
Calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
const RooArgList & list() const
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Bernstein basis polynomials are positive-definite in the range [0,1].
RooAbsRealLValue const & x() const
RooArgList const & coefList() const
Bifurcated Gaussian p.d.f with different widths on left and right side of maximum value.
RooAbsReal const & getSigmaL() const
Get the left sigma parameter.
RooAbsReal const & getSigmaR() const
Get the right sigma parameter.
RooAbsReal const & getX() const
Get the x variable.
RooAbsReal const & getMean() const
Get the mean parameter.
PDF implementing the Crystal Ball line shape.
RooAbsReal const & getSigma() const
RooAbsReal const & getM() const
RooAbsReal const & getN() const
RooAbsReal const & getM0() const
RooAbsReal const & getAlpha() const
Object to represent discrete states.
value_type getCurrentIndex() const final
Return current index.
Chebychev polynomial p.d.f.
RooAbsReal const & x() const
RooArgList const & coefList() const
const char * refRangeName() const
Represents a constant real-valued object.
Calculates the sum of the -(log) likelihoods of a set of RooAbsPfs that represent constraint function...
const RooArgList & list()
Container class to hold N-dimensional binned data.
double sum(bool correctForBinSize, bool inverseCorr=false) const
Return the sum of the weights of all bins in the histogram.
std::vector< std::unique_ptr< const RooAbsBinning > > const & getBinnings() const
std::string declWeightArrayForCodeSquash(RooFit::Experimental::CodegenContext &ctx, bool correctForBinSize) const
double weight(std::size_t i) const
Return weight of i-th bin.
std::string calculateTreeIndexForCodeSquash(RooFit::Experimental::CodegenContext &ctx, const RooAbsCollection &coords, bool reverse=false) const
double binVolume(std::size_t i) const
Return bin volume of i-th bin.
The class RooEffProd implements the product of a PDF with an efficiency function.
RooAbsReal const & pdf() const
RooAbsReal const & eff() const
A PDF helper class to fit efficiencies parameterized by a supplied function F.
RooAbsCategory const & cat() const
RooAbsReal const & effFunc() const
std::string sigCatName() const
bool negateCoefficient() const
RooAbsReal const & coefficient() const
Get the coefficient "c".
RooAbsReal const & variable() const
Get the x variable.
RooExtendPdf is a wrapper around an existing PDF that adds a parameteric extended likelihood term to ...
RooAbsPdf const & pdf() const
A RooProdPdf with a fixed normalization set can be replaced by this class.
RooArgSet const * partList() const
bool isRearranged() const
RooAbsReal const * rearrangedDen() const
RooAbsReal const * rearrangedNum() const
RooAbsReal const & normIntegral() const
RooAbsPdf const & pdf() const
A class to maintain the context for squashing of RooFit models into code.
void addToGlobalScope(std::string const &str)
Adds the given string to the string block that will be emitted at the top of the squashed function.
std::string const & getResult(RooAbsArg const &arg)
Gets the result for the given node using the node name.
std::string getTmpVarName() const
Get a unique variable name to be used in the generated code.
void addResult(RooAbsArg const *key, std::string const &value)
A function to save an expression that includes/depends on the result of the input node.
void addToCodeBody(RooAbsArg const *klass, std::string const &in)
Adds the input string to the squashed code body.
std::unique_ptr< LoopScope > beginLoop(RooAbsArg const *in)
Create a RAII scope for iterating over vector observables.
void collectFunction(std::string const &name)
Register a function that is only know to the interpreter to the context.
void addVecObs(const char *key, int idx)
Since the squashed code represents all observables as a single flattened array, it is important to ke...
int observableIndexOf(const RooAbsArg &arg) const
std::string buildArg(RooAbsCollection const &x, std::string const &arrayType="double")
Function to save a RooListProxy as an array in the squashed code.
std::string buildFunction(RooAbsArg const &arg, std::unordered_set< RooFit::Detail::DataKey > const &dependsOnData={})
Assemble and return the final code with the return expression and global statements.
std::string buildCall(std::string const &funcname, Args_t const &...args)
Build the code to call the function with name funcname, passing some arguments.
auto const & dependsOnData() const
RooCFunction1Binding is a templated implementation of class RooAbsReal that binds generic C(++) funct...
RooAbsReal const & variable() const
RooAbsReal const & variable() const
RooFunctorBinding makes math functions from ROOT usable in RooFit.
RooArgList const & variables() const
RooFunctorPdfBinding makes math functions from ROOT usable as PDFs in RooFit.
RooArgList const & variables() const
Implementation of the Gamma PDF for RooFit/RooStats.
RooAbsReal const & getX() const
RooAbsReal const & getGamma() const
RooAbsReal const & getBeta() const
RooAbsReal const & getMu() const
RooAbsReal const & getX() const
Get the x variable.
RooAbsReal const & getMean() const
Get the mean parameter.
RooAbsReal const & getSigma() const
Get the sigma parameter.
Implementation of a probability density function that takes a RooArgList of servers and a C++ express...
const RooArgList & dependents() const
std::string getUniqueFuncName() const
A real-valued function sampled from a multidimensional histogram.
Int_t getInterpolationOrder() const
Return histogram interpolation order.
bool getCdfBoundaries() const
If true, special boundary conditions for c.d.f.s are used.
RooDataHist & dataHist()
Return RooDataHist that is represented.
RooArgSet const & variables() const
A probability density function sampled from a multidimensional histogram.
Int_t getInterpolationOrder() const
bool haveUnitNorm() const
bool getCdfBoundaries() const
RooArgSet const & variables() const
Landau distribution p.d.f.
RooAbsReal const & getSigma() const
RooAbsReal const & getMean() const
RooAbsReal const & getX() const
bool useStandardParametrization() const
RooAbsReal const & getMedian() const
Get the median parameter.
RooAbsReal const & getShapeK() const
Get the shape parameter.
RooAbsReal const & getX() const
Get the x variable.
The class RooMultiPdf allows for the creation of a RooMultiPdf object, which can switch between previ...
const RooCategoryProxy & indexCategory() const
RooAbsPdf * getPdf(int index) const
const RooListProxy & getPdfList() const
Multivariate Gaussian p.d.f.
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Handle full integral here.
const RooArgList & xVec() const
const TMatrixDSym & covarianceMatrixInverse() const
const RooArgList & muVec() const
RooONNXFunc wraps an ONNX model as a RooAbsReal, allowing it to be used as a building block in likeli...
std::string outerWrapperName() const
std::size_t nInputTensors() const
RooArgList const & inputTensorList(int iTensor) const
A histogram function that assigns scale parameters to every bin.
const RooArgList & paramList() const
const RooArgList & xList() const
const RooDataHist & dataHist() const
RooAbsReal const & getX() const
Get the x variable.
bool getProtectNegativeMean() const
bool getNoRounding() const
RooAbsReal const & getMean() const
Get the mean parameter.
A RooAbsReal implementing a polynomial in terms of a list of RooAbsReal coefficients.
RooArgList const & coefList() const
RooAbsReal const & x() const
RooPolynomial implements a polynomial p.d.f of the form.
RooAbsReal const & x() const
Get the x variable.
int lowestOrder() const
Return the order for the first coefficient in the list.
RooArgList const & coefList() const
Get the coefficient list.
Represents the product of a given set of RooAbsReal objects.
const RooArgList & realComponents() const
Represents the ratio of two RooAbsReal objects.
RooAbsReal const & numerator() const
RooAbsReal const & denominator() const
Performs hybrid numerical/analytical integrals of RooAbsReal objects.
const RooArgSet & numIntRealVars() const
RooArgSet intVars() const
const RooAbsReal & integrand() const
const RooArgSet & numIntCatVars() const
const char * intRange() const
const RooArgList & coefList() const
const RooArgList & funcList() const
Implements a PDF constructed from a sum of functions:
const RooArgList & funcList() const
const RooArgList & funcIntListFromCache(Int_t code, const char *rangeName=nullptr) const
Collect the list of functions to be integrated from the cache.
const RooArgList & coefList() const
Variable that can be changed from the outside.
A RooAbsReal implementation that calculates the plain fraction of sum of RooAddPdf components from a ...
RooArgList const & variables() const
const std::vector< int > & interpolationCodes() const
double globalBoundary() const
const RooListProxy & variables() const
const std::vector< double > & high() const
const std::vector< double > & low() const
The RooWrapperPdf is a class that can be used to convert a function into a PDF.
RooAbsReal const & function() const
TClass instances represent classes, structs and namespaces in the ROOT type system.
const char * GetName() const override
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
std::string makeValidVarName(std::string const &in)
void codegenImpl(RooFit::Detail::RooFixedProdPdf &arg, CodegenContext &ctx)
void functorCodegenImpl(RooArg_t &arg, RooArgList const &variables, CodegenContext &ctx)
std::string codegenIntegralImpl(RooAbsReal &arg, int code, const char *rangeName, CodegenContext &ctx)
This function defines the analytical integral translation for the class.
static uint64_t sum(uint64_t i)