#ifndef ROOT_TProfile
#define ROOT_TProfile
#ifndef ROOT_TH1
#include "TH1.h"
#endif
class TProfileHelper;
enum EErrorType { kERRORMEAN = 0, kERRORSPREAD, kERRORSPREADI, kERRORSPREADG };
class TF1;
class TProfile : public TH1D {
public:
friend class TProfileHelper;
protected:
TArrayD fBinEntries;
EErrorType fErrorMode;
Double_t fYmin;
Double_t fYmax;
Bool_t fScaling;
Double_t fTsumwy;
Double_t fTsumwy2;
TArrayD fBinSumw2;
static Bool_t fgApproximate;
virtual Int_t BufferFill(Double_t, Double_t) {return -2;}
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t w);
void SetBins(const Int_t* nbins, const Double_t* range) { SetBins(nbins[0], range[0], range[1]); };
Int_t Fill(const Double_t* v) { return Fill(v[0], v[1], v[2]); };
private:
Int_t Fill(Double_t) { MayNotUse("Fill(Double_t)"); return -1;}
void FillN(Int_t, const Double_t *, const Double_t *, Int_t) { MayNotUse("FillN(Int_t, Double_t*, Double_t*, Int_t)"); }
void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)
{ MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }
void SetBins(Int_t, const Double_t*, Int_t, const Double_t*)
{ MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*"); }
void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t)
{ MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }
Double_t *GetB() {return &fBinEntries.fArray[0];}
Double_t *GetB2() {return (fBinSumw2.fN ? &fBinSumw2.fArray[0] : 0 ); }
Double_t *GetW() {return &fArray[0];}
Double_t *GetW2() {return &fSumw2.fArray[0];}
public:
TProfile();
TProfile(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup, Option_t *option="");
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="");
TProfile(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins, Option_t *option="");
TProfile(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins, Option_t *option="");
TProfile(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins, Double_t ylow,Double_t yup, Option_t *option="");
TProfile(const TProfile &profile);
virtual ~TProfile();
virtual void Add(TF1 *h1, Double_t c1=1, Option_t *option="");
virtual void Add(const TH1 *h1, Double_t c1=1);
virtual void Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1);
static void Approximate(Bool_t approx=kTRUE);
virtual Int_t BufferEmpty(Int_t action=0);
void BuildOptions(Double_t ymin, Double_t ymax, Option_t *option);
virtual void Copy(TObject &hnew) const;
virtual void Divide(TF1 *h1, Double_t c1=1);
virtual void Divide(const TH1 *h1);
virtual void Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="");
virtual TH1 *DrawCopy(Option_t *option="") const;
virtual Int_t Fill(Double_t x, Double_t y);
virtual Int_t Fill(const char *namex, Double_t y);
virtual Int_t Fill(Double_t x, Double_t y, Double_t w);
virtual Int_t Fill(const char *namex, Double_t y, Double_t w);
virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1);
virtual Double_t GetBinContent(Int_t bin) const;
virtual Double_t GetBinContent(Int_t bin, Int_t) const {return GetBinContent(bin);}
virtual Double_t GetBinContent(Int_t bin, Int_t, Int_t) const {return GetBinContent(bin);}
virtual Double_t GetBinError(Int_t bin) const;
virtual Double_t GetBinError(Int_t bin, Int_t) const {return GetBinError(bin);}
virtual Double_t GetBinError(Int_t bin, Int_t, Int_t) const {return GetBinError(bin);}
virtual Double_t GetBinEntries(Int_t bin) const;
virtual Double_t GetBinEffectiveEntries(Int_t bin) const;
virtual TArrayD *GetBinSumw2() {return &fBinSumw2;}
virtual const TArrayD *GetBinSumw2() const {return &fBinSumw2;}
Option_t *GetErrorOption() const;
virtual char *GetObjectInfo(Int_t px, Int_t py) const;
virtual void GetStats(Double_t *stats) const;
virtual Double_t GetYmin() const {return fYmin;}
virtual Double_t GetYmax() const {return fYmax;}
virtual void LabelsDeflate(Option_t *axis="X");
virtual void LabelsInflate(Option_t *axis="X");
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X");
virtual Long64_t Merge(TCollection *list);
virtual void Multiply(TF1 *h1, Double_t c1=1);
virtual void Multiply(const TH1 *h1);
virtual void Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="");
TH1D *ProjectionX(const char *name="_px", Option_t *option="e") const;
virtual void PutStats(Double_t *stats);
TH1 *Rebin(Int_t ngroup=2, const char*newname="", const Double_t *xbins=0);
virtual void RebinAxis(Double_t x, TAxis *axis);
virtual void Reset(Option_t *option="");
virtual void SavePrimitive(ostream &out, Option_t *option = "");
virtual void Scale(Double_t c1=1, Option_t *option="");
virtual void SetBinEntries(Int_t bin, Double_t w);
virtual void SetBins(Int_t nbins, Double_t xmin, Double_t xmax);
virtual void SetBins(Int_t nx, const Double_t *xbins);
virtual void SetBuffer(Int_t buffersize, Option_t *option="");
virtual void SetErrorOption(Option_t *option="");
virtual void Sumw2();
ClassDef(TProfile,6)
};
#endif