73 _refCoefNorm(
"!refCoefNorm",
"Reference coefficient normalization set",this,
kFALSE,
kFALSE),
103 _pdfList(
"!pdfs",
"List of PDFs",this),
104 _coefList(
"!coefficients",
"List of coefficients",this),
110 <<
") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1" << endl ;
127 <<
") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1" << endl ;
130 if (!dynamic_cast<RooAbsReal*>(coef)) {
134 if (!dynamic_cast<RooAbsReal*>(pdf)) {
144 if (!dynamic_cast<RooAbsReal*>(pdf)) {
216 if (refCoefNorm.
getSize()==0) {
261 <<
") convolution parameter of basis function and PDF don't match" << endl ;
264 inBasis->
Print(
"v") ;
269 newName.Append(
"_conv_") ;
270 newName.Append(inBasis->
GetName()) ;
271 newName.Append(
"_[") ;
272 newName.Append(owner->
GetName()) ;
273 newName.Append(
"]") ;
276 newTitle.Append(
" convoluted with basis function ") ;
277 newTitle.Append(inBasis->
GetName()) ;
285 modelList.
add(*conv) ;
292 theCoefList.
add(*coef) ;
296 for (std::set<std::string>::const_iterator attrIt =
_boolAttrib.begin();
300 for (std::map<std::string,std::string>::const_iterator attrIt =
_stringAttrib.begin();
326 }
else if (subCode==0) {
392 name.Append(
"_SupNorm") ;
396 snorm =
new RooRealVar(name,
"Unit Supplemental normalization integral",1.0) ;
404 cxcoutD(
Caching) <<
"RooAddModel::syncSuppNormList(" <<
GetName() <<
") synching supplemental normalization list for norm" << (nset?*nset:
RooArgSet()) << endl ;
426 coutI(
Caching) <<
"RooAddModel::syncCoefProjList(" <<
GetName() <<
") creating coefficient projection integrals" << endl ;
428 ccoutI(
Caching) <<
" with current range: " << (rangeName?rangeName:
"<none>") << endl ;
446 name.Append(thePdf->
GetName()) ;
447 name.Append(
"_ProjectNorm") ;
448 pdfProj =
new RooRealVar(name,
"Unit Projection normalization integral",1.0) ;
462 name.Append(thePdf->
GetName()) ;
463 name.Append(
"_ProjSupNorm") ;
465 snorm =
new RooRealIntegral(name,
"Projection Supplemental normalization integral",
468 snorm =
new RooRealVar(name,
"Unit Projection Supplemental normalization integral",1.0) ;
479 theName.Append(
"_") ;
480 theName.Append(thePdf->
GetName()) ;
481 theName.Append(
"_RangeNorm1") ;
482 rangeProj1 =
new RooRealVar(theName,
"Unit range normalization integral",1.0) ;
494 theName.Append(
"_") ;
495 theName.Append(thePdf->
GetName()) ;
496 theName.Append(
"_RangeNorm2") ;
497 rangeProj2 =
new RooRealVar(theName,
"Unit range normalization integral",1.0) ;
536 coutW(
Eval) <<
"RooAddModel::updateCoefCache(" <<
GetName() <<
") WARNING: total number of expected events is 0" << endl ;
571 <<
" WARNING: sum of PDF coefficients not in range [0-1], value=" 572 << 1-lastCoef << endl ;
574 coutW(
Eval) <<
" (no more will be printed)" << endl ;
600 <<
"sn = " << sn->
GetName() << endl
601 <<
"r1 = " << r1->
GetName() << endl
602 <<
"r2 = " << r2->
GetName() << endl ;
652 << pdf->
GetName() <<
"] " << pdfVal <<
" * " <<
_coefCache[i] <<
" / " << snormVal << endl ;
692 <<
" and PDF " << pdf->
GetName() <<
" have one or more dependents in common" << endl ;
705 const RooArgSet* normSet,
const char* rangeName)
const 710 analVars.
add(allVars) ;
728 Int_t sterileIdx(-1) ;
753 compIntList = &cache->_intList ;
811 << pdfInt->
GetName() <<
"] " << intVal <<
" * " <<
_coefCache[i] <<
" / " << snormVal << endl ;
847 expectedTotal += coef->
getVal() ;
851 return expectedTotal;
957 allNodes.
add(_projList) ;
958 allNodes.
add(_suppProjList) ;
959 allNodes.
add(_refRangeProjList) ;
960 allNodes.
add(_rangeProjList) ;
1001 os <<
" + [%] * " << pdf->
GetName() ;
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
virtual const char * GetName() const
Returns name of object.
TIterator * createIterator(Bool_t dir=kIterForward) const
Bool_t isDirectGenSafe(const RooAbsArg &arg) const
Direct generation is safe if all components say so.
static void globalSelectComp(Bool_t flag)
Global switch controlling the activation of the selectComp() functionality.
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
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...
TIterator * _pdfIter
List of supplemental normalization factors.
virtual void selectNormalizationRange(const char *rangeName=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of range for interpretation of fraction c...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
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 Double_t expectedEvents(const RooArgSet *nset) const
Return the number of expected events, which is either the sum of all coefficients or the sum of the c...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
Double_t getVal(const RooArgSet *set=0) const
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
void fixCoefNormalization(const RooArgSet &refCoefNorm)
By default the interpretation of the fraction coefficients is performed in the contextual choice of o...
RooRealVar & convVar() const
Return the convolution variable of the resolution model.
T * getObjByIndex(Int_t index) const
Bool_t equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically named contents.
std::set< std::string > _boolAttrib
virtual RooResolutionModel * convolution(RooFormulaVar *basis, RooAbsArg *owner) const
Instantiate a clone of this resolution model representing a convolution with given basis function...
RooArgList _rangeProjList
Iterator abstract base class.
void updateCoefficients(CacheElem &cache, const RooArgSet *nset) const
Update the coefficient values in the given cache element: calculate new remainder fraction...
void getCompIntList(const RooArgSet *nset, const RooArgSet *iset, pRooArgList &compIntList, Int_t &code, const char *isetRangeName) const
Check if this configuration was created before.
virtual void selectNormalization(const RooArgSet *depSet=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of observables for interpretation of frac...
RooAbsArg * findServer(const char *name) const
const RooNameSet * nameSet1ByIndex(Int_t index) const
TNamed * _refCoefRangeName
Reference observable set for coefficient interpretation.
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
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...
void printCompactTree(const char *indent="", const char *fileName=0, const char *namePat=0, RooAbsArg *client=0)
Print tree structure of expression tree on stdout, or to file if filename is specified.
The TNamed class is the base class for all named ROOT classes.
virtual Int_t basisCode(const char *name) const
Return code for basis function representing by 'name' string.
RooArgSet _ownedComps
Coefficient error counter.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
virtual ~RooAddModel()
Destructor.
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
RooListProxy _pdfList
Registry of component analytical integration codes.
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
RooRealVar represents a fundamental (non-derived) real valued object.
CacheElem * getProjCache(const RooArgSet *nset, const RooArgSet *iset=0, const char *rangeName=0) const
Retrieve cache element with for calculation of p.d.f value with normalization set nset and integrated...
virtual void changeBasis(RooFormulaVar *basis)
Change the basis function we convolute with.
virtual RooArgList containedArgs(Action)
List all RooAbsArg derived contents in this cache element.
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 Int_t _verboseEval
RooAbsArg * at(Int_t idx) const
RooArgList _refRangeProjList
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
TIterator * _coefIter
Iterator over PDF list.
friend class RooAddGenContext
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
RooObjCacheManager _projCacheMgr
RooAbsArg * absArg() const
virtual Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
OperMode operMode() const
RooObjCacheManager _intCacheMgr
virtual void resetErrorCounters(Int_t resetValue=10)
Reset error counter to given value, limiting the number of future error messages for this pdf to 'res...
RooDataSet is a container class to hold unbinned data.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Return pseud-code that indicates if all components can do internal generation (1) or not (0) ...
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooAddModel to more intuitively reflect the contents of the pro...
void generateEvent(Int_t code)
This function should never be called as RooAddModel implements a custom generator context...
virtual Bool_t isDirectGenSafe(const RooAbsArg &arg) const
Check if given observable can be safely generated using the pdfs internal generator mechanism (if tha...
virtual RooArgList containedArgs(Action)
List all RooAbsArg derived contents in this cache element.
const RooNameSet * nameSet2ByIndex(Int_t index) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Load generatedVars with the subset of directVars that we can generate events for, and return a code t...
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...
std::map< std::string, std::string > _stringAttrib
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Return specialized context to efficiently generate toy events from RooAddPdfs.
Double_t evaluate() const
Calculate the current value.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
Transiet cache with transformed values of coefficients.
Bool_t _haveLastCoef
Iterator over coefficient list.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
friend class RooRealIntegral
virtual TObject * Next()=0
static RooConstVar & value(Double_t value)
Return a constant value object with given value.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
Bool_t _projectCoefs
Reference range name for coefficient interpreation.
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
RooArgSet * _normSet
Normalization integral (owned by _normMgr)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
virtual Int_t basisCode(const char *name) const =0
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void fixCoefRange(const char *rangeName)
By default the interpretation of the fraction coefficients is performed in the default range...
virtual RooResolutionModel * convolution(RooFormulaVar *basis, RooAbsArg *owner) const
Instantiate a clone of this resolution model representing a convolution with given basis function...
virtual void resetErrorCounters(Int_t resetValue=10)
Reset error counter to given value, limiting the number of future error messages for this pdf to 'res...
virtual Bool_t checkObservables(const RooArgSet *nset) const
Check if PDF is valid for given normalization set.
virtual const char * GetTitle() const
Returns title of object.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Return analytical integral defined by given scenario code.