60 _funcIter = _funcList.createIterator();
61 _coefIter = _coefList.createIterator();
69 _funcList(
"!funcList",
"List of functions", this), _coefList(
"!coefList",
"List of coefficients", this),
82 _funcList(
"!funcList",
"List of functions", this),
_coefList(
"!coefList",
"List of coefficients", this),
103 _funcList(
"!funcList",
"List of functions", this),
_coefList(
"!coefList",
"List of coefficients", this),
114 <<
") number of pdfs and coefficients inconsistent, must have Nfunc=Ncoef or Nfunc=Ncoef+1" 131 if (!dynamic_cast<RooAbsReal *>(coef)) {
133 <<
" is not of type RooAbsReal, ignored" << endl;
136 if (!dynamic_cast<RooAbsReal *>(func)) {
138 <<
" is not of type RooAbsReal, ignored" << endl;
147 if (!dynamic_cast<RooAbsReal *>(func)) {
149 <<
" is not of type RooAbsReal, fatal error" << endl;
205 <<
" funcVal = " << func->IsA()->
GetName() <<
"::" << func->
GetName() <<
" = " << func->
getVal()
208 value += func->
getVal() * coefVal;
210 lastCoef -= coef->
getVal();
218 value += func->
getVal() * lastCoef;
222 <<
" funcVal = " << func->
getVal() << endl;
225 if (lastCoef < 0 || lastCoef > 1) {
227 <<
" WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
260 <<
" have one or more observables in common" << endl;
265 << coef->
GetName() <<
" depends on one or more of the following observables";
276 const char *rangeName)
const 290 analVars.
add(allVars);
294 Int_t sterileIdx(-1);
312 if (normSet && normSet->
getSize() > 0) {
355 assert(code == code2);
372 Double_t coefVal = coef->getVal(normSet2);
377 value += funcInt->getVal() * coefVal;
379 lastCoef -= coef->getVal(normSet2);
388 value += funcInt->getVal() * lastCoef;
392 if (lastCoef < 0 || lastCoef > 1) {
394 <<
" WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
399 if (normSet2 && normSet2->
getSize() > 0) {
408 Double_t coefVal = coef->getVal(normSet2);
411 normVal += funcNorm->
getVal() * coefVal;
419 normVal += funcNorm->
getVal() * lastCoef;
423 return value / normVal;
429 list<Double_t> *sumBinB = 0;
437 list<Double_t> *funcBinB = func->
binBoundaries(obs, xlo, xhi);
446 list<Double_t> *newSumBinB =
new list<Double_t>(sumBinB->size() + funcBinB->size());
449 merge(funcBinB->begin(), funcBinB->end(), sumBinB->begin(), sumBinB->end(), newSumBinB->begin());
454 sumBinB = newSumBinB;
462 list<Double_t>::iterator new_end = unique(sumBinB->begin(), sumBinB->end());
463 sumBinB->erase(new_end, sumBinB->end());
488 list<Double_t> *sumHint = 0;
507 list<Double_t> *newSumHint =
new list<Double_t>(sumHint->size() + funcHint->size());
510 merge(funcHint->begin(), funcHint->end(), sumHint->begin(), sumHint->end(), newSumHint->begin());
514 sumHint = newSumHint;
522 list<Double_t>::iterator new_end = unique(sumHint->begin(), sumHint->end());
523 sumHint->erase(new_end, sumHint->end());
535 while ((sarg = siter.
next())) {
537 trackNodes.
add(*sarg);
568 os <<
" + [%] * " << func->
GetName();
virtual const char * GetName() const
Returns name of object.
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
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 * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
void printMetaArgs(std::ostream &os) const
Double_t getVal(const RooArgSet *set=0) const
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Bool_t _doFloor
Iterator over coefficient list.
T * getObjByIndex(Int_t index) const
const RooArgList & funcList() const
virtual ~RooRealSumFunc()
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Iterator abstract base class.
const RooNameSet * nameSet1ByIndex(Int_t index) const
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...
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables...
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 ...
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual void setCacheAndTrackHints(RooArgSet &)
Double_t evaluate() const
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
const RooNameSet * nameSet2ByIndex(Int_t index) const
TIterator * _coefIter
Iterator over FUNC list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooFIter fwdIterator() const
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
static RooMathCoreReg dummy
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
typedef void((*Func_t)())
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual TObject * Next()=0
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
RooObjCacheManager _normIntMgr
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
static Bool_t _doFloorGlobal
virtual CacheMode canNodeBeCached() const