76 _funcList(
"!funcList",
"List of functions", this), _coefList(
"!coefList",
"List of coefficients", this),
89 _funcList(
"!funcList",
"List of functions", this), _coefList(
"!coefList",
"List of coefficients", this),
110 _funcList(
"!funcList",
"List of functions", this), _coefList(
"!coefList",
"List of coefficients", this),
120 coutE(InputArguments) <<
"RooRealSumFunc::RooRealSumFunc(" <<
GetName()
121 <<
") number of pdfs and coefficients inconsistent, must have Nfunc=Ncoef or Nfunc=Ncoef+1"
139 coutW(InputArguments) <<
"RooRealSumFunc::RooRealSumFunc(" <<
GetName() <<
") coefficient " << coef->
GetName()
140 <<
" is not of type RooAbsReal, ignored" << endl;
144 coutW(InputArguments) <<
"RooRealSumFunc::RooRealSumFunc(" <<
GetName() <<
") func " << func->
GetName()
145 <<
" is not of type RooAbsReal, ignored" << endl;
155 coutE(InputArguments) <<
"RooRealSumFunc::RooRealSumFunc(" <<
GetName() <<
") last func " << func->
GetName()
156 <<
" is not of type RooAbsReal, fatal error" << endl;
171 :
RooAbsReal(other,
name), _normIntMgr(other._normIntMgr, this), _haveLastCoef(other._haveLastCoef),
172 _funcList(
"!funcList", this, other._funcList), _coefList(
"!coefList", this, other._coefList),
173 _doFloor(other._doFloor)
211 cxcoutD(Eval) <<
"RooRealSumFunc::eval(" <<
GetName() <<
") coefVal = " << coefVal
212 <<
" funcVal = " << func->IsA()->
GetName() <<
"::" << func->
GetName() <<
" = " << func->
getVal()
215 value += func->
getVal() * coefVal;
217 lastCoef -= coef->
getVal();
225 value += func->
getVal() * lastCoef;
228 cxcoutD(Eval) <<
"RooRealSumFunc::eval(" <<
GetName() <<
") lastCoef = " << lastCoef
229 <<
" funcVal = " << func->
getVal() << endl;
232 if (lastCoef < 0 || lastCoef > 1) {
234 <<
" WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
266 coutE(InputArguments) <<
"RooRealSumFunc::checkObservables(" <<
GetName() <<
"): ERROR: coefficient "
268 <<
" have one or more observables in common" << endl;
272 coutE(InputArguments) <<
"RooRealPdf::checkObservables(" <<
GetName() <<
"): ERROR coefficient "
273 << coef->
GetName() <<
" depends on one or more of the following observables";
284 const char *rangeName)
const
298 analVars.
add(allVars);
302 Int_t sterileIdx(-1);
321 if (normSet && normSet->
getSize() > 0) {
364 assert(code == code2);
381 Double_t coefVal = coef->getVal(normSet2);
386 value += funcInt->getVal() * coefVal;
388 lastCoef -= coef->getVal(normSet2);
397 value += funcInt->getVal() * lastCoef;
401 if (lastCoef < 0 || lastCoef > 1) {
403 <<
" WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
408 if (normSet2 && normSet2->
getSize() > 0) {
417 Double_t coefVal = coef->getVal(normSet2);
420 normVal += funcNorm->
getVal() * coefVal;
428 normVal += funcNorm->
getVal() * lastCoef;
432 return value / normVal;
438 list<Double_t> *sumBinB = 0;
446 list<Double_t> *funcBinB = func->
binBoundaries(obs, xlo, xhi);
455 list<Double_t> *newSumBinB =
new list<Double_t>(sumBinB->size() + funcBinB->size());
458 merge(funcBinB->begin(), funcBinB->end(), sumBinB->begin(), sumBinB->end(), newSumBinB->begin());
463 sumBinB = newSumBinB;
471 list<Double_t>::iterator new_end = unique(sumBinB->begin(), sumBinB->end());
472 sumBinB->erase(new_end, sumBinB->end());
497 list<Double_t> *sumHint = 0;
516 list<Double_t> *newSumHint =
new list<Double_t>(sumHint->size() + funcHint->size());
519 merge(funcHint->begin(), funcHint->end(), sumHint->begin(), sumHint->end(), newSumHint->begin());
523 sumHint = newSumHint;
531 list<Double_t>::iterator new_end = unique(sumHint->begin(), sumHint->end());
532 sumHint->erase(new_end, sumHint->end());
544 while ((sarg = siter.
next())) {
546 trackNodes.
add(*sarg);
577 os <<
" + [%] * " << func->
GetName();
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Given a set of possible observables, return the observables that this PDF depends on.
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.
virtual CacheMode canNodeBeCached() const
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...
Bool_t observableOverlaps(const RooAbsData *dset, const RooAbsArg &testArg) const
Test if any of the dependents of the arg tree (as determined by getObservables) overlaps with those o...
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.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
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...
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
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.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
RooArgSet selectFromSet1(RooArgSet const &argSet, int index) const
Create RooArgSet contatining the objects that are both in the cached set 1.
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)
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()
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
Bool_t _doFloor
Iterator over coefficient list.
TIterator * _coefIter
Iterator over FUNC list.
Bool_t _haveLastCoef
The integration cache manager.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
static Bool_t _doFloorGlobal
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Retrieve bin boundaries if this distribution is binned in obs.
const RooArgList & funcList() const
RooObjCacheManager _normIntMgr
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
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...
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
virtual ~RooRealSumFunc()
virtual void setCacheAndTrackHints(RooArgSet &)
void printMetaArgs(std::ostream &os) const
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".