49 _valid(false), _dim(0), _bins(0), _boxes(0), _vol(0), _xl(0), _xu(0), _delx(0), _d(0), _xi(0), _xin(0), _weight(0)
58 : _valid(true), _xl(0),_xu(0),_delx(0),_xi(0)
124 <<
"," <<
_xu[
index] <<
"]" << endl;
145 if(bins ==
_bins)
return;
148 double pts_per_bin = (
double)
_bins / (
double) bins;
152 double xold,xnew(0),dw(0);
157 for(k = 1; k <=
_bins; k++) {
161 while(dw > pts_per_bin) {
163 newCoord(i++)= xnew - (xnew - xold) * dw;
167 for(k = 1 ; k < bins; k++) {
197 bool useQuasiRandom)
const
223 bin_width=
coord(1,j);
228 y=
coord(k,j) + (z-k)*bin_width;
263 if (0 !=
box[j])
return true;
279 <<
getNBins() <<
" bin(s) and sampled with " <<
_boxes <<
" box(es)" << endl;
285 os <<
indent <<
" bin-" << bin <<
" : x = " <<
coord(bin,
index) <<
" , y = "
342 double oldg =
value(0,j);
343 double newg =
value(1,j);
344 value(0,j)= (oldg + newg)/2;
345 double grid_tot_j =
value(0,j);
349 for (i = 1; i <
_bins - 1; i++) {
350 double rc = oldg + newg;
353 value(i,j)= (rc + newg)/3;
354 grid_tot_j+=
value(i,j);
361 double tot_weight(0);
362 for (i = 0; i <
_bins; i++) {
364 if (
value(i,j) > 0) {
365 oldg = grid_tot_j/
value(i,j);
372 double pts_per_bin = tot_weight /
_bins;
380 for (k = 0; k <
_bins; k++) {
385 while(dw > pts_per_bin) {
391 for (k = 1 ; k <
_bins ; k++) {
static void indent(ostringstream &buf, int indent_level)
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
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
RooGrid is a utility class for RooMCIntegrator which implements an adaptive multi-dimensional Monte C...
UInt_t getDimension() const
double * _xl
! Internal workspace
double value(Int_t i, Int_t j) const
double * _xi
! Internal workspace
bool initialize(const RooAbsFunc &function)
Calculate and store the grid dimensions and volume using the specified function, and initialize the g...
double * _delx
! Internal workspace
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...
double * _weight
! Internal workspace
double * _d
! Internal workspace
TClass * IsA() const override
void printClassName(std::ostream &os) const override
Print class name of grid object.
bool _valid
Is configuration valid.
double * _xu
! Internal workspace
void resetValues()
Reset the values associated with each grid cell.
double * _xin
! Internal workspace
~RooGrid() override
Destructor.
RooGrid()
Default constructor.
UInt_t _boxes
Number of dimensions, bins and boxes.
void accumulate(const UInt_t bin[], double amount)
Add the specified amount to bin[j] of the 1D histograms associated with each axis j.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Print info about this object to the specified stream.
void printName(std::ostream &os) const override
Print name of grid object.
double coord(Int_t i, Int_t j) const
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 refine(double alpha=1.5)
Refine the grid using the values that have been accumulated so far.
void printTitle(std::ostream &os) const override
Print title of grid object.
void firstBox(UInt_t box[]) const
Reset the specified array of box indices to refer to the first box in the standard traversal order.
double & newCoord(Int_t i)
static Int_t isInfinite(double x)
Return true if x is infinite by RooNumBer internal specification.
static double uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
static bool quasi(UInt_t dimension, double vector[], RooQuasiRandomGenerator *generator=quasiGenerator())
Return a quasi-random number in the range (0,1) using the Niederreiter base 2 generator described in ...
const char * GetName() const override
Returns name of object.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual const char * GetTitle() const
Returns title of object.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RVec< PromoteType< T > > log(const RVec< T > &v)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)