51 _valid(
kFALSE), _dim(0), _bins(0), _boxes(0), _vol(0), _xl(0), _xu(0), _delx(0), _d(0), _xi(0), _xin(0), _weight(0)
60 : _valid(
kTRUE), _xl(0),_xu(0),_delx(0),_xi(0)
69 _dim=
function.getDimension();
113 _xl[index]=
function.getMinLimit(index);
118 _xu[index]=
function.getMaxLimit(index);
126 <<
"," <<
_xu[index] <<
"]" << endl;
147 if(bins ==
_bins)
return;
159 for(k = 1; k <=
_bins; k++) {
163 while(dw > pts_per_bin) {
165 newCoord(i++)= xnew - (xnew - xold) * dw;
169 for(k = 1 ; k <
bins; k++) {
199 Bool_t useQuasiRandom)
const
225 bin_width=
coord(1,j);
230 y=
coord(k,j) + (z-k)*bin_width;
264 box[j]= (box[j] + 1) %
_boxes;
265 if (0 != box[j])
return kTRUE;
280 os << indent <<
" Has " <<
getDimension() <<
" dimension(s) each subdivided into "
281 <<
getNBins() <<
" bin(s) and sampled with " <<
_boxes <<
" box(es)" << endl;
283 os << indent <<
" (" << index <<
") ["
284 << setw(10) <<
_xl[index] <<
"," << setw(10) <<
_xu[index] <<
"]" << endl;
285 if(!verbose)
continue;
287 os << indent <<
" bin-" << bin <<
" : x = " <<
coord(bin,index) <<
" , y = "
288 <<
value(bin,index) << endl;
346 value(0,j)= (oldg + newg)/2;
351 for (i = 1; i <
_bins - 1; i++) {
355 value(i,j)= (rc + newg)/3;
356 grid_tot_j+=
value(i,j);
358 value(_bins-1,j)= (newg + oldg)/2;
359 grid_tot_j+=
value(_bins-1,j);
364 for (i = 0; i <
_bins; i++) {
366 if (
value(i,j) > 0) {
367 oldg = grid_tot_j/
value(i,j);
382 for (k = 0; k <
_bins; k++) {
387 while(dw > pts_per_bin) {
393 for (k = 1 ; k <
_bins ; k++) {
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 void printTitle(std::ostream &os) const
Print title of grid object.
RooGrid()
Default constructor.
virtual void printName(std::ostream &os) const
Print name of grid object.
Double_t & newCoord(Int_t i)
Double_t * _weight
Internal workspace.
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 * _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 ...
const TKDTreeBinning * bins
Double_t * _xu
Internal workspace.
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)
Double_t * _d
Internal workspace.
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.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Double_t value(Int_t i, Int_t j) const
Double_t coord(Int_t i, Int_t j) const
virtual ~RooGrid()
Destructor.
Double_t * _xin
Internal workspace.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual const char * GetName() const
Returns name of object.
static void indent(ostringstream &buf, int indent_level)
void refine(Double_t alpha=1.5)
Refine the grid using the values that have been accumulated so far.
UInt_t getDimension() const
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
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...
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.
void resetValues()
Reset the values associated with each grid cell.
virtual void printClassName(std::ostream &os) const
Print class name of grid object.
virtual const char * GetTitle() const
Returns title 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...