TProfile2D.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TProfile2D.h 35194 2010-09-08 09:07:44Z moneta $
00002 // Author: Rene Brun   16/04/2000
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_TProfile2D
00013 #define ROOT_TProfile2D
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TProfile2D                                                           //
00019 //                                                                      //
00020 // Profile2D histogram class.                                           //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TH2
00025 #include "TH2.h"
00026 #endif
00027 #ifndef ROOT_TProfile
00028 #include "TProfile.h"
00029 #endif
00030 
00031 class TProfile2D : public TH2D {
00032 
00033 public:
00034    friend class TProfileHelper;
00035 
00036 protected:
00037    TArrayD     fBinEntries;      //number of entries per bin
00038    EErrorType  fErrorMode;       //Option to compute errors
00039    Double_t    fZmin;            //Lower limit in Z (if set)
00040    Double_t    fZmax;            //Upper limit in Z (if set)
00041    Bool_t      fScaling;         //!True when TProfile2D::Scale is called
00042    Double_t    fTsumwz;          //Total Sum of weight*Z
00043    Double_t    fTsumwz2;         //Total Sum of weight*Z*Z
00044    TArrayD     fBinSumw2;         //Array of sum of squares of weights per bin 
00045    static Bool_t   fgApproximate; //bin error approximation option
00046 
00047    virtual Int_t    BufferFill(Double_t, Double_t) {return -2;} //may not use
00048    virtual Int_t    BufferFill(Double_t, Double_t, Double_t) {return -2;} //may not use
00049    virtual Int_t    BufferFill(Double_t x, Double_t y, Double_t z, Double_t w);
00050 
00051    // helper methods for the Merge unification in TProfileHelper
00052    void SetBins(const Int_t* nbins, const Double_t* range) { SetBins(nbins[0], range[0], range[1], 
00053                                                                      nbins[1], range[2], range[3]); };
00054    Int_t Fill(const Double_t* v) { return Fill(v[0], v[1], v[2], v[3]); };
00055 
00056 private:
00057    Double_t *GetB()  {return &fBinEntries.fArray[0];}
00058    Double_t *GetB2() {return (fBinSumw2.fN ? &fBinSumw2.fArray[0] : 0 ); }
00059    Double_t *GetW()  {return &fArray[0];}
00060    Double_t *GetW2() {return &fSumw2.fArray[0];}
00061    void  SetBins(Int_t, Double_t, Double_t)
00062       { MayNotUse("SetBins(Int_t, Double_t, Double_t"); }
00063    void  SetBins(Int_t, const Double_t*)
00064       { MayNotUse("SetBins(Int_t, const Double_t*"); }
00065    void  SetBins(Int_t, const Double_t*, Int_t, const Double_t*)
00066       { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*"); }
00067    void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)
00068       { MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }
00069    void SetBins(Int_t, const Double_t *, Int_t, const Double_t *, Int_t, const Double_t *)
00070       { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*, Int_t, const Double_t*"); }
00071 
00072 public:
00073    TProfile2D();
00074    TProfile2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
00075                                ,Int_t nbinsy,Double_t ylow,Double_t yup
00076                                ,Double_t zlow, Double_t zup,Option_t *option="");
00077    TProfile2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
00078                                ,Int_t nbinsy,Double_t ylow,Double_t yup,Option_t *option="");
00079    TProfile2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
00080                                ,Int_t nbinsy,Double_t ylow,Double_t yup,Option_t *option="");
00081    TProfile2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
00082                                ,Int_t nbinsy,const Double_t *ybins,Option_t *option="");
00083    TProfile2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
00084                                ,Int_t nbinsy,const Double_t *ybins,Option_t *option="");
00085    TProfile2D(const TProfile2D &profile);
00086    virtual ~TProfile2D();
00087    virtual void      Add(TF1 *h1, Double_t c1=1, Option_t *option="");
00088    virtual void      Add(const TH1 *h1, Double_t c1=1);
00089    virtual void      Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1); // *MENU*
00090    static  void      Approximate(Bool_t approx=kTRUE);
00091    void              BuildOptions(Double_t zmin, Double_t zmax, Option_t *option);
00092    virtual Int_t     BufferEmpty(Int_t action=0);
00093    virtual void      Copy(TObject &hnew) const;
00094    virtual void      Divide(TF1 *h1, Double_t c1=1);
00095    virtual void      Divide(const TH1 *h1);
00096    virtual void      Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
00097    virtual TH1      *DrawCopy(Option_t *option="") const;
00098    Int_t             Fill(Double_t) {return -1;} //MayNotUse
00099    Int_t             Fill(const char*, Double_t) {return -1;} //MayNotUse
00100    Int_t             Fill(Double_t, Double_t) {return -1; } //MayNotUse
00101    Int_t             Fill(Double_t x, Double_t y, Double_t z);
00102    virtual Int_t     Fill(Double_t x, const char *namey, Double_t z);
00103    virtual Int_t     Fill(const char *namex, Double_t y, Double_t z);
00104    virtual Int_t     Fill(const char *namex, const char *namey, Double_t z);
00105    virtual Int_t     Fill(Double_t x, Double_t y, Double_t z, Double_t w);
00106    virtual Double_t  GetBinContent(Int_t bin) const;
00107    virtual Double_t  GetBinContent(Int_t binx, Int_t biny) const {return GetBinContent(GetBin(binx,biny));}
00108    virtual Double_t  GetBinContent(Int_t binx, Int_t biny, Int_t) const {return GetBinContent(GetBin(binx,biny));}
00109    virtual Double_t  GetBinError(Int_t bin) const;
00110    virtual Double_t  GetBinError(Int_t binx, Int_t biny) const {return GetBinError(GetBin(binx,biny));}
00111    virtual Double_t  GetBinError(Int_t binx, Int_t biny, Int_t) const {return GetBinError(GetBin(binx,biny));}
00112    virtual Double_t  GetBinEntries(Int_t bin) const;
00113    virtual Double_t  GetBinEffectiveEntries(Int_t bin);
00114    virtual TArrayD *GetBinSumw2() {return &fBinSumw2;}
00115    virtual const TArrayD *GetBinSumw2() const {return &fBinSumw2;}
00116    Option_t         *GetErrorOption() const;
00117    virtual void      GetStats(Double_t *stats) const;
00118    virtual Double_t  GetZmin() const {return fZmin;}
00119    virtual Double_t  GetZmax() const {return fZmax;}
00120    virtual void      LabelsDeflate(Option_t *axis="X");
00121    virtual void      LabelsInflate(Option_t *axis="X");
00122    virtual void      LabelsOption(Option_t *option="h", Option_t *axis="X");
00123    virtual Long64_t  Merge(TCollection *list);
00124    virtual void      Multiply(TF1 *h1, Double_t c1=1);
00125    virtual void      Multiply(const TH1 *h1);
00126    virtual void      Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
00127    TH2D             *ProjectionXY(const char *name="_pxy", Option_t *option="e") const;
00128    virtual void      PutStats(Double_t *stats);
00129    virtual void      Reset(Option_t *option="");
00130    virtual void      RebinAxis(Double_t x, TAxis *axis);
00131    virtual TProfile2D *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="");
00132    virtual TProfile2D *RebinX(Int_t ngroup=2, const char *newname="");
00133    virtual TProfile2D *RebinY(Int_t ngroup=2, const char *newname="");     
00134    virtual void      SavePrimitive(ostream &out, Option_t *option = "");
00135    virtual void      Scale(Double_t c1=1, Option_t *option="");
00136    virtual void      SetBinEntries(Int_t bin, Double_t w);
00137    virtual void      SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, Int_t nbinsy, Double_t ymin, Double_t ymax);
00138    virtual void      SetBuffer(Int_t buffersize, Option_t *option="");
00139    virtual void      SetErrorOption(Option_t *option=""); // *MENU*
00140    virtual void      Sumw2();
00141 
00142    ClassDef(TProfile2D,7)  //Profile2D histogram class
00143 };
00144 
00145 #endif

Generated on Tue Jul 5 14:22:58 2011 for ROOT_528-00b_version by  doxygen 1.5.1