|
ROOT
Reference Guide |
|
Go to the documentation of this file.
57 cxcoutI(
Generation) <<
"RooAddGenContext::ctor() setting up event special generator context for sum p.d.f. " <<
model.GetName()
58 <<
" for generation of observable(s) " << vars ;
72 coefNSet.
add(*prototype->
get()) ;
80 for (
const auto arg :
model._pdfList) {
81 auto pdf =
dynamic_cast<const RooAbsPdf *
>(arg);
83 coutF(
Generation) <<
"Cannot generate events from an object that is not a PDF.\n\t"
84 <<
"The offending object is a " << arg->IsA()->GetName() <<
" named '" << arg->GetName() <<
"'." << std::endl;
85 throw std::invalid_argument(
"Trying to generate events from on object that is not a PDF.");
109 cxcoutI(
Generation) <<
"RooAddGenContext::ctor() setting up event special generator context for sum resolution model " <<
model.GetName()
110 <<
" for generation of observable(s) " << vars ;
123 for (
const auto obj :
model._pdfList) {
144 for (vector<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
161 for (vector<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
162 (*iter)->attach(args) ;
186 for (vector<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
187 (*iter)->initGenerator(theEvent) ;
202 for (i=0 ; i<
_nComp ; i++) {
204 _gcList[i]->generateEvent(theEvent,remaining) ;
224 for (i=0 ; i<
_nComp ; i++) {
237 for (i=0 ; i<
_nComp ; i++) {
254 for (vector<RooAbsGenContext*>::iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
255 (*iter)->setProtoDataOrder(lut) ;
267 os <<
indent <<
"--- RooAddGenContext ---" << endl ;
268 os <<
indent <<
"Using PDF ";
271 os <<
indent <<
"List of component generators" << endl ;
274 for (vector<RooAbsGenContext*>::const_iterator iter=
_gcList.begin() ; iter!=
_gcList.end() ; ++iter) {
275 (*iter)->printMultiline(os,content,
verbose,indent2) ;
RooAddPdf is an efficient implementation of a sum of PDFs of the form.
void updateCoefficients(CacheElem &cache, const RooArgSet *nset) const
Update the coefficient values in the given cache element: calculate new remainder fraction,...
virtual void initGenerator(const RooArgSet &theEvent)
One-time initialization of generator contex.
RooAddModel::CacheElem * _mcache
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print the details of the context.
RooAbsArg * find(const char *name) const
Find object with given name in list.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Set the operation mode of this node.
static void indent(ostringstream &buf, int indent_level)
std::vector< RooAbsGenContext * > _gcList
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
Recursively replace all servers with the new servers in newSet.
virtual void fixAddCoefNormalization(const RooArgSet &addNormSet=RooArgSet(), Bool_t force=kTRUE)
Fix the interpretation of the coefficient of any RooAddPdf component in the expression tree headed by...
virtual const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
virtual void setProtoDataOrder(Int_t *lut)
Set the traversal order of prototype data to that in the lookup tables passed as argument.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for multi-line printing.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Randomly choose one of the component contexts to generate this event, with a probability proportional...
void updateCoefficients(CacheElem &cache, const RooArgSet *nset) const
Update the coefficient values in the given cache element: calculate new remainder fraction,...
TString & Append(const char *cs)
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
virtual void attach(const RooArgSet ¶ms)
Attach given set of variables to internal p.d.f. clone.
RooAddPdf::CacheElem * _pcache
RooAddModel cache element.
RooAbsGenContext is the abstract base class for generator contexts of RooAbsPdf objects.
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...
RooAddGenContext is an efficient implementation of the generator context specific for RooAddPdf PDFs.
virtual void setProtoDataOrder(Int_t *lut)
Forward the setProtoDataOrder call to the component generator contexts.
virtual ~RooAddGenContext()
Destructor. Delete all owned subgenerator contexts.
RooAddModel is an efficient implementation of a sum of PDFs of the form.
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,...
std::vector< double > _coefCache
RooDataSet is a container class to hold unbinned data.
void updateThresholds()
Update the cumulative threshold table from the current coefficient values.
CacheElem * getProjCache(const RooArgSet *nset, const RooArgSet *iset=0, const char *rangeName=0) const
Retrieve cache element for the computation of the PDF normalisation.
RooAddGenContext(const RooAddPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
Constructor.
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
RooArgSet is a container object that can hold multiple RooAbsArg objects.