Warning, file /include/root/TProfile2D.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TProfile2D
0013 #define ROOT_TProfile2D
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TH2.h"
0025 #include "TProfile.h"
0026
0027 class TProfile2D : public TH2D {
0028
0029 public:
0030 friend class TProfileHelper;
0031 friend class TH1Merger;
0032
0033 protected:
0034 TArrayD fBinEntries;
0035 EErrorType fErrorMode;
0036 Double_t fZmin;
0037 Double_t fZmax;
0038 Bool_t fScaling;
0039 Double_t fTsumwz;
0040 Double_t fTsumwz2;
0041 TArrayD fBinSumw2;
0042 static Bool_t fgApproximate;
0043
0044 Int_t BufferFill(Double_t, Double_t) override {return -2;}
0045 Int_t BufferFill(Double_t, Double_t, Double_t) override {return -2;}
0046 virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w);
0047
0048
0049 void SetBins(const Int_t* nbins, const Double_t* range) { SetBins(nbins[0], range[0], range[1],
0050 nbins[1], range[2], range[3]); };
0051 Int_t Fill(const Double_t* v) { return Fill(v[0], v[1], v[2], v[3]); };
0052
0053 TProfile *DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const override;
0054
0055 using TH2::Fill;
0056 Int_t Fill(Double_t, Double_t) override {return TH2::Fill(0); }
0057
0058 Double_t RetrieveBinContent(Int_t bin) const override { return (fBinEntries.fArray[bin] > 0) ? fArray[bin]/fBinEntries.fArray[bin] : 0; }
0059
0060 Double_t GetBinErrorSqUnchecked(Int_t bin) const override { Double_t err = GetBinError(bin); return err*err; }
0061
0062 private:
0063 Double_t *GetB() {return &fBinEntries.fArray[0];}
0064 Double_t *GetB2() {return fBinSumw2.fN ? &fBinSumw2.fArray[0] : nullptr; }
0065 Double_t *GetW() {return &fArray[0];}
0066 Double_t *GetW2() {return &fSumw2.fArray[0];}
0067 void SetBins(Int_t, Double_t, Double_t) override
0068 { MayNotUse("SetBins(Int_t, Double_t, Double_t"); }
0069 void SetBins(Int_t, const Double_t*) override
0070 { MayNotUse("SetBins(Int_t, const Double_t*"); }
0071 void SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t) override
0072 { MayNotUse("SetBins(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t"); }
0073 void SetBins(Int_t, const Double_t *, Int_t, const Double_t *, Int_t, const Double_t *) override
0074 { MayNotUse("SetBins(Int_t, const Double_t*, Int_t, const Double_t*, Int_t, const Double_t*"); }
0075
0076 public:
0077 TProfile2D();
0078 TProfile2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
0079 ,Int_t nbinsy,Double_t ylow,Double_t yup
0080 ,Double_t zlow, Double_t zup,Option_t *option="");
0081 TProfile2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
0082 ,Int_t nbinsy,Double_t ylow,Double_t yup,Option_t *option="");
0083 TProfile2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
0084 ,Int_t nbinsy,Double_t ylow,Double_t yup,Option_t *option="");
0085 TProfile2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
0086 ,Int_t nbinsy,const Double_t *ybins,Option_t *option="");
0087 TProfile2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
0088 ,Int_t nbinsy,const Double_t *ybins,Option_t *option="");
0089 TProfile2D(const TProfile2D &profile);
0090 TProfile2D &operator=(const TProfile2D &profile);
0091 ~TProfile2D() override;
0092 Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="") override;
0093 Bool_t Add(const TH1 *h1, Double_t c1=1) override;
0094 Bool_t Add(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1) override;
0095 static void Approximate(Bool_t approx=kTRUE);
0096 void BuildOptions(Double_t zmin, Double_t zmax, Option_t *option);
0097 Int_t BufferEmpty(Int_t action=0) override;
0098 void Copy(TObject &hnew) const override;
0099 Bool_t Divide(TF1 *h1, Double_t c1=1) override;
0100 Bool_t Divide(const TH1 *h1) override;
0101 Bool_t Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="") override;
0102 void ExtendAxis(Double_t x, TAxis *axis) override;
0103 Int_t Fill(Double_t x, Double_t y, Double_t z) override;
0104
0105
0106 virtual Int_t Fill(Double_t x, const char *namey, Double_t z, Double_t w);
0107 virtual Int_t Fill(const char *namex, Double_t y, Double_t z, Double_t w);
0108 virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w);
0109 virtual Int_t Fill(Double_t x, Double_t y, Double_t z, Double_t w);
0110 inline Int_t Fill(Double_t x, const char *namey, Double_t z) override { return Fill(x, namey, z, 1.0); }
0111 inline Int_t Fill(const char *namex, Double_t y, Double_t z) override { return Fill(namex, y, z, 1.0); }
0112 inline Int_t Fill(const char *namex, const char *namey, Double_t z) override { return Fill(namex, namey, z, 1.0); }
0113 Double_t GetBinContent(Int_t bin) const override;
0114 Double_t GetBinContent(Int_t binx, Int_t biny) const override {return GetBinContent(GetBin(binx,biny));}
0115 Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const override {return GetBinContent(GetBin(binx,biny));}
0116 Double_t GetBinError(Int_t bin) const override;
0117 Double_t GetBinError(Int_t binx, Int_t biny) const override {return GetBinError(GetBin(binx,biny));}
0118 Double_t GetBinError(Int_t binx, Int_t biny, Int_t) const override {return GetBinError(GetBin(binx,biny));}
0119 virtual Double_t GetBinEntries(Int_t bin) const;
0120 virtual Double_t GetBinEffectiveEntries(Int_t bin);
0121 virtual TArrayD *GetBinSumw2() {return &fBinSumw2;}
0122 virtual const TArrayD *GetBinSumw2() const {return &fBinSumw2;}
0123 Option_t *GetErrorOption() const;
0124 void GetStats(Double_t *stats) const override;
0125 virtual Double_t GetZmin() const {return fZmin;}
0126 virtual Double_t GetZmax() const {return fZmax;}
0127 void LabelsDeflate(Option_t *axis="X") override;
0128 void LabelsInflate(Option_t *axis="X") override;
0129 void LabelsOption(Option_t *option="h", Option_t *axis="X") override;
0130 Long64_t Merge(TCollection *list) override;
0131 Bool_t Multiply(TF1 *h1, Double_t c1=1) override;
0132 Bool_t Multiply(const TH1 *h1) override;
0133 Bool_t Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="") override;
0134 TH2D *ProjectionXY(const char *name="_pxy", Option_t *option="e") const;
0135 TProfile *ProfileX(const char *name="_pfx", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const;
0136 TProfile *ProfileY(const char *name="_pfy", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const;
0137 void PutStats(Double_t *stats) override;
0138 void Reset(Option_t *option="") override;
0139 TProfile2D *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="") override;
0140 TProfile2D *RebinX(Int_t ngroup=2, const char *newname="") override;
0141 TProfile2D *RebinY(Int_t ngroup=2, const char *newname="") override;
0142 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0143 void Scale(Double_t c1=1, Option_t *option="") override;
0144 virtual void SetBinEntries(Int_t bin, Double_t w);
0145 void SetBins(Int_t nbinsx, Double_t xmin, Double_t xmax, Int_t nbinsy, Double_t ymin, Double_t ymax) override;
0146 void SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins) override;
0147 void SetBinsLength(Int_t n=-1) override;
0148 void SetBuffer(Int_t buffersize, Option_t *option="") override;
0149 virtual void SetErrorOption(Option_t *option="");
0150 void Sumw2(Bool_t flag = kTRUE) override;
0151 Double_t GetNumberOfBins() { return fBinEntries.GetSize(); }
0152
0153 ClassDefOverride(TProfile2D,8)
0154 };
0155
0156 #endif