ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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);
111  virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const;
112  virtual Long64_t Merge(TCollection *list);
113  virtual TH2 *RebinX(Int_t ngroup=2, const char *newname="");
114  virtual TH2 *RebinY(Int_t ngroup=2, const char *newname="");
115  virtual TH2 *Rebin2D(Int_t nxgroup=2, Int_t nygroup=2, const char *newname="");
116  TProfile *ProfileX(const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
117  TProfile *ProfileY(const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
118  TH1D *ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const; // *MENU*
119  TH1D *ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const; // *MENU*
120  virtual void PutStats(Double_t *stats);
121  TH1D *QuantilesX(Double_t prob = 0.5, const char * name = "_qx" ) const;
122  TH1D *QuantilesY(Double_t prob = 0.5, const char * name = "_qy" ) const;
123  virtual void Reset(Option_t *option="");
124  virtual void SetBinContent(Int_t bin, Double_t content);
125  virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
126  virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content) { SetBinContent(GetBin(binx, biny), content); }
127  virtual void SetShowProjectionX(Int_t nbins=1); // *MENU*
128  virtual void SetShowProjectionY(Int_t nbins=1); // *MENU*
129  virtual TH1 *ShowBackground(Int_t niter=20, Option_t *option="same");
130  virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05); // *MENU*
131  virtual void Smooth(Int_t ntimes=1, Option_t *option=""); // *MENU*
132 
133  ClassDef(TH2,4) //2-Dim histogram base class
134 };
135 
136 
137 //______________________________________________________________________________
138 
139 class TH2C : public TH2, public TArrayC {
140 
141 public:
142  TH2C();
143  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
144  ,Int_t nbinsy,Double_t ylow,Double_t yup);
145  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
146  ,Int_t nbinsy,Double_t ylow,Double_t yup);
147  TH2C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
148  ,Int_t nbinsy,const Double_t *ybins);
149  TH2C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
150  ,Int_t nbinsy,const Double_t *ybins);
151  TH2C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
152  ,Int_t nbinsy,const Float_t *ybins);
153  TH2C(const TH2C &h2c);
154  virtual ~TH2C();
155  virtual void AddBinContent(Int_t bin);
156  virtual void AddBinContent(Int_t bin, Double_t w);
157  virtual void Copy(TObject &hnew) const;
158  virtual void Reset(Option_t *option="");
159  virtual void SetBinsLength(Int_t n=-1);
160  TH2C& operator=(const TH2C &h1);
161  friend TH2C operator*(Float_t c1, TH2C &h1);
162  friend TH2C operator*(TH2C &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2C operator/(TH2C &h1, TH2C &h2);
167 
168 protected:
169  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
170  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Char_t (content); }
171 
172  ClassDef(TH2C,3) //2-Dim histograms (one char per channel)
173 };
174 
175 
176 //______________________________________________________________________________
177 
178 class TH2S : public TH2, public TArrayS {
179 
180 public:
181  TH2S();
182  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
183  ,Int_t nbinsy,Double_t ylow,Double_t yup);
184  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
185  ,Int_t nbinsy,Double_t ylow,Double_t yup);
186  TH2S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
187  ,Int_t nbinsy,const Double_t *ybins);
188  TH2S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
189  ,Int_t nbinsy,const Double_t *ybins);
190  TH2S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
191  ,Int_t nbinsy,const Float_t *ybins);
192  TH2S(const TH2S &h2s);
193  virtual ~TH2S();
194  virtual void AddBinContent(Int_t bin);
195  virtual void AddBinContent(Int_t bin, Double_t w);
196  virtual void Copy(TObject &hnew) const;
197  virtual void Reset(Option_t *option="");
198  virtual void SetBinsLength(Int_t n=-1);
199  TH2S& operator=(const TH2S &h1);
200  friend TH2S operator*(Float_t c1, TH2S &h1);
201  friend TH2S operator*(TH2S &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2S operator/(TH2S &h1, TH2S &h2);
206 
207 protected:
208  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
209  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Short_t (content); }
210 
211  ClassDef(TH2S,3) //2-Dim histograms (one short per channel)
212 };
213 
214 
215 //______________________________________________________________________________
216 
217 class TH2I : public TH2, public TArrayI {
218 
219 public:
220  TH2I();
221  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
222  ,Int_t nbinsy,Double_t ylow,Double_t yup);
223  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
224  ,Int_t nbinsy,Double_t ylow,Double_t yup);
225  TH2I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
226  ,Int_t nbinsy,const Double_t *ybins);
227  TH2I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
228  ,Int_t nbinsy,const Double_t *ybins);
229  TH2I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
230  ,Int_t nbinsy,const Float_t *ybins);
231  TH2I(const TH2I &h2i);
232  virtual ~TH2I();
233  virtual void AddBinContent(Int_t bin);
234  virtual void AddBinContent(Int_t bin, Double_t w);
235  virtual void Copy(TObject &hnew) const;
236  virtual void Reset(Option_t *option="");
237  virtual void SetBinsLength(Int_t n=-1);
238  TH2I& operator=(const TH2I &h1);
239  friend TH2I operator*(Float_t c1, TH2I &h1);
240  friend TH2I operator*(TH2I &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2I operator/(TH2I &h1, TH2I &h2);
245 
246 protected:
247  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
248  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Int_t (content); }
249 
250  ClassDef(TH2I,3) //2-Dim histograms (one 32 bits integer per channel)
251 };
252 
253 
254 //______________________________________________________________________________
255 
256 class TH2F : public TH2, public TArrayF {
257 
258 public:
259  TH2F();
260  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
261  ,Int_t nbinsy,Double_t ylow,Double_t yup);
262  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
263  ,Int_t nbinsy,Double_t ylow,Double_t yup);
264  TH2F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
265  ,Int_t nbinsy,const Double_t *ybins);
266  TH2F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
267  ,Int_t nbinsy,const Double_t *ybins);
268  TH2F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
269  ,Int_t nbinsy,const Float_t *ybins);
270  TH2F(const TMatrixFBase &m);
271  TH2F(const TH2F &h2f);
272  virtual ~TH2F();
273  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
274  virtual void AddBinContent(Int_t bin, Double_t w)
275  {fArray[bin] += Float_t (w);}
276  virtual void Copy(TObject &hnew) const;
277  virtual void Reset(Option_t *option="");
278  virtual void SetBinsLength(Int_t n=-1);
279  TH2F& operator=(const TH2F &h1);
280  friend TH2F operator*(Float_t c1, TH2F &h1);
281  friend TH2F operator*(TH2F &h1, Float_t c1);
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  friend TH2F operator/(TH2F &h1, TH2F &h2);
286 
287 protected:
288  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
289  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Float_t (content); }
290 
291  ClassDef(TH2F,3) //2-Dim histograms (one float per channel)
292 };
293 
294 
295 //______________________________________________________________________________
296 
297 class TH2D : public TH2, public TArrayD {
298 
299 public:
300  TH2D();
301  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
302  ,Int_t nbinsy,Double_t ylow,Double_t yup);
303  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
304  ,Int_t nbinsy,Double_t ylow,Double_t yup);
305  TH2D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
306  ,Int_t nbinsy,const Double_t *ybins);
307  TH2D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
308  ,Int_t nbinsy,const Double_t *ybins);
309  TH2D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
310  ,Int_t nbinsy,const Float_t *ybins);
311  TH2D(const TMatrixDBase &m);
312  TH2D(const TH2D &h2d);
313  virtual ~TH2D();
314  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
315  virtual void AddBinContent(Int_t bin, Double_t w)
316  {fArray[bin] += Double_t (w);}
317  virtual void Copy(TObject &hnew) const;
318  virtual void Reset(Option_t *option="");
319  virtual void SetBinsLength(Int_t n=-1);
320  TH2D& operator=(const TH2D &h1);
321  friend TH2D operator*(Float_t c1, TH2D &h1);
322  friend TH2D operator*(TH2D &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH2D operator/(TH2D &h1, TH2D &h2);
327 
328 protected:
329  virtual Double_t RetrieveBinContent(Int_t bin) const { return fArray[bin]; }
330  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = content; }
331 
332  ClassDef(TH2D,3) //2-Dim histograms (one double per channel)
333 };
334 
335 #endif
336 
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH2.cxx:4046
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:274
virtual Double_t RetrieveBinContent(Int_t bin) const
Definition: TH2.h:208
virtual void SetBinContent(Int_t binx, Int_t biny, Double_t content)
Definition: TH2.h:125
Float_t * fArray
Definition: TArrayF.h:32
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8412
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:3036
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.cxx:3269
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:592
friend TH2D operator+(TH2D &h1, TH2D &h2)
Operator +.
Definition: TH2.cxx:4115
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:1070
long long Long64_t
Definition: RtypesCore.h:69
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4629
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH2.cxx:172
friend TH2F operator/(TH2F &h1, TH2F &h2)
Operator /.
Definition: TH2.cxx:3897
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:675
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition: TH2.cxx:2572
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:289
friend TH2I operator*(TH2I &h1, Float_t c1)
Definition: TH2.h:240
float Float_t
Definition: RtypesCore.h:53
virtual Double_t RetrieveBinContent(Int_t bin) const
Definition: TH2.h:247
friend TH2C operator/(TH2C &h1, TH2C &h2)
Operator /.
Definition: TH2.cxx:3160
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:2601
virtual TProfile * DoProfile(bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
Definition: TH2.cxx:1980
Short_t * fArray
Definition: TArrayS.h:32
return c
const char Option_t
Definition: RtypesCore.h:62
TCanvas * c1
Definition: legend1.C:2
void Reset()
Definition: TArrayD.h:49
friend TH2C operator+(TH2C &h1, TH2C &h2)
Operator +.
Definition: TH2.cxx:3124
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t) const
Definition: TH2.h:92
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:2245
friend TH2D operator-(TH2D &h1, TH2D &h2)
Operator -.
Definition: TH2.cxx:4127
virtual TH2 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin2D.
Definition: TH2.cxx:1766
Double_t fScalefactor
Definition: TH2.h:39
friend TH2C operator*(TH2C &h1, Float_t c1)
Definition: TH2.h:162
friend TH2I operator-(TH2I &h1, TH2I &h2)
Operator -.
Definition: TH2.cxx:3609
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:246
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH2.cxx:3310
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:2588
virtual ~TH2D()
Destructor.
Definition: TH2.cxx:3927
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH2.cxx:1038
2-D histogram with a bype per channel (see TH1 documentation)
Definition: TH2.h:139
Array of floats (32 bits per element).
Definition: TArrayF.h:29
int Int_t
Definition: RtypesCore.h:41
virtual ~TH2()
Destructor.
Definition: TH2.cxx:159
friend TH2C operator*(Float_t c1, TH2C &h1)
Operator *.
Definition: TH2.cxx:3112
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:330
int nbins[3]
friend TH2I operator/(TH2I &h1, TH2I &h2)
Operator /.
Definition: TH2.cxx:3633
void Reset()
Definition: TArrayF.h:49
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:3544
Profile Historam.
Definition: TProfile.h:34
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:705
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:2731
friend TH2I operator*(Float_t c1, TH2I &h1)
Operator *.
Definition: TH2.cxx:3585
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:992
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH2.cxx:3056
friend TH2D operator/(TH2D &h1, TH2D &h2)
Operator /.
Definition: TH2.cxx:4151
friend TH2I operator+(TH2I &h1, TH2I &h2)
Operator +.
Definition: TH2.cxx:3597
Array of integers (32 bits per element).
Definition: TArrayI.h:29
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:3761
friend TH2S operator/(TH2S &h1, TH2S &h2)
Operator /.
Definition: TH2.cxx:3414
TH2 & operator=(const TH2 &)
friend TH2C operator-(TH2C &h1, TH2C &h2)
Operator -.
Definition: TH2.cxx:3136
Double_t x[n]
Definition: legend1.C:17
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition: TH1.cxx:8441
TH2F & operator=(const TH2F &h1)
Operator =.
Definition: TH2.cxx:3827
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:2760
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:2716
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH2.cxx:3290
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny)
Definition: TH2.h:96
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:2523
virtual Double_t RetrieveBinContent(Int_t bin) const
Definition: TH2.h:288
friend TH2S operator*(TH2S &h1, Float_t c1)
Definition: TH2.h:201
Double_t * fArray
Definition: TArrayD.h:32
TH2S & operator=(const TH2S &h1)
Operator =.
Definition: TH2.cxx:3356
ClassDef(TAttLine, 2)
Double_t fTsumwy2
Definition: TH2.h:41
TH2D * h2
Definition: fit2dHist.C:45
friend TH2F operator-(TH2F &h1, TH2F &h2)
Operator -.
Definition: TH2.cxx:3873
const Double_t sigma
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:2563
TH1F * h1
Definition: legend1.C:5
virtual Double_t RetrieveBinContent(Int_t bin) const
Definition: TH2.h:329
Float_t z[5]
Definition: Ifit.C:16
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.cxx:3015
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny)
Definition: TH2.h:95
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH2.h:90
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:314
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:2789
void Reset()
Definition: TArrayS.h:49
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH2.cxx:3045
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:4026
virtual ~TH2C()
Destructor.
Definition: TH2.cxx:2936
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.cxx:3523
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7378
Service class for 2-Dim histogram classes.
Definition: TH2.h:36
virtual Double_t RetrieveBinContent(Int_t bin) const
Definition: TH2.h:169
Array of shorts (16 bits per element).
Definition: TArrayS.h:29
TH2C & operator=(const TH2C &h1)
Operator =.
Definition: TH2.cxx:3102
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
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:891
friend TH2D operator*(TH2D &h1, Float_t c1)
Definition: TH2.h:322
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:256
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 By default the integral is compu...
Definition: TH1.cxx:7405
Double_t fTsumwxy
Definition: TH2.h:42
Double_t fTsumwy
Definition: TH2.h:40
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:2200
Collection abstract base class.
Definition: TCollection.h:48
TMarker * m
Definition: textangle.C:8
virtual void SetBinContent(Int_t binx, Int_t biny, Int_t, Double_t content)
Definition: TH2.h:126
tuple w
Definition: qtexample.py:51
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:170
virtual Double_t Integral(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t *="") const
Definition: TH2.h:105
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:613
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:1338
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:961
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH2.cxx:1182
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:248
friend TH2D operator*(Float_t c1, TH2D &h1)
Operator *.
Definition: TH2.cxx:4103
friend TH2F operator+(TH2F &h1, TH2F &h2)
Operator +.
Definition: TH2.cxx:3861
friend TH2S operator*(Float_t c1, TH2S &h1)
Operator *.
Definition: TH2.cxx:3366
virtual TH2 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin2D.
Definition: TH2.cxx:1756
TH2I & operator=(const TH2I &h1)
Operator =.
Definition: TH2.cxx:3575
double Double_t
Definition: RtypesCore.h:55
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH2.h:273
virtual void DoFitSlices(bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray *arr)
Definition: TH2.cxx:733
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:2255
Int_t * fArray
Definition: TArrayI.h:32
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:1211
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:956
Double_t y[n]
Definition: legend1.C:17
The TH1 histogram class.
Definition: TH1.h:80
2-D histogram with a short per channel (see TH1 documentation)
Definition: TH2.h:178
Array of doubles (64 bits per element).
Definition: TArrayD.h:29
friend TH2F operator*(Float_t c1, TH2F &h1)
Operator *.
Definition: TH2.cxx:3837
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH2.h:274
virtual TH1D * DoQuantiles(bool onX, const char *name, Double_t prob) const
Implementation of quantiles for x or y.
Definition: TH2.cxx:2610
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
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:315
virtual TH1 * ShowBackground(Int_t niter=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
Definition: TH2.cxx:2744
virtual ~TH2F()
Destructor.
Definition: TH2.cxx:3663
Bool_t axis
Definition: geodemo.C:37
virtual Double_t Interpolate(Double_t x)
illegal for a TH2
Definition: TH2.cxx:1220
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH2.cxx:3781
virtual ~TH2I()
Destructor.
Definition: TH2.cxx:3444
1-Dim function class
Definition: TF1.h:149
Char_t * fArray
Definition: TArrayC.h:32
virtual Long64_t Merge(TCollection *list)
Add all histograms in the collection to this histogram.
Definition: TH2.cxx:1520
TF1 * f1
Definition: legend1.C:11
void Reset()
Definition: TArrayI.h:49
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH2.cxx:3564
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:209
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:1123
friend TH2S operator+(TH2S &h1, TH2S &h2)
Operator +.
Definition: TH2.cxx:3378
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH2.cxx:2699
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH2.cxx:1020
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH2.cxx:2683
2-D histogram with a int per channel (see TH1 documentation)}
Definition: TH2.h:217
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH2.cxx:287
virtual ~TH2S()
Destructor.
Definition: TH2.cxx:3190
friend TH2S operator-(TH2S &h1, TH2S &h2)
Operator -.
Definition: TH2.cxx:3390
Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH2.h:62
const Int_t n
Definition: legend1.C:16
virtual Double_t GetBinContent(Int_t binx, Int_t biny) const
Definition: TH2.h:91
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:1798
TH2D & operator=(const TH2D &h1)
Operator =.
Definition: TH2.cxx:4092
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:297
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:29