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)
63 if(!(
_valid= function.isValid())) {
69 _dim= function.getDimension();
113 _xl[index]= function.getMinLimit(index);
115 oocoutE((
TObject*)0,Integration) <<
ClassName() <<
": lower limit of dimension " << index <<
" is infinite" << endl;
118 _xu[index]= function.getMaxLimit(index);
120 oocoutE((
TObject*)0,Integration) <<
ClassName() <<
": upper limit of dimension " << index <<
" is infinite" << endl;
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;
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;
317 os << IsA()->GetName() ;
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);
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++) {
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)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)