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)
61 : _valid(
kTRUE), _xl(0),_xu(0),_delx(0),_xi(0)
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;
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;
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);
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++) {
static void indent(ostringstream &buf, int indent_level)
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...
Double_t coord(Int_t i, Int_t j) const
UInt_t getDimension() 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 * _delx
Internal workspace.
virtual void printName(std::ostream &os) const
Print name of grid object.
virtual void printClassName(std::ostream &os) const
Print class name of grid object.
Double_t * _xin
Internal workspace.
Double_t * _xi
Internal workspace.
Double_t & newCoord(Int_t i)
virtual ~RooGrid()
Destructor.
Double_t * _d
Internal workspace.
Double_t * _weight
Internal workspace.
void refine(Double_t alpha=1.5)
Refine the grid using the values that have been accumulated so far.
virtual void printTitle(std::ostream &os) const
Print title of grid object.
Double_t * _xu
Internal workspace.
void resetValues()
Reset the values associated with each grid cell.
RooGrid()
Default constructor.
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.
Double_t getVolume() const
void resize(UInt_t bins)
Adjust the subdivision of each axis to give the specified number of bins, using an algorithm that pre...
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...
Double_t value(Int_t i, Int_t j) const
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.
void firstBox(UInt_t box[]) const
Reset the specified array of box indices to refer to the first box in the standard traversal order.
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...
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 ...
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
Mother of all ROOT objects.
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)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)