TProfile3D.h

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TProfile3D.h 35194 2010-09-08 09:07:44Z moneta $
00002 // Author: Rene Brun   17/05/2006
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_TProfile3D
00013 #define ROOT_TProfile3D
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TProfile3D                                                           //
00019 //                                                                      //
00020 // Profile3D histogram class.                                           //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TH3
00025 #include "TH3.h"
00026 #endif
00027 #ifndef ROOT_TProfile
00028 #include "TProfile.h"
00029 #endif
00030 
00031 class TProfile3D : public TH3D {
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      fTmin;            //Lower limit in T (if set)
00040    Double_t      fTmax;            //Upper limit in T (if set)
00041    Bool_t        fScaling;         //!True when TProfile3D::Scale is called
00042    Double_t      fTsumwt;          //Total Sum of weight*T
00043    Double_t      fTsumwt2;         //Total Sum of weight*T*T
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, Double_t, Double_t, Double_t) {return -2;} //may not use
00050    virtual Int_t    BufferFill(Double_t x, Double_t y, Double_t z, Double_t t, Double_t w);
00051 
00052    // helper methods for the Merge unification in TProfileHelper
00053    void SetBins(const Int_t* nbins,const Double_t* range) { SetBins(nbins[0], range[0], range[1], 
00054                                                                     nbins[1], range[2], range[3], 
00055                                                                     nbins[2], range[4], range[5]); };
00056    Int_t Fill(const Double_t* v) { return Fill(v[0], v[1], v[2], v[3], v[4]); };
00057    
00058 private:
00059    Double_t *GetB()  {return &fBinEntries.fArray[0];}
00060    Double_t *GetB2() {return (fBinSumw2.fN ? &fBinSumw2.fArray[0] : 0 ); }
00061    Double_t *GetW()  {return &fArray[0];}
00062    Double_t *GetW2() {return &fSumw2.fArray[0];}
00063    void  SetBins(Int_t, Double_t, Double_t)
00064       { MayNotUse("SetBins(Int_t, Double_t, Double_t"); }
00065    void  SetBins(Int_t, const Double_t*)
00066       { MayNotUse("SetBins(Int_t, const Double_t*"); }
00067    void SetBins(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"); }
00069    void SetBins(Int_t, const Double_t*, Int_t, const Double_t*)
00070       { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*"); }
00071    void SetBins(Int_t, const Double_t *, Int_t, const Double_t *, Int_t, const Double_t *)
00072       { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*, Int_t, const Double_t*"); }
00073 
00074 public:
00075    TProfile3D();
00076    TProfile3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
00077                                                 ,Int_t nbinsy,Double_t ylow,Double_t yup
00078                                                 ,Int_t nbinsz,Double_t zlow,Double_t zup, Option_t *option="");
00079    TProfile3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
00080                                                 ,Int_t nbinsy,const Double_t *ybins
00081                                                 ,Int_t nbinsz,const Double_t *zbins,Option_t *option="");
00082    TProfile3D(const TProfile3D &profile);
00083    virtual ~TProfile3D();
00084    virtual void      Add(TF1 *h1, Double_t c1=1, Option_t *option="");
00085    virtual void      Add(const TH1 *h1, Double_t c1=1);
00086    virtual void      Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1); // *MENU*
00087    static  void      Approximate(Bool_t approx=kTRUE);
00088    void              BuildOptions(Double_t tmin, Double_t tmax, Option_t *option);
00089    virtual Int_t     BufferEmpty(Int_t action=0);
00090    virtual void      Copy(TObject &hnew) const;
00091    virtual void      Divide(TF1 *h1, Double_t c1=1);
00092    virtual void      Divide(const TH1 *h1);
00093    virtual void      Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
00094    virtual TH1      *DrawCopy(Option_t *option="") const;
00095    Int_t             Fill(Double_t) {return -1;} //MayNotUse
00096    Int_t             Fill(const char*, Double_t) {return -1;} //MayNotUse
00097    Int_t             Fill(Double_t, Double_t) {return -1; } //MayNotUse
00098    Int_t             Fill(Double_t, Double_t,Double_t) {return -1; } //MayNotUse
00099    Int_t             Fill(const char *, const char *, const char *, Double_t) {return -1; } //MayNotUse
00100    Int_t             Fill(const char *, Double_t , const char *, Double_t) {return -1; } //MayNotUse
00101    Int_t             Fill(const char *, const char *, Double_t, Double_t) {return -1; } //MayNotUse
00102    Int_t             Fill(Double_t, const char *, const char *, Double_t) {return -1; } //MayNotUse
00103    Int_t             Fill(Double_t, const char *, Double_t, Double_t) {return -1; } //MayNotUse
00104    Int_t             Fill(Double_t, Double_t, const char *, Double_t) {return -1; } //MayNotUse
00105    virtual Int_t     Fill(Double_t x, Double_t y, Double_t z, Double_t t);
00106    virtual Int_t     Fill(Double_t x, Double_t y, Double_t z, Double_t t, Double_t w);
00107    virtual Double_t  GetBinContent(Int_t bin) const;
00108    virtual Double_t  GetBinContent(Int_t,Int_t) const
00109                      { MayNotUse("GetBinContent(Int_t, Int_t"); return -1; }
00110    virtual Double_t  GetBinContent(Int_t binx, Int_t biny, Int_t binz) const {return GetBinContent(GetBin(binx,biny,binz));}
00111    virtual Double_t  GetBinError(Int_t bin) const;
00112    virtual Double_t  GetBinError(Int_t,Int_t) const
00113                      { MayNotUse("GetBinError(Int_t, Int_t"); return -1; }
00114    virtual Double_t  GetBinError(Int_t binx, Int_t biny, Int_t binz) const {return GetBinError(GetBin(binx,biny,binz));}
00115    virtual Double_t  GetBinEntries(Int_t bin) const;
00116    virtual Double_t  GetBinEffectiveEntries(Int_t bin);
00117    virtual TArrayD *GetBinSumw2() {return &fBinSumw2;}
00118    virtual const TArrayD *GetBinSumw2() const {return &fBinSumw2;}
00119    Option_t         *GetErrorOption() const;
00120    virtual void      GetStats(Double_t *stats) const;
00121    virtual Double_t  GetTmin() const {return fTmin;}
00122    virtual Double_t  GetTmax() const {return fTmax;}
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    TH3D             *ProjectionXYZ(const char *name="_pxyz", 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 void      SavePrimitive(ostream &out, Option_t *option = "");
00132    virtual void      Scale(Double_t c1=1, Option_t *option="");
00133    virtual void      SetBinEntries(Int_t bin, Double_t w);
00134    virtual void      SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, 
00135                              Int_t nbinsy, Double_t ymin, Double_t ymax, 
00136                              Int_t nbinsz, Double_t zmin, Double_t zmax);
00137    virtual void      SetBuffer(Int_t buffersize, Option_t *opt="");
00138    virtual void      SetErrorOption(Option_t *option=""); // *MENU*
00139    virtual void      Sumw2(); 
00140 
00141    ClassDef(TProfile3D,7)  //Profile3D histogram class
00142 };
00143 
00144 #endif

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