40#ifdef ROOFIT_LEGACY_EVAL_BACKEND
80 if (sumSet1.
size() != sumSet2.
size()) {
81 coutE(InputArguments) <<
"RooAddition::ctor(" << GetName() <<
") ERROR: input lists should be of equal length" << std::endl;
82 RooErrorHandler::softAbort() ;
85 for (
unsigned int i = 0; i < sumSet1.
size(); ++i) {
86 const auto comp1 = &sumSet1[i];
87 const auto comp2 = &sumSet2[i];
90 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp1->GetName()
91 <<
" in first list is not of type RooAbsReal" << std::endl;
96 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp2->GetName()
97 <<
" in first list is not of type RooAbsReal" << std::endl;
102 _name.
Append(comp1->GetName());
104 _name.
Append(comp2->GetName());
106 auto prod = std::make_unique<RooProduct>( _name, _name ,
RooArgSet(*comp1, *comp2));
134 const double tmp = comp->getVal(nset);
145 std::vector<std::span<const double>> pdfs;
146 std::vector<double> coefs;
147 pdfs.reserve(
_set.size());
148 coefs.reserve(
_set.size());
149 for (
const auto arg :
_set) {
150 pdfs.push_back(ctx.
at(arg));
151 coefs.push_back(1.0);
172 if (
dynamic_cast<RooFit::Detail::RooNLLVarNew*
>(arg)) {
175#ifdef ROOFIT_LEGACY_EVAL_BACKEND
176 if (
dynamic_cast<RooNLLVar*
>(arg)) {
179 if (
dynamic_cast<RooChi2Var*
>(arg)) {
185 if (nllArg && !chi2Arg) {
186 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName()
187 <<
") Summation contains a RooNLLVar, using its error level" << std::endl;
189 }
else if (chi2Arg && !nllArg) {
190 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName()
191 <<
") Summation contains a RooChi2Var, using its error level" << std::endl;
193 }
else if (!nllArg && !chi2Arg) {
194 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
195 <<
"Summation contains neither RooNLLVar nor RooChi2Var server, using default level of 1.0" << std::endl;
197 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
198 <<
"Summation contains BOTH RooNLLVar and RooChi2Var server, using default level of 1.0" << std::endl;
210 for (
const auto arg :
_set) {
232 analVars.
add(allVars);
235 Int_t sterileIndex(-1);
237 if (cache!=
nullptr) {
245 cache->
_I.
addOwned(std::unique_ptr<RooAbsReal>{arg->createIntegral(analVars,rangeName)});
259 if (cache==
nullptr) {
268 assert(cache!=
nullptr);
272 for (
auto I : cache->
_I) {
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
int Int_t
Signed integer 4 bytes (int).
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooFit::OwningPtr< RooArgSet > getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
RooAbsArg()
Default constructor.
Abstract base class for objects to be stored in RooAbsCache cache manager objects.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
Abstract base class for binned and unbinned datasets.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
virtual double defaultErrorLevel() const
RooArgList _ownedList
List of owned components.
void doEval(RooFit::EvalContext &) const override
Compute addition of PDFs in batches.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=nullptr) const override
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Retrieve bin boundaries if this distribution is binned in obs.
RooListProxy _set
set of terms to be summed
void printMetaArgs(std::ostream &os) const override
bool setData(RooAbsData &data, bool cloneData=true) override
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Calculate integral internally from appropriate integral cache.
RooObjCacheManager _cacheMgr
! The cache manager
double defaultErrorLevel() const override
Return the default error level for MINUIT error analysis If the addition contains one or more RooNLLV...
double evaluate() const override
Calculate and return current value of self.
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
bool isBinnedDistribution(const RooArgSet &obs) const override
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
static void softAbort()
Soft abort function that interrupts macro execution but doesn't kill ROOT.
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
RooBatchCompute::Config config(RooAbsArg const *arg) const
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Retrieve bin boundaries if this distribution is binned in obs.
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooRealSumPdf to more intuitively reflect the contents of the p...
bool isBinnedDistribution(const RooArgSet &obs) const override
Check if all components that depend on obs are binned.
const char * GetName() const override
Returns name of object.
TString & Append(const char *cs)
void compute(Config cfg, Computer comp, std::span< double > output, VarSpan vars, ArgSpan extraArgs={})
static uint64_t sum(uint64_t i)