69 , _set(
"!set",
"set of components",this)
72 for (
const auto comp : sumSet) {
74 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp->
GetName()
75 <<
" is not of type RooAbsReal" << endl ;
102 , _set(
"!set",
"set of components",this)
106 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: input lists should be of equal length" << endl ;
110 for (
unsigned int i = 0; i < sumSet1.
size(); ++i) {
111 const auto comp1 = &sumSet1[i];
112 const auto comp2 = &sumSet2[i];
115 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp1->
GetName()
116 <<
" in first list is not of type RooAbsReal" << endl ;
121 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp2->GetName()
122 <<
" in first list is not of type RooAbsReal" << endl ;
128 _name.
Append(comp1->GetName());
130 _name.
Append(comp2->GetName());
149 , _set(
"!set",this,other._set)
150 , _cacheMgr(other._cacheMgr,this)
173 for (
const auto arg :
_set) {
174 const auto comp =
static_cast<RooAbsReal*
>(arg);
175 const Double_t tmp = comp->getVal(nset);
192 for (
const auto arg :
_set)
194 pdfs.push_back(dataMap.
at(arg));
195 coefs.push_back(1.0);
231 if (nllArg && !chi2Arg) {
232 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName()
233 <<
") Summation contains a RooNLLVar, using its error level" << endl ;
235 }
else if (chi2Arg && !nllArg) {
236 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName()
237 <<
") Summation contains a RooChi2Var, using its error level" << endl ;
239 }
else if (!nllArg && !chi2Arg) {
240 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
241 <<
"Summation contains neither RooNLLVar nor RooChi2Var server, using default level of 1.0" << endl ;
243 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
244 <<
"Summation contains BOTH RooNLLVar and RooChi2Var server, using default level of 1.0" << endl ;
255 for (
auto arg :
_set) {
266 for (
const auto arg :
_set) {
279 for (
const auto arg :
_set) {
285 os << arg->GetName() ;
295 analVars.
add(allVars);
298 Int_t sterileIndex(-1);
307 for (
const auto arg :
_set) {
336 for (
auto I : cache->
_I) {
349 std::list<Double_t>* sumBinB = 0 ;
357 std::list<Double_t>* funcBinB = func->
binBoundaries(obs,xlo,xhi) ;
366 std::list<Double_t>* newSumBinB =
new std::list<Double_t>(sumBinB->size()+funcBinB->size()) ;
369 merge(funcBinB->begin(),funcBinB->end(),sumBinB->begin(),sumBinB->end(),newSumBinB->begin()) ;
374 sumBinB = newSumBinB ;
382 std::list<Double_t>::iterator new_end = unique(sumBinB->begin(),sumBinB->end()) ;
383 sumBinB->erase(new_end,sumBinB->end()) ;
413 std::list<Double_t>* sumHint = 0 ;
432 std::list<Double_t>* newSumHint =
new std::list<Double_t>(sumHint->size()+funcHint->size()) ;
435 merge(funcHint->begin(),funcHint->end(),sumHint->begin(),sumHint->end(),newSumHint->begin()) ;
439 sumHint = newSumHint ;
447 std::list<Double_t>::iterator new_end = unique(sumHint->begin(),sumHint->end()) ;
448 sumHint->erase(new_end,sumHint->end()) ;
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
RooArgSet * getComponents() const
Create a RooArgSet with all components (branch nodes) of the expression tree headed by this object.
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...
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooFIter fwdIterator() const
One-time forward iterator.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add an argument and transfer the ownership to the collection.
Storage_t::size_type size() const
const char * GetName() const
Returns name of object.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsData is the common abstract base class for binned and unbinned datasets.
const RooArgSet * nset() const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual Double_t defaultErrorLevel() const
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables listed in ...
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
void printMetaArgs(std::ostream &os) const
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &numVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
virtual void enableOffsetting(Bool_t)
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate integral cache.
Double_t evaluate() const
The cache manager.
RooAddition()
Empty constructor.
RooObjCacheManager _cacheMgr
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Retrieve bin boundaries if this distribution is binned in obs.
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const
Compute addition of PDFs in batches.
Bool_t setData(RooAbsData &data, Bool_t cloneData=kTRUE)
virtual Double_t defaultErrorLevel() const
Return the default error level for MINUIT error analysis If the addition contains one or more RooNLLV...
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual void compute(cudaStream_t *, Computer, RestrictArr, size_t, const VarVector &, const ArgVector &={})=0
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
RooArgSet selectFromSet2(RooArgSet const &argSet, int index) const
Create RooArgSet contatining the objects that are both in the cached set 2.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooChi2Var implements a simple calculation from a binned dataset and a PDF.
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
auto & at(RooAbsArg const *arg, RooAbsArg const *=nullptr)
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
Class RooNLLVar implements a -log(likelihood) calculation from a dataset and a PDF.
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
A RooProduct represents the product of a given set of RooAbsReal objects.
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
TString & Append(const char *cs)
std::vector< RooSpan< const double > > VarVector
R__EXTERN RooBatchComputeInterface * dispatchCUDA
R__EXTERN RooBatchComputeInterface * dispatchCPU
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
std::vector< double > ArgVector
static uint64_t sum(uint64_t i)
static void output(int code)