56 cxcoutI(
Generation) <<
"RooProdGenContext::ctor() setting up event special generator context for product p.d.f. " << model.
GetName()
57 <<
" for generation of observable(s) " << vars ;
71 RooLinkedList termList,depsList,impDepList,crossDepList,intList ;
78 cxcoutD(
Generation) <<
"RooProdGenContext::ctor() factorizing product expression in irriducible terms " ;
101 Bool_t anyPrevAction=anyAction ;
112 if (impDeps==0 || termDeps==0) {
116 cxcoutD(
Generation) <<
"RooProdGenContext::ctor() analyzing product term " << *term <<
" with observable(s) " << *termDeps ;
118 ccxcoutD(
Generation) <<
" which has dependence of external observable(s) " << *impDeps <<
" that to be generated first by other terms" ;
127 if (!anyPrevAction) {
128 cxcoutD(
Generation) <<
"RooProdGenContext::ctor() no convergence in single term analysis loop, terminating loop and process remainder of terms as single unit " << endl ;
132 cxcoutD(
Generation) <<
"RooProdGenContext::ctor() skipping this term for now because it needs imported dependents that are not generated yet" << endl ;
138 if (termDeps->getSize()==0) {
139 cxcoutD(
Generation) <<
"RooProdGenContext::ctor() term has no observables requested to be generated, removing it" << endl ;
141 depsList.
Remove(termDeps) ;
142 impDepList.
Remove(impDeps) ;
157 coutI(
Generation) <<
"RooProdGenContext::ctor() creating subcontext for generation of observables " << *pdfDep <<
" from model " << pdf->
GetName() << endl ;
165 genDeps.
add(*pdfDep) ;
172 if (termDeps->getSize()>0) {
185 pdfSetList.
Add(pdfSet) ;
187 if (pdfnset && pdfnset->
getSize()>0) {
192 fullPdfSet.
add(*pdfSet) ;
204 coutI(
Generation) <<
"RooProdGenContext()::ctor creating subcontext for generation of observables " << *termDeps
205 <<
"for irriducuble composite term using sub-product object " << multiPdf->
GetName() ;
209 genDeps.
add(*termDeps) ;
219 depsList.
Remove(termDeps) ;
220 impDepList.
Remove(impDeps) ;
232 cxcoutD(
Generation) <<
"RooProdGenContext::ctor() there are left-over terms that need to be generated separately" << endl ;
244 trailerTerm.
add(*term) ;
245 trailerTermDeps.
add(*termDeps) ;
261 pdfSetList.
Add(pdfSet) ;
263 if (pdfnset && pdfnset->
getSize()>0) {
267 fullPdfSet.
add(*pdfSet) ;
280 cxcoutD(
Generation) <<
"RooProdGenContext(" << model.
GetName() <<
"): creating context for irreducible composite trailer term "
281 << multiPdf->
GetName() <<
" that generates observables " << trailerTermDeps << endl ;
292 coutI(
Generation) <<
"RooProdGenContext(" << model.
GetName() <<
"): generating uniform distribution for non-dependent observable(s) " <<
_uniObs << endl ;
318 for (list<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
330 for (list<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
331 (*iter)->attach(args) ;
342 for (list<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
343 (*iter)->initGenerator(theEvent) ;
359 for (list<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
360 (*iter)->generateEvent(theEvent,remaining) ;
389 for (list<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
390 (*iter)->setProtoDataOrder(lut) ;
403 os <<
indent <<
"--- RooProdGenContext ---" << endl ;
404 os <<
indent <<
"Using PDF ";
406 os <<
indent <<
"List of component generators" << endl ;
411 for (list<RooAbsGenContext*>::const_iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
412 (*iter)->printMultiline(os,content,
verbose,indent2) ;
static void indent(ostringstream &buf, int indent_level)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for multi-line printing.
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
Abstract base class for objects that are lvalues, i.e.
virtual void randomize(const char *rangeName=0)=0
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Interface function to create a generator context from a p.d.f.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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...
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...
RooDataSet is a container class to hold unbinned data.
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
virtual void Add(TObject *arg)
virtual Bool_t Remove(TObject *arg)
Remove object from collection.
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,...
RooProdGenContext is an efficient implementation of the generator context specific for RooProdPdf PDF...
RooArgSet _ownedMultiProds
std::list< RooAbsGenContext * > _gcList
virtual void attach(const RooArgSet ¶ms)
Attach generator to given event buffer.
RooProdGenContext(const RooProdPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Generate a single event of the product by generating the components of the products sequentially.
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of the prototype dataset by the given lookup table.
virtual void initGenerator(const RooArgSet &theEvent)
One-time initialization of generator context, forward to component generators.
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Detailed printing interface.
virtual ~RooProdGenContext()
Destructor. Delete all owned subgenerator contexts.
RooProdPdf is an efficient implementation of a product of PDFs of the form.
void factorizeProduct(const RooArgSet &normSet, const RooArgSet &intSet, RooLinkedList &termList, RooLinkedList &normList, RooLinkedList &impDepList, RooLinkedList &crossDepList, RooLinkedList &intList) const
Factorize product in irreducible terms for given choice of integration/normalization.
void useDefaultGen(Bool_t flag=kTRUE)
std::string makeRGPPName(const char *pfx, const RooArgSet &term, const RooArgSet &iset, const RooArgSet &nset, const char *isetRangeName) const
Make an appropriate automatic name for a RooGenProdProj object in getPartIntList()
RooArgSet * findPdfNSet(RooAbsPdf &pdf) const
Look up user specified normalization set for given input PDF component.
virtual RooAbsGenContext * genContext(const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE) const
Return generator context optimized for generating events from product p.d.f.s.
Iterator abstract base class.
virtual TObject * Next()=0
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual const char * GetName() const
Returns name of object.
TString & Append(const char *cs)
RooCmdArg Conditional(const RooArgSet &pdfSet, const RooArgSet &depSet, Bool_t depsAreCond=kFALSE)