Logo ROOT   6.08/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 #ifndef ROOT_TH1
25 #include "TH1.h"
26 #endif
27 #ifndef ROOT_TMatrixFBasefwd
28 #include "TMatrixFBasefwd.h"
29 #endif
30 #ifndef ROOT_TMatrixDBasefwd
31 #include "TMatrixDBasefwd.h"
32 #endif
33 
34 class TProfile;
35 
36 class TH2 : public TH1 {
37 
38 protected:
39  Double_t fScalefactor; //Scale factor
40  Double_t fTsumwy; //Total Sum of weight*Y
41  Double_t fTsumwy2; //Total Sum of weight*Y*Y
42  Double_t fTsumwxy; //Total Sum of weight*X*Y
43 
44  TH2();
45  TH2(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
46  ,Int_t nbinsy,Double_t ylow,Double_t yup);
47  TH2(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
48  ,Int_t nbinsy,Double_t ylow,Double_t yup);
49  TH2(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
50  ,Int_t nbinsy,const Double_t *ybins);
51  TH2(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
52  ,Int_t nbinsy,const Double_t *ybins);
53  TH2(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
54  ,Int_t nbinsy,const Float_t *ybins);
55 
57  virtual TH1D *DoProjection(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const;
58  virtual TProfile *DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const;
59  virtual TH1D *DoQuantiles(bool onX, const char *name, Double_t prob) const;
60  virtual void DoFitSlices(bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray* arr);
61 
62  Int_t BufferFill(Double_t, Double_t) {return -2;} //may not use
63  Int_t Fill(Double_t); //MayNotUse
64  Int_t Fill(const char*, Double_t) { return Fill(0);} //MayNotUse
65 
66 private:
67 
68  TH2(const TH2&);
69  TH2& operator=(const TH2&); // Not implemented
70 
71 public:
72  virtual ~TH2();
73  virtual Int_t BufferEmpty(Int_t action=0);
74  virtual void Copy(TObject &hnew) const;
75  virtual Int_t Fill(Double_t x, Double_t y);
76  virtual Int_t Fill(Double_t x, Double_t y, Double_t w);
77  virtual Int_t Fill(Double_t x, const char *namey, Double_t w);
78  virtual Int_t Fill(const char *namex, Double_t y, Double_t w);
79  virtual Int_t Fill(const char *namex, const char *namey, Double_t w);
80  virtual void FillN(Int_t, const Double_t *, const Double_t *, Int_t) {;} //MayNotUse
81  virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1);
82  virtual void FillRandom(const char *fname, Int_t ntimes=5000);
83  virtual void FillRandom(TH1 *h, Int_t ntimes=5000);
84  virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1) const;
85  virtual Int_t FindLastBinAbove (Double_t threshold=0, Int_t axis=1) const;
86  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); // *MENU*
87  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); // *MENU*
88  virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz = 0) const;
89  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;
90  virtual Double_t GetBinContent(Int_t bin) const { return TH1::GetBinContent(bin); }
91  virtual Double_t GetBinContent(Int_t binx, Int_t biny) const { return TH1::GetBinContent( GetBin(binx, biny) ); }
92  virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const { return TH1::GetBinContent( GetBin(binx, biny) ); }
93  using TH1::GetBinErrorLow;
94  using TH1::GetBinErrorUp;
95  virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny) { return TH1::GetBinErrorLow( GetBin(binx, biny) ); }
96  virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny) { return TH1::GetBinErrorUp( GetBin(binx, biny) ); }
97  virtual Double_t GetCorrelationFactor(Int_t axis1=1,Int_t axis2=2) const;
98  virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
99  virtual void GetRandom2(Double_t &x, Double_t &y);
100  virtual void GetStats(Double_t *stats) const;
101  virtual Double_t Integral(Option_t *option="") const;
102  //virtual Double_t Integral(Int_t, Int_t, Option_t * ="") const {return 0;}
103  using TH1::Integral;
104  virtual Double_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Option_t *option="") const;
105  virtual Double_t Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t * ="") const {return 0;}
106  using TH1::IntegralAndError;
107  virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Double_t & err, Option_t *option="") const;
108  virtual Double_t Interpolate(Double_t x);
109  virtual Double_t Interpolate(Double_t x, Double_t y);
111  virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const;
112  virtual TH2 *RebinX(Int_t ngroup=2, const char *newname="");
113  virtual TH2 *RebinY(Int_t ngroup=2, const char *newname="");
114  virtual TH2 *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="");
115  TProfile *ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
116  TProfile *ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
117  TH1D *ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
118  TH1D *ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
119  virtual void PutStats(Double_t *stats);
120  TH1D *QuantilesX(Double_t prob = 0.5, const char * name = "_qx" ) const;
121  TH1D *QuantilesY(Double_t prob = 0.5, const char * name = "_qy" ) const;
122  virtual void Reset(Option_t *option="");
123  virtual void SetBinContent(Int_t bin, Double_t content);
124  virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
125  virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
126  virtual void SetShowProjectionX(Int_t nbins=1); // *MENU*
127  virtual void SetShowProjectionY(Int_t nbins=1); // *MENU*
128  virtual TH1 *ShowBackground(Int_t niter=20, Option_t *option="same");
129  virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05); // *MENU*
130  virtual void Smooth(Int_t ntimes=1, Option_t *option=""); // *MENU*
131 
132  ClassDef(TH2,4) //2-Dim histogram base class
133 };
134 
135 
136 //______________________________________________________________________________
137 
138 class TH2C : public TH2, public TArrayC {
139 
140 public:
141  TH2C();
142  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
143  ,Int_t nbinsy,Double_t ylow,Double_t yup);
144  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
145  ,Int_t nbinsy,Double_t ylow,Double_t yup);
146  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
147  ,Int_t nbinsy,const Double_t *ybins);
148  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
149  ,Int_t nbinsy,const Double_t *ybins);
150  TH2C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
151  ,Int_t nbinsy,const Float_t *ybins);
152  TH2C(const TH2C &h2c);
153  virtual ~TH2C();
154  virtual void AddBinContent(Int_t bin);
155  virtual void AddBinContent(Int_t bin, Double_t w);
156  virtual void Copy(TObject &hnew) const;
157  virtual void Reset(Option_t *option="");
158  virtual void SetBinsLength(Int_t n=-1);
159  TH2C& operator=(const TH2C &h1);
160  friend TH2C operator*(Float_t c1, TH2C &h1);
161  friend TH2C operator*(TH2C &h1, Float_t c1) {return operator*(c1,h1);}
162  friend TH2C operator+(TH2C &h1, TH2C &h2);
163  friend TH2C operator-(TH2C &h1, TH2C &h2);
164  friend TH2C operator*(TH2C &h1, TH2C &h2);
165  friend TH2C operator/(TH2C &h1, TH2C &h2);
166 
167 protected:
168  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
169  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Char_t (content); }
170 
171  ClassDef(TH2C,3) //2-Dim histograms (one char per channel)
172 };
173 
174 
175 //______________________________________________________________________________
176 
177 class TH2S : public TH2, public TArrayS {
178 
179 public:
180  TH2S();
181  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
182  ,Int_t nbinsy,Double_t ylow,Double_t yup);
183  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
184  ,Int_t nbinsy,Double_t ylow,Double_t yup);
185  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
186  ,Int_t nbinsy,const Double_t *ybins);
187  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
188  ,Int_t nbinsy,const Double_t *ybins);
189  TH2S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
190  ,Int_t nbinsy,const Float_t *ybins);
191  TH2S(const TH2S &h2s);
192  virtual ~TH2S();
193  virtual void AddBinContent(Int_t bin);
194  virtual void AddBinContent(Int_t bin, Double_t w);
195  virtual void Copy(TObject &hnew) const;
196  virtual void Reset(Option_t *option="");
197  virtual void SetBinsLength(Int_t n=-1);
198  TH2S& operator=(const TH2S &h1);
199  friend TH2S operator*(Float_t c1, TH2S &h1);
200  friend TH2S operator*(TH2S &h1, Float_t c1) {return operator*(c1,h1);}
201  friend TH2S operator+(TH2S &h1, TH2S &h2);
202  friend TH2S operator-(TH2S &h1, TH2S &h2);
203  friend TH2S operator*(TH2S &h1, TH2S &h2);
204  friend TH2S operator/(TH2S &h1, TH2S &h2);
205 
206 protected:
207  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
208  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Short_t (content); }
209 
210  ClassDef(TH2S,3) //2-Dim histograms (one short per channel)
211 };
212 
213 
214 //______________________________________________________________________________
215 
216 class TH2I : public TH2, public TArrayI {
217 
218 public:
219  TH2I();
220  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
221  ,Int_t nbinsy,Double_t ylow,Double_t yup);
222  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
223  ,Int_t nbinsy,Double_t ylow,Double_t yup);
224  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
225  ,Int_t nbinsy,const Double_t *ybins);
226  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
227  ,Int_t nbinsy,const Double_t *ybins);
228  TH2I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
229  ,Int_t nbinsy,const Float_t *ybins);
230  TH2I(const TH2I &h2i);
231  virtual ~TH2I();
232  virtual void AddBinContent(Int_t bin);
233  virtual void AddBinContent(Int_t bin, Double_t w);
234  virtual void Copy(TObject &hnew) const;
235  virtual void Reset(Option_t *option="");
236  virtual void SetBinsLength(Int_t n=-1);
237  TH2I& operator=(const TH2I &h1);
238  friend TH2I operator*(Float_t c1, TH2I &h1);
239  friend TH2I operator*(TH2I &h1, Float_t c1) {return operator*(c1,h1);}
240  friend TH2I operator+(TH2I &h1, TH2I &h2);
241  friend TH2I operator-(TH2I &h1, TH2I &h2);
242  friend TH2I operator*(TH2I &h1, TH2I &h2);
243  friend TH2I operator/(TH2I &h1, TH2I &h2);
244 
245 protected:
246  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
247  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Int_t (content); }
248 
249  ClassDef(TH2I,3) //2-Dim histograms (one 32 bits integer per channel)
250 };
251 
252 
253 //______________________________________________________________________________
254 
255 class TH2F : public TH2, public TArrayF {
256 
257 public:
258  TH2F();
259  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
260  ,Int_t nbinsy,Double_t ylow,Double_t yup);
261  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
262  ,Int_t nbinsy,Double_t ylow,Double_t yup);
263  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
264  ,Int_t nbinsy,const Double_t *ybins);
265  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
266  ,Int_t nbinsy,const Double_t *ybins);
267  TH2F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
268  ,Int_t nbinsy,const Float_t *ybins);
269  TH2F(const TMatrixFBase &m);
270  TH2F(const TH2F &h2f);
271  virtual ~TH2F();
272  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
273  virtual void AddBinContent(Int_t bin, Double_t w)
274  {fArray[bin] += Float_t (w);}
275  virtual void Copy(TObject &hnew) const;
276  virtual void Reset(Option_t *option="");
277  virtual void SetBinsLength(Int_t n=-1);
278  TH2F& operator=(const TH2F &h1);
279  friend TH2F operator*(Float_t c1, TH2F &h1);
280  friend TH2F operator*(TH2F &h1, Float_t c1);
281  friend TH2F operator+(TH2F &h1, TH2F &h2);
282  friend TH2F operator-(TH2F &h1, TH2F &h2);
283  friend TH2F operator*(TH2F &h1, TH2F &h2);
284  friend TH2F operator/(TH2F &h1, TH2F &h2);
285 
286 protected:
287  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
288  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Float_t (content); }
289 
290  ClassDef(TH2F,3) //2-Dim histograms (one float per channel)
291 };
292 
293 
294 //______________________________________________________________________________
295 
296 class TH2D : public TH2, public TArrayD {
297 
298 public:
299  TH2D();
300  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
301  ,Int_t nbinsy,Double_t ylow,Double_t yup);
302  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
303  ,Int_t nbinsy,Double_t ylow,Double_t yup);
304  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
305  ,Int_t nbinsy,const Double_t *ybins);
306  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
307  ,Int_t nbinsy,const Double_t *ybins);
308  TH2D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
309  ,Int_t nbinsy,const Float_t *ybins);
310  TH2D(const TMatrixDBase &m);
311  TH2D(const TH2D &h2d);
312  virtual ~TH2D();
313  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
314  virtual void AddBinContent(Int_t bin, Double_t w)
315  {fArray[bin] += Double_t (w);}
316  virtual void Copy(TObject &hnew) const;
317  virtual void Reset(Option_t *option="");
318  virtual void SetBinsLength(Int_t n=-1);
319  TH2D& operator=(const TH2D &h1);
320  friend TH2D operator*(Float_t c1, TH2D &h1);
321  friend TH2D operator*(TH2D &h1, Float_t c1) {return operator*(c1,h1);}
322  friend TH2D operator+(TH2D &h1, TH2D &h2);
323  friend TH2D operator-(TH2D &h1, TH2D &h2);
324  friend TH2D operator*(TH2D &h1, TH2D &h2);
325  friend TH2D operator/(TH2D &h1, TH2D &h2);
326 
327 protected:
328  virtual Double_t RetrieveBinContent(Int_t bin) const { return fArray[bin]; }
329  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = content; }
330 
331  ClassDef(TH2D,3) //2-Dim histograms (one double per channel)
332 };
333 
334 #endif
335 
virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content)
Definition: TH2.h:124
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:2361
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:7151
An array of TObjects.
Definition: TObjArray.h:39
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:328
virtual void GetRandom2(Double_t &x, Double_t &y)
Return 2 random numbers along axis x and y distributed according the cellcontents of a 2-dim histogra...
Definition: TH2.cxx:1075
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH2.cxx:177
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition: TH2.cxx:2341
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:288
friend TH2I operator*(TH2I &h1, Float_t c1)
Definition: TH2.h:239
float Float_t
Definition: RtypesCore.h:53
return c
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:2332
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:39
friend TH2C operator*(TH2C &h1, Float_t c1)
Definition: TH2.h:161
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:4638
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7124
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:2292
virtual TH1D * DoQuantiles(bool onX, const char *name, Double_t prob) const
Implementation of quantiles for x or y.
Definition: TH2.cxx:2383
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH2.cxx:1025
tomato 2-D histogram with a byte per channel (see TH1 documentation)
Definition: TH2.h:138
Array of floats (32 bits per element).
Definition: TArrayF.h:29
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:89
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:329
int nbins[3]
Profile Historam.
Definition: TProfile.h:34
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:2507
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:168
Array of integers (32 bits per element).
Definition: TArrayI.h:29
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:287
TH2 & operator=(const TH2 &)
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
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:2536
TTime operator-(const TTime &t1, const TTime &t2)
Definition: TTime.h:85
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:2492
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny)
Definition: TH2.h:96
friend TH2S operator*(TH2S &h1, Float_t c1)
Definition: TH2.h:200
Double_t fTsumwy2
Definition: TH2.h:41
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:1438
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH1.cxx:1193
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny)
Definition: TH2.h:95
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:313
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const
Definition: TH2.h:92
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:2565
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:91
Int_t Fill(const char *, Double_t)
Increment bin with namex with a weight w.
Definition: TH2.h:64
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:279
Service class for 2-Dim histogram classes.
Definition: TH2.h:36
virtual void GetStats(Double_t *stats) const
Fill the array stats from the contents of this histogram The array stats must be correctly dimensionn...
Definition: TH2.cxx:1128
Array of shorts (16 bits per element).
Definition: TArrayS.h:29
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:309
friend TH2D operator*(TH2D &h1, Float_t c1)
Definition: TH2.h:321
tomato 2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:255
TTime operator*(const TTime &t1, const TTime &t2)
Definition: TTime.h:87
Double_t fTsumwxy
Definition: TH2.h:42
Double_t fTsumwy
Definition: TH2.h:40
TMarker * m
Definition: textangle.C:8
virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content)
Definition: TH2.h:125
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:169
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:246
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
tomato 1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:618
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:105
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:247
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:2374
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:2014
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:1964
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8189
double Double_t
Definition: RtypesCore.h:55
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:272
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:80
tomato 2-D histogram with a short per channel (see TH1 documentation)
Definition: TH2.h:177
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
Definition: THist.hxx:307
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:29
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH2.h:273
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:207
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:314
virtual TH1 * ShowBackground(Int_t niter=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
Definition: TH2.cxx:2520
virtual Double_t Interpolate(Double_t x)
illegal for a TH2
Definition: TH2.cxx:1225
1-Dim function class
Definition: TF1.h:149
virtual void SetBinsLength(Int_t=-1)
Definition: TH1.h:377
TF1 * f1
Definition: legend1.C:11
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH2.h:90
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition: TH1.cxx:8220
THist< 2, int, THistStatContent > TH2I
Definition: THist.hxx:310
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:208
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH2.cxx:2475
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH2.cxx:2459
tomato 2-D histogram with an int per channel (see TH1 documentation)}
Definition: TH2.h:216
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:308
TH2()
Constructor.
Definition: TH2.cxx:60
Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH2.h:62
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:80
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:2024
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH2.cxx:1043
tomato 2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:296
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:29