Logo ROOT   6.14/05
Reference Guide
TProfile2Poly.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Filip Ilic
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TProfile2Poly
13 #define ROOT_TProfile2Poly
14 
15 #include "TH2Poly.h"
16 #include "TProfile.h"
17 
18 class TProfile2PolyBin : public TH2PolyBin {
19 public:
20  friend class TProfile2Poly;
21 
23  TProfile2PolyBin(TObject *poly, Int_t bin_number);
24  virtual ~TProfile2PolyBin() {}
25 
26  void Merge(const TProfile2PolyBin *toMerge);
27 
28  void Update();
29  void ClearStats();
30 
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; }
37 
38 
39 private:
47 
48 protected:
49  void Fill(Double_t value, Double_t weight);
50  void UpdateAverage();
51  void UpdateError();
52  void SetErrorOption(EErrorType type) { fErrorMode = type; }
53 
55 };
56 
57 class TProfile2Poly : public TH2Poly {
58  friend class TProfile2PolyBin;
59 
60 public:
61  friend class TProfileHelper;
62 
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,
66  Double_t yup);
67  virtual ~TProfile2Poly() {}
68 
69  using TH2Poly::Fill;
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);
72 
73  Long64_t Merge(const std::vector<TProfile2Poly *> &list);
74  Long64_t Merge(TCollection *in) override;
75  virtual void Reset(Option_t *option = "") override;
76 
77  // option to dispay different measures on bins
78  void SetContentToAverage(); // this one is used by default
79  void SetContentToError();
80 
82 
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;
88 
90  virtual Double_t GetBinContent(Int_t bin) const override;
91 
93  virtual Double_t GetBinError(Int_t bin) const override;
94 
95  virtual void GetStats(Double_t *stats) const override;
96 
97 
98  Double_t GetOverflowContent(Int_t idx) { return fOverflowBins[idx].fSumw; }
99  void PrintOverflowRegions();
100 
101 private:
102  TProfile2PolyBin fOverflowBins[kNOverflow];
106 
107 protected:
108  virtual TProfile2PolyBin *CreateBin(TObject *poly) override;
109 
110  Int_t GetOverflowRegionFromCoordinates(Double_t x, Double_t y);
111  Int_t OverflowIdxToArrayIdx(Int_t val) { return -val - 1; }
112 
113 
115 };
116 #endif
void Fill(Double_t value, Double_t weight)
Fill.
void UpdateError()
Update error.
long long Long64_t
Definition: RtypesCore.h:69
Double_t GetEntriesWV2() const
Definition: TProfile2Poly.h:35
EErrorType fErrorMode
Definition: TProfile2Poly.h:46
virtual Double_t GetBinError(Int_t bin) const
Returns the value of error associated to bin number bin.
Definition: TH2Poly.cxx:775
static Double_t GetBinError(T *p, Int_t bin)
Double_t fTsumwz2
const char Option_t
Definition: RtypesCore.h:62
void Merge(const TProfile2PolyBin *toMerge)
Merge.
int Int_t
Definition: RtypesCore.h:41
Double_t GetEffectiveEntries() const
Definition: TProfile2Poly.h:31
Helper class to represent a bin in the TProfile2Poly histogram.
Definition: TProfile2Poly.h:18
void ClearStats()
Clear statistics.
Double_t GetError() const
Definition: TProfile2Poly.h:36
Helper class to represent a bin in the TH2Poly histogram.
Definition: TH2Poly.h:25
EErrorType
Definition: TProfile.h:28
Double_t x[n]
Definition: legend1.C:17
virtual ~TProfile2Poly()
Definition: TProfile2Poly.h:67
#define ClassDef(name, id)
Definition: Rtypes.h:320
Double_t GetOverflowContent(Int_t idx)
Definition: TProfile2Poly.h:98
Double_t GetEntries() const
Definition: TProfile2Poly.h:32
void UpdateAverage()
Update average.
virtual Double_t GetBinContent(Int_t bin) const
Returns the content of the input bin For the overflow/underflow/sea bins: -1 | -2 | -3 ---+----+---- ...
Definition: TH2Poly.cxx:762
Double_t GetEntriesW2() const
Definition: TProfile2Poly.h:33
Collection abstract base class.
Definition: TCollection.h:63
2D Profile Histogram with Polygonal Bins.
Definition: TProfile2Poly.h:57
Double_t GetEntriesVW() const
Definition: TProfile2Poly.h:34
void Update()
Update.
void Reset(Detail::TBranchProxy *x)
Int_t OverflowIdxToArrayIdx(Int_t val)
double Double_t
Definition: RtypesCore.h:55
virtual ~TProfile2PolyBin()
Definition: TProfile2Poly.h:24
static Double_t GetBinEffectiveEntries(T *p, Int_t bin)
int type
Definition: TGX11.cxx:120
Double_t y[n]
Definition: legend1.C:17
Mother of all ROOT objects.
Definition: TObject.h:37
void SetErrorOption(EErrorType type)
Definition: TProfile2Poly.h:52
Double_t fTsumwz
#define ClassDefOverride(name, id)
Definition: Rtypes.h:324
friend class TProfile2Poly
Definition: TProfile2Poly.h:20
TProfile2PolyBin()
TProfile2PolyBin constructor.
char name[80]
Definition: TGX11.cxx:109
virtual Int_t Fill(Double_t x, Double_t y)
Increment the bin containing (x,y) by 1.
Definition: TH2Poly.cxx:605
2D Histogram with Polygonal Bins
Definition: TH2Poly.h:66