64 RooRealVar nTrial0D(
"nTrial0D",
"Number of trial samples for cat-only generation",100,0,1e9) ;
65 RooRealVar nTrial1D(
"nTrial1D",
"Number of trial samples for 1-dim generation",1000,0,1e9) ;
66 RooRealVar nTrial2D(
"nTrial2D",
"Number of trial samples for 2-dim generation",100000,0,1e9) ;
67 RooRealVar nTrial3D(
"nTrial3D",
"Number of trial samples for N-dim generation",10000000,0,1e9) ;
105 <<
" variables with accept-reject may not be accurate" << endl;
112 <<
") WARNING: performing accept/reject sampling on a p.d.f in " 113 <<
_realSampleDim <<
" dimensions without prior knowledge on maximum value " 114 <<
"of p.d.f. Determining maximum value by taking " <<
_minTrials 115 <<
" trial samples. If p.d.f contains sharp peaks smaller than average " 116 <<
"distance between trial sampling points these may be missed and p.d.f. " 117 <<
"may be sampled incorrectly." << endl ;
127 <<
_realSampleDim <<
"-dimensional accept/reject sampling, this may take some time" << endl ;
133 <<
" Initializing accept-reject generator for" << endl <<
" ";
136 ccoutI(
Generation) <<
" Function maximum provided, no trial sampling performed" << endl ;
183 if(event->getSize() == 1)
return event;
196 coutI(
Generation) <<
"RooAcceptReject::generateEvent: resetting event cache" << endl ;
207 cxcoutD(
Generation) <<
"RooAcceptReject::generateEvent maxFuncVal has changed, need to resample already accepted events by factor" 220 coutE(
Generation) <<
"RooAcceptReject::generateEvent: cannot estimate efficiency...giving up" << endl;
226 cxcoutD(
Generation) <<
"RooAcceptReject::generateEvent: adding " << extra <<
" events to the cache, eff = " << eff << endl;
231 cxcoutD(
Generation) <<
"RooAcceptReject::generateEvent: estimated function maximum increased from " 283 cerr <<
"RooAcceptReject: accepted event (used " <<
_eventsUsed <<
" of " 325 cerr <<
"RooAcceptReject: generated " <<
_totalEvents <<
" events so far." << endl ;
342 coutI(
Generation) <<
"RooAcceptReject::getFuncMax: resetting event cache" << endl ;
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual ~RooAcceptReject()
Destructor.
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'.
const RooArgSet * nextAcceptedEvent()
Scan through events in the cache which have not been used yet, looking for the first accepted one whi...
virtual void randomize(const char *rangeName=0)
Set a new value sampled from a uniform distribution over the fit range.
Double_t getVal(const RooArgSet *set=0) const
const RooAbsReal * _funcMaxVal
void addEventToCache()
Add a trial event to our cache and update our estimates of the function maximum value and integral...
Iterator abstract base class.
virtual void randomize(const char *rangeName=0)
Randomize current value.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Int_t numTypes(const char *=0) const
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
const RooArgSet * generateEvent(UInt_t remaining, Double_t &resampleRatio)
Return a pointer to a generated event.
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
Class RooAcceptReject is a generic toy monte carlo generator implement the accept/reject sampling tec...
Class RooAbsNumGenerator is the abstract base class for MC event generator implementations like RooAc...
Bool_t storeProtoSampler(RooAbsNumGenerator *proto, const RooArgSet &defConfig)
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
RooCategory represents a fundamental (non-derived) discrete value object.
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
UInt_t _minTrialsArray[4]
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double func(double *x, double *p)
Double_t getRealValue(const char *name, Double_t defVal=0, Bool_t verbose=kFALSE) const
Get value of a RooAbsReal stored in set with given name.
virtual TObject * Next()=0
RooAbsCategory is the common abstract base class for objects that represent a discrete value with a f...
RooNumGenConfig holds the configuration parameters of the various numeric integrators used by RooReal...
static void registerSampler(RooNumGenFactory &fact)
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.
RooNumGenFactory is a factory to instantiate numeric integrators from a given function binding and a ...
virtual Int_t numEntries() const