60 RooCategory samplingMode(
"samplingMode",
"Sampling Mode") ;
76 RooRealVar alpha(
"alpha",
"Grid structure constant",1.5) ;
77 RooRealVar nRefineIter(
"nRefineIter",
"Number of refining iterations",5) ;
78 RooRealVar nRefinePerDim(
"nRefinePerDim",
"Number of refining samples (per dimension)",1000) ;
79 RooRealVar nIntPerDim(
"nIntPerDim",
"Number of integration samples (per dimension)",5000) ;
114 _alpha(1.5), _mode(mode), _genType(genType),
115 _nRefineIter(5),_nRefinePerDim(1000),_nIntegratePerDim(5000)
236 bins= boxes/box_per_bin;
238 boxes = box_per_bin *
bins;
240 << box_per_bin <<
" boxes/bin" << endl;
244 << boxes <<
" boxes" << endl;
273 for (
UInt_t it = 0; it < iterations; it++) {
295 q+= d * d * (k / (k + 1.0));
329 intgrl_sq = intgrl * intgrl;
347 cum_int += (intgrl - cum_int) / (it + 1.0);
351 <<
" Cumulative : I = " << cum_int <<
" +/- " << cum_sig <<
"( chi2 = " <<
_chisq
365 if(absError) *absError = cum_sig;
void generatePoint(const UInt_t box[], Double_t x[], UInt_t bin[], Double_t &vol, Bool_t useQuasiRandom=kTRUE) const
Generate a random vector in the specified box and and store its coordinates in the x[] array provided...
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set value by specifying the index code of the desired state.
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Return clone of this generator operating on given function with given configuration Needed to support...
void firstBox(UInt_t box[]) const
Reset the specified array of box indices to refer to the first box in the standard traversal order...
ClassImp(RooMCIntegrator)
const TKDTreeBinning * bins
Bool_t nextBox(UInt_t box[]) const
Update the specified array of box indices to refer to the next box in the standard traversal order an...
Double_t getVolume() const
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RooMCIntegrator()
Default constructor.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual Bool_t setLabel(const char *label, Bool_t printError=kTRUE)
Set value by specifying the name of the desired state If printError is set, a message will be printed...
UInt_t * createIndexVector() const
virtual Double_t integral(const Double_t *yvec=0)
Evaluate the integral using a fixed number of calls to evaluate the integrand equal to about 10k per ...
void setNBoxes(UInt_t boxes)
virtual Bool_t checkLimits() const
Check if we can integrate over the current domain.
void function(const char *name_, T fun, const char *docstring=0)
Double_t * createPoint() const
Int_t getCatIndex(const char *name, Int_t defVal=0, Bool_t verbose=kFALSE) const
Get index value of a RooAbsCategory stored in set with given name.
const RooAbsFunc * _function
static void registerIntegrator(RooNumIntFactory &fact)
This function registers class RooMCIntegrator, its configuration options and its capabilities with Ro...
void refine(Double_t alpha=1.5)
Refine the grid using the values that have been accumulated so far.
virtual ~RooMCIntegrator()
Destructor.
UInt_t getDimension() const
virtual const char * GetName() const
Returns name of object.
Bool_t initialize(const RooAbsFunc &function)
Calculate and store the grid dimensions and volume using the specified function, and initialize the g...
void accumulate(const UInt_t bin[], Double_t amount)
Add the specified amount to bin[j] of the 1D histograms associated with each axis j...
Mother of all ROOT objects.
const RooAbsFunc * integrand() const
void resetValues()
Reset the values associated with each grid cell.
Bool_t defineType(const char *label)
Define a state with given name, the lowest available positive integer is assigned as index...
Double_t vegas(Stage stage, UInt_t calls, UInt_t iterations, Double_t *absError=0)
Perform one step of Monte Carlo integration using the specified number of iterations with (approximat...
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
void resize(UInt_t bins)
Adjust the subdivision of each axis to give the specified number of bins, using an algorithm that pre...
const RooArgSet & getConfigSection(const char *name) const
Retrieve configuration information specific to integrator with given name.
Bool_t storeProtoIntegrator(RooAbsIntegrator *proto, const RooArgSet &defConfig, const char *depName="")
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
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.