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 ~RooAcceptReject()
Destructor.
const RooArgSet * nextAcceptedEvent()
Scan through events in the cache which have not been used yet, looking for the first accepted one whi...
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
virtual void randomize(const char *rangeName=0)
Set a new value sampled from a uniform distribution over the fit range.
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 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.
Int_t numTypes(const char *=0) const
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
Double_t getVal(const RooArgSet *set=0) const
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.
ClassImp(RooAcceptReject)
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Int_t numEntries() const
Bool_t storeProtoSampler(RooAbsNumGenerator *proto, const RooArgSet &defConfig)
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
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)
virtual TObject * Next()=0
static void registerSampler(RooNumGenFactory &fact)
Register RooIntegrator1D, is parameters and capabilities with RooNumIntFactory.
virtual const RooArgSet * get(Int_t index) const
Return RooArgSet with coordinates of event 'index'.
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.