12 #ifndef ROOT_TProfile2Poly
13 #define ROOT_TProfile2Poly
18 class TProfile2PolyBin :
public TH2PolyBin {
20 friend class TProfile2Poly;
23 TProfile2PolyBin(TObject *poly, Int_t bin_number);
24 virtual ~TProfile2PolyBin() {}
26 void Merge(
const TProfile2PolyBin *toMerge);
31 Double_t GetEffectiveEntries()
const {
return (fSumw * fSumw) / fSumw2; }
32 Double_t GetEntries()
const {
return fSumw; }
33 Double_t GetEntriesW2()
const {
return fSumw2; }
34 Double_t GetEntriesVW()
const {
return fSumvw; }
35 Double_t GetEntriesWV2()
const {
return fSumwv2; }
36 Double_t GetError()
const {
return fError; }
46 EErrorType fErrorMode = kERRORMEAN;
49 void Fill(Double_t value, Double_t weight);
52 void SetErrorOption(EErrorType type) { fErrorMode = type; }
54 ClassDef(TProfile2PolyBin, 1)
57 class TProfile2Poly :
public TH2Poly {
58 friend class TProfile2PolyBin;
61 friend class TProfileHelper;
64 TProfile2Poly(
const char *name,
const char *title, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup);
65 TProfile2Poly(
const char *name,
const char *title, Int_t nX, Double_t xlow, Double_t xup, Int_t nY, Double_t ylow,
67 virtual ~TProfile2Poly() {}
70 virtual Int_t Fill(Double_t xcoord, Double_t ycoord, Double_t value)
override;
71 virtual Int_t Fill(Double_t xcoord, Double_t ycoord, Double_t value, Double_t weight);
73 Long64_t Merge(
const std::vector<TProfile2Poly *> &list);
74 Long64_t Merge(TCollection *in)
override;
75 virtual void Reset(Option_t *option =
"")
override;
78 void SetContentToAverage();
79 void SetContentToError();
81 void SetErrorOption(EErrorType type);
83 Double_t GetBinEffectiveEntries(Int_t bin)
const;
84 Double_t GetBinEntries(Int_t bin)
const;
85 Double_t GetBinEntriesW2(Int_t bin)
const;
86 Double_t GetBinEntriesVW(Int_t bin)
const;
87 Double_t GetBinEntriesWV2(Int_t bin)
const;
89 using TH2Poly::GetBinContent;
90 virtual Double_t GetBinContent(Int_t bin)
const override;
92 using TH2Poly::GetBinError;
93 virtual Double_t GetBinError(Int_t bin)
const override;
95 virtual void GetStats(Double_t *stats)
const override;
98 Double_t GetOverflowContent(Int_t idx) {
return fOverflowBins[idx].fSumw; }
99 void PrintOverflowRegions();
102 TProfile2PolyBin fOverflowBins[kNOverflow];
103 EErrorType fErrorMode = kERRORMEAN;
108 virtual TProfile2PolyBin *CreateBin(TObject *poly)
override;
110 Int_t GetOverflowRegionFromCoordinates(Double_t x, Double_t y);
111 Int_t OverflowIdxToArrayIdx(Int_t val) {
return -val - 1; }
114 ClassDefOverride(TProfile2Poly, 2)