61 RooCategory samplingMode(
"samplingMode",
"Sampling Mode") ;
77 RooRealVar alpha(
"alpha",
"Grid structure constant",1.5) ;
78 RooRealVar nRefineIter(
"nRefineIter",
"Number of refining iterations",5) ;
79 RooRealVar nRefinePerDim(
"nRefinePerDim",
"Number of refining samples (per dimension)",1000) ;
80 RooRealVar nIntPerDim(
"nIntPerDim",
"Number of integration samples (per dimension)",5000) ;
115 _alpha(1.5), _mode(mode), _genType(genType),
116 _nRefineIter(5),_nRefinePerDim(1000),_nIntegratePerDim(5000)
237 bins= boxes/box_per_bin;
239 boxes = box_per_bin *
bins;
241 << box_per_bin <<
" boxes/bin" << endl;
245 << boxes <<
" boxes" << endl;
274 for (
UInt_t it = 0; it < iterations; it++) {
296 q+= d * d * (k / (k + 1.0));
330 intgrl_sq = intgrl * intgrl;
348 cum_int += (intgrl - cum_int) / (it + 1.0);
352 <<
" Cumulative : I = " << cum_int <<
" +/- " << cum_sig <<
"( chi2 = " <<
_chisq
366 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.
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
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.
RooNumIntFactory is a factory to instantiate numeric integrators from a given function binding and a ...
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
RooMCIntegrator implements an adaptive multi-dimensional Monte Carlo numerical integration, following the VEGAS algorithm originally described in G.
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.
RooRealVar represents a fundamental (non-derived) real valued object.
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...
RooCategory represents a fundamental (non-derived) discrete value object.
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...
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
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.