Logo ROOT   6.12/07
Reference Guide
TH2.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Rene Brun 26/12/94
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_TH2
13 #define ROOT_TH2
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TH2 //
19 // //
20 // 2-Dim histogram base class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TH1.h"
25 #include "TMatrixFBasefwd.h"
26 #include "TMatrixDBasefwd.h"
27 
28 class TProfile;
29 
30 class TH2 : public TH1 {
31 
32 protected:
33  Double_t fScalefactor; //Scale factor
34  Double_t fTsumwy; //Total Sum of weight*Y
35  Double_t fTsumwy2; //Total Sum of weight*Y*Y
36  Double_t fTsumwxy; //Total Sum of weight*X*Y
37 
38  TH2();
39  TH2(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
40  ,Int_t nbinsy,Double_t ylow,Double_t yup);
41  TH2(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
42  ,Int_t nbinsy,Double_t ylow,Double_t yup);
43  TH2(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
44  ,Int_t nbinsy,const Double_t *ybins);
45  TH2(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
46  ,Int_t nbinsy,const Double_t *ybins);
47  TH2(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
48  ,Int_t nbinsy,const Float_t *ybins);
49 
51  virtual TH1D *DoProjection(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const;
52  virtual TProfile *DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const;
53  virtual TH1D *DoQuantiles(bool onX, const char *name, Double_t prob) const;
54  virtual void DoFitSlices(bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray* arr);
55 
56  Int_t BufferFill(Double_t, Double_t) {return -2;} //may not use
57  Int_t Fill(Double_t); //MayNotUse
58  Int_t Fill(const char*, Double_t) { return Fill(0);} //MayNotUse
59 
60 private:
61 
62  TH2(const TH2&);
63  TH2& operator=(const TH2&); // Not implemented
64 
65 public:
66  virtual ~TH2();
67  virtual Int_t BufferEmpty(Int_t action=0);
68  virtual void Copy(TObject &hnew) const;
69  virtual Int_t Fill(Double_t x, Double_t y);
70  virtual Int_t Fill(Double_t x, Double_t y, Double_t w);
71  virtual Int_t Fill(Double_t x, const char *namey, Double_t w);
72  virtual Int_t Fill(const char *namex, Double_t y, Double_t w);
73  virtual Int_t Fill(const char *namex, const char *namey, Double_t w);
74  virtual void FillN(Int_t, const Double_t *, const Double_t *, Int_t) {;} //MayNotUse
75  virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1);
76  virtual void FillRandom(const char *fname, Int_t ntimes=5000);
77  virtual void FillRandom(TH1 *h, Int_t ntimes=5000);
78  virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1) const;
79  virtual Int_t FindLastBinAbove (Double_t threshold=0, Int_t axis=1) const;
80  virtual void FitSlicesX(TF1 *f1=0,Int_t firstybin=0, Int_t lastybin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray* arr = 0);
81  virtual void FitSlicesY(TF1 *f1=0,Int_t firstxbin=0, Int_t lastxbin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray* arr = 0);
82  virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz = 0) const;
83  virtual Double_t GetBinWithContent2(Double_t c, Int_t &binx, Int_t &biny, Int_t firstxbin=1, Int_t lastxbin=-1,Int_t firstybin=1, Int_t lastybin=-1, Double_t maxdiff=0) const;
84  virtual Double_t GetBinContent(Int_t bin) const { return TH1::GetBinContent(bin); }
85  virtual Double_t GetBinContent(Int_t binx, Int_t biny) const { return TH1::GetBinContent( GetBin(binx, biny) ); }
86  virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const { return TH1::GetBinContent( GetBin(binx, biny) ); }
87  using TH1::GetBinErrorLow;
88  using TH1::GetBinErrorUp;
89  virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny) { return TH1::GetBinErrorLow( GetBin(binx, biny) ); }
90  virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny) { return TH1::GetBinErrorUp( GetBin(binx, biny) ); }
91  virtual Double_t GetCorrelationFactor(Int_t axis1=1,Int_t axis2=2) const;
92  virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
93  virtual void GetRandom2(Double_t &x, Double_t &y);
94  virtual void GetStats(Double_t *stats) const;
95  virtual Double_t Integral(Option_t *option="") const;
96  //virtual Double_t Integral(Int_t, Int_t, Option_t * ="") const {return 0;}
97  using TH1::Integral;
98  virtual Double_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Option_t *option="") const;
99  virtual Double_t Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t * ="") const {return 0;}
100  using TH1::IntegralAndError;
101  virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Double_t & err, Option_t *option="") const;
102  virtual Double_t Interpolate(Double_t x);
103  virtual Double_t Interpolate(Double_t x, Double_t y);
105  virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const;
106  virtual TH2 *RebinX(Int_t ngroup=2, const char *newname="");
107  virtual TH2 *RebinY(Int_t ngroup=2, const char *newname="");
108  virtual TH2 *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="");
109  TProfile *ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
110  TProfile *ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
111  TH1D *ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
112  TH1D *ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
113  virtual void PutStats(Double_t *stats);
114  TH1D *QuantilesX(Double_t prob = 0.5, const char * name = "_qx" ) const;
115  TH1D *QuantilesY(Double_t prob = 0.5, const char * name = "_qy" ) const;
116  virtual void Reset(Option_t *option="");
117  virtual void SetBinContent(Int_t bin, Double_t content);
118  virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
119  virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
120  virtual void SetShowProjectionX(Int_t nbins=1); // *MENU*
121  virtual void SetShowProjectionY(Int_t nbins=1); // *MENU*
122  virtual TH1 *ShowBackground(Int_t niter=20, Option_t *option="same");
123  virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05); // *MENU*
124  virtual void Smooth(Int_t ntimes=1, Option_t *option=""); // *MENU*
125 
126  ClassDef(TH2,4) //2-Dim histogram base class
127 };
128 
129 
130 //______________________________________________________________________________
131 
132 class TH2C : public TH2, public TArrayC {
133 
134 public:
135  TH2C();
136  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
137  ,Int_t nbinsy,Double_t ylow,Double_t yup);
138  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
139  ,Int_t nbinsy,Double_t ylow,Double_t yup);
140  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
141  ,Int_t nbinsy,const Double_t *ybins);
142  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
143  ,Int_t nbinsy,const Double_t *ybins);
144  TH2C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
145  ,Int_t nbinsy,const Float_t *ybins);
146  TH2C(const TH2C &h2c);
147  virtual ~TH2C();
148  virtual void AddBinContent(Int_t bin);
149  virtual void AddBinContent(Int_t bin, Double_t w);
150  virtual void Copy(TObject &hnew) const;
151  virtual void Reset(Option_t *option="");
152  virtual void SetBinsLength(Int_t n=-1);
153  TH2C& operator=(const TH2C &h1);
154  friend TH2C operator*(Float_t c1, TH2C &h1);
155  friend TH2C operator*(TH2C &h1, Float_t c1) {return operator*(c1,h1);}
156  friend TH2C operator+(TH2C &h1, TH2C &h2);
157  friend TH2C operator-(TH2C &h1, TH2C &h2);
158  friend TH2C operator*(TH2C &h1, TH2C &h2);
159  friend TH2C operator/(TH2C &h1, TH2C &h2);
160 
161 protected:
162  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
163  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Char_t (content); }
164 
165  ClassDef(TH2C,3) //2-Dim histograms (one char per channel)
166 };
167 
168 
169 //______________________________________________________________________________
170 
171 class TH2S : public TH2, public TArrayS {
172 
173 public:
174  TH2S();
175  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
176  ,Int_t nbinsy,Double_t ylow,Double_t yup);
177  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
178  ,Int_t nbinsy,Double_t ylow,Double_t yup);
179  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
180  ,Int_t nbinsy,const Double_t *ybins);
181  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
182  ,Int_t nbinsy,const Double_t *ybins);
183  TH2S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
184  ,Int_t nbinsy,const Float_t *ybins);
185  TH2S(const TH2S &h2s);
186  virtual ~TH2S();
187  virtual void AddBinContent(Int_t bin);
188  virtual void AddBinContent(Int_t bin, Double_t w);
189  virtual void Copy(TObject &hnew) const;
190  virtual void Reset(Option_t *option="");
191  virtual void SetBinsLength(Int_t n=-1);
192  TH2S& operator=(const TH2S &h1);
193  friend TH2S operator*(Float_t c1, TH2S &h1);
194  friend TH2S operator*(TH2S &h1, Float_t c1) {return operator*(c1,h1);}
195  friend TH2S operator+(TH2S &h1, TH2S &h2);
196  friend TH2S operator-(TH2S &h1, TH2S &h2);
197  friend TH2S operator*(TH2S &h1, TH2S &h2);
198  friend TH2S operator/(TH2S &h1, TH2S &h2);
199 
200 protected:
201  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
202  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Short_t (content); }
203 
204  ClassDef(TH2S,3) //2-Dim histograms (one short per channel)
205 };
206 
207 
208 //______________________________________________________________________________
209 
210 class TH2I : public TH2, public TArrayI {
211 
212 public:
213  TH2I();
214  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
215  ,Int_t nbinsy,Double_t ylow,Double_t yup);
216  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
217  ,Int_t nbinsy,Double_t ylow,Double_t yup);
218  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
219  ,Int_t nbinsy,const Double_t *ybins);
220  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
221  ,Int_t nbinsy,const Double_t *ybins);
222  TH2I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
223  ,Int_t nbinsy,const Float_t *ybins);
224  TH2I(const TH2I &h2i);
225  virtual ~TH2I();
226  virtual void AddBinContent(Int_t bin);
227  virtual void AddBinContent(Int_t bin, Double_t w);
228  virtual void Copy(TObject &hnew) const;
229  virtual void Reset(Option_t *option="");
230  virtual void SetBinsLength(Int_t n=-1);
231  TH2I& operator=(const TH2I &h1);
232  friend TH2I operator*(Float_t c1, TH2I &h1);
233  friend TH2I operator*(TH2I &h1, Float_t c1) {return operator*(c1,h1);}
234  friend TH2I operator+(TH2I &h1, TH2I &h2);
235  friend TH2I operator-(TH2I &h1, TH2I &h2);
236  friend TH2I operator*(TH2I &h1, TH2I &h2);
237  friend TH2I operator/(TH2I &h1, TH2I &h2);
238 
239 protected:
240  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
241  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Int_t (content); }
242 
243  ClassDef(TH2I,3) //2-Dim histograms (one 32 bits integer per channel)
244 };
245 
246 
247 //______________________________________________________________________________
248 
249 class TH2F : public TH2, public TArrayF {
250 
251 public:
252  TH2F();
253  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
254  ,Int_t nbinsy,Double_t ylow,Double_t yup);
255  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
256  ,Int_t nbinsy,Double_t ylow,Double_t yup);
257  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
258  ,Int_t nbinsy,const Double_t *ybins);
259  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
260  ,Int_t nbinsy,const Double_t *ybins);
261  TH2F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
262  ,Int_t nbinsy,const Float_t *ybins);
263  TH2F(const TMatrixFBase &m);
264  TH2F(const TH2F &h2f);
265  virtual ~TH2F();
266  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
267  virtual void AddBinContent(Int_t bin, Double_t w)
268  {fArray[bin] += Float_t (w);}
269  virtual void Copy(TObject &hnew) const;
270  virtual void Reset(Option_t *option="");
271  virtual void SetBinsLength(Int_t n=-1);
272  TH2F& operator=(const TH2F &h1);
273  friend TH2F operator*(Float_t c1, TH2F &h1);
274  friend TH2F operator*(TH2F &h1, Float_t c1);
275  friend TH2F operator+(TH2F &h1, TH2F &h2);
276  friend TH2F operator-(TH2F &h1, TH2F &h2);
277  friend TH2F operator*(TH2F &h1, TH2F &h2);
278  friend TH2F operator/(TH2F &h1, TH2F &h2);
279 
280 protected:
281  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
282  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Float_t (content); }
283 
284  ClassDef(TH2F,3) //2-Dim histograms (one float per channel)
285 };
286 
287 
288 //______________________________________________________________________________
289 
290 class TH2D : public TH2, public TArrayD {
291 
292 public:
293  TH2D();
294  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
295  ,Int_t nbinsy,Double_t ylow,Double_t yup);
296  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
297  ,Int_t nbinsy,Double_t ylow,Double_t yup);
298  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
299  ,Int_t nbinsy,const Double_t *ybins);
300  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
301  ,Int_t nbinsy,const Double_t *ybins);
302  TH2D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
303  ,Int_t nbinsy,const Float_t *ybins);
304  TH2D(const TMatrixDBase &m);
305  TH2D(const TH2D &h2d);
306  virtual ~TH2D();
307  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
308  virtual void AddBinContent(Int_t bin, Double_t w)
309  {fArray[bin] += Double_t (w);}
310  virtual void Copy(TObject &hnew) const;
311  virtual void Reset(Option_t *option="");
312  virtual void SetBinsLength(Int_t n=-1);
313  TH2D& operator=(const TH2D &h1);
314  friend TH2D operator*(Float_t c1, TH2D &h1);
315  friend TH2D operator*(TH2D &h1, Float_t c1) {return operator*(c1,h1);}
316  friend TH2D operator+(TH2D &h1, TH2D &h2);
317  friend TH2D operator-(TH2D &h1, TH2D &h2);
318  friend TH2D operator*(TH2D &h1, TH2D &h2);
319  friend TH2D operator/(TH2D &h1, TH2D &h2);
320 
321 protected:
322  virtual Double_t RetrieveBinContent(Int_t bin) const { return fArray[bin]; }
323  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = content; }
324 
325  ClassDef(TH2D,3) //2-Dim histograms (one double per channel)
326 };
327 
328 #endif
329 
virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content)
Definition: TH2.h:118
TH1D * QuantilesX(Double_t prob=0.5, const char *name="_qx") const
Compute the X distribution of quantiles in the other variable Y name is the name of the returned hist...
Definition: TH2.cxx:2357
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [binx1,binx2] and its error.
Definition: TH1.cxx:7283
An array of TObjects.
Definition: TObjArray.h:37
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH2.cxx:597
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition: TH2.h:322
virtual void GetRandom2(Double_t &x, Double_t &y)
Return 2 random numbers along axis x and y distributed according the cell-contents of a 2-dim histogr...
Definition: TH2.cxx:1075
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH2.cxx:177
auto * m
Definition: textangle.C:8
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition: TH2.cxx:2337
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition: TH2.h:282
friend TH2I operator*(TH2I &h1, Float_t c1)
Definition: TH2.h:233
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
return c1
Definition: legend1.C:41
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along Y.
Definition: TH2.cxx:2328
virtual TH2 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin2D.
Definition: TH2.cxx:1525
Double_t fScalefactor
Definition: TH2.h:33
friend TH2C operator*(TH2C &h1, Float_t c1)
Definition: TH2.h:155
TH1 * h
Definition: legend2.C:5
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t w)
accumulate arguments in buffer.
Definition: TH2.cxx:251
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4763
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7256
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along X.
Definition: TH2.cxx:2288
virtual TH1D * DoQuantiles(bool onX, const char *name, Double_t prob) const
Implementation of quantiles for x or y.
Definition: TH2.cxx:2379
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH2.cxx:1025
2-D histogram with a byte per channel (see TH1 documentation)
Definition: TH2.h:132
Array of floats (32 bits per element).
Definition: TArrayF.h:27
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH2.cxx:1187
TTime operator/(const TTime &t1, const TTime &t2)
Definition: TTime.h:87
int Int_t
Definition: RtypesCore.h:41
virtual ~TH2()
Destructor.
Definition: TH2.cxx:164
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition: TH2.h:323
Profile Histogram.
Definition: TProfile.h:32
virtual void SetShowProjectionY(Int_t nbins=1)
When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the pr...
Definition: TH2.cxx:2503
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition: TH2.h:162
Array of integers (32 bits per element).
Definition: TArrayI.h:27
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition: TH2.h:281
TH2 & operator=(const TH2 &)
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
Interface to TSpectrum2::Search the function finds peaks in this histogram where the width is > sigma...
Definition: TH2.cxx:2532
TTime operator-(const TTime &t1, const TTime &t2)
Definition: TTime.h:83
virtual void SetShowProjectionX(Int_t nbins=1)
When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the pr...
Definition: TH2.cxx:2488
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny)
Definition: TH2.h:90
friend TH2S operator*(TH2S &h1, Float_t c1)
Definition: TH2.h:194
Double_t fTsumwy2
Definition: TH2.h:35
const Double_t sigma
TH1F * h1
Definition: legend1.C:5
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Definition: TString.cxx:1448
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH1.cxx:1200
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny)
Definition: TH2.h:89
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:307
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const
Definition: TH2.h:86
virtual void Smooth(Int_t ntimes=1, Option_t *option="")
Smooth bin contents of this 2-d histogram using kernel algorithms similar to the ones used in the ras...
Definition: TH2.cxx:2561
virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1) const
Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold ...
Definition: TH2.cxx:680
virtual Double_t GetBinWithContent2(Double_t c, Int_t &binx, Int_t &biny, Int_t firstxbin=1, Int_t lastxbin=-1, Int_t firstybin=1, Int_t lastybin=-1, Double_t maxdiff=0) const
compute first cell (binx,biny) in the range [firstxbin,lastxbin][firstybin,lastybin] for which diff =...
Definition: TH2.cxx:997
virtual Double_t GetBinContent(Int_t binx, Int_t biny) const
Definition: TH2.h:85
Int_t Fill(const char *, Double_t)
Increment bin with namex with a weight w.
Definition: TH2.h:58
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:279
Service class for 2-Dim histogram classes.
Definition: TH2.h:30
virtual void GetStats(Double_t *stats) const
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
Definition: TH2.cxx:1128
Array of shorts (16 bits per element).
Definition: TArrayS.h:27
virtual void FitSlicesX(TF1 *f1=0, Int_t firstybin=0, Int_t lastybin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=0)
Project slices along X in case of a 2-D histogram, then fit each slice with function f1 and make a hi...
Definition: TH2.cxx:896
THist< 2, char, THistStatContent > TH2C
Definition: THist.hxx:292
friend TH2D operator*(TH2D &h1, Float_t c1)
Definition: TH2.h:315
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:249
TTime operator*(const TTime &t1, const TTime &t2)
Definition: TTime.h:85
Double_t fTsumwxy
Definition: TH2.h:36
Double_t fTsumwy
Definition: TH2.h:34
virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content)
Definition: TH2.h:119
short Short_t
Definition: RtypesCore.h:35
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition: TH2.h:163
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition: TH2.h:240
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [firstxbin,lastxbin],[firstybin,lastybin] for a 2-D histogra...
Definition: TH2.cxx:1216
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:610
Linear Algebra Package.
virtual Double_t Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t *="") const
Definition: TH2.h:99
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition: TH2.h:241
TH1D * QuantilesY(Double_t prob=0.5, const char *name="_qy") const
Compute the Y distribution of quantiles in the other variable X name is the name of the returned hist...
Definition: TH2.cxx:2370
virtual TH2 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin2D.
Definition: TH2.cxx:1515
TProfile * ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const
Project a 2-D histogram into a profile histogram along Y.
Definition: TH2.cxx:2012
TProfile * ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a profile histogram along X.
Definition: TH2.cxx:1962
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8335
double Double_t
Definition: RtypesCore.h:55
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:266
virtual void DoFitSlices(bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray *arr)
Definition: TH2.cxx:738
virtual void FitSlicesY(TF1 *f1=0, Int_t firstxbin=0, Int_t lastxbin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=0)
Project slices along Y in case of a 2-D histogram, then fit each slice with function f1 and make a hi...
Definition: TH2.cxx:961
Double_t y[n]
Definition: legend1.C:17
The TH1 histogram class.
Definition: TH1.h:56
2-D histogram with a short per channel (see TH1 documentation)
Definition: TH2.h:171
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
Definition: THist.hxx:290
virtual Int_t FindLastBinAbove(Double_t threshold=0, Int_t axis=1) const
Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold i...
Definition: TH2.cxx:710
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH2.h:267
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition: TH2.h:201
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
char Char_t
Definition: RtypesCore.h:29
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH2.h:308
virtual TH1 * ShowBackground(Int_t niter=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
Definition: TH2.cxx:2516
virtual Double_t Interpolate(Double_t x)
illegal for a TH2
Definition: TH2.cxx:1225
1-Dim function class
Definition: TF1.h:211
virtual void SetBinsLength(Int_t=-1)
Definition: TH1.h:368
TF1 * f1
Definition: legend1.C:11
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH2.h:84
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition: TH1.cxx:8366
THist< 2, int, THistStatContent > TH2I
Definition: THist.hxx:293
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition: TH2.h:202
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH2.cxx:2471
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH2.cxx:2455
2-D histogram with an int per channel (see TH1 documentation)}
Definition: TH2.h:210
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
Definition: TH2.cxx:966
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH2.cxx:292
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
Definition: THist.hxx:291
TH2()
Constructor.
Definition: TH2.cxx:60
Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH2.h:56
const Int_t n
Definition: legend1.C:16
virtual TProfile * DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
Definition: TH2.cxx:1739
char name[80]
Definition: TGX11.cxx:109
virtual void FillN(Int_t, const Double_t *, const Double_t *, Int_t)
Fill this histogram with an array x and weights w.
Definition: TH2.h:74
virtual TH2 * Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="")
Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.
Definition: TH2.cxx:1557
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test...
Definition: TH2.cxx:1343
virtual TH1D * DoProjection(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
Internal (protected) method for performing projection on the X or Y axis called by ProjectionX or Pro...
Definition: TH2.cxx:2022
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH2.cxx:1043
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:290
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:27