library: libRooFit #include "RooHist.h"

# RooHist

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

## class RooHist : public TGraphAsymmErrors, public RooPlotable

| Inheritance Chart:
`TObject`
| <- | `TNamed`
`TAttLine`
`TAttFill`
`TAttMarker`
| <- | `TGraph`
| <- | `TGraphAsymmErrors`
`RooPrintable`
| <- | `RooPlotable`
| <- | `RooHist` |

        protected:

           void initialize()
          Int_t roundBin(Double_t y)

        public:

                           RooHist()
                           RooHist(Double_t nominalBinWidth, Double_t nSigma = 1, Double_t xErrorFrac = 1.0)
                           RooHist(const TH1& data, Double_t nominalBinWidth = 0, Double_t nSigma = 1, RooAbsData::ErrorType = RooAbsData::Poisson, Double_t xErrorFrac = 1.0)
                           RooHist(const TH1& data1, const TH1& data2, Double_t nominalBinWidth = 0, Double_t nSigma = 1, Double_t xErrorFrac = 1.0)
                           RooHist(const RooHist& hist1, const RooHist& hist2, Double_t wgt1 = 1.0, Double_t wgt2 = 1.0, RooAbsData::ErrorType etype = RooAbsData::Poisson, Double_t xErrorFrac = 1.0)
                           RooHist(const RooHist&)
                   virtual ~RooHist()
                      void addAsymmetryBin(Axis_t binCenter, Int_t n1, Int_t n2, Double_t binWidth = 0, Double_t xErrorFrac = 1.0)
                      void addBin(Axis_t binCenter, Int_t n, Double_t binWidth = 0, Double_t xErrorFrac = 1.0)
                      void addBinWithError(Axis_t binCenter, Double_t n, Double_t elow, Double_t ehigh, Double_t binWidth = 0, Double_t xErrorFrac = 1.0)
            static TClass* Class()
          virtual Double_t getFitRangeBinW() const
          virtual Double_t getFitRangeNEvt() const
          virtual Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const
                  Double_t getNominalBinWidth() const
                    Bool_t hasIdenticalBinning(const RooHist& other) const
           virtual TClass* IsA() const
                  RooHist* makePullHist(const RooCurve& curve) const
                  RooHist& operator=(const RooHist&)
              virtual void Print(Option_t* options = "0") const
              virtual void printToStream(ostream& os, RooPrintable::PrintOption opt = Standard, TString indent = ) const
                      void setRawEntries(Double_t n)
              virtual void ShowMembers(TMemberInspector& insp, char* parent)
              virtual void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

          Double_t _nominalBinWidth
          Double_t _nSigma
          Double_t _entries
          Double_t _rawEntries

## Class Description

RooHist(Double_t nominalBinWidth, Double_t nSigma, Double_t /*xErrorFrac*/) : TGraphAsymmErrors(), _nominalBinWidth(nominalBinWidth), _nSigma(nSigma), _rawEntries(-1)

     Create an empty histogram that can be filled with the addBin()
     and addAsymmetryBin() methods. Use the optional parameter to
     specify the confidence level in units of sigma to use for
     calculating error bars. The nominal bin width specifies the
     default used by addBin(), and is used to set the relative
     normalization of bins with different widths.

RooHist(const TH1 &data, Double_t nominalBinWidth, Double_t nSigma, RooAbsData::ErrorType etype, Double_t xErrorFrac) : TGraphAsymmErrors(), _nominalBinWidth(nominalBinWidth), _nSigma(nSigma), _rawEntries(-1)

     Create a histogram from the contents of the specified TH1 object
     which may have fixed or variable bin widths. Error bars are
     calculated using Poisson statistics. Prints a warning and rounds
     any bins with non-integer contents. Use the optional parameter to
     specify the confidence level in units of sigma to use for
     calculating error bars. The nominal bin width specifies the
     default used by addBin(), and is used to set the relative
     normalization of bins with different widths. If not set, the
     nominal bin width is calculated as range/nbins.

RooHist(const TH1 &data1, const TH1 &data2, Double_t nominalBinWidth, Double_t nSigma, Double_t xErrorFrac) : TGraphAsymmErrors(), _nominalBinWidth(nominalBinWidth), _nSigma(nSigma), _rawEntries(-1)

     Create a histogram from the asymmetry between the specified TH1 objects
     which may have fixed or variable bin widths, but which must both have
     the same binning. The asymmetry is calculated as (1-2)/(1+2). Error bars are
     calculated using Binomial statistics. Prints a warning and rounds
     any bins with non-integer contents. Use the optional parameter to
     specify the confidence level in units of sigma to use for
     calculating error bars. The nominal bin width specifies the
     default used by addAsymmetryBin(), and is used to set the relative
     normalization of bins with different widths. If not set, the
     nominal bin width is calculated as range/nbins.

RooHist(const RooHist& hist1, const RooHist& hist2, Double_t wgt1, Double_t wgt2, RooAbsData::ErrorType etype, Double_t xErrorFrac) : _rawEntries(-1)

     Create histogram as sum of two existing histograms. If Poisson errors are selected the histograms are
     added and Poisson confidence intervals are calculated for the summed content. If wgt1 and wgt2 are not
     1 in this mode, a warning message is printed. If SumW2 errors are selectd the histograms are added
     and the histograms errors are added in quadrature, taking the weights into account.

void initialize()

     Perform common initialization for all constructors.

Double_t getFitRangeNEvt() const

Double_t getFitRangeNEvt(Double_t xlo, Double_t xhi) const

     Calculate integral of histogram in given range

Double_t getFitRangeBinW() const

Int_t roundBin(Double_t y)

     Return the nearest positive integer to the input value
     and print a warning if an adjustment is required.

void addBin(Axis_t binCenter, Int_t n, Double_t binWidth, Double_t xErrorFrac)

     Add a bin to this histogram with the specified integer bin contents
     and using an error bar calculated with Poisson statistics. The bin width
     is used to set the relative scale of bins with different widths.

void addBinWithError(Axis_t binCenter, Double_t n, Double_t elow, Double_t ehigh, Double_t binWidth, Double_t xErrorFrac)

     Add a bin to this histogram with the specified bin contents
     and error. The bin width is used to set the relative scale of
     bins with different widths.

void addAsymmetryBin(Axis_t binCenter, Int_t n1, Int_t n2, Double_t binWidth, Double_t xErrorFrac)

     Add a bin to this histogram with the value (n1-n2)/(n1+n2)
     using an error bar calculated with Binomial statistics.

~RooHist()

Bool_t hasIdenticalBinning(const RooHist& other) const

     First check if number of bins is the same

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

     Print info about this histogram to the specified output stream.

       Standard: number of entries
          Shape: error CL and maximum value
        Verbose: print our bin contents and errors

RooHist* makePullHist(const RooCurve& curve) const

     Make histogram of pulls w.r.t to given curve

### Inline Functions

                RooHist RooHist(const RooHist& hist1, const RooHist& hist2, Double_t wgt1 = 1.0, Double_t wgt2 = 1.0, RooAbsData::ErrorType etype = RooAbsData::Poisson, Double_t xErrorFrac = 1.0)
                   void Print(Option_t* options = "0") const
               Double_t getNominalBinWidth() const
                   void setRawEntries(Double_t n)
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
                RooHist RooHist(const RooHist&)
               RooHist& operator=(const RooHist&)

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