73 _cloneSet(0), _pdfClone(0), _acceptRejectFunc(0), _generator(0),
74 _maxVar(0), _uniIter(0), _updateFMaxPerEvent(0)
77 <<
" for generation of observable(s) " << vars ;
80 if (forceDirect && forceDirect->
getSize()>0)
ccxcoutI(
Generation) <<
" with internal generation forced for observables " << *forceDirect ;
89 coutE(
Generation) <<
"RooGenContext::RooGenContext(" <<
GetName() <<
") Couldn't deep-clone PDF, abort," << endl ;
100 fullNormSet.
add(*prototype->
get()) ;
113 coutE(
Generation) <<
"RooGenContext::ctor(): cannot generate values for derived \"" << tmp->
GetName() <<
"\"" << endl;
121 <<
"\" which will have uniform distribution" << endl;
129 if (forceDirect==0 || !forceDirect->
find(direct->
GetName())) {
131 cxcoutD(
Generation) <<
"RooGenContext::ctor() observable " << arg->
GetName() <<
" has been determined to be unsafe for internal generation" << endl;
148 coutE(
Generation) <<
"RooGenContext::ctor() constructor failed with errors" << endl;
155 cxcoutD(
Generation) <<
"RooGenContext::ctor() observables " <<
_directVars <<
" are safe for internal generator (if supported by p.d.f)" << endl ;
158 cxcoutD(
Generation) <<
"RooGenContext::ctor() observables " <<
_otherVars <<
" are NOT safe for internal generator (if supported by p.d.f)" << endl ;
165 cxcoutD(
Generation) <<
"RooGenContext::ctor() Model depends on supplied protodata observables, static initialization of internal generator will not be allowed" << endl ;
173 cxcoutD(
Generation) <<
"RooGenContext::ctor() Model indicates that it can internally generate observables "
174 << generatedVars <<
" with configuration identifier " <<
_code << endl ;
201 ntitle.
Append(
" (Accept/Reject)") ;
216 if (maxFindCode != 0) {
217 coutI(
Generation) <<
"RooGenContext::ctor() no prototype data provided, all observables are generated with numerically and "
218 <<
"model supports analytical maximum findin:, can provide analytical pdf maximum to numeric generator" << endl ;
221 cxcoutD(
Generation) <<
"RooGenContext::ctor() maximum value returned by RooAbsPdf::maxVal() is " << maxVal << endl ;
244 if (maxFindCode != 0) {
246 coutI(
Generation) <<
"RooGenContext::ctor() prototype data provided, and "
247 <<
"model supports analytical maximum finding in the full phase space: "
248 <<
"can provide analytical pdf maximum to numeric generator" << endl ;
252 if (maxFindCode != 0) {
254 coutI(
Generation) <<
"RooGenContext::ctor() prototype data provided, and "
255 <<
"model supports analytical maximum finding in the variables which are not"
256 <<
" internally generated. Can provide analytical pdf maximum to numeric "
257 <<
"generator" << endl;
258 cxcoutD(
Generation) <<
"RooGenContext::ctor() maximum value must be reevaluated for each "
259 <<
"event with configuration code " << maxFindCode << endl ;
269 otherAndProto.
add(*protoDeps) ;
273 cxcoutD(
Generation) <<
"RooGenContext::ctor() prototype data provided, observables are generated numericaly no "
274 <<
"analytical estimate of maximum function value provided by model, must determine maximum value through initial sampling space "
275 <<
"of accept/reject observables plus prototype observables: " << otherAndProto << endl ;
286 <<
") ERROR: generating conditional p.d.f. which requires prior knowledge of function maximum, "
287 <<
"but chosen numeric generator (" << maxFinder->IsA()->
GetName() <<
") does not support maximum finding" << endl ;
289 throw string(
"RooGenContext::ctor()") ;
293 cxcoutD(
Generation) <<
"RooGenContext::ctor() maximum function value found through initial sampling is " << max << endl ;
356 while((arg=iter.
next())) {
367 cxcoutD(
Generation) <<
"RooGenContext::initGenerator() initializing internal generator of model with code " <<
_code << endl ;
389 cxcoutD(
Generation) <<
"RooGenContext::initGenerator() reevaluation of maximum function value is required for each event, new value is " << max << endl ;
396 if (resampleRatio<1) {
397 coutI(
Generation) <<
"RooGenContext::generateEvent INFO: accept/reject generator requests resampling of previously produced events by factor "
398 << resampleRatio <<
" due to increased maximum weight" << endl ;
402 coutE(
Generation) <<
"RooGenContext::generateEvent ERROR accept/reject generator failed" << endl ;
424 coutE(
Generation) <<
"RooGenContext::generateEvent(" <<
GetName() <<
") ERROR: uniform variable " << uniVar->
GetName() <<
" is not an lvalue" << endl ;
441 os << indent <<
" --- RooGenContext --- " << endl ;
442 os << indent <<
"Using PDF ";
446 os << indent <<
"Use PDF generator for " <<
_directVars << endl ;
449 os << indent <<
"Prototype observables are " <<
_protoVars << endl ;
virtual const char * GetTitle() const
Returns title of object.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
TIterator * serverIterator() const
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'.
Double_t getNorm(const RooArgSet &nset) const
RooFIter fwdIterator() const
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
virtual Bool_t isFundamental() const
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
Generate one event.
RooAbsNumGenerator * createSampler(RooAbsReal &func, const RooArgSet &genVars, const RooArgSet &condVars, const RooNumGenConfig &config, Bool_t verbose=kFALSE, RooAbsReal *maxFuncVal=0)
Construct a numeric integrator instance that operates on function 'func' and is configured with 'conf...
Iterator abstract base class.
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 void removeAll()
Remove all arguments from our set, deleting them if we own them.
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
TString & Append(const char *cs)
void attachParameters(const RooArgSet &vars)
Reattach original parameters to function clone.
Double_t getVal(const RooArgSet *set=0) const
virtual void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Printing interface.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual void generateEvent(Int_t code)
Interface for generation of anan event using the algorithm corresponding to the specified code...
virtual Double_t getFuncMax()
virtual const RooArgSet * generateEvent(UInt_t remaining, Double_t &resampleRatio)=0
virtual const char * GetName() const
Returns name of object.
RooGenContext(const RooAbsPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t verbose=kFALSE, const RooArgSet *forceDirect=0)
Initialize a new context for generating events with the specified variables, using the specified PDF ...
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...
static void indent(ostringstream &buf, int indent_level)
RooAbsNumGenerator * _generator
virtual Int_t getMaxVal(const RooArgSet &vars) const
Advertise capability to determine maximum value of function for given set of observables.
const RooNumGenConfig * getGeneratorConfig() const
Return the numeric MC generator configuration used for this object.
virtual void randomize(const char *rangeName=0)=0
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, Bool_t oneSafe=kFALSE)
The assignment operator sets the value of any argument in our set that also appears in the other set...
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for multi-line printing.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
virtual ~RooGenContext()
Destructor.
Int_t _updateFMaxPerEvent
void resampleData(Double_t &ratio)
Rescale existing output buffer with given ratio.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual void initGenerator(Int_t code)
Interface for one-time initialization to setup the generator for the specified code.
virtual TObject * Next()=0
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.
static RooNumGenFactory & instance()
Static method returning reference to singleton instance of factory.
virtual void initGenerator(const RooArgSet &theEvent)
Perform one-time initialization of the generator context.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
RooRealIntegral * _acceptRejectFunc
virtual Double_t maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
virtual void attach(const RooArgSet ¶ms)
Attach the cloned model to the event buffer we will be filling.
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...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
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...
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 ...