67 , _set(
"!set",
"set of components",this)
70 for (
const auto comp : sumSet) {
72 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp->
GetName()
73 <<
" is not of type RooAbsReal" << endl ;
100 , _set(
"!set",
"set of components",this)
104 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: input lists should be of equal length" << endl ;
108 for (
unsigned int i = 0; i < sumSet1.
size(); ++i) {
109 const auto comp1 = &sumSet1[i];
110 const auto comp2 = &sumSet2[i];
113 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp1->
GetName()
114 <<
" in first list is not of type RooAbsReal" << endl ;
119 coutE(InputArguments) <<
"RooAddition::ctor(" <<
GetName() <<
") ERROR: component " << comp2->GetName()
120 <<
" in first list is not of type RooAbsReal" << endl ;
126 _name.
Append(comp1->GetName());
128 _name.
Append(comp2->GetName());
147 , _set(
"!set",this,other._set)
148 , _cacheMgr(other._cacheMgr,this)
171 for (
const auto arg :
_set) {
172 const auto comp =
static_cast<RooAbsReal*
>(arg);
173 const Double_t tmp = comp->getVal(nset);
211 if (nllArg && !chi2Arg) {
212 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName()
213 <<
") Summation contains a RooNLLVar, using its error level" << endl ;
215 }
else if (chi2Arg && !nllArg) {
216 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName()
217 <<
") Summation contains a RooChi2Var, using its error level" << endl ;
219 }
else if (!nllArg && !chi2Arg) {
220 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
221 <<
"Summation contains neither RooNLLVar nor RooChi2Var server, using default level of 1.0" << endl ;
223 coutI(Fitting) <<
"RooAddition::defaultErrorLevel(" <<
GetName() <<
") WARNING: "
224 <<
"Summation contains BOTH RooNLLVar and RooChi2Var server, using default level of 1.0" << endl ;
235 for (
auto arg :
_set) {
246 for (
const auto arg :
_set) {
259 for (
const auto arg :
_set) {
265 os << arg->GetName() ;
275 analVars.
add(allVars);
278 Int_t sterileIndex(-1);
287 for (
const auto arg :
_set) {
316 for (
auto I : cache->
_I) {
329 std::list<Double_t>* sumBinB = 0 ;
337 std::list<Double_t>* funcBinB = func->
binBoundaries(obs,xlo,xhi) ;
346 std::list<Double_t>* newSumBinB =
new std::list<Double_t>(sumBinB->size()+funcBinB->size()) ;
349 merge(funcBinB->begin(),funcBinB->end(),sumBinB->begin(),sumBinB->end(),newSumBinB->begin()) ;
354 sumBinB = newSumBinB ;
362 std::list<Double_t>::iterator new_end = unique(sumBinB->begin(),sumBinB->end()) ;
363 sumBinB->erase(new_end,sumBinB->end()) ;
393 std::list<Double_t>* sumHint = 0 ;
412 std::list<Double_t>* newSumHint =
new std::list<Double_t>(sumHint->size()+funcHint->size()) ;
415 merge(funcHint->begin(),funcHint->end(),sumHint->begin(),sumHint->end(),newSumHint->begin()) ;
419 sumHint = newSumHint ;
427 std::list<Double_t>::iterator new_end = unique(sumHint->begin(),sumHint->end()) ;
428 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...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooFIter fwdIterator() const
One-time forward iterator.
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
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.
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 > * 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
Calculate and return current value of self.
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.
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.
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
const RooNameSet * nameSet2ByIndex(Int_t index) const
Retrieve RooNameSet associated with slot at given index.
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
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.
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.
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
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)
static uint64_t sum(uint64_t i)