52 _valid(
kFALSE), _dim(0), _bins(0), _boxes(0), _vol(0), _xl(0), _xu(0), _delx(0), _d(0), _xi(0), _xin(0), _weight(0)
70 _dim=
function.getDimension();
114 _xl[index]=
function.getMinLimit(index);
119 _xu[index]=
function.getMaxLimit(index);
127 <<
"," <<
_xu[index] <<
"]" << endl;
148 if(bins ==
_bins)
return;
160 for(k = 1; k <=
_bins; k++) {
164 while(dw > pts_per_bin) {
166 newCoord(i++)= xnew - (xnew - xold) * dw;
170 for(k = 1 ; k < bins; k++) {
200 Bool_t useQuasiRandom)
const 226 bin_width=
coord(1,j);
231 y=
coord(k,j) + (z-k)*bin_width;
265 box[j]= (box[j] + 1) %
_boxes;
266 if (0 != box[j])
return kTRUE;
281 os << indent <<
" Has " <<
getDimension() <<
" dimension(s) each subdivided into " 282 <<
getNBins() <<
" bin(s) and sampled with " <<
_boxes <<
" box(es)" << endl;
284 os << indent <<
" (" << index <<
") [" 285 << setw(10) <<
_xl[index] <<
"," << setw(10) <<
_xu[index] <<
"]" << endl;
286 if(!verbose)
continue;
288 os << indent <<
" bin-" << bin <<
" : x = " <<
coord(bin,index) <<
" , y = " 289 <<
value(bin,index) << endl;
318 os << IsA()->GetName() ;
347 value(0,j)= (oldg + newg)/2;
352 for (i = 1; i <
_bins - 1; i++) {
356 value(i,j)= (rc + newg)/3;
357 grid_tot_j+=
value(i,j);
359 value(_bins-1,j)= (newg + oldg)/2;
360 grid_tot_j+=
value(_bins-1,j);
365 for (i = 0; i <
_bins; i++) {
367 if (
value(i,j) > 0) {
368 oldg = grid_tot_j/
value(i,j);
383 for (k = 0; k <
_bins; k++) {
388 while(dw > pts_per_bin) {
394 for (k = 1 ; k <
_bins ; k++) {
virtual void printClassName(std::ostream &os) const
Print class name of grid object.
UInt_t getDimension() const
virtual void printTitle(std::ostream &os) const
Print title of grid object.
RooGrid()
Default constructor.
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 & newCoord(Int_t i)
Double_t * _weight
Internal workspace.
Double_t * _delx
Internal workspace.
static Int_t isInfinite(Double_t x)
Return true if x is infinite by RooNumBer internal specification.
static Bool_t quasi(UInt_t dimension, Double_t vector[], RooQuasiRandomGenerator *generator=quasiGenerator())
Return a quasi-random number in the range (0,1) using the Niederreiter base 2 generator described in ...
Double_t * _xu
Internal workspace.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t * _d
Internal workspace.
Double_t coord(Int_t i, Int_t j) const
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
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...
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual ~RooGrid()
Destructor.
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_t * _xin
Internal workspace.
void refine(Double_t alpha=1.5)
Refine the grid using the values that have been accumulated so far.
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
Double_t value(Int_t i, Int_t j) const
Bool_t initialize(const RooAbsFunc &function)
Calculate and store the grid dimensions and volume using the specified function, and initialize the g...
Double_t * _xi
Internal workspace.
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.
you should not use this method at all Int_t Int_t z
virtual const char * GetTitle() const
Returns title of object.
void resetValues()
Reset the values associated with each grid cell.
Double_t getVolume() const
virtual void printName(std::ostream &os) const
Print name of grid object.
virtual const char * GetName() const
Returns name of object.
void resize(UInt_t bins)
Adjust the subdivision of each axis to give the specified number of bins, using an algorithm that pre...
RooGrid is a utility class for RooMCIntegrator which implements an adaptive multi-dimensional Monte C...
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...