Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

TH1.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Name:  $:$Id: TH1.h,v 1.46 2003/05/22 21:02:08 brun Exp $
00002 // Author: Rene Brun   26/12/94
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TH1
00013 #define ROOT_TH1
00014 
00015 
00017 //                                                                      //
00018 // TH1                                                                  //
00019 //                                                                      //
00020 // 1-Dim histogram base class.                                          //
00021 //                                                                      //
00023 
00024 #ifndef ROOT_TVirtualHistPainter
00025 #include "TVirtualHistPainter.h"
00026 #endif
00027 
00028 #ifndef ROOT_TAxis
00029 #include "TAxis.h"
00030 #endif
00031 
00032 #ifndef ROOT_TAttLine
00033 #include "TAttLine.h"
00034 #endif
00035 
00036 #ifndef ROOT_TAttFill
00037 #include "TAttFill.h"
00038 #endif
00039 
00040 #ifndef ROOT_TAttMarker
00041 #include "TAttMarker.h"
00042 #endif
00043 
00044 #ifndef ROOT_TArrayC
00045 #include "TArrayC.h"
00046 #endif
00047 #ifndef ROOT_TArrayS
00048 #include "TArrayS.h"
00049 #endif
00050 #ifndef ROOT_TArrayF
00051 #include "TArrayF.h"
00052 #endif
00053 #ifndef ROOT_TArrayD
00054 #include "TArrayD.h"
00055 #endif
00056 #include "Foption.h"
00057 
00058 class TF1;
00059 class TH1D;
00060 class TBrowser;
00061 class TDirectory;
00062 class TVector;
00063 class TVectorD;
00064 
00065 class TH1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
00066 
00067 protected:
00068     Int_t         fNcells;          //number of bins(1D), cells (2D) +U/Overflows
00069     TAxis         fXaxis;           //X axis descriptor
00070     TAxis         fYaxis;           //Y axis descriptor
00071     TAxis         fZaxis;           //Z axis descriptor
00072     Short_t       fBarOffset;       //(1000*offset) for bar charts or legos
00073     Short_t       fBarWidth;        //(1000*width) for bar charts or legos
00074     Stat_t        fEntries;         //Number of entries
00075     Stat_t        fTsumw;           //Total Sum of weights
00076     Stat_t        fTsumw2;          //Total Sum of squares of weights
00077     Stat_t        fTsumwx;          //Total Sum of weight*X
00078     Stat_t        fTsumwx2;         //Total Sum of weight*X*X
00079     Double_t      fMaximum;         //Maximum value for plotting
00080     Double_t      fMinimum;         //Minimum value for plotting
00081     Double_t      fNormFactor;      //Normalization factor
00082     TArrayD       fContour;         //Array to display contour levels
00083     TArrayD       fSumw2;           //Array of sum of squares of weights
00084     TString       fOption;          //histogram options
00085     TList        *fFunctions;       //->Pointer to list of functions (fits and user)
00086     Int_t         fBufferSize;      //fBuffer size
00087     Double_t     *fBuffer;          //[fBufferSize] entry buffer
00088     TDirectory   *fDirectory;       
00089     Int_t         fDimension;       
00090     Double_t     *fIntegral;        
00091     TVirtualHistPainter *fPainter;  
00092     static Int_t  fgBufferSize;     
00093     static Bool_t fgAddDirectory;   
00094 
00095 private:
00096     Int_t   AxisChoice(Option_t *axis) const;
00097     void    Build();
00098     Int_t   FitOptionsMake(Option_t *option, Foption_t &Foption);
00099     TH1(const TH1&); // Intentionally not implemented
00100 
00101 protected:
00102     TH1();
00103     TH1(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xup);
00104     TH1(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
00105     TH1(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
00106     virtual void     Copy(TObject &hnew) const;
00107     virtual Int_t    BufferFill(Axis_t x, Stat_t w);
00108 
00109 public:
00110     // TH1 status bits
00111     enum {
00112        kNoStats     = BIT(9),  // don't draw stats box
00113        kUserContour = BIT(10), // user specified contour levels
00114        kCanRebin    = BIT(11), // can rebin axis
00115        kLogX        = BIT(15), // X-axis in log scale
00116        kIsZoomed    = BIT(16), // bit set when zooming on Y axis
00117        kNoTitle     = BIT(17)  // don't draw the histogram title
00118     };
00119 
00120     virtual ~TH1();
00121 
00122     virtual void     Add(TF1 *h1, Double_t c1=1);
00123     virtual void     Add(const TH1 *h1, Double_t c1=1);
00124     virtual void     Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1); // *MENU*
00125     virtual void     AddBinContent(Int_t bin);
00126     virtual void     AddBinContent(Int_t bin, Stat_t w);
00127     static  void     AddDirectory(Bool_t add=kTRUE);
00128     static  Bool_t   AddDirectoryStatus();
00129     virtual void     Browse(TBrowser *b);
00130     virtual Double_t ComputeIntegral();
00131     virtual Int_t    DistancetoPrimitive(Int_t px, Int_t py);
00132     virtual void     Divide(TF1 *f1, Double_t c1=1);
00133     virtual void     Divide(const TH1 *h1);
00134     virtual void     Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
00135     virtual void     Draw(Option_t *option="");
00136     virtual TH1     *DrawCopy(Option_t *option="") const;
00137     virtual TH1     *DrawNormalized(Option_t *option="", Double_t norm=1) const;
00138     virtual void     DrawPanel(); // *MENU*
00139     virtual Int_t    BufferEmpty(Bool_t deleteBuffer=kFALSE);
00140     virtual void     Eval(TF1 *f1, Option_t *option="");
00141     virtual void     ExecuteEvent(Int_t event, Int_t px, Int_t py);
00142     virtual Int_t    Fill(Axis_t x);
00143     virtual Int_t    Fill(Axis_t x, Stat_t w);
00144     virtual Int_t    Fill(const char *name, Stat_t w);
00145     virtual void     FillN(Int_t ntimes, const Axis_t *x, const Double_t *w, Int_t stride=1);
00146     virtual void     FillN(Int_t, const Axis_t *, const Axis_t *, const Double_t *, Int_t) {;}
00147     virtual void     FillRandom(const char *fname, Int_t ntimes=5000);
00148     virtual void     FillRandom(TH1 *h, Int_t ntimes=5000);
00149     virtual Int_t    FindBin(Axis_t x, Axis_t y=0, Axis_t z=0);
00150     virtual TObject *FindObject(const char *name) const;
00151     virtual TObject *FindObject(const TObject *obj) const;
00152     virtual Int_t    Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0); // *MENU*
00153     virtual Int_t    Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0);
00154     virtual void     FitPanel(); // *MENU*
00155     TH1             *GetAsymmetry(TH1* h2, Double_t c2=1, Double_t dc2=0);
00156     Int_t            GetBufferLength() const {return (Int_t)fBuffer[0];}
00157     Int_t            GetBufferSize  () const {return fBufferSize;}
00158     const   Double_t *GetBuffer() const {return fBuffer;}
00159     static  Int_t    GetDefaultBufferSize();
00160     virtual Double_t *GetIntegral() {return fIntegral;}
00161 
00162     TList           *GetListOfFunctions() const { return fFunctions; }
00163 
00164     virtual Int_t    GetNdivisions(Option_t *axis="X") const;
00165     virtual Color_t  GetAxisColor(Option_t *axis="X") const;
00166     virtual Color_t  GetLabelColor(Option_t *axis="X") const;
00167     virtual Style_t  GetLabelFont(Option_t *axis="X") const;
00168     virtual Float_t  GetLabelOffset(Option_t *axis="X") const;
00169     virtual Float_t  GetLabelSize(Option_t *axis="X") const;
00170     virtual Float_t  GetTitleOffset(Option_t *axis="X") const;
00171     virtual Float_t  GetTitleSize(Option_t *axis="X") const;
00172     virtual Float_t  GetTickLength(Option_t *axis="X") const;
00173     virtual Float_t  GetBarOffset() const {return Float_t(0.001*Float_t(fBarOffset));}
00174     virtual Float_t  GetBarWidth() const  {return Float_t(0.001*Float_t(fBarWidth));}
00175     virtual Int_t    GetContour(Double_t *levels=0);
00176     virtual Double_t GetContourLevel(Int_t level) const;
00177     virtual Double_t GetContourLevelPad(Int_t level) const;
00178 
00179     virtual Int_t    GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const;
00180     virtual Axis_t   GetBinCenter(Int_t bin) const {return fXaxis.GetBinCenter(bin);}
00181     virtual Stat_t   GetBinContent(Int_t bin) const;
00182     virtual Stat_t   GetBinContent(Int_t binx, Int_t biny) const;
00183     virtual Stat_t   GetBinContent(Int_t binx, Int_t biny, Int_t binz) const;
00184     virtual Stat_t   GetBinError(Int_t bin) const;
00185     virtual Stat_t   GetBinError(Int_t binx, Int_t biny) const;
00186     virtual Stat_t   GetBinError(Int_t binx, Int_t biny, Int_t binz) const;
00187     virtual Axis_t   GetBinLowEdge(Int_t bin) const {return fXaxis.GetBinLowEdge(bin);}
00188     virtual Axis_t   GetBinWidth(Int_t bin) const {return fXaxis.GetBinWidth(bin);}
00189     virtual Stat_t   GetCellContent(Int_t binx, Int_t biny) const;
00190     virtual Stat_t   GetCellError(Int_t binx, Int_t biny) const;
00191     virtual void     GetCenter(Axis_t *center) const {fXaxis.GetCenter(center);}
00192     TDirectory      *GetDirectory() const {return fDirectory;}
00193     virtual Stat_t   GetEntries() const;
00194     virtual TF1     *GetFunction(const char *name) const;
00195     virtual Int_t    GetDimension() const { return fDimension; }
00196     virtual void     GetLowEdge(Axis_t *edge) const {fXaxis.GetLowEdge(edge);}
00197     virtual Double_t GetMaximum() const;
00198     virtual Int_t    GetMaximumBin() const;
00199     virtual Int_t    GetMaximumBin(Int_t &locmax, Int_t &locmay, Int_t &locmaz) const;
00200     virtual Double_t GetMaximumStored() const {return fMaximum;}
00201     virtual Double_t GetMinimum() const;
00202     virtual Int_t    GetMinimumBin() const;
00203     virtual Int_t    GetMinimumBin(Int_t &locmix, Int_t &locmiy, Int_t &locmiz) const;
00204     virtual Double_t GetMinimumStored() const {return fMinimum;}
00205     virtual Stat_t   GetMean(Int_t axis=1) const;
00206     virtual Int_t    GetNbinsX() const {return fXaxis.GetNbins();}
00207     virtual Int_t    GetNbinsY() const {return fYaxis.GetNbins();}
00208     virtual Int_t    GetNbinsZ() const {return fZaxis.GetNbins();}
00209     virtual Double_t GetNormFactor() const {return fNormFactor;}
00210     virtual char    *GetObjectInfo(Int_t px, Int_t py) const;
00211     Option_t        *GetOption() const {return fOption.Data();}
00212 
00213     TVirtualHistPainter *GetPainter();
00214 
00215     virtual Int_t    GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=0);
00216     virtual Axis_t   GetRandom();
00217     virtual void     GetStats(Stat_t *stats) const;
00218     virtual Stat_t   GetSumOfWeights() const;
00219     virtual Int_t    GetSumw2N() const {return fSumw2.fN;}
00220     virtual Stat_t   GetRMS(Int_t axis=1) const;
00221             TAxis   *GetXaxis() const;
00222             TAxis   *GetYaxis() const;
00223             TAxis   *GetZaxis() const;
00224     virtual Stat_t   Integral(Option_t *option="") const;
00225     virtual Stat_t   Integral(Int_t binx1, Int_t binx2, Option_t *option="") const;
00226     virtual Stat_t   Integral(Int_t, Int_t, Int_t, Int_t, Option_t * /*option*/ ="") const {return 0;}
00227     virtual Stat_t   Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t * /*option*/ ="" ) const {return 0;}
00228     virtual Double_t KolmogorovTest(TH1 *h2, Option_t *option="") const;
00229     virtual void     LabelsDeflate(Option_t *axis="X");
00230     virtual void     LabelsInflate(Option_t *axis="X");
00231     virtual void     LabelsOption(Option_t *option="h", Option_t *axis="X");
00232     virtual Int_t    Merge(TCollection *list);
00233     virtual void     Multiply(TF1 *h1, Double_t c1=1);
00234     virtual void     Multiply(const TH1 *h1);
00235     virtual void     Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
00236     virtual void     Paint(Option_t *option="");
00237     virtual void     Print(Option_t *option="") const;
00238     virtual void     PutStats(Stat_t *stats);
00239     virtual TH1     *Rebin(Int_t ngroup=2, const char*newname="");  // *MENU*
00240     virtual void     RebinAxis(Axis_t x, Option_t *axis="X");
00241     virtual void     Rebuild(Option_t *option="");
00242     virtual void     RecursiveRemove(TObject *obj);
00243     virtual void     Reset(Option_t *option="");
00244     virtual void     SavePrimitive(ofstream &out, Option_t *option);
00245     virtual void     Scale(Double_t c1=1);
00246     virtual void     SetAxisColor(Color_t color=1, Option_t *axis="X");
00247     virtual void     SetAxisRange(Axis_t xmin, Axis_t xmax, Option_t *axis="X");
00248     virtual void     SetBarOffset(Float_t offset=0.25) {fBarOffset = Short_t(1000*offset);}
00249     virtual void     SetBarWidth(Float_t width=0.5) {fBarWidth = Short_t(1000*width);}
00250     virtual void     SetBinContent(Int_t bin, Stat_t content);
00251     virtual void     SetBinContent(Int_t binx, Int_t biny, Stat_t content);
00252     virtual void     SetBinContent(Int_t binx, Int_t biny, Int_t binz, Stat_t content);
00253     virtual void     SetBinError(Int_t bin, Stat_t error);
00254     virtual void     SetBinError(Int_t binx, Int_t biny, Stat_t error);
00255     virtual void     SetBinError(Int_t binx, Int_t biny, Int_t binz, Stat_t error);
00256     virtual void     SetBins(Int_t nx, Axis_t xmin, Axis_t xmax);
00257     virtual void     SetBins(Int_t nx, Axis_t xmin, Axis_t xmax, Int_t ny, Axis_t ymin, Axis_t ymax);
00258     virtual void     SetBins(Int_t nx, Axis_t xmin, Axis_t xmax, Int_t ny, Axis_t ymin, Axis_t ymax,
00259                              Int_t nz, Axis_t zmin, Axis_t zmax);
00260     virtual void     SetBinsLength(Int_t = -1) { } //refefined in derived classes
00261     virtual void     SetBuffer(Int_t buffersize, Option_t *option="");
00262     virtual void     SetCellContent(Int_t binx, Int_t biny, Stat_t content);
00263     virtual void     SetCellError(Int_t binx, Int_t biny, Stat_t content);
00264     virtual void     SetContent(const Stat_t *content);
00265     virtual void     SetContour(Int_t nlevels, const Double_t *levels=0);
00266     virtual void     SetContourLevel(Int_t level, Double_t value);
00267     static  void     SetDefaultBufferSize(Int_t buffersize=1000);
00268     virtual void     SetDirectory(TDirectory *dir);
00269     virtual void     SetEntries(Stat_t n) {fEntries = n;};
00270     virtual void     SetError(const Stat_t *error);
00271     virtual void     SetLabelColor(Color_t color=1, Option_t *axis="X");
00272     virtual void     SetLabelFont(Style_t font=62, Option_t *axis="X");
00273     virtual void     SetLabelOffset(Float_t offset=0.005, Option_t *axis="X");
00274     virtual void     SetLabelSize(Float_t size=0.02, Option_t *axis="X");
00275 
00276     virtual void     SetMaximum(Double_t maximum=-1111); // *MENU*
00277     virtual void     SetMinimum(Double_t minimum=-1111); // *MENU*
00278     virtual void     SetName(const char *name); // *MENU*
00279     virtual void     SetNameTitle(const char *name, const char *title);
00280     virtual void     SetNdivisions(Int_t n=510, Option_t *axis="X");
00281     virtual void     SetNormFactor(Double_t factor=1) {fNormFactor = factor;}
00282     virtual void     SetStats(Bool_t stats=kTRUE);
00283     virtual void     SetOption(Option_t *option=" ") {fOption = option;}
00284     virtual void     SetTickLength(Float_t length=0.02, Option_t *axis="X");
00285     virtual void     SetTitleOffset(Float_t offset=1, Option_t *axis="X");
00286     virtual void     SetTitleSize(Float_t size=0.02, Option_t *axis="X");
00287     virtual void     SetTitle(const char *title);
00288     virtual void     SetXTitle(const char *title) {fXaxis.SetTitle(title);}
00289     virtual void     SetYTitle(const char *title) {fYaxis.SetTitle(title);}
00290     virtual void     SetZTitle(const char *title) {fZaxis.SetTitle(title);}
00291     virtual void     Smooth(Int_t ntimes=1); // *MENU*
00292     static  void     SmoothArray(Int_t NN, Double_t *XX, Int_t ntimes=1);
00293     static Double_t  SmoothMedian(Int_t n, Double_t *a);
00294     virtual void     Sumw2();
00295     void             UseCurrentStyle();
00296 
00297     ClassDef(TH1,4)  //1-Dim histogram base class
00298 };
00299 
00300 //________________________________________________________________________
00301 
00302 class TH1C : public TH1, public TArrayC {
00303 
00304 public:
00305     TH1C();
00306     TH1C(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xup);
00307     TH1C(const char *name,const char *title,Int_t nbinsx,const Float_t  *xbins);
00308     TH1C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
00309     TH1C(const TH1C &h1c);
00310     virtual ~TH1C();
00311 
00312     virtual void    AddBinContent(Int_t bin);
00313     virtual void    AddBinContent(Int_t bin, Stat_t w);
00314     virtual void    Copy(TObject &hnew) const;
00315     virtual TH1    *DrawCopy(Option_t *option="") const;
00316     virtual Stat_t  GetBinContent(Int_t bin) const;
00317     virtual Stat_t  GetBinContent(Int_t bin, Int_t) const {return GetBinContent(bin);}
00318     virtual Stat_t  GetBinContent(Int_t bin, Int_t, Int_t) const {return GetBinContent(bin);}
00319     virtual void    Reset(Option_t *option="");
00320     virtual void    SetBinContent(Int_t bin, Stat_t content);
00321     virtual void    SetBinContent(Int_t bin, Int_t, Stat_t content) {SetBinContent(bin,content);}
00322     virtual void    SetBinContent(Int_t bin, Int_t, Int_t, Stat_t content) {SetBinContent(bin,content);}
00323     virtual void    SetBinsLength(Int_t n=-1);
00324             TH1C&   operator=(const TH1C &h1);
00325     friend  TH1C    operator*(Double_t c1, const TH1C &h1);
00326     friend  TH1C    operator*(const TH1C &h1, Double_t c1);
00327     friend  TH1C    operator+(const TH1C &h1, const TH1C &h2);
00328     friend  TH1C    operator-(const TH1C &h1, const TH1C &h2);
00329     friend  TH1C    operator*(const TH1C &h1, const TH1C &h2);
00330     friend  TH1C    operator/(const TH1C &h1, const TH1C &h2);
00331 
00332     ClassDef(TH1C,1)  //1-Dim histograms (one char per channel)
00333 };
00334 
00335 TH1C operator*(Double_t c1, const TH1C &h1);
00336 inline
00337 TH1C operator*(const TH1C &h1, Double_t c1) {return operator*(c1,h1);}
00338 TH1C operator+(const TH1C &h1, const TH1C &h2);
00339 TH1C operator-(const TH1C &h1, const TH1C &h2);
00340 TH1C operator*(const TH1C &h1, const TH1C &h2);
00341 TH1C operator/(const TH1C &h1, const TH1C &h2);
00342 
00343 //________________________________________________________________________
00344 
00345 class TH1S : public TH1, public TArrayS {
00346 
00347 public:
00348     TH1S();
00349     TH1S(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xup);
00350     TH1S(const char *name,const char *title,Int_t nbinsx,const Float_t  *xbins);
00351     TH1S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
00352     TH1S(const TH1S &h1s);
00353     virtual ~TH1S();
00354 
00355     virtual void    AddBinContent(Int_t bin);
00356     virtual void    AddBinContent(Int_t bin, Stat_t w);
00357     virtual void    Copy(TObject &hnew) const;
00358     virtual TH1    *DrawCopy(Option_t *option="") const;
00359     virtual Stat_t  GetBinContent(Int_t bin) const;
00360     virtual Stat_t  GetBinContent(Int_t bin, Int_t) const {return GetBinContent(bin);}
00361     virtual Stat_t  GetBinContent(Int_t bin, Int_t, Int_t) const {return GetBinContent(bin);}
00362     virtual void    Reset(Option_t *option="");
00363     virtual void    SetBinContent(Int_t bin, Stat_t content);
00364     virtual void    SetBinContent(Int_t bin, Int_t, Stat_t content) {SetBinContent(bin,content);}
00365     virtual void    SetBinContent(Int_t bin, Int_t, Int_t, Stat_t content) {SetBinContent(bin,content);}
00366     virtual void    SetBinsLength(Int_t n=-1);
00367             TH1S&   operator=(const TH1S &h1);
00368     friend  TH1S    operator*(Double_t c1, const TH1S &h1);
00369     friend  TH1S    operator*(const TH1S &h1, Double_t c1);
00370     friend  TH1S    operator+(const TH1S &h1, const TH1S &h2);
00371     friend  TH1S    operator-(const TH1S &h1, const TH1S &h2);
00372     friend  TH1S    operator*(const TH1S &h1, const TH1S &h2);
00373     friend  TH1S    operator/(const TH1S &h1, const TH1S &h2);
00374 
00375     ClassDef(TH1S,1)  //1-Dim histograms (one short per channel)
00376 };
00377 
00378 TH1S operator*(Double_t c1, const TH1S &h1);
00379 inline
00380 TH1S operator*(const TH1S &h1, Double_t c1) {return operator*(c1,h1);}
00381 TH1S operator+(const TH1S &h1, const TH1S &h2);
00382 TH1S operator-(const TH1S &h1, const TH1S &h2);
00383 TH1S operator*(const TH1S &h1, const TH1S &h2);
00384 TH1S operator/(const TH1S &h1, const TH1S &h2);
00385 
00386 //________________________________________________________________________
00387 
00388 class TH1F : public TH1, public TArrayF {
00389 
00390 public:
00391     TH1F();
00392     TH1F(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xup);
00393     TH1F(const char *name,const char *title,Int_t nbinsx,const Float_t  *xbins);
00394     TH1F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
00395     TH1F(const TVector &v);
00396     TH1F(const TH1F &h1f);
00397     virtual ~TH1F();
00398 
00399     virtual void    AddBinContent(Int_t bin) {++fArray[bin];}
00400     virtual void    AddBinContent(Int_t bin, Stat_t w)
00401                                  {fArray[bin] += Float_t (w);}
00402     virtual void    Copy(TObject &hnew) const;
00403     virtual TH1    *DrawCopy(Option_t *option="") const;
00404     virtual Stat_t  GetBinContent(Int_t bin) const;
00405     virtual Stat_t  GetBinContent(Int_t bin, Int_t) const {return GetBinContent(bin);}
00406     virtual Stat_t  GetBinContent(Int_t bin, Int_t, Int_t) const {return GetBinContent(bin);}
00407     virtual void    Reset(Option_t *option="");
00408     virtual void    SetBinContent(Int_t bin, Stat_t content);
00409     virtual void    SetBinContent(Int_t bin, Int_t, Stat_t content) {SetBinContent(bin,content);}
00410     virtual void    SetBinContent(Int_t bin, Int_t, Int_t, Stat_t content) {SetBinContent(bin,content);}
00411     virtual void    SetBinsLength(Int_t n=-1);
00412             TH1F&   operator=(const TH1F &h1);
00413     friend  TH1F    operator*(Double_t c1, const TH1F &h1);
00414     friend  TH1F    operator*(const TH1F &h1, Double_t c1);
00415     friend  TH1F    operator+(const TH1F &h1, const TH1F &h2);
00416     friend  TH1F    operator-(const TH1F &h1, const TH1F &h2);
00417     friend  TH1F    operator*(const TH1F &h1, const TH1F &h2);
00418     friend  TH1F    operator/(const TH1F &h1, const TH1F &h2);
00419 
00420     ClassDef(TH1F,1)  //1-Dim histograms (one float per channel)
00421 };
00422 
00423 TH1F operator*(Double_t c1, const TH1F &h1);
00424 inline
00425 TH1F operator*(const TH1F &h1, Double_t c1) {return operator*(c1,h1);}
00426 TH1F operator+(const TH1F &h1, const TH1F &h2);
00427 TH1F operator-(const TH1F &h1, const TH1F &h2);
00428 TH1F operator*(const TH1F &h1, const TH1F &h2);
00429 TH1F operator/(const TH1F &h1, const TH1F &h2);
00430 
00431 //________________________________________________________________________
00432 
00433 class TH1D : public TH1, public TArrayD {
00434 
00435 public:
00436     TH1D();
00437     TH1D(const char *name,const char *title,Int_t nbinsx,Axis_t xlow,Axis_t xup);
00438     TH1D(const char *name,const char *title,Int_t nbinsx,const Float_t  *xbins);
00439     TH1D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
00440     TH1D(const TVectorD &v);
00441     TH1D(const TH1D &h1d);
00442     virtual ~TH1D();
00443 
00444     virtual void    AddBinContent(Int_t bin) {++fArray[bin];}
00445     virtual void    AddBinContent(Int_t bin, Stat_t w)
00446                                  {fArray[bin] += Double_t (w);}
00447     virtual void    Copy(TObject &hnew) const;
00448     virtual TH1    *DrawCopy(Option_t *option="") const;
00449     virtual Stat_t  GetBinContent(Int_t bin) const;
00450     virtual Stat_t  GetBinContent(Int_t bin, Int_t) const {return GetBinContent(bin);}
00451     virtual Stat_t  GetBinContent(Int_t bin, Int_t, Int_t) const {return GetBinContent(bin);}
00452     virtual void    Reset(Option_t *option="");
00453     virtual void    SetBinContent(Int_t bin, Stat_t content);
00454     virtual void    SetBinContent(Int_t bin, Int_t, Stat_t content) {SetBinContent(bin,content);}
00455     virtual void    SetBinContent(Int_t bin, Int_t, Int_t, Stat_t content) {SetBinContent(bin,content);}
00456     virtual void    SetBinsLength(Int_t n=-1);
00457             TH1D&   operator=(const TH1D &h1);
00458     friend  TH1D    operator*(Double_t c1, const TH1D &h1);
00459     friend  TH1D    operator*(const TH1D &h1, Double_t c1);
00460     friend  TH1D    operator+(const TH1D &h1, const TH1D &h2);
00461     friend  TH1D    operator-(const TH1D &h1, const TH1D &h2);
00462     friend  TH1D    operator*(const TH1D &h1, const TH1D &h2);
00463     friend  TH1D    operator/(const TH1D &h1, const TH1D &h2);
00464 
00465     ClassDef(TH1D,1)  //1-Dim histograms (one double per channel)
00466 };
00467 
00468 TH1D operator*(Double_t c1, const TH1D &h1);
00469 inline
00470 TH1D operator*(const TH1D &h1, Double_t c1) {return operator*(c1,h1);}
00471 TH1D operator+(const TH1D &h1, const TH1D &h2);
00472 TH1D operator-(const TH1D &h1, const TH1D &h2);
00473 TH1D operator*(const TH1D &h1, const TH1D &h2);
00474 TH1D operator/(const TH1D &h1, const TH1D &h2);
00475 
00476    extern TH1 *R__H(Int_t hid);
00477    extern TH1 *R__H(const char *hname);
00478 
00479 #endif

Generated on Thu Dec 18 14:52:20 2003 for ROOT by doxygen1.2.16