48 class RooProduct::ProdMap :
public std::vector<std::pair<RooArgSet*,RooArgList*> > {} ;
52 typedef RooProduct::ProdMap::iterator RPPMIter ;
53 std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end) ;
54 void dump_map(ostream& os, RPPMIter i, RPPMIter end) ;
84 _compRSet(
"!compRSet",
"Set of real product components",this),
85 _compCSet(
"!compCSet",
"Set of category product components",this),
91 if (dynamic_cast<RooAbsReal*>(comp)) {
93 }
else if (dynamic_cast<RooAbsCategory*>(comp)) {
97 <<
" is not of type RooAbsReal or RooAbsCategory" << endl ;
111 _compRSet(
"!compRSet",this,other._compRSet),
112 _compCSet(
"!compCSet",this,other._compCSet),
113 _cacheMgr(other._cacheMgr,this)
146 ProdMap* map =
new ProdMap ;
157 map->push_back( std::make_pair(
new RooArgSet(),indep) );
172 map->push_back( std::make_pair(vars,comps) );
178 std::pair<ProdMap::iterator,ProdMap::iterator> i = findOverlap2nd(map->begin(),map->end());
179 overlap = (i.first!=i.second);
181 i.first->first->add(*i.second->first);
184 RooFIter it = i.second->second->fwdIterator() ;
186 while ((targ = it.
next())) {
187 if (!i.first->second->find(*targ)) {
188 i.first->second->add(*targ) ;
193 delete i.second->first;
194 delete i.second->second;
195 map->erase(i.second);
201 int nVar=0;
int nFunc=0;
202 for (ProdMap::iterator i = map->begin();i!=map->end();++i) {
203 nVar+=i->first->getSize();
204 nFunc+=i->second->getSize();
222 Int_t sterileIndex(-1);
240 for (ProdMap::iterator
iter = map->begin() ;
iter != map->end() ; ++
iter) {
242 delete iter->second ;
250 for (ProdMap::const_iterator i = map->begin();i!=map->end();++i) {
252 if (i->second->getSize()>1) {
258 assert(i->second->getSize()==1);
259 RooFIter j = i->second->fwdIterator();
263 if (i->first->getSize()==0) {
277 <<
" for iset=" << *iset <<
" @" << iset <<
" range: " << (isetRange?isetRange:
"<none>") << endl ;
279 for (ProdMap::iterator
iter = map->begin() ;
iter != map->end() ; ++
iter) {
281 delete iter->second ;
293 const char* rangeName)
const
301 analVars.
add(allVars) ;
355 if (first) { first=
kFALSE;}
375 prod *= rcomp->
getVal(nset) ;
472 while ((parg=piter.
next())) {
475 trackNodes.
add(*parg) ;
497 if (!first) { os <<
" * " ; }
else { first =
kFALSE ; }
504 if (!first) { os <<
" * " ; }
else { first =
kFALSE ; }
517 std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end)
520 for (; i!=end; ++i)
for ( RPPMIter j(i+1); j!=end; ++j) {
521 if (i->second->overlaps(*j->second)) {
522 return std::make_pair(i,j);
525 return std::make_pair(end,end);
529 void dump_map(ostream& os, RPPMIter i, RPPMIter end)
536 else { os <<
" , " ; }
537 os << *(i->first) <<
" -> " << *(i->second) ;
Double_t evaluate() const
Evaluate product of input functions.
const RooArgSet * nset() const
virtual ~CacheElem()
Destructor.
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
Double_t calculate(const RooArgList &partIntList) const
Calculate and return product of partial terms in partIntList.
Int_t getPartIntList(const RooArgSet *iset, const char *rangeName=0) const
Return list of (partial) integrals whose product defines the integral of this RooProduct over the obs...
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
virtual Bool_t isDerived() const
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Declare that we handle all integrations internally.
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
const RooNameSet * nameSet2ByIndex(Int_t index) const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooFIter fwdIterator() const
virtual Int_t getIndex() const
Return index number of current state.
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
Force internal handling of integration of given observable if any of the product terms depend on it...
const char * Data() const
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
std::map< std::string, std::string >::const_iterator iter
TString & Append(const char *cs)
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...
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
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 std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
RooProduct()
Default constructor.
virtual const char * GetName() const
Returns name of object.
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
virtual ~RooProduct()
Destructor.
RooProduct a RooAbsReal implementation that represent the product of a given set of other RooAbsReal ...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double func(double *x, double *p)
virtual CacheMode canNodeBeCached() const
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
T * getObjByIndex(Int_t index) const
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
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.
RooObjCacheManager _cacheMgr
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate partial integral cache.
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...
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
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 void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooProduct with cache-and-track.
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 ...