Logo ROOT  
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);
81  virtual Int_t Fill(Double_t x, Double_t y, Double_t z, Double_t w);
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(const char *namex, Double_t y, Double_t z, Double_t w);
88  virtual Int_t Fill(Double_t x, const char *namey, Double_t z, Double_t w);
89  virtual Int_t Fill(Double_t x, Double_t y, const char *namez, Double_t w);
90 
91  virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom * rng = nullptr);
92  virtual void FillRandom(TH1 *h, Int_t ntimes=5000, TRandom * rng = nullptr);
93  virtual void FitSlicesZ(TF1 *f1=0,Int_t binminx=1, Int_t binmaxx=0,Int_t binminy=1, Int_t binmaxy=0,
94  Int_t cut=0 ,Option_t *option="QNR"); // *MENU*
95  virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const;
96  virtual Double_t GetBinContent(Int_t bin) const { return TH1::GetBinContent(bin); }
97  virtual Double_t GetBinContent(Int_t bin, Int_t) const { return TH1::GetBinContent(bin); }
98  virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const { return TH1::GetBinContent( GetBin(binx, biny, binz) ); }
99  using TH1::GetBinErrorLow;
100  using TH1::GetBinErrorUp;
101  virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz) { return TH1::GetBinErrorLow( GetBin(binx, biny, binz) ); }
102  virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz) { return TH1::GetBinErrorUp( GetBin(binx, biny, binz) ); }
103  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;
104  virtual Double_t GetCorrelationFactor(Int_t axis1=1,Int_t axis2=2) const;
105  virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
106  virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &, TRandom * rng = nullptr);
107  virtual void GetStats(Double_t *stats) const;
108  virtual Double_t Integral(Option_t *option="") const;
109  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;
110  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;
111  virtual Double_t Interpolate(Double_t x, Double_t y, Double_t z) const;
112  virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const;
113  virtual TH1D *ProjectionX(const char *name="_px", Int_t iymin=0, Int_t iymax=-1, Int_t izmin=0,
114  Int_t izmax=-1, Option_t *option="") const; // *MENU*
115  virtual TH1D *ProjectionY(const char *name="_py", Int_t ixmin=0, Int_t ixmax=-1, Int_t izmin=0,
116  Int_t izmax=-1, Option_t *option="") const; // *MENU*
117  virtual TH1D *ProjectionZ(const char *name="_pz", Int_t ixmin=0, Int_t ixmax=-1, Int_t iymin=0,
118  Int_t iymax=-1, Option_t *option="") const; // *MENU*
119  virtual TH1 *Project3D(Option_t *option="x") const; // *MENU*
120  virtual TProfile2D *Project3DProfile(Option_t *option="xy") const; // *MENU*
121  virtual void PutStats(Double_t *stats);
122  virtual TH3 *RebinX(Int_t ngroup = 2, const char *newname = "");
123  virtual TH3 *RebinY(Int_t ngroup = 2, const char *newname = "");
124  virtual TH3 *RebinZ(Int_t ngroup = 2, const char *newname = "");
125  virtual TH3 *Rebin3D(Int_t nxgroup = 2, Int_t nygroup = 2, Int_t nzgroup = 2, const char *newname = "");
126  virtual void Reset(Option_t *option="");
127  virtual void SetBinContent(Int_t bin, Double_t content);
128  virtual void SetBinContent(Int_t bin, Int_t, Double_t content) { SetBinContent(bin, content); }
129  virtual void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) { SetBinContent(GetBin(binx, biny, binz), content); }
130  virtual void SetShowProjection(const char *option="xy",Int_t nbins=1); // *MENU*
131 
132 protected:
133 
134  virtual TH1D *DoProject1D(const char* name, const char * title, int imin1, int imax1, int imin2, int imax2,
135  const TAxis* projAxis, const TAxis * axis1, const TAxis * axis2, Option_t * option) const;
136  virtual TH1D *DoProject1D(const char *name, const char *title, const TAxis *projAxis, const TAxis *axis1,
137  const TAxis *axis2, bool computeErrors, bool originalRange, bool useUF, bool useOF) const;
138  virtual TH2D *DoProject2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
139  bool computeErrors, bool originalRange,
140  bool useUF, bool useOF) const;
141  virtual TProfile2D *DoProjectProfile2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
142  bool originalRange, bool useUF, bool useOF) const;
143 
144  // these functions are need to be used inside TProfile3D::DoProjectProfile2D
145  static TH1D *DoProject1D(const TH3 & h, const char* name, const char * title, const TAxis* projX,
146  bool computeErrors, bool originalRange, bool useUF, bool useOF) {
147  return h.DoProject1D(name, title, projX, nullptr, nullptr, computeErrors, originalRange, useUF, useOF);
148  }
149  static TH2D *DoProject2D(const TH3 & h, const char* name, const char * title, const TAxis* projX, const TAxis* projY,
150  bool computeErrors, bool originalRange, bool useUF, bool useOF) {
151  return h.DoProject2D(name, title, projX,projY, computeErrors, originalRange, useUF, useOF);
152  }
153 
154  ClassDef(TH3,6) //3-Dim histogram base class
155 };
156 
157 //________________________________________________________________________
158 
159 class TH3C : public TH3, public TArrayC {
160 public:
161  TH3C();
162  TH3C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
163  ,Int_t nbinsy,Double_t ylow,Double_t yup
164  ,Int_t nbinsz,Double_t zlow,Double_t zup);
165  TH3C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
166  ,Int_t nbinsy,const Float_t *ybins
167  ,Int_t nbinsz,const Float_t *zbins);
168  TH3C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
169  ,Int_t nbinsy,const Double_t *ybins
170  ,Int_t nbinsz,const Double_t *zbins);
171  TH3C(const TH3C &h3c);
172  virtual ~TH3C();
173  virtual void AddBinContent(Int_t bin);
174  virtual void AddBinContent(Int_t bin, Double_t w);
175  virtual void Copy(TObject &hnew) const;
176  virtual void Reset(Option_t *option="");
177  virtual void SetBinsLength(Int_t n=-1);
178  TH3C& operator=(const TH3C &h1);
179  friend TH3C operator*(Float_t c1, TH3C &h1);
180  friend TH3C operator*(TH3C &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH3C operator/(TH3C &h1, TH3C &h2);
185 
186 protected:
187  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
188  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Char_t (content); }
189 
190  ClassDef(TH3C,4) //3-Dim histograms (one char per channel)
191 };
192 
193 //________________________________________________________________________
194 
195 class TH3S : public TH3, public TArrayS {
196 public:
197  TH3S();
198  TH3S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
199  ,Int_t nbinsy,Double_t ylow,Double_t yup
200  ,Int_t nbinsz,Double_t zlow,Double_t zup);
201  TH3S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
202  ,Int_t nbinsy,const Float_t *ybins
203  ,Int_t nbinsz,const Float_t *zbins);
204  TH3S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
205  ,Int_t nbinsy,const Double_t *ybins
206  ,Int_t nbinsz,const Double_t *zbins);
207  TH3S(const TH3S &h3s);
208  virtual ~TH3S();
209  virtual void AddBinContent(Int_t bin);
210  virtual void AddBinContent(Int_t bin, Double_t w);
211  virtual void Copy(TObject &hnew) const;
212  virtual void Reset(Option_t *option="");
213  virtual void SetBinsLength(Int_t n=-1);
214  TH3S& operator=(const TH3S &h1);
215  friend TH3S operator*(Float_t c1, TH3S &h1);
216  friend TH3S operator*(TH3S &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH3S operator/(TH3S &h1, TH3S &h2);
221 
222 protected:
223  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
224  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Short_t (content); }
225 
226  ClassDef(TH3S,4) //3-Dim histograms (one short per channel)
227 };
228 
229 //________________________________________________________________________
230 
231 class TH3I : public TH3, public TArrayI {
232 public:
233  TH3I();
234  TH3I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
235  ,Int_t nbinsy,Double_t ylow,Double_t yup
236  ,Int_t nbinsz,Double_t zlow,Double_t zup);
237  TH3I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
238  ,Int_t nbinsy,const Float_t *ybins
239  ,Int_t nbinsz,const Float_t *zbins);
240  TH3I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
241  ,Int_t nbinsy,const Double_t *ybins
242  ,Int_t nbinsz,const Double_t *zbins);
243  TH3I(const TH3I &h3i);
244  virtual ~TH3I();
245  virtual void AddBinContent(Int_t bin);
246  virtual void AddBinContent(Int_t bin, Double_t w);
247  virtual void Copy(TObject &hnew) const;
248  virtual void Reset(Option_t *option="");
249  virtual void SetBinsLength(Int_t n=-1);
250  TH3I& operator=(const TH3I &h1);
251  friend TH3I operator*(Float_t c1, TH3I &h1);
252  friend TH3I operator*(TH3I &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH3I operator/(TH3I &h1, TH3I &h2);
257 
258 protected:
259  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
260  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Int_t (content); }
261 
262  ClassDef(TH3I,4) //3-Dim histograms (one 32 bits integer per channel)
263 };
264 
265 
266 //________________________________________________________________________
267 
268 class TH3F : public TH3, public TArrayF {
269 public:
270  TH3F();
271  TH3F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
272  ,Int_t nbinsy,Double_t ylow,Double_t yup
273  ,Int_t nbinsz,Double_t zlow,Double_t zup);
274  TH3F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
275  ,Int_t nbinsy,const Float_t *ybins
276  ,Int_t nbinsz,const Float_t *zbins);
277  TH3F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
278  ,Int_t nbinsy,const Double_t *ybins
279  ,Int_t nbinsz,const Double_t *zbins);
280  TH3F(const TH3F &h3f);
281  virtual ~TH3F();
282  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
283  virtual void AddBinContent(Int_t bin, Double_t w)
284  {fArray[bin] += Float_t (w);}
285  virtual void Copy(TObject &hnew) const;
286  virtual void Reset(Option_t *option="");
287  virtual void SetBinsLength(Int_t n=-1);
288  TH3F& operator=(const TH3F &h1);
289  friend TH3F operator*(Float_t c1, TH3F &h1);
290  friend TH3F operator*(TH3F &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH3F operator/(TH3F &h1, TH3F &h2);
295 
296 protected:
297  virtual Double_t RetrieveBinContent(Int_t bin) const { return Double_t (fArray[bin]); }
298  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = Float_t (content); }
299 
300  ClassDef(TH3F,4) //3-Dim histograms (one float per channel)
301 };
302 
303 //________________________________________________________________________
304 
305 class TH3D : public TH3, public TArrayD {
306 public:
307  TH3D();
308  TH3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
309  ,Int_t nbinsy,Double_t ylow,Double_t yup
310  ,Int_t nbinsz,Double_t zlow,Double_t zup);
311  TH3D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
312  ,Int_t nbinsy,const Float_t *ybins
313  ,Int_t nbinsz,const Float_t *zbins);
314  TH3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
315  ,Int_t nbinsy,const Double_t *ybins
316  ,Int_t nbinsz,const Double_t *zbins);
317  TH3D(const TH3D &h3d);
318  virtual ~TH3D();
319  virtual void AddBinContent(Int_t bin) {++fArray[bin];}
320  virtual void AddBinContent(Int_t bin, Double_t w)
321  {fArray[bin] += Double_t (w);}
322  virtual void Copy(TObject &hnew) const;
323  virtual void Reset(Option_t *option="");
324  virtual void SetBinsLength(Int_t n=-1);
325  TH3D& operator=(const TH3D &h1);
326  friend TH3D operator*(Float_t c1, TH3D &h1);
327  friend TH3D operator*(TH3D &h1, Float_t c1) {return operator*(c1,h1);}
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  friend TH3D operator/(TH3D &h1, TH3D &h2);
332 
333 protected:
334  virtual Double_t RetrieveBinContent(Int_t bin) const { return fArray[bin]; }
335  virtual void UpdateBinContent(Int_t bin, Double_t content) { fArray[bin] = content; }
336 
337  ClassDef(TH3D,4) //3-Dim histograms (one double per channel)
338 };
339 
340 #endif
TH3F::AddBinContent
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:283
c
#define c(i)
Definition: RSha256.hxx:101
TH3::Project3D
virtual TH1 * Project3D(Option_t *option="x") const
Project a 3-d histogram into 1 or 2-d histograms depending on the option parameter,...
Definition: TH3.cxx:2314
TH3I::~TH3I
virtual ~TH3I()
Destructor.
Definition: TH3.cxx:3888
TH3::fTsumwy2
Double_t fTsumwy2
Definition: TH3.h:35
TH3C::operator*
friend TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
Definition: TH3.cxx:3578
n
const Int_t n
Definition: legend1.C:16
TH3C::AddBinContent
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3453
TAxis
Class to manage histogram axis.
Definition: TAxis.h:30
TH3I
3-D histogram with an int per channel (see TH1 documentation)}
Definition: TH3.h:231
TArrayS
Array of shorts (16 bits per element).
Definition: TArrayS.h:27
TH3::ProjectionZ
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:1722
TH3C::Reset
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH3.cxx:3483
TH3D::UpdateBinContent
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:335
TH3S
3-D histogram with a short per channel (see TH1 documentation)
Definition: TH3.h:195
TH1::GetBinErrorLow
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8845
TH3::DoProject2D
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:2012
TH3::Rebin3D
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:2829
Option_t
const char Option_t
Definition: RtypesCore.h:66
TH3::Integral
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7760
TH3::GetBin
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
Definition: TH3.cxx:1026
TH3::SetShowProjection
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:3524
TH3I::SetBinsLength
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3988
TH3D
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:305
TH3S::~TH3S
virtual ~TH3S()
Destructor.
Definition: TH3.cxx:3656
TH3S::operator/
friend TH3S operator/(TH3S &h1, TH3S &h2)
Operator /.
Definition: TH3.cxx:3858
TH3::ProjectionX
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:1657
TH3::GetBinContent
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH3.h:97
TH3D::AddBinContent
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:320
TH3I::operator*
friend TH3I operator*(Float_t c1, TH3I &h1)
Operator *.
Definition: TH3.cxx:4009
TH3D::operator/
friend TH3D operator/(TH3D &h1, TH3D &h2)
Operator /.
Definition: TH3.cxx:4479
TH3::GetCovariance
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH3.cxx:1118
TH3::FillRandom
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:742
TH3S::AddBinContent
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3714
TH3::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH3.h:96
TH3::GetBinWithContent3
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,...
Definition: TH3.cxx:1060
TH3C::TH3C
TH3C()
Constructor.
Definition: TH3.cxx:3385
TH3::Project3DProfile
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:2678
TH3::operator=
TH3 & operator=(const TH3 &)
TH3I::operator-
friend TH3I operator-(TH3I &h1, TH3I &h2)
Operator _.
Definition: TH3.cxx:4033
TH3C::~TH3C
virtual ~TH3C()
Destructor.
Definition: TH3.cxx:3395
TProfile2D
Profile2D histograms are used to display the mean value of Z and its error for each cell in X,...
Definition: TProfile2D.h:27
TH3::Reset
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH3.cxx:3321
TH1D
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:618
TH3::SetBinContent
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH3.cxx:3340
Float_t
float Float_t
Definition: RtypesCore.h:57
TH3D::Copy
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:4356
TH1::GetBinErrorUp
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition: TH1.cxx:8876
Int_t
int Int_t
Definition: RtypesCore.h:45
TH3::GetBinErrorLow
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:101
TArrayI::fArray
Int_t * fArray
Definition: TArrayI.h:30
TH3D::operator*
friend TH3D operator*(TH3D &h1, Float_t c1)
Definition: TH3.h:327
TH3::DoProject2D
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:149
TH3C::Copy
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3474
TArrayC::fArray
Char_t * fArray
Definition: TArrayC.h:30
TH3D::operator=
TH3D & operator=(const TH3D &h1)
Operator =.
Definition: TH3.cxx:4421
TH3::Copy
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH3.cxx:163
TH3D::SetBinsLength
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:4377
TArrayS::fArray
Short_t * fArray
Definition: TArrayS.h:30
x
Double_t x[n]
Definition: legend1.C:17
TH3C::operator/
friend TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
Definition: TH3.cxx:3626
TH3::RebinZ
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition: TH3.cxx:2798
TH3C::operator-
friend TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
Definition: TH3.cxx:3602
TH3::DoFillProfileProjection
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:2446
TH3I::Copy
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3967
TH3F::UpdateBinContent
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:298
TH3::PutStats
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition: TH3.cxx:2761
TH3::SetBinContent
virtual void SetBinContent(Int_t bin, Int_t, Double_t content)
Definition: TH3.h:128
TH3F::~TH3F
virtual ~TH3F()
Destructor.
Definition: TH3.cxx:4087
TH3S::operator*
friend TH3S operator*(TH3S &h1, Float_t c1)
Definition: TH3.h:216
TH3C
3-D histogram with a byte per channel (see TH1 documentation)
Definition: TH3.h:159
TH3I::operator*
friend TH3I operator*(TH3I &h1, Float_t c1)
Definition: TH3.h:252
TH3::DoProject1D
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:1739
TH3F::SetBinsLength
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:4166
TArrayF
Array of floats (32 bits per element).
Definition: TArrayF.h:27
TAtt3D
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
h1
TH1F * h1
Definition: legend1.C:5
TH3I::UpdateBinContent
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:260
bool
TH3F::operator=
TH3F & operator=(const TH3F &h1)
Operator =.
Definition: TH3.cxx:4210
TH3::fTsumwxy
Double_t fTsumwxy
Definition: TH3.h:36
TH3S::operator*
friend TH3S operator*(Float_t c1, TH3S &h1)
Operator *.
Definition: TH3.cxx:3810
TH3::SetBinContent
virtual void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content)
Definition: TH3.h:129
TH3C::operator*
friend TH3C operator*(TH3C &h1, Float_t c1)
Definition: TH3.h:180
TArrayI::Reset
void Reset()
Definition: TArrayI.h:47
TH1::IntegralAndError
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:7787
TH3::fTsumwxz
Double_t fTsumwxz
Definition: TH3.h:39
TH3::ProjectionY
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:1690
TH3D::AddBinContent
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:319
TH3S::SetBinsLength
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3756
TH3I::operator=
TH3I & operator=(const TH3I &h1)
Operator =.
Definition: TH3.cxx:3999
TH3F::operator/
friend TH3F operator/(TH3F &h1, TH3F &h2)
Operator /.
Definition: TH3.cxx:4268
TH3::DoProjectProfile2D
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:2472
TH1::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4970
TRandom
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
TH3::RebinY
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition: TH3.cxx:2788
TAtt3D.h
TH3::Fill
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH3.cxx:287
TH3
The 3-D histogram classes derived from the 1-D histogram classes.
Definition: TH3.h:31
TH3F::Copy
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:4145
h
#define h(i)
Definition: RSha256.hxx:106
TH3F::operator*
friend TH3F operator*(TH3F &h1, Float_t c1)
Definition: TH3.h:290
TH3C::SetBinsLength
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3495
TH3D::operator*
friend TH3D operator*(Float_t c1, TH3D &h1)
Operator *.
Definition: TH3.cxx:4431
TH3::Interpolate
virtual Double_t Interpolate(Double_t x, Double_t y) const
Not yet implemented.
Definition: TH3.cxx:1351
TH3::GetStats
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:1217
TH3::fTsumwz
Double_t fTsumwz
Definition: TH3.h:37
TH3D::~TH3D
virtual ~TH3D()
Destructor.
Definition: TH3.cxx:4298
TH3::BufferFill
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
accumulate arguments in buffer.
Definition: TH3.cxx:258
TH3I::TH3I
TH3I()
Constructor.
Definition: TH3.cxx:3878
TArrayF::fArray
Float_t * fArray
Definition: TArrayF.h:30
TH2D
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:292
TH3F::operator*
friend TH3F operator*(Float_t c1, TH3F &h1)
Operator *.
Definition: TH3.cxx:4220
TH3I::operator+
friend TH3I operator+(TH3I &h1, TH3I &h2)
Operator +.
Definition: TH3.cxx:4021
TArrayF::Reset
void Reset()
Definition: TArrayF.h:47
TH3I::operator/
friend TH3I operator/(TH3I &h1, TH3I &h2)
Operator /.
Definition: TH3.cxx:4057
TH3::BufferEmpty
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH3.cxx:184
TH3S::RetrieveBinContent
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:223
y
Double_t y[n]
Definition: legend1.C:17
TH3F::operator-
friend TH3F operator-(TH3F &h1, TH3F &h2)
Operator -.
Definition: TH3.cxx:4244
TH3::fTsumwz2
Double_t fTsumwz2
Definition: TH3.h:38
Short_t
short Short_t
Definition: RtypesCore.h:39
TH3::GetCorrelationFactor
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH3.cxx:1100
TH3::FitSlicesZ
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:887
TH3::RebinX
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
Definition: TH3.cxx:2778
TH3S::Copy
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3735
TH3D::operator-
friend TH3D operator-(TH3D &h1, TH3D &h2)
Operator -.
Definition: TH3.cxx:4455
TH3::IntegralAndError
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:7787
TH3F
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:268
TArrayC
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:27
TH3::fTsumwy
Double_t fTsumwy
Definition: TH3.h:34
TArrayD::Reset
void Reset()
Definition: TArrayD.h:47
TArrayD::fArray
Double_t * fArray
Definition: TArrayD.h:30
TH3::GetBinContent
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const
Definition: TH3.h:98
TH3D::operator+
friend TH3D operator+(TH3D &h1, TH3D &h2)
Operator +.
Definition: TH3.cxx:4443
f1
TF1 * f1
Definition: legend1.C:11
TH3S::operator=
TH3S & operator=(const TH3S &h1)
Operator =.
Definition: TH3.cxx:3800
Double_t
double Double_t
Definition: RtypesCore.h:59
TH3F::operator+
friend TH3F operator+(TH3F &h1, TH3F &h2)
Operator +.
Definition: TH3.cxx:4232
TH3::GetRandom3
virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &, TRandom *rng=nullptr)
Return 3 random numbers along axis x , y and z distributed according to the cell-contents of this 3-d...
Definition: TH3.cxx:1169
TH3F::AddBinContent
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:282
TH3::BufferFill
virtual Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH3.h:56
TH3::fTsumwyz
Double_t fTsumwyz
Definition: TH3.h:40
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TH1
TH1 is the base class of all histogramm classes in ROOT.
Definition: TH1.h:58
TH3I::RetrieveBinContent
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:259
TH3::KolmogorovTest
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:1442
TH3F::TH3F
TH3F()
Constructor.
Definition: TH3.cxx:4077
name
char name[80]
Definition: TGX11.cxx:110
TH3S::UpdateBinContent
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:224
TH3C::operator+
friend TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
Definition: TH3.cxx:3590
TH3::GetBinErrorUp
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:102
TH3C::RetrieveBinContent
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:187
TH3S::TH3S
TH3S()
Constructor.
Definition: TH3.cxx:3646
TH3S::operator-
friend TH3S operator-(TH3S &h1, TH3S &h2)
Operator -.
Definition: TH3.cxx:3834
TH3I::AddBinContent
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3946
TArrayS::Reset
void Reset()
Definition: TArrayS.h:47
TF1
1-Dim function class
Definition: TF1.h:213
TArrayD
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
TH3C::UpdateBinContent
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:188
TH3::DoProject1D
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:145
TH1::Integral
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7760
TH3::TH3
TH3()
Default constructor.
Definition: TH3.cxx:64
Char_t
char Char_t
Definition: RtypesCore.h:33
TH1.h
TH3::BufferFill
virtual Int_t BufferFill(Double_t, Double_t, Double_t)
Definition: TH3.h:57
TH3F::RetrieveBinContent
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:297
TH3D::TH3D
TH3D()
Constructor.
Definition: TH3.cxx:4288
TH3C::operator=
TH3C & operator=(const TH3C &h1)
Operator =.
Definition: TH3.cxx:3568
TH3D::RetrieveBinContent
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:334
fw3dlego::xbins
const double xbins[xbins_n]
Definition: collection_proxies.C:48
TArrayI
Array of integers (32 bits per element).
Definition: TArrayI.h:27
TH3::~TH3
virtual ~TH3()
Destructor.
Definition: TH3.cxx:155
int
c1
return c1
Definition: legend1.C:41
TH3S::operator+
friend TH3S operator+(TH3S &h1, TH3S &h2)
Operator +.
Definition: TH3.cxx:3822