63 _funcIter = _funcList.createIterator() ;
64 _coefIter = _coefList.createIterator() ;
78 _funcList(
"!funcList",
"List of functions",this),
79 _coefList(
"!coefList",
"List of coefficients",this),
99 _funcList(
"!funcList",
"List of functions",this),
100 _coefList(
"!coefList",
"List of coefficients",this),
124 _normIntMgr(this,10),
126 _funcList(
"!funcList",
"List of functions",this),
127 _coefList(
"!coefList",
"List of coefficients",this),
133 <<
") number of pdfs and coefficients inconsistent, must have Nfunc=Ncoef or Nfunc=Ncoef+1" << endl ;
149 if (!dynamic_cast<RooAbsReal*>(coef)) {
153 if (!dynamic_cast<RooAbsReal*>(func)) {
163 if (!dynamic_cast<RooAbsReal*>(func)) {
164 coutE(
InputArguments) <<
"RooRealSumPdf::RooRealSumPdf(" <<
GetName() <<
") last func " << coef->
GetName() <<
" is not of type RooAbsReal, fatal error" << endl ;
184 _normIntMgr(other._normIntMgr,this),
185 _haveLastCoef(other._haveLastCoef),
186 _funcList(
"!funcList",this,other._funcList),
187 _coefList(
"!coefList",this,other._coefList),
188 _extended(other._extended),
189 _doFloor(other._doFloor)
239 cxcoutD(
Eval) <<
"RooRealSumPdf::eval(" <<
GetName() <<
") coefVal = " << coefVal <<
" funcVal = " << func->IsA()->
GetName() <<
"::" << func->
GetName() <<
" = " << func->
getVal() << endl ;
241 value += func->
getVal()*coefVal ;
243 lastCoef -= coef->
getVal() ;
251 value += func->
getVal()*lastCoef ;
254 cxcoutD(
Eval) <<
"RooRealSumPdf::eval(" <<
GetName() <<
") lastCoef = " << lastCoef <<
" funcVal = " << func->
getVal() << endl ;
257 if (lastCoef<0 || lastCoef>1) {
259 <<
" WARNING: sum of FUNC coefficients not in range [0-1], value="
260 << 1-lastCoef << endl ;
295 <<
" and FUNC " << func->
GetName() <<
" have one or more observables in common" << endl ;
300 <<
" depends on one or more of the following observables" ; nset->
Print(
"1") ;
316 const RooArgSet* normSet2,
const char* rangeName)
const
319 if (allVars.
getSize()==0)
return 0 ;
323 analVars.
add(allVars) ;
328 Int_t sterileIdx(-1) ;
344 if (normSet && normSet->
getSize()>0) {
372 if (code==0)
return getVal(normSet2) ;
400 Double_t coefVal = coef->getVal(normSet2) ;
405 value += funcInt->getVal()*coefVal ;
407 lastCoef -= coef->getVal(normSet2) ;
416 value += funcInt->getVal()*lastCoef ;
420 if (lastCoef<0 || lastCoef>1) {
422 <<
" WARNING: sum of FUNC coefficients not in range [0-1], value="
423 << 1-lastCoef << endl ;
428 if (normSet2 && normSet2->
getSize()>0) {
437 Double_t coefVal = coef->getVal(normSet2) ;
440 normVal += funcNorm->
getVal()*coefVal ;
448 normVal += funcNorm->
getVal()*lastCoef ;
452 return value / normVal;
472 list<Double_t>* sumBinB = 0 ;
480 list<Double_t>* funcBinB = func->
binBoundaries(obs,xlo,xhi) ;
489 list<Double_t>* newSumBinB =
new list<Double_t>(sumBinB->size()+funcBinB->size()) ;
492 merge(funcBinB->begin(),funcBinB->end(),sumBinB->begin(),sumBinB->end(),newSumBinB->begin()) ;
497 sumBinB = newSumBinB ;
505 list<Double_t>::iterator new_end = unique(sumBinB->begin(),sumBinB->end()) ;
506 sumBinB->erase(new_end,sumBinB->end()) ;
538 list<Double_t>* sumHint = 0 ;
557 list<Double_t>* newSumHint =
new list<Double_t>(sumHint->size()+funcHint->size()) ;
560 merge(funcHint->begin(),funcHint->end(),sumHint->begin(),sumHint->end(),newSumHint->begin()) ;
564 sumHint = newSumHint ;
572 list<Double_t>::iterator new_end = unique(sumHint->begin(),sumHint->end()) ;
573 sumHint->erase(new_end,sumHint->end()) ;
589 while ((sarg=siter.
next())) {
591 trackNodes.
add(*sarg) ;
623 os <<
" + [%] * " << func->
GetName() ;
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
const RooNameSet * nameSet2ByIndex(Int_t index) const
Double_t getNorm(const RooArgSet &nset) const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
RooFIter fwdIterator() const
const RooNameSet * nameSet1ByIndex(Int_t index) const
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
virtual Bool_t checkObservables(const RooArgSet *nset) const
Check if FUNC is valid for given normalization set.
static Bool_t _doFloorGlobal
TIterator * _coefIter
Iterator over FUNC list.
RooObjCacheManager _normIntMgr
Iterator abstract base class.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
if on multiple lines(like in C++).**The" * configuration fragment. * * The "import myobject continue
Parses the configuration file.
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooRealSumPdf with cache-and-track.
Double_t getVal(const RooArgSet *set=0) const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
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...
Bool_t _extended
Iterator over coefficient list.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Double_t evaluate() const
Calculate the current value.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
virtual const char * GetName() const
Returns name of object.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Bool_t isBinnedDistribution(const RooArgSet &obs) const
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooRealSumPdf to more intuitively reflect the contents of the p...
RooRealSumPdf()
Default constructor coverity[UNINIT_CTOR].
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
static RooMathCoreReg dummy
double func(double *x, double *p)
virtual CacheMode canNodeBeCached() const
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
const RooArgList & funcList() const
virtual ~RooRealSumPdf()
Destructor.
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 * getObjByIndex(Int_t index) const
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual TObject * Next()=0
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
cout << "RooRealSumPdf::getAnalyticalIntegralWN:"<") << endl; Advertise that all integrals can be handled internally.
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 ExtendMode extendMode() const
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...
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
void logEvalError(const char *message, const char *serverValueString=0) const
Log evaluation error message.
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
cout << "RooRealSumPdf::analyticalIntegralWN:"<") << endl; Implement analytical integrations by deferring integration of component functions to integrators of components
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
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 ...