Logo ROOT   6.14/05
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=""); // *MENU*
107  virtual TH2 *RebinY(Int_t ngroup=2, const char *newname=""); // *MENU*
108  virtual TH2 *Rebin(Int_t ngroup=2, const char*newname="", const Double_t *xbins=0); // re-implementation of the TH1 function using RebinX
109  virtual TH2 *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname=""); // *MENU*
110  TProfile *ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
111  TProfile *ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
112  TH1D *ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
113  TH1D *ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
114  virtual void PutStats(Double_t *stats);
115  TH1D *QuantilesX(Double_t prob = 0.5, const char * name = "_qx" ) const;
116  TH1D *QuantilesY(Double_t prob = 0.5, const char * name = "_qy" ) const;
117  virtual void Reset(Option_t *option="");
118  virtual void SetBinContent(Int_t bin, Double_t content);
119  virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
120  virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
121  virtual void SetShowProjectionX(Int_t nbins=1); // *MENU*
122  virtual void SetShowProjectionY(Int_t nbins=1); // *MENU*
123  virtual TH1 *ShowBackground(Int_t niter=20, Option_t *option="same");
124  virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05); // *MENU*
125  virtual void Smooth(Int_t ntimes=1, Option_t *option=""); // *MENU*
126 
127  ClassDef(TH2,4) //2-Dim histogram base class
128 };
129 
130 
131 //______________________________________________________________________________
132 
133 class TH2C : public TH2, public TArrayC {
134 
135 public:
136  TH2C();
137  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
138  ,Int_t nbinsy,Double_t ylow,Double_t yup);
139  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
140  ,Int_t nbinsy,Double_t ylow,Double_t yup);
141  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
142  ,Int_t nbinsy,const Double_t *ybins);
143  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
144  ,Int_t nbinsy,const Double_t *ybins);
145  TH2C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
146  ,Int_t nbinsy,const Float_t *ybins);
147  TH2C(const TH2C &h2c);
148  virtual ~TH2C();
149  virtual void AddBinContent(Int_t bin);
150  virtual void AddBinContent(Int_t bin, Double_t w);
151  virtual void Copy(TObject &hnew) const;
152  virtual void Reset(Option_t *option="");
153  virtual void SetBinsLength(Int_t n=-1);
154  TH2C& operator=(const TH2C &h1);
155  friend TH2C operator*(Float_t c1, TH2C &h1);
156  friend TH2C operator*(TH2C &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2C operator/(TH2C &h1, TH2C &h2);
161 
162 protected:
163  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
164  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Char_t (content); }
165 
166  ClassDef(TH2C,3) //2-Dim histograms (one char per channel)
167 };
168 
169 
170 //______________________________________________________________________________
171 
172 class TH2S : public TH2, public TArrayS {
173 
174 public:
175  TH2S();
176  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
177  ,Int_t nbinsy,Double_t ylow,Double_t yup);
178  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
179  ,Int_t nbinsy,Double_t ylow,Double_t yup);
180  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
181  ,Int_t nbinsy,const Double_t *ybins);
182  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
183  ,Int_t nbinsy,const Double_t *ybins);
184  TH2S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
185  ,Int_t nbinsy,const Float_t *ybins);
186  TH2S(const TH2S &h2s);
187  virtual ~TH2S();
188  virtual void AddBinContent(Int_t bin);
189  virtual void AddBinContent(Int_t bin, Double_t w);
190  virtual void Copy(TObject &hnew) const;
191  virtual void Reset(Option_t *option="");
192  virtual void SetBinsLength(Int_t n=-1);
193  TH2S& operator=(const TH2S &h1);
194  friend TH2S operator*(Float_t c1, TH2S &h1);
195  friend TH2S operator*(TH2S &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2S operator/(TH2S &h1, TH2S &h2);
200 
201 protected:
202  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
203  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Short_t (content); }
204 
205  ClassDef(TH2S,3) //2-Dim histograms (one short per channel)
206 };
207 
208 
209 //______________________________________________________________________________
210 
211 class TH2I : public TH2, public TArrayI {
212 
213 public:
214  TH2I();
215  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
216  ,Int_t nbinsy,Double_t ylow,Double_t yup);
217  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
218  ,Int_t nbinsy,Double_t ylow,Double_t yup);
219  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
220  ,Int_t nbinsy,const Double_t *ybins);
221  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
222  ,Int_t nbinsy,const Double_t *ybins);
223  TH2I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
224  ,Int_t nbinsy,const Float_t *ybins);
225  TH2I(const TH2I &h2i);
226  virtual ~TH2I();
227  virtual void AddBinContent(Int_t bin);
228  virtual void AddBinContent(Int_t bin, Double_t w);
229  virtual void Copy(TObject &hnew) const;
230  virtual void Reset(Option_t *option="");
231  virtual void SetBinsLength(Int_t n=-1);
232  TH2I& operator=(const TH2I &h1);
233  friend TH2I operator*(Float_t c1, TH2I &h1);
234  friend TH2I operator*(TH2I &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2I operator/(TH2I &h1, TH2I &h2);
239 
240 protected:
241  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
242  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Int_t (content); }
243 
244  ClassDef(TH2I,3) //2-Dim histograms (one 32 bits integer per channel)
245 };
246 
247 
248 //______________________________________________________________________________
249 
250 class TH2F : public TH2, public TArrayF {
251 
252 public:
253  TH2F();
254  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
255  ,Int_t nbinsy,Double_t ylow,Double_t yup);
256  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
257  ,Int_t nbinsy,Double_t ylow,Double_t yup);
258  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
259  ,Int_t nbinsy,const Double_t *ybins);
260  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
261  ,Int_t nbinsy,const Double_t *ybins);
262  TH2F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
263  ,Int_t nbinsy,const Float_t *ybins);
264  TH2F(const TMatrixFBase &m);
265  TH2F(const TH2F &h2f);
266  virtual ~TH2F();
267  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
268  virtual void AddBinContent(Int_t bin, Double_t w)
269  {fArray[bin] += Float_t (w);}
270  virtual void Copy(TObject &hnew) const;
271  virtual void Reset(Option_t *option="");
272  virtual void SetBinsLength(Int_t n=-1);
273  TH2F& operator=(const TH2F &h1);
274  friend TH2F operator*(Float_t c1, TH2F &h1);
275  friend TH2F operator*(TH2F &h1, Float_t c1);
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  friend TH2F operator/(TH2F &h1, TH2F &h2);
280 
281 protected:
282  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
283  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Float_t (content); }
284 
285  ClassDef(TH2F,3) //2-Dim histograms (one float per channel)
286 };
287 
288 
289 //______________________________________________________________________________
290 
291 class TH2D : public TH2, public TArrayD {
292 
293 public:
294  TH2D();
295  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
296  ,Int_t nbinsy,Double_t ylow,Double_t yup);
297  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
298  ,Int_t nbinsy,Double_t ylow,Double_t yup);
299  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
300  ,Int_t nbinsy,const Double_t *ybins);
301  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
302  ,Int_t nbinsy,const Double_t *ybins);
303  TH2D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
304  ,Int_t nbinsy,const Float_t *ybins);
305  TH2D(const TMatrixDBase &m);
306  TH2D(const TH2D &h2d);
307  virtual ~TH2D();
308  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
309  virtual void AddBinContent(Int_t bin, Double_t w)
310  {fArray[bin] += Double_t (w);}
311  virtual void Copy(TObject &hnew) const;
312  virtual void Reset(Option_t *option="");
313  virtual void SetBinsLength(Int_t n=-1);
314  TH2D& operator=(const TH2D &h1);
315  friend TH2D operator*(Float_t c1, TH2D &h1);
316  friend TH2D operator*(TH2D &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2D operator/(TH2D &h1, TH2D &h2);
321 
322 protected:
323  virtual Double_t RetrieveBinContent(Int_t bin) const { return fArray[bin]; }
324  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = content; }
325 
326  ClassDef(TH2D,3) //2-Dim histograms (one double per channel)
327 };
328 
329 #endif
330 
virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content)
Definition: TH2.h:119
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:2386
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:7320
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:323
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:1090
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:2366
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:283
friend TH2I operator*(TH2I &h1, Float_t c1)
Definition: TH2.h:234
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:2357
virtual TH2 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin2D.
Definition: TH2.cxx:1540
Double_t fScalefactor
Definition: TH2.h:33
friend TH2C operator*(TH2C &h1, Float_t c1)
Definition: TH2.h:156
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:4770
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7293
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:2317
virtual TH1D * DoQuantiles(bool onX, const char *name, Double_t prob) const
Implementation of quantiles for x or y.
Definition: TH2.cxx:2408
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH2.cxx:1040
2-D histogram with a byte per channel (see TH1 documentation)
Definition: TH2.h:133
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:1202
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:324
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:2532
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:163
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:282
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:2561
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:2517
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:195
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:1449
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:308
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:2590
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:695
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:1012
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:1143
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:911
THist< 2, char, THistStatContent > TH2C
Definition: THist.hxx:292
friend TH2D operator*(TH2D &h1, Float_t c1)
Definition: TH2.h:316
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:250
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:120
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:164
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:241
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:1231
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:610
Linear Algebra Package.
#define h(i)
Definition: RSha256.hxx:106
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:242
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:2399
virtual TH2 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin2D.
Definition: TH2.cxx:1530
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:2041
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:1991
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8372
double Double_t
Definition: RtypesCore.h:55
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:267
virtual void DoFitSlices(bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray *arr)
Definition: TH2.cxx:753
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:976
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:172
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:725
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:268
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:202
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:309
virtual TH1 * ShowBackground(Int_t niter=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
Definition: TH2.cxx:2545
virtual Double_t Interpolate(Double_t x)
illegal for a TH2
Definition: TH2.cxx:1240
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
#define c(i)
Definition: RSha256.hxx:101
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition: TH1.cxx:8403
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:203
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH2.cxx:2500
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH2.cxx:2484
2-D histogram with an int per channel (see TH1 documentation)}
Definition: TH2.h:211
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:981
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:1768
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 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=0)
Override TH1::Rebin as TH2::RebinX Rebinning in variable binning as for TH1 is not allowed If a non-n...
Definition: TH2.cxx:1551
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:1586
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:1358
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:2051
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH2.cxx:1058
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:291
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:27