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