00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TProfile
00013 #define ROOT_TProfile
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TH1
00025 #include "TH1.h"
00026 #endif
00027
00028 class TProfileHelper;
00029
00030 enum EErrorType { kERRORMEAN = 0, kERRORSPREAD, kERRORSPREADI, kERRORSPREADG };
00031
00032 class TF1;
00033
00034 class TProfile : public TH1D {
00035
00036 public:
00037 friend class TProfileHelper;
00038
00039 protected:
00040 TArrayD fBinEntries;
00041 EErrorType fErrorMode;
00042 Double_t fYmin;
00043 Double_t fYmax;
00044 Bool_t fScaling;
00045 Double_t fTsumwy;
00046 Double_t fTsumwy2;
00047 TArrayD fBinSumw2;
00048
00049 static Bool_t fgApproximate;
00050
00051 virtual Int_t BufferFill(Double_t, Double_t) {return -2;}
00052 virtual Int_t BufferFill(Double_t x, Double_t y, Double_t w);
00053
00054
00055 void SetBins(const Int_t* nbins, const Double_t* range) { SetBins(nbins[0], range[0], range[1]); };
00056 Int_t Fill(const Double_t* v) { return Fill(v[0], v[1], v[2]); };
00057
00058 private:
00059 Int_t Fill(Double_t) { MayNotUse("Fill(Double_t)"); return -1;}
00060 void FillN(Int_t, const Double_t *, const Double_t *, Int_t) { MayNotUse("FillN(Int_t, Double_t*, Double_t*, Int_t)"); }
00061 Double_t *GetB() {return &fBinEntries.fArray[0];}
00062 Double_t *GetB2() {return (fBinSumw2.fN ? &fBinSumw2.fArray[0] : 0 ); }
00063 Double_t *GetW() {return &fArray[0];}
00064 Double_t *GetW2() {return &fSumw2.fArray[0];}
00065 void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)
00066 { MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }
00067 void SetBins(Int_t, const Double_t*, Int_t, const Double_t*)
00068 { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*"); }
00069 void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)
00070 { MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, 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 TProfile();
00076 TProfile(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup, Option_t *option="");
00077 TProfile(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup,Double_t ylow,Double_t yup,Option_t *option="");
00078 TProfile(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins, Option_t *option="");
00079 TProfile(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins, Option_t *option="");
00080 TProfile(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins, Double_t ylow,Double_t yup, Option_t *option="");
00081 TProfile(const TProfile &profile);
00082 virtual ~TProfile();
00083 virtual void Add(TF1 *h1, Double_t c1=1, Option_t *option="");
00084 virtual void Add(const TH1 *h1, Double_t c1=1);
00085 virtual void Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1);
00086 static void Approximate(Bool_t approx=kTRUE);
00087 virtual Int_t BufferEmpty(Int_t action=0);
00088 void BuildOptions(Double_t ymin, Double_t ymax, Option_t *option);
00089 virtual void Copy(TObject &hnew) const;
00090 virtual void Divide(TF1 *h1, Double_t c1=1);
00091 virtual void Divide(const TH1 *h1);
00092 virtual void Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="");
00093 virtual TH1 *DrawCopy(Option_t *option="") const;
00094 virtual Int_t Fill(Double_t x, Double_t y);
00095 virtual Int_t Fill(const char *namex, Double_t y);
00096 virtual Int_t Fill(Double_t x, Double_t y, Double_t w);
00097 virtual Int_t Fill(const char *namex, Double_t y, Double_t w);
00098 virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1);
00099 virtual Double_t GetBinContent(Int_t bin) const;
00100 virtual Double_t GetBinContent(Int_t bin, Int_t) const {return GetBinContent(bin);}
00101 virtual Double_t GetBinContent(Int_t bin, Int_t, Int_t) const {return GetBinContent(bin);}
00102 virtual Double_t GetBinError(Int_t bin) const;
00103 virtual Double_t GetBinError(Int_t bin, Int_t) const {return GetBinError(bin);}
00104 virtual Double_t GetBinError(Int_t bin, Int_t, Int_t) const {return GetBinError(bin);}
00105 virtual Double_t GetBinEntries(Int_t bin) const;
00106 virtual Double_t GetBinEffectiveEntries(Int_t bin) const;
00107 virtual TArrayD *GetBinSumw2() {return &fBinSumw2;}
00108 virtual const TArrayD *GetBinSumw2() const {return &fBinSumw2;}
00109 Option_t *GetErrorOption() const;
00110 virtual char *GetObjectInfo(Int_t px, Int_t py) const;
00111 virtual void GetStats(Double_t *stats) const;
00112 virtual Double_t GetYmin() const {return fYmin;}
00113 virtual Double_t GetYmax() const {return fYmax;}
00114 virtual void LabelsDeflate(Option_t *axis="X");
00115 virtual void LabelsInflate(Option_t *axis="X");
00116 virtual void LabelsOption(Option_t *option="h", Option_t *axis="X");
00117 virtual Long64_t Merge(TCollection *list);
00118 virtual void Multiply(TF1 *h1, Double_t c1=1);
00119 virtual void Multiply(const TH1 *h1);
00120 virtual void Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="");
00121 TH1D *ProjectionX(const char *name="_px", Option_t *option="e") const;
00122 virtual void PutStats(Double_t *stats);
00123 TH1 *Rebin(Int_t ngroup=2, const char*newname="", const Double_t *xbins=0);
00124 virtual void RebinAxis(Double_t x, TAxis *axis);
00125 virtual void Reset(Option_t *option="");
00126 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00127 virtual void Scale(Double_t c1=1, Option_t *option="");
00128 virtual void SetBinEntries(Int_t bin, Double_t w);
00129 virtual void SetBins(Int_t nbins, Double_t xmin, Double_t xmax);
00130 virtual void SetBins(Int_t nx, const Double_t *xbins);
00131 virtual void SetBuffer(Int_t buffersize, Option_t *option="");
00132 virtual void SetErrorOption(Option_t *option="");
00133 virtual void Sumw2();
00134
00135 ClassDef(TProfile,6)
00136 };
00137
00138 #endif
00139