Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 Int_t BufferFill(Double_t, Double_t) override {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) override; //MayNotUse
59 Int_t Fill(Double_t,Double_t) override {return Fill(0.);} //MayNotUse
60 Int_t Fill(const char*, Double_t) override {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 Double_t Interpolate(Double_t x, Double_t y) const override; // May not use
66 Double_t Interpolate(Double_t x) const override; // MayNotUse
67
68private:
69
70 TH3(const TH3&) = delete;
71 TH3& operator=(const TH3&) = delete;
72
73 using TH1::Integral;
75
76public:
77 virtual ~TH3();
78 Int_t BufferEmpty(Int_t action = 0) override;
79 void Copy(TObject &hnew) const override;
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(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 void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng = nullptr) override;
92 void FillRandom(TH1 *h, Int_t ntimes=5000, TRandom *rng = nullptr) override;
93 virtual void FitSlicesZ(TF1 *f1 = nullptr, 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 Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override;
97 Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const override { 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 &, TRandom * rng = nullptr);
106 void GetStats(Double_t *stats) const override;
107 Double_t Integral(Option_t *option="") const override;
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 Double_t Interpolate(Double_t x, Double_t y, Double_t z) const override;
111 Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const override;
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 void PutStats(Double_t *stats) override;
121 TH3 *RebinX(Int_t ngroup = 2, const char *newname = "") override;
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 void Reset(Option_t *option="") override;
126 void SetBinContent(Int_t bin, Double_t content) override;
127 void SetBinContent(Int_t bin, Int_t, Double_t content) override { SetBinContent(bin, content); }
128 void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) override { 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, bool useUF, bool useOF) const;
139 virtual TProfile2D *DoProjectProfile2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
140 bool originalRange, bool useUF, bool useOF) const;
141
142 // these functions are need to be used inside TProfile3D::DoProjectProfile2D
143 static TH1D *DoProject1D(const TH3 & h, const char* name, const char * title, const TAxis* projX,
144 bool computeErrors, bool originalRange, bool useUF, bool useOF);
145 static TH2D *DoProject2D(const TH3 & h, const char* name, const char * title, const TAxis* projX, const TAxis* projY,
146 bool computeErrors, bool originalRange, bool useUF, bool useOF);
147
148 ClassDefOverride(TH3,6) //3-Dim histogram base class
149};
150
151//________________________________________________________________________
152
153class TH3C : public TH3, public TArrayC {
154public:
155 TH3C();
156 TH3C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
157 ,Int_t nbinsy,Double_t ylow,Double_t yup
158 ,Int_t nbinsz,Double_t zlow,Double_t zup);
159 TH3C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
160 ,Int_t nbinsy,const Float_t *ybins
161 ,Int_t nbinsz,const Float_t *zbins);
162 TH3C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
163 ,Int_t nbinsy,const Double_t *ybins
164 ,Int_t nbinsz,const Double_t *zbins);
165 TH3C(const TH3C &h3c);
166 virtual ~TH3C();
167
168 void AddBinContent(Int_t bin) override;
169 void AddBinContent(Int_t bin, Double_t w) override;
170 void Copy(TObject &hnew) const override;
171 void Reset(Option_t *option="") override;
172 void SetBinsLength(Int_t n=-1) override;
173
174 TH3C& operator=(const TH3C &h1);
175 friend TH3C operator*(Float_t c1, TH3C &h1);
176 friend TH3C operator*(TH3C &h1, Float_t c1) {return operator*(c1,h1);}
177 friend TH3C operator+(TH3C &h1, TH3C &h2);
178 friend TH3C operator-(TH3C &h1, TH3C &h2);
179 friend TH3C operator*(TH3C &h1, TH3C &h2);
180 friend TH3C operator/(TH3C &h1, TH3C &h2);
181
182protected:
183 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
184 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Char_t (content); }
185
186 ClassDefOverride(TH3C,4) //3-Dim histograms (one char per channel)
187};
188
189//________________________________________________________________________
190
191class TH3S : public TH3, public TArrayS {
192public:
193 TH3S();
194 TH3S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
195 ,Int_t nbinsy,Double_t ylow,Double_t yup
196 ,Int_t nbinsz,Double_t zlow,Double_t zup);
197 TH3S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
198 ,Int_t nbinsy,const Float_t *ybins
199 ,Int_t nbinsz,const Float_t *zbins);
200 TH3S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
201 ,Int_t nbinsy,const Double_t *ybins
202 ,Int_t nbinsz,const Double_t *zbins);
203 TH3S(const TH3S &h3s);
204 virtual ~TH3S();
205
206 void AddBinContent(Int_t bin) override;
207 void AddBinContent(Int_t bin, Double_t w) override;
208 void Copy(TObject &hnew) const override;
209 void Reset(Option_t *option="") override;
210 void SetBinsLength(Int_t n=-1) override;
211
212 TH3S& operator=(const TH3S &h1);
213 friend TH3S operator*(Float_t c1, TH3S &h1);
214 friend TH3S operator*(TH3S &h1, Float_t c1) {return operator*(c1,h1);}
215 friend TH3S operator+(TH3S &h1, TH3S &h2);
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
220protected:
221 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
222 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Short_t (content); }
223
224 ClassDefOverride(TH3S,4) //3-Dim histograms (one short per channel)
225};
226
227//________________________________________________________________________
228
229class TH3I : public TH3, public TArrayI {
230public:
231 TH3I();
232 TH3I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
233 ,Int_t nbinsy,Double_t ylow,Double_t yup
234 ,Int_t nbinsz,Double_t zlow,Double_t zup);
235 TH3I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
236 ,Int_t nbinsy,const Float_t *ybins
237 ,Int_t nbinsz,const Float_t *zbins);
238 TH3I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
239 ,Int_t nbinsy,const Double_t *ybins
240 ,Int_t nbinsz,const Double_t *zbins);
241 TH3I(const TH3I &h3i);
242 virtual ~TH3I();
243
244 void AddBinContent(Int_t bin) override;
245 void AddBinContent(Int_t bin, Double_t w) override;
246 void Copy(TObject &hnew) const override;
247 void Reset(Option_t *option="") override;
248 void SetBinsLength(Int_t n=-1) override;
249
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
258protected:
259 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
260 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
261
262 ClassDefOverride(TH3I,4) //3-Dim histograms (one 32 bits integer per channel)
263};
264
265
266//________________________________________________________________________
267
268class TH3F : public TH3, public TArrayF {
269public:
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
283 void AddBinContent(Int_t bin) override {++fArray[bin];}
284 void AddBinContent(Int_t bin, Double_t w) override
285 {fArray[bin] += Float_t (w);}
286 void Copy(TObject &hnew) const override;
287 void Reset(Option_t *option="") override;
288 void SetBinsLength(Int_t n=-1) override;
289
290 TH3F& operator=(const TH3F &h1);
291 friend TH3F operator*(Float_t c1, TH3F &h1);
292 friend TH3F operator*(TH3F &h1, Float_t c1) {return operator*(c1,h1);}
293 friend TH3F operator+(TH3F &h1, TH3F &h2);
294 friend TH3F operator-(TH3F &h1, TH3F &h2);
295 friend TH3F operator*(TH3F &h1, TH3F &h2);
296 friend TH3F operator/(TH3F &h1, TH3F &h2);
297
298protected:
299 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
300 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Float_t (content); }
301
302 ClassDefOverride(TH3F,4) //3-Dim histograms (one float per channel)
303};
304
305//________________________________________________________________________
306
307class TH3D : public TH3, public TArrayD {
308public:
309 TH3D();
310 TH3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
311 ,Int_t nbinsy,Double_t ylow,Double_t yup
312 ,Int_t nbinsz,Double_t zlow,Double_t zup);
313 TH3D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
314 ,Int_t nbinsy,const Float_t *ybins
315 ,Int_t nbinsz,const Float_t *zbins);
316 TH3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
317 ,Int_t nbinsy,const Double_t *ybins
318 ,Int_t nbinsz,const Double_t *zbins);
319 TH3D(const TH3D &h3d);
320 virtual ~TH3D();
321
322 void AddBinContent(Int_t bin) override {++fArray[bin];}
323 void AddBinContent(Int_t bin, Double_t w) override
324 {fArray[bin] += Double_t (w);}
325 void Copy(TObject &hnew) const override;
326 void Reset(Option_t *option="") override;
327 void SetBinsLength(Int_t n=-1) override;
328
329 TH3D& operator=(const TH3D &h1);
330 friend TH3D operator*(Float_t c1, TH3D &h1);
331 friend TH3D operator*(TH3D &h1, Float_t c1) {return operator*(c1,h1);}
332 friend TH3D operator+(TH3D &h1, TH3D &h2);
333 friend TH3D operator-(TH3D &h1, TH3D &h2);
334 friend TH3D operator*(TH3D &h1, TH3D &h2);
335 friend TH3D operator/(TH3D &h1, TH3D &h2);
336
337protected:
338 Double_t RetrieveBinContent(Int_t bin) const override { return fArray[bin]; }
339 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = content; }
340
341 ClassDefOverride(TH3D,4) //3-Dim histograms (one double per channel)
342};
343
344#endif
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
int Int_t
Definition RtypesCore.h:45
char Char_t
Definition RtypesCore.h:37
float Float_t
Definition RtypesCore.h:57
short Short_t
Definition RtypesCore.h:39
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
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:213
1-D histogram with a double per channel (see TH1 documentation)}
Definition TH1.h:620
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
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:7878
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition TH1.cxx:8945
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7851
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition TH1.cxx:5025
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition TH1.cxx:8976
2-D histogram with a double per channel (see TH1 documentation)}
Definition TH2.h:300
3-D histogram with a byte per channel (see TH1 documentation)
Definition TH3.h:153
friend TH3C operator/(TH3C &h1, TH3C &h2)
Operator /.
Definition TH3.cxx:3694
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:3562
friend TH3C operator*(Float_t c1, TH3C &h1)
Operator *.
Definition TH3.cxx:3646
friend TH3C operator-(TH3C &h1, TH3C &h2)
Operator -.
Definition TH3.cxx:3670
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Definition TH3.cxx:3550
Double_t RetrieveBinContent(Int_t bin) const override
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH3.h:183
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:3520
friend TH3C operator+(TH3C &h1, TH3C &h2)
Operator +.
Definition TH3.cxx:3658
TH3C & operator=(const TH3C &h1)
Operator =.
Definition TH3.cxx:3635
TH3C()
Constructor.
Definition TH3.cxx:3448
void UpdateBinContent(Int_t bin, Double_t content) override
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition TH3.h:184
friend TH3C operator*(TH3C &h1, Float_t c1)
Definition TH3.h:176
virtual ~TH3C()
Destructor.
Definition TH3.cxx:3458
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:3541
3-D histogram with a double per channel (see TH1 documentation)}
Definition TH3.h:307
friend TH3D operator+(TH3D &h1, TH3D &h2)
Operator +.
Definition TH3.cxx:4533
void UpdateBinContent(Int_t bin, Double_t content) override
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition TH3.h:339
TH3D()
Constructor.
Definition TH3.cxx:4371
friend TH3D operator*(TH3D &h1, Float_t c1)
Definition TH3.h:331
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4465
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w.
Definition TH3.h:323
Double_t RetrieveBinContent(Int_t bin) const override
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH3.h:338
friend TH3D operator-(TH3D &h1, TH3D &h2)
Operator -.
Definition TH3.cxx:4545
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4444
friend TH3D operator*(Float_t c1, TH3D &h1)
Operator *.
Definition TH3.cxx:4521
TH3D & operator=(const TH3D &h1)
Operator =.
Definition TH3.cxx:4509
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.h:322
friend TH3D operator/(TH3D &h1, TH3D &h2)
Operator /.
Definition TH3.cxx:4569
virtual ~TH3D()
Destructor.
Definition TH3.cxx:4381
3-D histogram with a float per channel (see TH1 documentation)}
Definition TH3.h:268
friend TH3F operator-(TH3F &h1, TH3F &h2)
Operator -.
Definition TH3.cxx:4327
friend TH3F operator+(TH3F &h1, TH3F &h2)
Operator +.
Definition TH3.cxx:4315
TH3F & operator=(const TH3F &h1)
Operator =.
Definition TH3.cxx:4292
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.h:283
void UpdateBinContent(Int_t bin, Double_t content) override
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition TH3.h:300
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w.
Definition TH3.h:284
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4248
Double_t RetrieveBinContent(Int_t bin) const override
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH3.h:299
TH3F()
Constructor.
Definition TH3.cxx:4155
friend TH3F operator*(Float_t c1, TH3F &h1)
Operator *.
Definition TH3.cxx:4303
virtual ~TH3F()
Destructor.
Definition TH3.cxx:4165
friend TH3F operator/(TH3F &h1, TH3F &h2)
Operator /.
Definition TH3.cxx:4351
friend TH3F operator*(TH3F &h1, Float_t c1)
Definition TH3.h:292
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4227
3-D histogram with an int per channel (see TH1 documentation)}
Definition TH3.h:229
Double_t RetrieveBinContent(Int_t bin) const override
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH3.h:259
TH3I & operator=(const TH3I &h1)
Operator =.
Definition TH3.cxx:4076
friend TH3I operator*(Float_t c1, TH3I &h1)
Operator *.
Definition TH3.cxx:4087
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:4023
void UpdateBinContent(Int_t bin, Double_t content) override
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition TH3.h:260
TH3I()
Constructor.
Definition TH3.cxx:3951
friend TH3I operator*(TH3I &h1, Float_t c1)
Definition TH3.h:252
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4044
friend TH3I operator/(TH3I &h1, TH3I &h2)
Operator /.
Definition TH3.cxx:4135
friend TH3I operator+(TH3I &h1, TH3I &h2)
Operator +.
Definition TH3.cxx:4099
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4065
virtual ~TH3I()
Destructor.
Definition TH3.cxx:3961
friend TH3I operator-(TH3I &h1, TH3I &h2)
Operator _.
Definition TH3.cxx:4111
3-D histogram with a short per channel (see TH1 documentation)
Definition TH3.h:191
friend TH3S operator*(TH3S &h1, Float_t c1)
Definition TH3.h:214
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:3828
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:3786
void UpdateBinContent(Int_t bin, Double_t content) override
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition TH3.h:222
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:3807
friend TH3S operator-(TH3S &h1, TH3S &h2)
Operator -.
Definition TH3.cxx:3907
virtual ~TH3S()
Destructor.
Definition TH3.cxx:3724
friend TH3S operator+(TH3S &h1, TH3S &h2)
Operator +.
Definition TH3.cxx:3895
Double_t RetrieveBinContent(Int_t bin) const override
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH3.h:221
friend TH3S operator*(Float_t c1, TH3S &h1)
Operator *.
Definition TH3.cxx:3883
TH3S & operator=(const TH3S &h1)
Operator =.
Definition TH3.cxx:3872
TH3S()
Constructor.
Definition TH3.cxx:3714
friend TH3S operator/(TH3S &h1, TH3S &h2)
Operator /.
Definition TH3.cxx:3931
The 3-D histogram classes derived from the 1-D histogram classes.
Definition TH3.h:31
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:2875
Int_t BufferFill(Double_t, Double_t) override
accumulate arguments in buffer.
Definition TH3.h:56
Int_t BufferEmpty(Int_t action=0) override
Fill histogram with all entries in the buffer.
Definition TH3.cxx:222
Double_t fTsumwy
Total Sum of weight*Y.
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
Double_t fTsumwy2
Total Sum of weight*Y*Y.
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:1167
void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
Definition TH3.cxx:1265
void Copy(TObject &hnew) const override
Copy.
Definition TH3.cxx:201
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:2057
Double_t fTsumwxz
Total Sum of weight*X*Z.
Definition TH3.h:39
void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function fname.
Definition TH3.cxx:791
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition TH3.h:101
Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const override
Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test.
Definition TH3.cxx:1490
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:1738
Int_t Fill(const char *, Double_t) override
Increment bin with namex with a weight w.
Definition TH3.h:60
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:1217
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Definition TH3.cxx:3367
virtual ~TH3()
Destructor.
Definition TH3.cxx:193
Int_t Fill(Double_t) override
Invalid Fill method.
Definition TH3.cxx:326
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition TH3.cxx:2834
TH3 & operator=(const TH3 &)=delete
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:1379
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:1770
void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) override
Definition TH3.h:128
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:1705
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:2724
Double_t fTsumwz2
Total Sum of weight*Z*Z.
Definition TH3.h:38
Double_t fTsumwxy
Total Sum of weight*X*Y.
Definition TH3.h:36
Int_t Fill(Double_t, Double_t) override
Increment bin with abscissa X with a weight w.
Definition TH3.h:59
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:2363
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition TH3.h:100
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:1109
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:2492
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition TH3.cxx:2844
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
Definition TH3.cxx:1348
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
Accumulate arguments in buffer.
Definition TH3.cxx:297
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:3591
Int_t Fill(const char *, Double_t, Double_t)
Definition TH3.h:62
TH3 * RebinX(Int_t ngroup=2, const char *newname="") override
Rebin only the X axis see Rebin3D.
Definition TH3.cxx:2824
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition TH3.cxx:1149
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:1787
TH3(const TH3 &)=delete
Double_t fTsumwz
Total Sum of weight*Z.
Definition TH3.h:37
Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const override
Definition TH3.h:97
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Definition TH3.cxx:3386
void SetBinContent(Int_t bin, Int_t, Double_t content) override
Definition TH3.h:127
Double_t fTsumwyz
Total Sum of weight*Y*Z.
Definition TH3.h:40
TH3()
Default constructor.
Definition TH3.cxx:64
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override
See comments in TH1::GetBin.
Definition TH3.cxx:1075
virtual void FitSlicesZ(TF1 *f1=nullptr, 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:936
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:2518
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
Definition TH3.cxx:2807
Mother of all ROOT objects.
Definition TObject.h:41
Profile2D histograms are used to display the mean value of Z and its error for each cell in X,...
Definition TProfile2D.h:27
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
#define Interpolate(a, x, b, y)
Definition geom.c:179
Double_t y[n]
Definition legend1.C:17
return c1
Definition legend1.C:41
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