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
46 TH3(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
48 ,Int_t nbinsz,const Float_t *zbins);
49 TH3(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
51 ,Int_t nbinsz,const Double_t *zbins);
53
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 ~TH3() override;
79 /// Increment 3D bin content by 1.
80 /// Passing an out-of-range bin leads to undefined behavior
82 /// Increment 3D bin content by a weight w.
83 /// Passing an out-of-range bin leads to undefined behavior
85 Int_t BufferEmpty(Int_t action = 0) override;
86 void Copy(TObject &hnew) const override;
87 virtual Int_t Fill(Double_t x, Double_t y, Double_t z);
89
90 virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w);
91 virtual Int_t Fill(const char *namex, Double_t y, const char *namez, Double_t w);
92 virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w);
93 virtual Int_t Fill(Double_t x, const char *namey, const char *namez, Double_t w);
94 virtual Int_t Fill(const char *namex, Double_t y, Double_t z, Double_t w);
95 virtual Int_t Fill(Double_t x, const char *namey, Double_t z, Double_t w);
96 virtual Int_t Fill(Double_t x, Double_t y, const char *namez, Double_t w);
97
98 using TH1::FillRandom;
99 void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng = nullptr) override;
100 void FillRandom(TH1 *h, Int_t ntimes=5000, TRandom *rng = nullptr) override;
101 virtual void FitSlicesZ(TF1 *f1 = nullptr, Int_t binminx = 1, Int_t binmaxx = 0, Int_t binminy = 1, Int_t binmaxy = 0,
102 Int_t cut = 0, Option_t *option = "QNR"); // *MENU*
103 Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override;
104 using TH1::GetBinContent;
107 using TH1::GetBinErrorUp;
112 virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
113 virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &, TRandom * rng = nullptr);
114 void GetStats(Double_t *stats) const override;
115 Double_t Integral(Option_t *option="") const override;
118 Double_t Interpolate(Double_t x, Double_t y, Double_t z) const override;
119 Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const override;
120 virtual TH1D *ProjectionX(const char *name="_px", Int_t iymin=0, Int_t iymax=-1, Int_t izmin=0,
121 Int_t izmax=-1, Option_t *option="") const; // *MENU*
122 virtual TH1D *ProjectionY(const char *name="_py", Int_t ixmin=0, Int_t ixmax=-1, Int_t izmin=0,
123 Int_t izmax=-1, Option_t *option="") const; // *MENU*
124 virtual TH1D *ProjectionZ(const char *name="_pz", Int_t ixmin=0, Int_t ixmax=-1, Int_t iymin=0,
125 Int_t iymax=-1, Option_t *option="") const; // *MENU*
126 virtual TH1 *Project3D(Option_t *option="x") const; // *MENU*
127 virtual TProfile2D *Project3DProfile(Option_t *option="xy") const; // *MENU*
128 void PutStats(Double_t *stats) override;
129 TH3 *RebinX(Int_t ngroup = 2, const char *newname = "") override;
130 virtual TH3 *RebinY(Int_t ngroup = 2, const char *newname = "");
131 virtual TH3 *RebinZ(Int_t ngroup = 2, const char *newname = "");
132 virtual TH3 *Rebin3D(Int_t nxgroup = 2, Int_t nygroup = 2, Int_t nzgroup = 2, const char *newname = "");
133 void Reset(Option_t *option="") override;
134 void SetBinContent(Int_t bin, Double_t content) override;
137 virtual void SetShowProjection(const char *option="xy",Int_t nbins=1); // *MENU*
138
139protected:
140
141 virtual TH1D *DoProject1D(const char* name, const char * title, int imin1, int imax1, int imin2, int imax2,
142 const TAxis* projAxis, const TAxis * axis1, const TAxis * axis2, Option_t * option) const;
143 virtual TH1D *DoProject1D(const char *name, const char *title, const TAxis *projAxis, const TAxis *axis1,
144 const TAxis *axis2, bool computeErrors, bool originalRange, bool useUF, bool useOF) const;
145 virtual TH2D *DoProject2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
146 bool computeErrors, bool originalRange, bool useUF, bool useOF) const;
147 virtual TProfile2D *DoProjectProfile2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
148 bool originalRange, bool useUF, bool useOF) const;
149
150 // these functions are need to be used inside TProfile3D::DoProjectProfile2D
151 static TH1D *DoProject1D(const TH3 & h, const char* name, const char * title, const TAxis* projX,
152 bool computeErrors, bool originalRange, bool useUF, bool useOF);
153 static TH2D *DoProject2D(const TH3 & h, const char* name, const char * title, const TAxis* projX, const TAxis* projY,
154 bool computeErrors, bool originalRange, bool useUF, bool useOF);
155
156 ClassDefOverride(TH3,6) //3-Dim histogram base class
157};
158
159//________________________________________________________________________
160
161class TH3C : public TH3, public TArrayC {
162public:
163 TH3C();
164 TH3C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
165 ,Int_t nbinsy,Double_t ylow,Double_t yup
167 TH3C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
168 ,Int_t nbinsy,const Float_t *ybins
169 ,Int_t nbinsz,const Float_t *zbins);
170 TH3C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
171 ,Int_t nbinsy,const Double_t *ybins
172 ,Int_t nbinsz,const Double_t *zbins);
173 TH3C(const TH3C &h3c);
174 ~TH3C() override;
175
176 void AddBinContent(Int_t bin) override;
177 void AddBinContent(Int_t bin, Double_t w) override;
178 using TH3::AddBinContent;
179 void Copy(TObject &hnew) const override;
180 void Reset(Option_t *option="") override;
181 void SetBinsLength(Int_t n=-1) override;
182
183 TH3C& operator=(const TH3C &h1);
184 friend TH3C operator*(Float_t c1, TH3C const &h1);
185 friend TH3C operator*(TH3C const &h1, Float_t c1) {return operator*(c1,h1);}
186 friend TH3C operator+(TH3C const &h1, TH3C const &h2);
187 friend TH3C operator-(TH3C const &h1, TH3C const &h2);
188 friend TH3C operator*(TH3C const &h1, TH3C const &h2);
189 friend TH3C operator/(TH3C const &h1, TH3C const &h2);
190
191protected:
192 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
193 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Char_t (content); }
194
195 ClassDefOverride(TH3C,4) //3-Dim histograms (one char per channel)
196};
197
198//________________________________________________________________________
199
200class TH3S : public TH3, public TArrayS {
201public:
202 TH3S();
203 TH3S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
204 ,Int_t nbinsy,Double_t ylow,Double_t yup
206 TH3S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
207 ,Int_t nbinsy,const Float_t *ybins
208 ,Int_t nbinsz,const Float_t *zbins);
209 TH3S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
210 ,Int_t nbinsy,const Double_t *ybins
211 ,Int_t nbinsz,const Double_t *zbins);
212 TH3S(const TH3S &h3s);
213 ~TH3S() override;
214
215 void AddBinContent(Int_t bin) override;
216 void AddBinContent(Int_t bin, Double_t w) override;
217 using TH3::AddBinContent;
218 void Copy(TObject &hnew) const override;
219 void Reset(Option_t *option="") override;
220 void SetBinsLength(Int_t n=-1) override;
221
222 TH3S& operator=(const TH3S &h1);
223 friend TH3S operator*(Float_t c1, TH3S const &h1);
224 friend TH3S operator*(TH3S const &h1, Float_t c1) {return operator*(c1,h1);}
225 friend TH3S operator+(TH3S const &h1, TH3S const &h2);
226 friend TH3S operator-(TH3S const &h1, TH3S const &h2);
227 friend TH3S operator*(TH3S const &h1, TH3S const &h2);
228 friend TH3S operator/(TH3S const &h1, TH3S const &h2);
229
230protected:
231 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
232 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Short_t (content); }
233
234 ClassDefOverride(TH3S,4) //3-Dim histograms (one short per channel)
235};
236
237//________________________________________________________________________
238
239class TH3I : public TH3, public TArrayI {
240public:
241 TH3I();
242 TH3I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
243 ,Int_t nbinsy,Double_t ylow,Double_t yup
245 TH3I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
246 ,Int_t nbinsy,const Float_t *ybins
247 ,Int_t nbinsz,const Float_t *zbins);
248 TH3I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
249 ,Int_t nbinsy,const Double_t *ybins
250 ,Int_t nbinsz,const Double_t *zbins);
251 TH3I(const TH3I &h3i);
252 ~TH3I() override;
253
254 void AddBinContent(Int_t bin) override;
255 void AddBinContent(Int_t bin, Double_t w) override;
256 using TH3::AddBinContent;
257 void Copy(TObject &hnew) const override;
258 void Reset(Option_t *option="") override;
259 void SetBinsLength(Int_t n=-1) override;
260
261 TH3I& operator=(const TH3I &h1);
262 friend TH3I operator*(Float_t c1, TH3I const &h1);
263 friend TH3I operator*(TH3I const &h1, Float_t c1) {return operator*(c1,h1);}
264 friend TH3I operator+(TH3I const &h1, TH3I const &h2);
265 friend TH3I operator-(TH3I const &h1, TH3I const &h2);
266 friend TH3I operator*(TH3I const &h1, TH3I const &h2);
267 friend TH3I operator/(TH3I const &h1, TH3I const &h2);
268
269protected:
270 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
271 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
272
273 ClassDefOverride(TH3I,4) //3-Dim histograms (one 32 bit integer per channel)
274};
275
276
277//________________________________________________________________________
278
279class TH3L : public TH3, public TArrayL64 {
280public:
281 TH3L();
282 TH3L(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
283 ,Int_t nbinsy,Double_t ylow,Double_t yup
285 TH3L(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
286 ,Int_t nbinsy,const Float_t *ybins
287 ,Int_t nbinsz,const Float_t *zbins);
288 TH3L(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
289 ,Int_t nbinsy,const Double_t *ybins
290 ,Int_t nbinsz,const Double_t *zbins);
291 TH3L(const TH3L &h3l);
292 ~TH3L() override;
293 void AddBinContent(Int_t bin) override;
294 void AddBinContent(Int_t bin, Double_t w) override;
295 using TH3::AddBinContent;
296 void Copy(TObject &hnew) const override;
297 void Reset(Option_t *option="") override;
298 void SetBinsLength(Int_t n=-1) override;
299 TH3L& operator=(const TH3L &h1);
300 friend TH3L operator*(Float_t c1, TH3L const &h1);
301 friend TH3L operator*(TH3L const &h1, Float_t c1) {return operator*(c1,h1);}
302 friend TH3L operator+(TH3L const &h1, TH3L const &h2);
303 friend TH3L operator-(TH3L const &h1, TH3L const &h2);
304 friend TH3L operator*(TH3L const &h1, TH3L const &h2);
305 friend TH3L operator/(TH3L const &h1, TH3L const &h2);
306
307protected:
308 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
309 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
310
311 ClassDefOverride(TH3L,0) //3-Dim histograms (one 64 bit integer per channel)
312};
313
314
315//________________________________________________________________________
316
317class TH3F : public TH3, public TArrayF {
318public:
319 TH3F();
320 TH3F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
321 ,Int_t nbinsy,Double_t ylow,Double_t yup
323 TH3F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
324 ,Int_t nbinsy,const Float_t *ybins
325 ,Int_t nbinsz,const Float_t *zbins);
326 TH3F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
327 ,Int_t nbinsy,const Double_t *ybins
328 ,Int_t nbinsz,const Double_t *zbins);
329 TH3F(const TH3F &h3f);
330 ~TH3F() override;
331
332 /// Increment bin content by 1.
333 /// Passing an out-of-range bin leads to undefined behavior
334 void AddBinContent(Int_t bin) override {++fArray[bin];}
335 /// Increment bin content by a weight w.
336 /// \warning The value of w is cast to `Float_t` before being added.
337 /// Passing an out-of-range bin leads to undefined behavior
338 void AddBinContent(Int_t bin, Double_t w) override
339 {fArray[bin] += Float_t (w);}
340 using TH3::AddBinContent;
341 void Copy(TObject &hnew) const override;
342 void Reset(Option_t *option="") override;
343 void SetBinsLength(Int_t n=-1) override;
344
345 TH3F& operator=(const TH3F &h1);
346 friend TH3F operator*(Float_t c1, TH3F const &h1);
347 friend TH3F operator*(TH3F const &h1, Float_t c1) {return operator*(c1,h1);}
348 friend TH3F operator+(TH3F const &h1, TH3F const &h2);
349 friend TH3F operator-(TH3F const &h1, TH3F const &h2);
350 friend TH3F operator*(TH3F const &h1, TH3F const &h2);
351 friend TH3F operator/(TH3F const &h1, TH3F const &h2);
352
353protected:
354 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
355 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Float_t (content); }
356
357 ClassDefOverride(TH3F,4) //3-Dim histograms (one float per channel)
358};
359
360//________________________________________________________________________
361
362class TH3D : public TH3, public TArrayD {
363public:
364 TH3D();
365 TH3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
366 ,Int_t nbinsy,Double_t ylow,Double_t yup
368 TH3D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
369 ,Int_t nbinsy,const Float_t *ybins
370 ,Int_t nbinsz,const Float_t *zbins);
371 TH3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
372 ,Int_t nbinsy,const Double_t *ybins
373 ,Int_t nbinsz,const Double_t *zbins);
374 TH3D(const TH3D &h3d);
375 ~TH3D() override;
376
377 /// Increment bin content by 1.
378 /// Passing an out-of-range bin leads to undefined behavior
379 void AddBinContent(Int_t bin) override {++fArray[bin];}
380 /// Increment bin content by a weight w
381 /// Passing an out-of-range bin leads to undefined behavior
382 void AddBinContent(Int_t bin, Double_t w) override
383 {fArray[bin] += Double_t (w);}
384 using TH3::AddBinContent;
385 void Copy(TObject &hnew) const override;
386 void Reset(Option_t *option="") override;
387 void SetBinsLength(Int_t n=-1) override;
388
389 TH3D& operator=(const TH3D &h1);
390 friend TH3D operator*(Float_t c1, TH3D const &h1);
391 friend TH3D operator*(TH3D const &h1, Float_t c1) {return operator*(c1,h1);}
392 friend TH3D operator+(TH3D const &h1, TH3D const &h2);
393 friend TH3D operator-(TH3D const &h1, TH3D const &h2);
394 friend TH3D operator*(TH3D const &h1, TH3D const &h2);
395 friend TH3D operator/(TH3D const &h1, TH3D const &h2);
396
397protected:
398 Double_t RetrieveBinContent(Int_t bin) const override { return fArray[bin]; }
399 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = content; }
400
401 ClassDefOverride(TH3D,4) //3-Dim histograms (one double per channel)
402};
403
404#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:346
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 long64s (64 bits per element).
Definition TArrayL64.h:27
Long64_t * fArray
Definition TArrayL64.h:30
void Reset()
Definition TArrayL64.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:32
1-Dim function class
Definition TF1.h:233
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:693
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
virtual void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr)
Definition TH1.cxx:3499
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:7970
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition TH1.cxx:9081
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7943
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition TH1.cxx:5059
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition TH1.cxx:9112
virtual void AddBinContent(Int_t bin)=0
Increment bin content by 1.
2-D histogram with a double per channel (see TH1 documentation)
Definition TH2.h:356
3-D histogram with a byte per channel (see TH1 documentation)
Definition TH3.h:161
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:3608
friend TH3C operator*(TH3C const &h1, Float_t c1)
Definition TH3.h:185
friend TH3C operator*(Float_t c1, TH3C const &h1)
Operator *.
Definition TH3.cxx:3692
~TH3C() override
Destructor.
Definition TH3.cxx:3501
friend TH3C operator-(TH3C const &h1, TH3C const &h2)
Operator -.
Definition TH3.cxx:3716
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Definition TH3.cxx:3596
friend TH3C operator+(TH3C const &h1, TH3C const &h2)
Operator +.
Definition TH3.cxx:3704
friend TH3C operator/(TH3C const &h1, TH3C const &h2)
Operator /.
Definition TH3.cxx:3740
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:192
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:3564
TH3C & operator=(const TH3C &h1)
Operator =.
Definition TH3.cxx:3681
TH3C()
Constructor.
Definition TH3.cxx:3491
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:193
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:3587
3-D histogram with a double per channel (see TH1 documentation)
Definition TH3.h:362
friend TH3D operator*(TH3D const &h1, Float_t c1)
Definition TH3.h:391
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:399
TH3D()
Constructor.
Definition TH3.cxx:4630
friend TH3D operator+(TH3D const &h1, TH3D const &h2)
Operator +.
Definition TH3.cxx:4792
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4724
~TH3D() override
Destructor.
Definition TH3.cxx:4640
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w Passing an out-of-range bin leads to undefined behavior.
Definition TH3.h:382
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:398
friend TH3D operator-(TH3D const &h1, TH3D const &h2)
Operator -.
Definition TH3.cxx:4804
friend TH3D operator/(TH3D const &h1, TH3D const &h2)
Operator /.
Definition TH3.cxx:4828
friend TH3D operator*(Float_t c1, TH3D const &h1)
Operator *.
Definition TH3.cxx:4780
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4703
TH3D & operator=(const TH3D &h1)
Operator =.
Definition TH3.cxx:4768
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.h:379
3-D histogram with a float per channel (see TH1 documentation)
Definition TH3.h:317
friend TH3F operator/(TH3F const &h1, TH3F const &h2)
Operator /.
Definition TH3.cxx:4610
TH3F & operator=(const TH3F &h1)
Operator =.
Definition TH3.cxx:4551
friend TH3F operator+(TH3F const &h1, TH3F const &h2)
Operator +.
Definition TH3.cxx:4574
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.h:334
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:355
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w.
Definition TH3.h:338
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4507
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:354
TH3F()
Constructor.
Definition TH3.cxx:4414
~TH3F() override
Destructor.
Definition TH3.cxx:4424
friend TH3F operator-(TH3F const &h1, TH3F const &h2)
Operator -.
Definition TH3.cxx:4586
friend TH3F operator*(TH3F const &h1, Float_t c1)
Definition TH3.h:347
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4486
friend TH3F operator*(Float_t c1, TH3F const &h1)
Operator *.
Definition TH3.cxx:4562
3-D histogram with an int per channel (see TH1 documentation)
Definition TH3.h:239
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:270
TH3I & operator=(const TH3I &h1)
Operator =.
Definition TH3.cxx:4128
friend TH3I operator+(TH3I const &h1, TH3I const &h2)
Operator +.
Definition TH3.cxx:4151
friend TH3I operator-(TH3I const &h1, TH3I const &h2)
Operator _.
Definition TH3.cxx:4163
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:4073
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:271
TH3I()
Constructor.
Definition TH3.cxx:4000
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4096
friend TH3I operator*(Float_t c1, TH3I const &h1)
Operator *.
Definition TH3.cxx:4139
friend TH3I operator/(TH3I const &h1, TH3I const &h2)
Operator /.
Definition TH3.cxx:4187
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4117
~TH3I() override
Destructor.
Definition TH3.cxx:4010
friend TH3I operator*(TH3I const &h1, Float_t c1)
Definition TH3.h:263
3-D histogram with a long64 per channel (see TH1 documentation)
Definition TH3.h:279
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:309
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:308
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4303
TH3L & operator=(const TH3L &h1)
Operator =.
Definition TH3.cxx:4335
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:4280
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4324
friend TH3L operator+(TH3L const &h1, TH3L const &h2)
Operator +.
Definition TH3.cxx:4358
~TH3L() override
Destructor.
Definition TH3.cxx:4217
TH3L()
Constructor.
Definition TH3.cxx:4207
friend TH3L operator*(Float_t c1, TH3L const &h1)
Operator *.
Definition TH3.cxx:4346
friend TH3L operator-(TH3L const &h1, TH3L const &h2)
Operator _.
Definition TH3.cxx:4370
friend TH3L operator/(TH3L const &h1, TH3L const &h2)
Operator /.
Definition TH3.cxx:4394
friend TH3L operator*(TH3L const &h1, Float_t c1)
Definition TH3.h:301
3-D histogram with a short per channel (see TH1 documentation)
Definition TH3.h:200
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:3877
friend TH3S operator*(TH3S const &h1, Float_t c1)
Definition TH3.h:224
friend TH3S operator+(TH3S const &h1, TH3S const &h2)
Operator +.
Definition TH3.cxx:3944
friend TH3S operator/(TH3S const &h1, TH3S const &h2)
Operator /.
Definition TH3.cxx:3980
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:3833
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:232
~TH3S() override
Destructor.
Definition TH3.cxx:3770
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:3856
friend TH3S operator*(Float_t c1, TH3S const &h1)
Operator *.
Definition TH3.cxx:3932
friend TH3S operator-(TH3S const &h1, TH3S const &h2)
Operator -.
Definition TH3.cxx:3956
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:231
TH3S & operator=(const TH3S &h1)
Operator =.
Definition TH3.cxx:3921
TH3S()
Constructor.
Definition TH3.cxx:3760
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:2918
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:228
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:1170
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:1268
void Copy(TObject &hnew) const override
Copy.
Definition TH3.cxx:208
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:2064
Double_t fTsumwxz
Total Sum of weight*X*Z.
Definition TH3.h:39
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition TH3.h:109
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:1493
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:1741
Int_t Fill(const char *, Double_t) override
Increment bin with namex with a weight w.
Definition TH3.h:60
Double_t Interpolate(Double_t x, Double_t y) const override
Not yet implemented.
Definition TH3.cxx:1402
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:1220
void AddBinContent(Int_t binx, Int_t biny, Int_t binz)
Increment 3D bin content by 1.
Definition TH3.h:81
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Definition TH3.cxx:3410
~TH3() override
Destructor.
Definition TH3.cxx:200
Int_t Fill(Double_t) override
Invalid Fill method.
Definition TH3.cxx:332
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition TH3.cxx:2877
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:1382
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:1773
void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) override
Definition TH3.h:136
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:1708
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:2767
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:2370
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition TH3.h:108
Int_t Fill(Double_t, const char *, Double_t)
Definition TH3.h:61
void AddBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t w)
Increment 3D bin content by a weight w.
Definition TH3.h:84
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:1112
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:2511
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition TH3.cxx:2887
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
Definition TH3.cxx:1351
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
Accumulate arguments in buffer.
Definition TH3.cxx:303
void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function fname.
Definition TH3.cxx:797
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:3637
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:2867
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition TH3.cxx:1152
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:1790
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:105
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Definition TH3.cxx:3429
void SetBinContent(Int_t bin, Int_t, Double_t content) override
Definition TH3.h:135
Double_t fTsumwyz
Total Sum of weight*Y*Z.
Definition TH3.h:40
TH3()
Default constructor.
Definition TH3.cxx:74
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override
See comments in TH1::GetBin.
Definition TH3.cxx:1078
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:939
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:2537
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
Definition TH3.cxx:2850
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
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