84 _refCoefNorm(
"!refCoefNorm",
"Reference coefficient normalization set",this,
kFALSE,
kFALSE),
105 _refCoefNorm(
"!refCoefNorm",
"Reference coefficient normalization set",this,
kFALSE,
kFALSE),
106 _refCoefRangeName(0),
108 _projCacheMgr(this,10),
110 _pdfList(
"!pdfs",
"List of PDFs",this),
111 _coefList(
"!coefficients",
"List of coefficients",this),
133 _refCoefNorm(
"!refCoefNorm",
"Reference coefficient normalization set",this,
kFALSE,
kFALSE),
134 _refCoefRangeName(0),
136 _projCacheMgr(this,10),
138 _pdfList(
"!pdfs",
"List of PDFs",this),
139 _coefList(
"!coefficients",
"List of coefficients",this),
171 _refCoefNorm(
"!refCoefNorm",
"Reference coefficient normalization set",this,
kFALSE,
kFALSE),
172 _refCoefRangeName(0),
174 _projCacheMgr(this,10),
176 _pdfList(
"!pdfs",
"List of PDFs",this),
177 _coefList(
"!coefficients",
"List of coefficients",this),
184 <<
") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1" << endl ;
188 if (recursiveFractions && inPdfList.
getSize()!=inCoefList.
getSize()+1) {
190 <<
") WARNING inconsistent input: recursive fractions options can only be used if Npdf=Ncoef+1, ignoring recursive fraction setting" << endl ;
211 <<
") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1" << endl ;
214 if (!dynamic_cast<RooAbsReal*>(coef)) {
218 if (!dynamic_cast<RooAbsReal*>(pdf)) {
225 if (recursiveFractions) {
226 partinCoefList.
add(*coef) ;
249 if (!dynamic_cast<RooAbsReal*>(pdf)) {
256 if (recursiveFractions) {
292 _refCoefNorm(
"!refCoefNorm",
"Reference coefficient normalization set",this,
kFALSE,
kFALSE),
293 _refCoefRangeName(0),
295 _projCacheMgr(this,10),
296 _pdfList(
"!pdfs",
"List of PDFs",this),
297 _coefList(
"!coefficients",
"List of coefficients",this),
299 _allExtendable(
kTRUE),
310 if (!dynamic_cast<RooAbsReal*>(pdf)) {
336 _refCoefNorm(
"!refCoefNorm",this,other._refCoefNorm),
337 _refCoefRangeName((
TNamed*)other._refCoefRangeName),
338 _projectCoefs(other._projectCoefs),
339 _projCacheMgr(other._projCacheMgr,this),
340 _codeReg(other._codeReg),
341 _pdfList(
"!pdfs",this,other._pdfList),
342 _coefList(
"!coefficients",this,other._coefList),
343 _haveLastCoef(other._haveLastCoef),
344 _allExtendable(other._allExtendable),
345 _recursive(other._recursive)
382 if (refCoefNorm.
getSize()==0) {
475 cxcoutD(
Caching) <<
"RooAddPdf " <<
GetName() <<
" making supplemental normalization set " << supNSet <<
" for pdf component " << pdf->
GetName() << endl ;
478 snorm =
new RooRealVar(name,
"Unit Supplemental normalization integral",1.0) ;
486 cxcoutD(
Caching) <<
"RooAddPdf::syncSuppNormList(" <<
GetName() <<
") synching supplemental normalization list for norm" << (nset?*nset:
RooArgSet()) << endl ;
526 cxcoutD(
Caching) <<
"ALEX: RooAddPdf::syncCoefProjList(" <<
GetName() <<
") projecting coefficients from "
527 << *nset2 << (rangeName?
":":
"") << (rangeName?rangeName:
"")
546 name.
Append(
"_ProjectNorm") ;
547 pdfProj =
new RooRealVar(name,
"Unit Projection normalization integral",1.0) ;
564 name.
Append(
"_ProjSupNorm") ;
566 snorm =
new RooRealIntegral(name,
"Projection Supplemental normalization integral",
569 snorm =
new RooRealVar(name,
"Unit Projection Supplemental normalization integral",1.0) ;
617 theName.
Append(
"_RangeNorm1") ;
618 rangeProj1 =
new RooRealVar(theName,
"Unit range normalization integral",1.0) ;
627 cxcoutD(
Caching) <<
"RooAddPdf::syncCoefProjList(" <<
GetName() <<
") rangename = " << (rangeName?rangeName:
"<null>")
628 <<
" nset = " << (nset?*nset:
RooArgSet()) << endl ;
645 theName.
Append(
"_RangeNorm2") ;
646 rangeProj2 =
new RooRealVar(theName,
"Unit range normalization integral",1.0) ;
690 coutW(
Eval) <<
"RooAddPdf::updateCoefCache(" <<
GetName() <<
") WARNING: total number of expected events is 0" << endl ;
693 for (i=0 ; i<siz ; i++) {
711 coutW(
Eval) <<
"RooAddPdf::updateCoefCache(" <<
GetName() <<
") WARNING: sum of coefficients is zero 0" << endl ;
714 for (i=0 ; i<siz ; i++) {
735 if ((lastCoef<-1e-05 || (lastCoef-1)>1e-5) &&
_coefErrCount-->0) {
737 <<
" WARNING: sum of PDF coefficients not in range [0-1], value="
740 coutW(
Eval) <<
" (no more will be printed)" ;
794 <<
" ( _coefCache[i]/coefSum = " <<
_coefCache[i]*coefSum <<
"/" << coefSum <<
" ) "<< endl ;
811 if (nset==0 || nset->
getSize()==0) {
883 <<
" and PDF " << pdf->
GetName() <<
" have one or more dependents in common" << endl ;
903 const RooArgSet* normSet,
const char* rangeName)
const
933 if (allAnalVars.
getSize()==0) {
948 if (subCode[n]==0 && allAnalVars2->
getSize()>0) {
950 <<
" advertises inconsistent set of integrals (e.g. (X,Y) but not X or Y individually."
951 <<
" Distributed analytical integration disabled. Please fix PDF" << endl ;
954 delete allAnalVars2 ;
963 analVars.
add(allAnalVars) ;
989 if (subCode.empty()) {
990 coutE(
InputArguments) <<
"RooAddPdf::analyticalIntegral(" <<
GetName() <<
"): ERROR unrecognized integration code, " << code << endl ;
1094 expectedTotal += ncomp ;
1100 return expectedTotal ;
1176 list<Double_t>* sumHint = 0 ;
1196 list<Double_t>* newSumHint =
new list<Double_t>(sumHint->size()+pdfHint->size()) ;
1199 merge(pdfHint->begin(),pdfHint->end(),sumHint->begin(),sumHint->end(),newSumHint->begin()) ;
1203 sumHint = newSumHint ;
1210 list<Double_t>::iterator new_end = unique(sumHint->begin(),sumHint->end()) ;
1211 sumHint->erase(new_end,sumHint->end()) ;
1223 list<Double_t>* sumBinB = 0 ;
1242 list<Double_t>* newSumBinB =
new list<Double_t>(sumBinB->size()+pdfBinB->size()) ;
1245 merge(pdfBinB->begin(),pdfBinB->end(),sumBinB->begin(),sumBinB->end(),newSumBinB->begin()) ;
1250 sumBinB = newSumBinB ;
1258 list<Double_t>::iterator new_end = unique(sumBinB->begin(),sumBinB->end()) ;
1259 sumBinB->erase(new_end,sumBinB->end()) ;
1290 while ((aarg=aiter.
next())) {
1292 trackNodes.
add(*aarg) ;
1324 os <<
" + [%] * " << pdf->
GetName() ;
void fixCoefRange(const char *rangeName)
By default the interpretation of the fraction coefficients is performed in the default range...
Bool_t isBinnedDistribution(const RooArgSet &obs) const
If all components that depend on obs are binned that so is the product.
static void globalSelectComp(Bool_t flag)
Global switch controlling the activation of the selectComp() functionality.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
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...
Bool_t _haveLastCoef
Iterator over coefficient list.
virtual RooArgList containedArgs(Action)
List all RooAbsArg derived contents in this cache element.
void fixCoefNormalization(const RooArgSet &refCoefNorm)
By default the interpretation of the fraction coefficients is performed in the contextual choice of o...
void updateCoefficients(CacheElem &cache, const RooArgSet *nset) const
Update the coefficient values in the given cache element: calculate new remainder fraction...
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Bool_t equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically named contents.
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
RooFIter fwdIterator() const
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
TString _normRange
MC generator configuration specific for this object.
RooListProxy _pdfList
Registry of component analytical integration codes.
RooAddPdf()
Default constructor used for persistence.
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 selectNormalization(const RooArgSet *depSet=0, Bool_t force=kFALSE)
Interface function used by test statistics to freeze choice of observables for interpretation of frac...
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooAddPdf to more intuitively reflect the contents of the produ...
Transiet cache with transformed values of coefficients.
virtual Double_t getMin(const char *name=0) const
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...
Bool_t addOwnedComponents(const RooArgSet &comps)
Take ownership of the contents of 'comps'.
virtual Bool_t checkObservables(const RooArgSet *nset) const
Check if PDF is valid for given normalization set.
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
Iterator abstract base class.
const char * Data() const
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Loop over components for plot sampling hints and merge them if there are multiple.
The TNamed class is the base class for all named ROOT classes.
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.
TString & Append(const char *cs)
TIterator * _pdfIter
List of supplemental normalization factors.
Double_t getVal(const RooArgSet *set=0) const
Double_t evaluate() const
Calculate and return the current value.
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...
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Return analytical integral defined by given scenario code.
virtual ~RooAddPdf()
Destructor.
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
RooAbsArg * find(const char *name) const
Find object with given name in list.
static Int_t _verboseEval
const RooArgList & pdfList() const
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
unsigned int r1[N_CITIES]
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
RooArgList _refRangeProjList
char * Form(const char *fmt,...)
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 return RooAbsPdf::genCo...
friend class RooAddGenContext
virtual const char * GetName() const
Returns name of object.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
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...
TNamed * _refCoefRangeName
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...
const std::vector< Int_t > & retrieve(Int_t masterCode) const
Retrieve the array of integer codes associated with the given master code.
Int_t store(const std::vector< Int_t > &codeList, RooArgSet *set1=0, RooArgSet *set2=0, RooArgSet *set3=0, RooArgSet *set4=0)
Store given arrays of integer codes, and up to four RooArgSets in the registry (each setX pointer may...
RooAbsArg * at(Int_t idx) const
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Determine which part (if any) of given integral can be performed analytically.
RooObjCacheManager _projCacheMgr
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooAddPdf with cache-and-track.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Bool_t canBeExtended() const
TIterator * _coefIter
Iterator over PDF list.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Loop over components for plot sampling hints and merge them if there are multiple.
virtual CacheMode canNodeBeCached() const
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Analytical integral with normalization (see RooAbsReal::analyticalIntegralWN() for further informatio...
static Bool_t _globalSelectComp
Component selection flag for RooAbsPdf::plotCompOn.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
virtual Double_t getMax(const char *name=0) 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...
RooConstVar & RooConst(Double_t val)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
friend class RooRealIntegral
virtual TObject * Next()=0
OperMode operMode() const
static RooConstVar & value(Double_t value)
Return a constant value object with given value.
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.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
RooArgSet * _normSet
Normalization integral (owned by _normMgr)
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
unsigned int r2[N_CITIES]
RooArgList _rangeProjList
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 ...
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...