library: libRooFit #include "RooGrid.h"

# RooGrid

class description - source file - inheritance tree (.pdf)

## class RooGrid : public TObject, public RooPrintable

| Inheritance Chart:

`TObject`

`RooPrintable`

<-

`RooGrid`

        protected:

          Double_t& coord(Int_t i, Int_t j)
          Double_t& newCoord(Int_t i)
          Double_t& value(Int_t i, Int_t j)

        public:

                          RooGrid()
                          RooGrid(const RooAbsFunc& function)
                          RooGrid(const RooGrid&)
                  virtual ~RooGrid()
                     void accumulate(const UInt_t* bin, Double_t amount)
           static TClass* Class()
                 Double_t coord(Int_t i, Int_t j) const
                  UInt_t* createIndexVector() const
                Double_t* createPoint() const
                     void firstBox(UInt_t* box) const
                     void generatePoint(const UInt_t* box, Double_t* x, UInt_t* bin, Double_t& vol, Bool_t useQuasiRandom = kTRUE) const
                   UInt_t getDimension() const
                   UInt_t getNBins() const
                   UInt_t getNBoxes() const
                 Double_t getVolume() const
                   Bool_t initialize(const RooAbsFunc& function)
          virtual TClass* IsA() const
                   Bool_t isValid() const
                   Bool_t nextBox(UInt_t* box) const
                 RooGrid& operator=(const RooGrid&)
             virtual void Print(Option_t* options = "0") const
             virtual void printToStream(ostream& os, RooPrintable::PrintOption opt = Standard, TString indent = ) const
                     void refine(Double_t alpha = 1.5)
                     void resetValues()
                     void resize(UInt_t bins)
                     void setNBoxes(UInt_t boxes)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
                 Double_t value(Int_t i, Int_t j) const

### Data Members

        protected:

             Bool_t _valid
             UInt_t _dim
             UInt_t _bins
             UInt_t _boxes
           Double_t _vol
          Double_t* _xl      ! do not persist
          Double_t* _xu      ! do not persist
          Double_t* _delx    ! do not persist
          Double_t* _d       ! do not persist
          Double_t* _xi      ! do not persist
          Double_t* _xin     ! do not persist
          Double_t* _weight  ! do not persist

        public:

          static const enum RooGrid:: maxBins

## Class Description

RooGrid()

RooGrid(const RooAbsFunc &function) : _valid(kTRUE), _xl(0),_xu(0),_delx(0),_xi(0)

     check that the input function is valid

~RooGrid()

Bool_t initialize(const RooAbsFunc &function)

     Calculate and store the grid dimensions and volume using the
     specified function, and initialize the grid using a single bin.
     Return kTRUE, or else kFALSE if the range is not valid.

void resize(UInt_t bins)

     Adjust the subdivision of each axis to give the specified
     number of bins, using an algorithm that preserves relative
     bin density. The new binning can be finer or coarser than
     the original binning.

void resetValues()

     Reset the values associated with each grid cell.

void generatePoint(const UInt_t box[], Double_t x[], UInt_t bin[], Double_t &vol, Bool_t useQuasiRandom) const

     Generate a random vector in the specified box and and store its
     coordinates in the x[] array provided, the corresponding bin
     indices in the bin[] array, and the volume of this bin in vol.
     The box is specified by the array box[] of box integer indices
     that each range from 0 to getNBoxes()-1.

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 and return kTRUE, or else return
     kFALSE if we the indices already refer to the last box.

void printToStream(ostream& os, PrintOption opt, TString indent) const

     Print info about this object to the specified stream.

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 refine(Double_t alpha)

     Refine the grid using the values that have been accumulated so far.
     The parameter alpha controls the stiffness of the rebinning and should
     usually be between 1 (stiffer) and 2 (more flexible). A value of zero
     prevents any rebinning.

### Inline Functions

                   void Print(Option_t* options = "0") const
                 Bool_t isValid() const
                 UInt_t getDimension() const
               Double_t getVolume() const
                 UInt_t getNBins() const
                 UInt_t getNBoxes() const
                   void setNBoxes(UInt_t boxes)
              Double_t* createPoint() const
                UInt_t* createIndexVector() const
               Double_t coord(Int_t i, Int_t j) const
               Double_t value(Int_t i, Int_t j) const
              Double_t& coord(Int_t i, Int_t j)
              Double_t& value(Int_t i, Int_t j)
              Double_t& newCoord(Int_t i)
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
                RooGrid RooGrid(const RooGrid&)
               RooGrid& operator=(const RooGrid&)

Last update: Tue Jun 28 18:12:59 2005
Copyright (c) 2000-2005, Regents of the University of California *