59 RooCategory samplingMode(
"samplingMode",
"Sampling Mode") ;
75 RooRealVar alpha(
"alpha",
"Grid structure constant",1.5) ;
76 RooRealVar nRefineIter(
"nRefineIter",
"Number of refining iterations",5) ;
77 RooRealVar nRefinePerDim(
"nRefinePerDim",
"Number of refining samples (per dimension)",1000) ;
78 RooRealVar nIntPerDim(
"nIntPerDim",
"Number of integration samples (per dimension)",5000) ;
113 _alpha(1.5), _mode(
mode), _genType(genType),
114 _nRefineIter(5),_nRefinePerDim(1000),_nIntegratePerDim(5000)
235 bins= boxes/box_per_bin;
237 boxes = box_per_bin * bins;
239 << box_per_bin <<
" boxes/bin" << endl;
243 << boxes <<
" boxes" << endl;
248 double tot_boxes =
TMath::Power((
double)boxes,(
double)dim);
269 double cum_int(0),cum_sig(0);
272 for (
UInt_t it = 0; it < iterations; it++) {
273 double intgrl(0),intgrl_sq(0),sig(0),jacbin(
_jac);
294 q+=
d *
d * (k / (k + 1.0));
307 std::size_t
index = 0;
308 std::size_t sizeOfDim = 1;
336 intgrl_sq = intgrl * intgrl;
354 cum_int += (intgrl - cum_int) / (it + 1.0);
358 <<
" Cumulative : I = " << cum_int <<
" +/- " << cum_sig <<
"( chi2 = " <<
_chisq
372 if(absError) *absError = cum_sig;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char mode
Int_t getCatIndex(const char *name, Int_t defVal=0, bool verbose=false) const
Get index value of a RooAbsCategory stored in set with given name.
double getRealValue(const char *name, double defVal=0, bool verbose=false) const
Get value of a RooAbsReal stored in set with given name.
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
const RooAbsFunc * _function
Pointer to function binding of integrand.
const RooAbsFunc * integrand() const
Return integrand function binding.
bool _valid
Is integrator in valid state?
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooCategory is an object to represent discrete states.
bool setIndex(Int_t index, bool printError=true) override
Set value by specifying the index code of the desired state.
bool defineType(const std::string &label)
Define a state with given name.
bool setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
UInt_t getDimension() const
void Print(Option_t *options=0) const override
This method must be overridden when a class wants to print itself.
bool initialize(const RooAbsFunc &function)
Calculate and store the grid dimensions and volume using the specified function, and initialize the g...
void generatePoint(const UInt_t box[], double x[], UInt_t bin[], double &vol, bool useQuasiRandom=true) const
Generate a random vector in the specified box and and store its coordinates in the x[] array provided...
UInt_t * createIndexVector() const
double * createPoint() const
void resetValues()
Reset the values associated with each grid cell.
void accumulate(const UInt_t bin[], double amount)
Add the specified amount to bin[j] of the 1D histograms associated with each axis j.
bool nextBox(UInt_t box[]) const
Update the specified array of box indices to refer to the next box in the standard traversal order an...
void resize(UInt_t bins)
Adjust the subdivision of each axis to give the specified number of bins, using an algorithm that pre...
void setNBoxes(UInt_t boxes)
void refine(double alpha=1.5)
Refine the grid using the values that have been accumulated so far.
void firstBox(UInt_t box[]) const
Reset the specified array of box indices to refer to the first box in the standard traversal order.
RooMCIntegrator implements an adaptive multi-dimensional Monte Carlo numerical integration,...
GeneratorType _genType
Generator type.
RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const override
Return clone of this generator operating on given function with given configuration Needed to support...
RooMCIntegrator()
Default constructor.
static void registerIntegrator(RooNumIntFactory &fact)
This function registers class RooMCIntegrator, its configuration options and its capabilities with Ro...
Int_t _nIntegratePerDim
Number of integration samplings (per dim)
~RooMCIntegrator() override
Destructor.
bool checkLimits() const override
Check if we can integrate over the current domain.
double _sigma
Scratch variables preserved between calls to vegas1/2/2.
bool _verbose
Verbosity control.
TClass * IsA() const override
Int_t _mode
Sampling mode.
double vegas(Stage stage, UInt_t calls, UInt_t iterations, double *absError=0)
Perform one step of Monte Carlo integration using the specified number of iterations with (approximat...
double integral(const double *yvec=0) override
Evaluate the integral using a fixed number of calls to evaluate the integrand equal to about 10k per ...
Int_t _nRefinePerDim
Number of refinement samplings (per dim)
double _alpha
Grid stiffness parameter.
UInt_t _calls_per_box
Scratch variables preserved between calls to vegas1/2/2.
Int_t _nRefineIter
Number of refinement iterations.
RooNumIntConfig 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.
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
RooNumIntFactory is a factory to instantiate numeric integrators from a given function binding and a ...
bool storeProtoIntegrator(RooAbsIntegrator *proto, const RooArgSet &defConfig, const char *depName="")
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
RooRealVar represents a variable that can be changed from the outside.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of 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.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RVec< PromoteType< T > > floor(const RVec< T > &v)
RVec< PromoteTypes< T0, T1 > > pow(const T0 &x, const RVec< T1 > &v)
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)