Logo ROOT   master
Reference Guide
TH3.h
Go to the documentation of this file.
1 // @(#)root/hist:$Id$
2 // Author: Rene Brun 27/10/95
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_TH3
13 #define ROOT_TH3
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TH3 //
19 // //
20 // 3-Dim histogram base class. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TH1.h"
25 
26 #include "TAtt3D.h"
27 
28 class TH2D;
29 class TProfile2D;
30 
31 class TH3 : public TH1, public TAtt3D {
32 
33 protected:
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  Double_t fTsumwz; //Total Sum of weight*Z
38  Double_t fTsumwz2; //Total Sum of weight*Z*Z
39  Double_t fTsumwxz; //Total Sum of weight*X*Z
40  Double_t fTsumwyz; //Total Sum of weight*Y*Z
41 
42  TH3();
43  TH3(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
44  ,Int_t nbinsy,Double_t ylow,Double_t yup
45  ,Int_t nbinsz,Double_t zlow,Double_t zup);
46  TH3(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
47  ,Int_t nbinsy,const Float_t *ybins
48  ,Int_t nbinsz,const Float_t *zbins);
49  TH3(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
50  ,Int_t nbinsy,const Double_t *ybins
51  ,Int_t nbinsz,const Double_t *zbins);
53 
54  void DoFillProfileProjection(TProfile2D * p2, const TAxis & a1, const TAxis & a2, const TAxis & a3, Int_t bin1, Int_t bin2, Int_t bin3, Int_t inBin, Bool_t useWeights) const;
55 
56  virtual Int_t BufferFill(Double_t, Double_t) {return -2;} //may not use
57  virtual Int_t BufferFill(Double_t, Double_t, Double_t) {return -2;} //may not use
58  Int_t Fill(Double_t); //MayNotUse
59  Int_t Fill(Double_t,Double_t) {return Fill(0.);} //MayNotUse
60  Int_t Fill(const char*, Double_t) {return Fill(0);} //MayNotUse
61  Int_t Fill(Double_t,const char*,Double_t) {return Fill(0);} //MayNotUse
62  Int_t Fill(const char*,Double_t,Double_t) {return Fill(0);} //MayNotUse
63  Int_t Fill(const char*,const char*,Double_t) {return Fill(0);} //MayNotUse
64 
65  virtual Double_t Interpolate(Double_t x, Double_t y) const; // May not use
66  virtual Double_t Interpolate(Double_t x) const; // MayNotUse
67 
68 private:
69 
70  TH3(const TH3&);
71  TH3& operator=(const TH3&); // Not implemented
72 
73  using TH1::Integral;
75 
76 public:
77  virtual ~TH3();
78  virtual Int_t BufferEmpty(Int_t action=0);
79  virtual void Copy(TObject &hnew) const;
80  virtual Int_t Fill(Double_t x, Double_t y, Double_t z);
82 
83  virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w);
84  virtual Int_t Fill(const char *namex, Double_t y, const char *namez, Double_t w);
85  virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w);
86  virtual Int_t Fill(Double_t x, const char *namey, const char *namez, Double_t w);
87  virtual Int_t Fill(Double_t x, const char *namey, Double_t z, Double_t w);
88  virtual Int_t Fill(Double_t x, Double_t y, const char *namez, Double_t w);
89 
90  virtual void FillRandom(const char *fname, Int_t ntimes=5000);
91  virtual void FillRandom(TH1 *h, Int_t ntimes=5000);
92  virtual void FitSlicesZ(TF1 *f1=0,Int_t binminx=1, Int_t binmaxx=0,Int_t binminy=1, Int_t binmaxy=0,
93  Int_t cut=0 ,Option_t *option="QNR"); // *MENU*
94  virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const;
95  virtual Double_t GetBinContent(Int_t bin) const { return TH1::GetBinContent(bin); }
96  virtual Double_t GetBinContent(Int_t bin, Int_t) const { return TH1::GetBinContent(bin); }
97  virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const { return TH1::GetBinContent( GetBin(binx, biny, binz) ); }
98  using TH1::GetBinErrorLow;
99  using TH1::GetBinErrorUp;
100  virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz) { return TH1::GetBinErrorLow( GetBin(binx, biny, binz) ); }
101  virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz) { return TH1::GetBinErrorUp( GetBin(binx, biny, binz) ); }
102  virtual Double_t GetBinWithContent3(Double_t c, Int_t &binx, Int_t &biny, Int_t &binz, Int_t firstx=0, Int_t lastx=0,Int_t firsty=0, Int_t lasty=0, Int_t firstz=0, Int_t lastz=0, Double_t maxdiff=0) const;
103  virtual Double_t GetCorrelationFactor(Int_t axis1=1,Int_t axis2=2) const;
104  virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
105  virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &z);
106  virtual void GetStats(Double_t *stats) const;
107  virtual Double_t Integral(Option_t *option="") const;
108  virtual Double_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Option_t *option="") const;
109  virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Double_t & err, Option_t *option="") const;
110  virtual Double_t Interpolate(Double_t x, Double_t y, Double_t z) const;
111  virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const;
112  virtual TH1D *ProjectionX(const char *name="_px", Int_t iymin=0, Int_t iymax=-1, Int_t izmin=0,
113  Int_t izmax=-1, Option_t *option="") const; // *MENU*
114  virtual TH1D *ProjectionY(const char *name="_py", Int_t ixmin=0, Int_t ixmax=-1, Int_t izmin=0,
115  Int_t izmax=-1, Option_t *option="") const; // *MENU*
116  virtual TH1D *ProjectionZ(const char *name="_pz", Int_t ixmin=0, Int_t ixmax=-1, Int_t iymin=0,
117  Int_t iymax=-1, Option_t *option="") const; // *MENU*
118  virtual TH1 *Project3D(Option_t *option="x") const; // *MENU*
119  virtual TProfile2D *Project3DProfile(Option_t *option="xy") const; // *MENU*
120  virtual void PutStats(Double_t *stats);
121  virtual TH3 *RebinX(Int_t ngroup = 2, const char *newname = "");
122  virtual TH3 *RebinY(Int_t ngroup = 2, const char *newname = "");
123  virtual TH3 *RebinZ(Int_t ngroup = 2, const char *newname = "");
124  virtual TH3 *Rebin3D(Int_t nxgroup = 2, Int_t nygroup = 2, Int_t nzgroup = 2, const char *newname = "");
125  virtual void Reset(Option_t *option="");
126  virtual void SetBinContent(Int_t bin, Double_t content);
127  virtual void SetBinContent(Int_t bin, Int_t, Double_t content) { SetBinContent(bin, content); }
128  virtual void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) { SetBinContent(GetBin(binx, biny, binz), content); }
129  virtual void SetShowProjection(const char *option="xy",Int_t nbins=1); // *MENU*
130 
131 protected:
132 
133  virtual TH1D *DoProject1D(const char* name, const char * title, int imin1, int imax1, int imin2, int imax2,
134  const TAxis* projAxis, const TAxis * axis1, const TAxis * axis2, Option_t * option) const;
135  virtual TH1D *DoProject1D(const char *name, const char *title, const TAxis *projAxis, const TAxis *axis1,
136  const TAxis *axis2, bool computeErrors, bool originalRange, bool useUF, bool useOF) const;
137  virtual TH2D *DoProject2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
138  bool computeErrors, bool originalRange,
139  bool useUF, bool useOF) const;
140  virtual TProfile2D *DoProjectProfile2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
141  bool originalRange, bool useUF, bool useOF) const;
142 
143  // these functions are need to be used inside TProfile3D::DoProjectProfile2D
144  static TH1D *DoProject1D(const TH3 & h, const char* name, const char * title, const TAxis* projX,
145  bool computeErrors, bool originalRange, bool useUF, bool useOF) {
146  return h.DoProject1D(name, title, projX, nullptr, nullptr, computeErrors, originalRange, useUF, useOF);
147  }
148  static TH2D *DoProject2D(const TH3 & h, const char* name, const char * title, const TAxis* projX, const TAxis* projY,
149  bool computeErrors, bool originalRange, bool useUF, bool useOF) {
150  return h.DoProject2D(name, title, projX,projY, computeErrors, originalRange, useUF, useOF);
151  }
152 
153  ClassDef(TH3,6) //3-Dim histogram base class
154 };
155 
156 //________________________________________________________________________
157 
158 class TH3C : public TH3, public TArrayC {
159 public:
160  TH3C();
161  TH3C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
162  ,Int_t nbinsy,Double_t ylow,Double_t yup
163  ,Int_t nbinsz,Double_t zlow,Double_t zup);
164  TH3C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
165  ,Int_t nbinsy,const Float_t *ybins
166  ,Int_t nbinsz,const Float_t *zbins);
167  TH3C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
168  ,Int_t nbinsy,const Double_t *ybins
169  ,Int_t nbinsz,const Double_t *zbins);
170  TH3C(const TH3C &h3c);
171  virtual ~TH3C();
172  virtual void AddBinContent(Int_t bin);
173  virtual void AddBinContent(Int_t bin, Double_t w);
174  virtual void Copy(TObject &hnew) const;
175  virtual void Reset(Option_t *option="");
176  virtual void SetBinsLength(Int_t n=-1);
177  TH3C& operator=(const TH3C &h1);
178  friend TH3C operator*(Float_t c1, TH3C &h1);
179  friend TH3C operator*(TH3C &h1, Float_t c1) {return operator*(c1,h1);}
180  friend TH3C operator+(TH3C &h1, TH3C &h2);
181  friend TH3C operator-(TH3C &h1, TH3C &h2);
182  friend TH3C operator*(TH3C &h1, TH3C &h2);
183  friend TH3C operator/(TH3C &h1, TH3C &h2);
184 
185 protected:
186  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
187  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Char_t (content); }
188 
189  ClassDef(TH3C,4) //3-Dim histograms (one char per channel)
190 };
191 
192 //________________________________________________________________________
193 
194 class TH3S : public TH3, public TArrayS {
195 public:
196  TH3S();
197  TH3S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
198  ,Int_t nbinsy,Double_t ylow,Double_t yup
199  ,Int_t nbinsz,Double_t zlow,Double_t zup);
200  TH3S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
201  ,Int_t nbinsy,const Float_t *ybins
202  ,Int_t nbinsz,const Float_t *zbins);
203  TH3S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
204  ,Int_t nbinsy,const Double_t *ybins
205  ,Int_t nbinsz,const Double_t *zbins);
206  TH3S(const TH3S &h3s);
207  virtual ~TH3S();
208  virtual void AddBinContent(Int_t bin);
209  virtual void AddBinContent(Int_t bin, Double_t w);
210  virtual void Copy(TObject &hnew) const;
211  virtual void Reset(Option_t *option="");
212  virtual void SetBinsLength(Int_t n=-1);
213  TH3S& operator=(const TH3S &h1);
214  friend TH3S operator*(Float_t c1, TH3S &h1);
215  friend TH3S operator*(TH3S &h1, Float_t c1) {return operator*(c1,h1);}
216  friend TH3S operator+(TH3S &h1, TH3S &h2);
217  friend TH3S operator-(TH3S &h1, TH3S &h2);
218  friend TH3S operator*(TH3S &h1, TH3S &h2);
219  friend TH3S operator/(TH3S &h1, TH3S &h2);
220 
221 protected:
222  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
223  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Short_t (content); }
224 
225  ClassDef(TH3S,4) //3-Dim histograms (one short per channel)
226 };
227 
228 //________________________________________________________________________
229 
230 class TH3I : public TH3, public TArrayI {
231 public:
232  TH3I();
233  TH3I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
234  ,Int_t nbinsy,Double_t ylow,Double_t yup
235  ,Int_t nbinsz,Double_t zlow,Double_t zup);
236  TH3I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
237  ,Int_t nbinsy,const Float_t *ybins
238  ,Int_t nbinsz,const Float_t *zbins);
239  TH3I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
240  ,Int_t nbinsy,const Double_t *ybins
241  ,Int_t nbinsz,const Double_t *zbins);
242  TH3I(const TH3I &h3i);
243  virtual ~TH3I();
244  virtual void AddBinContent(Int_t bin);
245  virtual void AddBinContent(Int_t bin, Double_t w);
246  virtual void Copy(TObject &hnew) const;
247  virtual void Reset(Option_t *option="");
248  virtual void SetBinsLength(Int_t n=-1);
249  TH3I& operator=(const TH3I &h1);
250  friend TH3I operator*(Float_t c1, TH3I &h1);
251  friend TH3I operator*(TH3I &h1, Float_t c1) {return operator*(c1,h1);}
252  friend TH3I operator+(TH3I &h1, TH3I &h2);
253  friend TH3I operator-(TH3I &h1, TH3I &h2);
254  friend TH3I operator*(TH3I &h1, TH3I &h2);
255  friend TH3I operator/(TH3I &h1, TH3I &h2);
256 
257 protected:
258  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
259  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Int_t (content); }
260 
261  ClassDef(TH3I,4) //3-Dim histograms (one 32 bits integer per channel)
262 };
263 
264 
265 //________________________________________________________________________
266 
267 class TH3F : public TH3, public TArrayF {
268 public:
269  TH3F();
270  TH3F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
271  ,Int_t nbinsy,Double_t ylow,Double_t yup
272  ,Int_t nbinsz,Double_t zlow,Double_t zup);
273  TH3F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
274  ,Int_t nbinsy,const Float_t *ybins
275  ,Int_t nbinsz,const Float_t *zbins);
276  TH3F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
277  ,Int_t nbinsy,const Double_t *ybins
278  ,Int_t nbinsz,const Double_t *zbins);
279  TH3F(const TH3F &h3f);
280  virtual ~TH3F();
281  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
282  virtual void AddBinContent(Int_t bin, Double_t w)
283  {fArray[bin] += Float_t (w);}
284  virtual void Copy(TObject &hnew) const;
285  virtual void Reset(Option_t *option="");
286  virtual void SetBinsLength(Int_t n=-1);
287  TH3F& operator=(const TH3F &h1);
288  friend TH3F operator*(Float_t c1, TH3F &h1);
289  friend TH3F operator*(TH3F &h1, Float_t c1) {return operator*(c1,h1);}
290  friend TH3F operator+(TH3F &h1, TH3F &h2);
291  friend TH3F operator-(TH3F &h1, TH3F &h2);
292  friend TH3F operator*(TH3F &h1, TH3F &h2);
293  friend TH3F operator/(TH3F &h1, TH3F &h2);
294 
295 protected:
296  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
297  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Float_t (content); }
298 
299  ClassDef(TH3F,4) //3-Dim histograms (one float per channel)
300 };
301 
302 //________________________________________________________________________
303 
304 class TH3D : public TH3, public TArrayD {
305 public:
306  TH3D();
307  TH3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
308  ,Int_t nbinsy,Double_t ylow,Double_t yup
309  ,Int_t nbinsz,Double_t zlow,Double_t zup);
310  TH3D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
311  ,Int_t nbinsy,const Float_t *ybins
312  ,Int_t nbinsz,const Float_t *zbins);
313  TH3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
314  ,Int_t nbinsy,const Double_t *ybins
315  ,Int_t nbinsz,const Double_t *zbins);
316  TH3D(const TH3D &h3d);
317  virtual ~TH3D();
318  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
319  virtual void AddBinContent(Int_t bin, Double_t w)
320  {fArray[bin] += Double_t (w);}
321  virtual void Copy(TObject &hnew) const;
322  virtual void Reset(Option_t *option="");
323  virtual void SetBinsLength(Int_t n=-1);
324  TH3D& operator=(const TH3D &h1);
325  friend TH3D operator*(Float_t c1, TH3D &h1);
326  friend TH3D operator*(TH3D &h1, Float_t c1) {return operator*(c1,h1);}
327  friend TH3D operator+(TH3D &h1, TH3D &h2);
328  friend TH3D operator-(TH3D &h1, TH3D &h2);
329  friend TH3D operator*(TH3D &h1, TH3D &h2);
330  friend TH3D operator/(TH3D &h1, TH3D &h2);
331 
332 protected:
333  virtual Double_t RetrieveBinContent(Int_t bin) const { return fArray[bin]; }
334  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = content; }
335 
336  ClassDef(TH3D,4) //3-Dim histograms (one double per channel)
337 };
338 
339 #endif
virtual Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH3.h:56
Float_t * fArray
Definition: TArrayF.h:30
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:7477
TH3()
Default constructor.
Definition: TH3.cxx:64
friend TH3D operator*(Float_t c1, TH3D &h1)
Operator *.
Definition: TH3.cxx:4343
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:4057
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: TH3.h:222
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3668
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3647
virtual TH1 * Project3D(Option_t *option="x") const
Project a 3-d histogram into 1 or 2-d histograms depending on the option parameter, which may contain a combination of the characters x,y,z,e.
Definition: TH3.cxx:2226
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
Definition: TH3.cxx:2690
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:318
friend TH3F operator+(TH3F &h1, TH3F &h2)
Operator +.
Definition: TH3.cxx:4144
float Float_t
Definition: RtypesCore.h:55
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:669
friend TH3F operator/(TH3F &h1, TH3F &h2)
Operator /.
Definition: TH3.cxx:4180
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:267
virtual TProfile2D * DoProjectProfile2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool originalRange, bool useUF, bool useOF) const
internal method to project to a 2D Profile called from TH3::Project3DProfile
Definition: TH3.cxx:2384
Short_t * fArray
Definition: TArrayS.h:30
const char Option_t
Definition: RtypesCore.h:64
friend TH3I operator+(TH3I &h1, TH3I &h2)
Operator +.
Definition: TH3.cxx:3933
return c1
Definition: legend1.C:41
void Reset()
Definition: TArrayD.h:47
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH3.cxx:3252
virtual TH3 * Rebin3D(Int_t nxgroup=2, Int_t nygroup=2, Int_t nzgroup=2, const char *newname="")
Rebin this histogram grouping nxgroup/nygroup/nzgroup bins along the xaxis/yaxis/zaxis together...
Definition: TH3.cxx:2741
friend TH3F operator*(TH3F &h1, Float_t c1)
Definition: TH3.h:289
virtual TH1D * ProjectionZ(const char *name="_pz", Int_t ixmin=0, Int_t ixmax=-1, Int_t iymin=0, Int_t iymax=-1, Option_t *option="") const
Project a 3-D histogram into a 1-D histogram along Z.
Definition: TH3.cxx:1634
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4907
TH3F()
Constructor.
Definition: TH3.cxx:3989
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
Definition: TH3.cxx:949
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7450
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:100
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
TH3S & operator=(const TH3S &h1)
Operator =.
Definition: TH3.cxx:3712
friend TH3D operator-(TH3D &h1, TH3D &h2)
Operator -.
Definition: TH3.cxx:4367
static TH2D * DoProject2D(const TH3 &h, const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool computeErrors, bool originalRange, bool useUF, bool useOF)
Definition: TH3.h:148
friend TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
Definition: TH3.cxx:3502
virtual ~TH3D()
Destructor.
Definition: TH3.cxx:4210
Double_t fTsumwy
Definition: TH3.h:34
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:281
Array of floats (32 bits per element).
Definition: TArrayF.h:27
int Int_t
Definition: RtypesCore.h:43
friend TH3F operator*(Float_t c1, TH3F &h1)
Operator *.
Definition: TH3.cxx:4132
Double_t fTsumwz
Definition: TH3.h:37
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH3.h:95
friend TH3I operator/(TH3I &h1, TH3I &h2)
Operator /.
Definition: TH3.cxx:3969
void Reset()
Definition: TArrayF.h:47
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: TH3.h:258
virtual TProfile2D * Project3DProfile(Option_t *option="xy") const
Project a 3-d histogram into a 2-d profile histograms depending on the option parameter option may co...
Definition: TH3.cxx:2590
Double_t fTsumwyz
Definition: TH3.h:40
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const
Definition: TH3.h:97
static TH1D * DoProject1D(const TH3 &h, const char *name, const char *title, const TAxis *projX, bool computeErrors, bool originalRange, bool useUF, bool useOF)
Definition: TH3.h:144
friend TH3F operator-(TH3F &h1, TH3F &h2)
Operator -.
Definition: TH3.cxx:4156
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH3.cxx:1041
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
accumulate arguments in buffer.
Definition: TH3.cxx:258
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: TH3.h:296
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH3.cxx:1212
TH3D()
Constructor.
Definition: TH3.cxx:4200
virtual TH2D * DoProject2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool computeErrors, bool originalRange, bool useUF, bool useOF) const
internal method performing the projection to a 2D histogram called from TH3::Project3D ...
Definition: TH3.cxx:1924
TH3S()
Constructor.
Definition: TH3.cxx:3558
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:322
Double_t fTsumwxz
Definition: TH3.h:39
Int_t Fill(const char *, const char *, Double_t)
Definition: TH3.h:63
Int_t Fill(Double_t, const char *, Double_t)
Definition: TH3.h:61
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: TH3.cxx:1354
friend TH3D operator+(TH3D &h1, TH3D &h2)
Operator +.
Definition: TH3.cxx:4355
virtual TH1D * ProjectionY(const char *name="_py", Int_t ixmin=0, Int_t ixmax=-1, Int_t izmin=0, Int_t izmax=-1, Option_t *option="") const
Project a 3-D histogram into a 1-D histogram along Y.
Definition: TH3.cxx:1602
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition: TH3.cxx:2700
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH3.cxx:1023
friend TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
Definition: TH3.cxx:3490
Int_t Fill(const char *, Double_t)
Increment bin with namex with a weight w.
Definition: TH3.h:60
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3365
Double_t * fArray
Definition: TArrayD.h:30
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3858
TH1F * h1
Definition: legend1.C:5
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: TH3.cxx:1135
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: TH3.h:223
The 3-D histogram classes derived from the 1-D histogram classes.
Definition: TH3.h:31
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3900
3-D histogram with an int per channel (see TH1 documentation)}
Definition: TH3.h:230
virtual ~TH3I()
Destructor.
Definition: TH3.cxx:3800
virtual ~TH3S()
Destructor.
Definition: TH3.cxx:3568
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [binx1,binx2],[biny1,biny2],[binz1,binz2] for a 3-D histogra...
Definition: TH3.cxx:1243
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:101
void Reset()
Definition: TArrayS.h:47
3-D histogram with a short per channel (see TH1 documentation)
Definition: TH3.h:194
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: TH3.h:186
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH3.cxx:3395
TH3C & operator=(const TH3C &h1)
Operator =.
Definition: TH3.cxx:3480
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: TH3.h:333
friend TH3S operator-(TH3S &h1, TH3S &h2)
Operator -.
Definition: TH3.cxx:3746
TH3C()
Constructor.
Definition: TH3.cxx:3297
Class to manage histogram axis.
Definition: TAxis.h:30
friend TH3S operator+(TH3S &h1, TH3S &h2)
Operator +.
Definition: TH3.cxx:3734
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:304
Array of shorts (16 bits per element).
Definition: TArrayS.h:27
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: TH3.h:187
virtual void FitSlicesZ(TF1 *f1=0, Int_t binminx=1, Int_t binmaxx=0, Int_t binminy=1, Int_t binmaxy=0, Int_t cut=0, Option_t *option="QNR")
Project slices along Z in case of a 3-D histogram, then fit each slice with function f1 and make a 2-...
Definition: TH3.cxx:810
Double_t fTsumwy2
Definition: TH3.h:35
virtual TH1D * DoProject1D(const char *name, const char *title, int imin1, int imax1, int imin2, int imax2, const TAxis *projAxis, const TAxis *axis1, const TAxis *axis2, Option_t *option) const
internal method performing the projection to 1D histogram called from TH3::Project3D ...
Definition: TH3.cxx:1651
virtual Double_t Interpolate(Double_t x, Double_t y) const
Not yet implemented.
Definition: TH3.cxx:1263
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: TH3.h:334
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition: TH3.cxx:2673
short Short_t
Definition: RtypesCore.h:37
virtual void SetShowProjection(const char *option="xy", Int_t nbins=1)
When the mouse is moved in a pad containing a 3-d view of this histogram a second canvas shows a proj...
Definition: TH3.cxx:3436
friend TH3D operator*(TH3D &h1, Float_t c1)
Definition: TH3.h:326
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH3.cxx:287
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH3.cxx:163
virtual TH1D * ProjectionX(const char *name="_px", Int_t iymin=0, Int_t iymax=-1, Int_t izmin=0, Int_t izmax=-1, Option_t *option="") const
Project a 3-D histogram into a 1-D histogram along X.
Definition: TH3.cxx:1569
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:614
friend TH3I operator-(TH3I &h1, TH3I &h2)
Operator _.
Definition: TH3.cxx:3945
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: TH3.h:297
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:282
#define h(i)
Definition: RSha256.hxx:106
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH3.cxx:3233
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:319
friend TH3S operator/(TH3S &h1, TH3S &h2)
Operator /.
Definition: TH3.cxx:3770
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH3.h:96
TH3 & operator=(const TH3 &)
Double_t fTsumwz2
Definition: TH3.h:38
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3386
friend TH3D operator/(TH3D &h1, TH3D &h2)
Operator /.
Definition: TH3.cxx:4391
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8535
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: TH3.h:259
double Double_t
Definition: RtypesCore.h:57
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH3.cxx:184
Int_t * fArray
Definition: TArrayI.h:30
TH3D & operator=(const TH3D &h1)
Operator =.
Definition: TH3.cxx:4333
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:4289
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3626
void DoFillProfileProjection(TProfile2D *p2, const TAxis &a1, const TAxis &a2, const TAxis &a3, Int_t bin1, Int_t bin2, Int_t bin3, Int_t inBin, Bool_t useWeights) const
internal function to fill the bins of the projected profile 2D histogram called from DoProjectProfile...
Definition: TH3.cxx:2358
friend TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
Definition: TH3.cxx:3514
Double_t y[n]
Definition: legend1.C:17
The TH1 histogram class.
Definition: TH1.h:56
3-D histogram with a byte per channel (see TH1 documentation)
Definition: TH3.h:158
Profile2D histograms are used to display the mean value of Z and its error for each cell in X...
Definition: TProfile2D.h:27
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
friend TH3I operator*(Float_t c1, TH3I &h1)
Operator *.
Definition: TH3.cxx:3921
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:4268
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:4078
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:31
friend TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
Definition: TH3.cxx:3538
Double_t fTsumwxy
Definition: TH3.h:36
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3879
virtual ~TH3C()
Destructor.
Definition: TH3.cxx:3307
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition: TH3.cxx:2710
virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &z)
Return 3 random numbers along axis x , y and z distributed according the cell-contents of a 3-dim his...
Definition: TH3.cxx:1088
Int_t Fill(const char *, Double_t, Double_t)
Definition: TH3.h:62
virtual void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content)
Definition: TH3.h:128
friend TH3C operator*(TH3C &h1, Float_t c1)
Definition: TH3.h:179
1-Dim function class
Definition: TF1.h:210
Char_t * fArray
Definition: TArrayC.h:30
virtual ~TH3F()
Destructor.
Definition: TH3.cxx:3999
virtual void SetBinContent(Int_t bin, Int_t, Double_t content)
Definition: TH3.h:127
TF1 * f1
Definition: legend1.C:11
virtual Double_t GetBinWithContent3(Double_t c, Int_t &binx, Int_t &biny, Int_t &binz, Int_t firstx=0, Int_t lastx=0, Int_t firsty=0, Int_t lasty=0, Int_t firstz=0, Int_t lastz=0, Double_t maxdiff=0) const
Compute first cell (binx,biny,binz) in the range [firstx,lastx](firsty,lasty][firstz,lastz] for which diff = abs(cell_content-c) <= maxdiff In case several cells in the specified range with diff=0 are found the first cell found is returned in binx,biny,binz.
Definition: TH3.cxx:983
void Reset()
Definition: TArrayI.h:47
friend TH3I operator*(TH3I &h1, Float_t c1)
Definition: TH3.h:251
virtual Int_t BufferFill(Double_t, Double_t, Double_t)
Definition: TH3.h:57
#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:8566
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3407
virtual ~TH3()
Destructor.
Definition: TH3.cxx:155
TH3F & operator=(const TH3F &h1)
Operator =.
Definition: TH3.cxx:4122
TH3I()
Constructor.
Definition: TH3.cxx:3790
friend TH3S operator*(Float_t c1, TH3S &h1)
Operator *.
Definition: TH3.cxx:3722
Int_t Fill(Double_t, Double_t)
Increment bin with abscissa X with a weight w.
Definition: TH3.h:59
const Int_t n
Definition: legend1.C:16
char name[80]
Definition: TGX11.cxx:109
friend TH3S operator*(TH3S &h1, Float_t c1)
Definition: TH3.h:215
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:292
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:27
TH3I & operator=(const TH3I &h1)
Operator =.
Definition: TH3.cxx:3911