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
28class TH2D;
29class TProfile2D;
30
31class TH3 : public TH1, public TAtt3D {
32
33protected:
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
68private:
69
70 TH3(const TH3&);
71 TH3& operator=(const TH3&); // Not implemented
72
73 using TH1::Integral;
75
76public:
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) ); }
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
131protected:
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
158class TH3C : public TH3, public TArrayC {
159public:
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
185protected:
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
194class TH3S : public TH3, public TArrayS {
195public:
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
221protected:
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
230class TH3I : public TH3, public TArrayI {
231public:
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
257protected:
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
267class TH3F : public TH3, public TArrayF {
268public:
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
295protected:
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
304class TH3D : public TH3, public TArrayD {
305public:
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
332protected:
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
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:43
char Char_t
Definition: RtypesCore.h:31
short Short_t
Definition: RtypesCore.h:37
double Double_t
Definition: RtypesCore.h:57
float Float_t
Definition: RtypesCore.h:55
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
char name[80]
Definition: TGX11.cxx:109
Array of chars or bytes (8 bits per element).
Definition: TArrayC.h:27
Char_t * fArray
Definition: TArrayC.h:30
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
Double_t * fArray
Definition: TArrayD.h:30
void Reset()
Definition: TArrayD.h:47
Array of floats (32 bits per element).
Definition: TArrayF.h:27
Float_t * fArray
Definition: TArrayF.h:30
void Reset()
Definition: TArrayF.h:47
Array of integers (32 bits per element).
Definition: TArrayI.h:27
Int_t * fArray
Definition: TArrayI.h:30
void Reset()
Definition: TArrayI.h:47
Array of shorts (16 bits per element).
Definition: TArrayS.h:27
void Reset()
Definition: TArrayS.h:47
Short_t * fArray
Definition: TArrayS.h:30
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Class to manage histogram axis.
Definition: TAxis.h:30
1-Dim function class
Definition: TF1.h:210
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:614
The TH1 histogram class.
Definition: TH1.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:7477
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition: TH1.cxx:8535
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH1.cxx:7450
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4907
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition: TH1.cxx:8566
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:292
3-D histogram with a byte per channel (see TH1 documentation)
Definition: TH3.h:158
friend TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
Definition: TH3.cxx:3538
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3386
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH3.cxx:3395
friend TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
Definition: TH3.cxx:3490
friend TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
Definition: TH3.cxx:3514
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 SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3407
friend TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
Definition: TH3.cxx:3502
TH3C & operator=(const TH3C &h1)
Operator =.
Definition: TH3.cxx:3480
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3365
TH3C()
Constructor.
Definition: TH3.cxx:3297
friend TH3C operator*(TH3C &h1, Float_t c1)
Definition: TH3.h:179
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 ~TH3C()
Destructor.
Definition: TH3.cxx:3307
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:304
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:319
friend TH3D operator+(TH3D &h1, TH3D &h2)
Operator +.
Definition: TH3.cxx:4355
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:4289
TH3D()
Constructor.
Definition: TH3.cxx:4200
friend TH3D operator*(TH3D &h1, Float_t c1)
Definition: TH3.h:326
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:318
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 TH3D operator-(TH3D &h1, TH3D &h2)
Operator -.
Definition: TH3.cxx:4367
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:4268
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
friend TH3D operator*(Float_t c1, TH3D &h1)
Operator *.
Definition: TH3.cxx:4343
TH3D & operator=(const TH3D &h1)
Operator =.
Definition: TH3.cxx:4333
friend TH3D operator/(TH3D &h1, TH3D &h2)
Operator /.
Definition: TH3.cxx:4391
virtual ~TH3D()
Destructor.
Definition: TH3.cxx:4210
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:267
virtual void AddBinContent(Int_t bin, Double_t w)
Increment bin content by a weight w.
Definition: TH3.h:282
friend TH3F operator-(TH3F &h1, TH3F &h2)
Operator -.
Definition: TH3.cxx:4156
friend TH3F operator+(TH3F &h1, TH3F &h2)
Operator +.
Definition: TH3.cxx:4144
TH3F & operator=(const TH3F &h1)
Operator =.
Definition: TH3.cxx:4122
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.h:281
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:4078
TH3F()
Constructor.
Definition: TH3.cxx:3989
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
friend TH3F operator*(Float_t c1, TH3F &h1)
Operator *.
Definition: TH3.cxx:4132
virtual ~TH3F()
Destructor.
Definition: TH3.cxx:3999
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:4057
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
friend TH3F operator/(TH3F &h1, TH3F &h2)
Operator /.
Definition: TH3.cxx:4180
friend TH3F operator*(TH3F &h1, Float_t c1)
Definition: TH3.h:289
3-D histogram with an int per channel (see TH1 documentation)}
Definition: TH3.h:230
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3879
TH3I & operator=(const TH3I &h1)
Operator =.
Definition: TH3.cxx:3911
friend TH3I operator*(Float_t c1, TH3I &h1)
Operator *.
Definition: TH3.cxx:3921
TH3I()
Constructor.
Definition: TH3.cxx:3790
friend TH3I operator*(TH3I &h1, Float_t c1)
Definition: TH3.h:251
friend TH3I operator/(TH3I &h1, TH3I &h2)
Operator /.
Definition: TH3.cxx:3969
friend TH3I operator+(TH3I &h1, TH3I &h2)
Operator +.
Definition: TH3.cxx:3933
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3858
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 ~TH3I()
Destructor.
Definition: TH3.cxx:3800
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
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3900
friend TH3I operator-(TH3I &h1, TH3I &h2)
Operator _.
Definition: TH3.cxx:3945
3-D histogram with a short per channel (see TH1 documentation)
Definition: TH3.h:194
friend TH3S operator*(TH3S &h1, Float_t c1)
Definition: TH3.h:215
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition: TH3.cxx:3626
virtual void SetBinsLength(Int_t n=-1)
Set total number of bins including under/overflow Reallocate bin contents array.
Definition: TH3.cxx:3668
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
friend TH3S operator-(TH3S &h1, TH3S &h2)
Operator -.
Definition: TH3.cxx:3746
virtual ~TH3S()
Destructor.
Definition: TH3.cxx:3568
friend TH3S operator+(TH3S &h1, TH3S &h2)
Operator +.
Definition: TH3.cxx:3734
friend TH3S operator*(Float_t c1, TH3S &h1)
Operator *.
Definition: TH3.cxx:3722
TH3S & operator=(const TH3S &h1)
Operator =.
Definition: TH3.cxx:3712
TH3S()
Constructor.
Definition: TH3.cxx:3558
friend TH3S operator/(TH3S &h1, TH3S &h2)
Operator /.
Definition: TH3.cxx:3770
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
virtual void Copy(TObject &hnew) const
Copy this 3-D histogram structure to newth3.
Definition: TH3.cxx:3647
The 3-D histogram classes derived from the 1-D histogram classes.
Definition: TH3.h:31
Int_t Fill(const char *, Double_t)
Increment bin with namex with a weight w.
Definition: TH3.h:60
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
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
Int_t Fill(Double_t)
Invalid Fill method.
Definition: TH3.cxx:287
Double_t fTsumwy
Definition: TH3.h:34
Int_t Fill(const char *, const char *, Double_t)
Definition: TH3.h:63
virtual Int_t BufferFill(Double_t, Double_t, Double_t)
Definition: TH3.h:57
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
Double_t fTsumwy2
Definition: TH3.h:35
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 BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition: TH3.cxx:184
virtual void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content)
Definition: TH3.h:128
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
Double_t fTsumwxz
Definition: TH3.h:39
virtual Int_t BufferFill(Double_t, Double_t)
accumulate arguments in buffer.
Definition: TH3.h:56
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:101
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
Int_t Fill(Double_t, Double_t)
Increment bin with abscissa X with a weight w.
Definition: TH3.h:59
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const
See comments in TH1::GetBin.
Definition: TH3.cxx:949
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition: TH3.cxx:3233
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition: TH3.cxx:1212
virtual void Copy(TObject &hnew) const
Copy.
Definition: TH3.cxx:163
virtual void SetBinContent(Int_t bin, Int_t, Double_t content)
Definition: TH3.h:127
TH3 & operator=(const TH3 &)
virtual ~TH3()
Destructor.
Definition: TH3.cxx:155
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition: TH3.cxx:2700
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 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 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
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
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Definition: TH3.cxx:669
Double_t fTsumwz2
Definition: TH3.h:38
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH3.h:95
Double_t fTsumwxy
Definition: TH3.h:36
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
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
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:2226
virtual Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const
Definition: TH3.h:97
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition: TH3.cxx:2673
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition: TH3.h:100
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition: TH3.h:96
Int_t Fill(Double_t, const char *, Double_t)
Definition: TH3.h:61
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:983
virtual TH3 * RebinX(Int_t ngroup=2, const char *newname="")
Rebin only the X axis see Rebin3D.
Definition: TH3.cxx:2690
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
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
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
Definition: TH3.cxx:3252
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition: TH3.cxx:2710
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 Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
accumulate arguments in buffer.
Definition: TH3.cxx:258
virtual Double_t Interpolate(Double_t x, Double_t y) const
Not yet implemented.
Definition: TH3.cxx:1263
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
Int_t Fill(const char *, Double_t, Double_t)
Definition: TH3.h:62
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition: TH3.cxx:1023
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
Double_t fTsumwz
Definition: TH3.h:37
Double_t fTsumwyz
Definition: TH3.h:40
TH3()
Default constructor.
Definition: TH3.cxx:64
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
Mother of all ROOT objects.
Definition: TObject.h:37
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X,...
Definition: TProfile2D.h:27
return c1
Definition: legend1.C:41
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
TH1F * h1
Definition: legend1.C:5
TF1 * f1
Definition: legend1.C:11