Logo ROOT   6.14/05
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 private:
66 
67  TH3(const TH3&);
68  TH3& operator=(const TH3&); // Not implemented
69 
70 public:
71  virtual ~TH3();
72  virtual Int_t BufferEmpty(Int_t action=0);
73  virtual void Copy(TObject &hnew) const;
74  virtual Int_t Fill(Double_t x, Double_t y, Double_t z);
75  virtual Int_t Fill(Double_t x, Double_t y, Double_t z, Double_t w);
76 
77  virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w);
78  virtual Int_t Fill(const char *namex, Double_t y, const char *namez, Double_t w);
79  virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w);
80  virtual Int_t Fill(Double_t x, const char *namey, const char *namez, Double_t w);
81  virtual Int_t Fill(Double_t x, const char *namey, Double_t z, Double_t w);
82  virtual Int_t Fill(Double_t x, Double_t y, const char *namez, Double_t w);
83 
84  virtual void FillRandom(const char *fname, Int_t ntimes=5000);
85  virtual void FillRandom(TH1 *h, Int_t ntimes=5000);
86  virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1) const;
87  virtual Int_t FindLastBinAbove (Double_t threshold=0, Int_t axis=1) const;
88  virtual void FitSlicesZ(TF1 *f1=0,Int_t binminx=1, Int_t binmaxx=0,Int_t binminy=1, Int_t binmaxy=0,
89  Int_t cut=0 ,Option_t *option="QNR"); // *MENU*
90  virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const;
91  virtual Double_t GetBinContent(Int_t bin) const { return TH1::GetBinContent(bin); }
92  virtual Double_t GetBinContent(Int_t bin, Int_t) const { return TH1::GetBinContent(bin); }
93  virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const { return TH1::GetBinContent( GetBin(binx, biny, binz) ); }
94  using TH1::GetBinErrorLow;
95  using TH1::GetBinErrorUp;
96  virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz) { return TH1::GetBinErrorLow( GetBin(binx, biny, binz) ); }
97  virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz) { return TH1::GetBinErrorUp( GetBin(binx, biny, binz) ); }
98  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;
99  virtual Double_t GetCorrelationFactor(Int_t axis1=1,Int_t axis2=2) const;
100  virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
101  virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &z);
102  virtual void GetStats(Double_t *stats) const;
103  virtual Double_t Integral(Option_t *option="") const;
104  using TH1::Integral;
105  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;
106  using TH1::IntegralAndError;
107  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;
108  virtual Double_t Interpolate(Double_t x);
109  virtual Double_t Interpolate(Double_t x, Double_t y);
110  virtual Double_t Interpolate(Double_t x, Double_t y, Double_t z);
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,
136  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, 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,5) //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,3) //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,3) //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,3) //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,3) //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,3) //3-Dim histograms (one double per channel)
337 };
338 
339 #endif
340 
virtual Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH3.h:56
virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Double_t &err, Option_t *option="") const
Return integral of bin contents in range [binx1,binx2] and its error.
Definition: TH1.cxx:7320
TH3()
Default constructor.
Definition: TH3.cxx:63
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 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:2233
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
Definition: TH3.cxx:2697
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:318
float Float_t
Definition: RtypesCore.h:53
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:668
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:2391
const char Option_t
Definition: RtypesCore.h:62
return c1
Definition: legend1.C:41
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH3.cxx:3259
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:2748
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:1666
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4770
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
Definition: TH3.cxx:982
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7293
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:96
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
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: TH3.cxx:825
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
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
TTime operator/(const TTime &t1, const TTime &t2)
Definition: TTime.h:87
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t fTsumwz
Definition: TH3.h:37
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH3.h:91
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:2597
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: TH3.cxx:782
Double_t fTsumwyz
Definition: TH3.h:40
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const
Definition: TH3.h:93
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
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition: TH3.cxx:1074
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
accumulate arguments in buffer.
Definition: TH3.cxx:257
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:1245
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:1931
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
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:1388
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:1635
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition: TH3.cxx:2707
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH3.cxx:1056
Int_t Fill(const char *, Double_t)
Increment bin with namex with a weight w.
Definition: TH3.h:60
TTime operator-(const TTime &t1, const TTime &t2)
Definition: TTime.h:83
static double p2(double t, double a, double b, double c)
TH1F * h1
Definition: legend1.C:5
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Definition: TString.cxx:1449
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH1.cxx:1200
virtual 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:1168
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
3-D histogram with an int per channel (see TH1 documentation)}
Definition: TH3.h:230
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:1276
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:97
3-D histogram with a short per channel (see TH1 documentation)
Definition: TH3.h:194
THist< 3, double, THistStatContent, THistStatUncertainty > TH3D
Definition: THist.hxx:296
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 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
THist< 3, char, THistStatContent > TH3C
Definition: THist.hxx:298
Class to manage histogram axis.
Definition: TAxis.h:30
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:896
TTime operator*(const TTime &t1, const TTime &t2)
Definition: TTime.h:85
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:1682
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:2680
short Short_t
Definition: RtypesCore.h:35
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:3443
friend TH3D operator*(TH3D &h1, Float_t c1)
Definition: TH3.h:326
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH3.cxx:286
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH3.cxx:162
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:1603
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:610
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:3240
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:319
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH3.h:92
TH3 & operator=(const TH3 &)
Double_t fTsumwz2
Definition: TH3.h:38
THist< 3, int, THistStatContent > TH3I
Definition: THist.hxx:299
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8372
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:55
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH3.cxx:183
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:2365
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 RMS for each cell in X...
Definition: TProfile2D.h:27
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
THist< 3, float, THistStatContent, THistStatUncertainty > TH3F
Definition: THist.hxx:297
Mother of all ROOT objects.
Definition: TObject.h:37
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
char Char_t
Definition: RtypesCore.h:29
Double_t fTsumwxy
Definition: TH3.h:36
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition: TH3.cxx:2717
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:1121
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:211
virtual void SetBinsLength(Int_t=-1)
Definition: TH1.h:368
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:1016
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:8403
virtual ~TH3()
Destructor.
Definition: TH3.cxx:154
virtual Double_t Interpolate(Double_t x)
Not yet implemented.
Definition: TH3.cxx:1287
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:291
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:27