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
31namespace ROOT::Internal {
32/// Entrypoint for thread-safe filling from RDataFrame.
33template <typename T, typename... Args>
34auto FillThreadSafe(T &histo, Args... args) -> decltype(histo.FillThreadSafe(args...), void())
35{
36 histo.FillThreadSafe(args...);
37}
38} // namespace ROOT::Internal
39
40class TH3 : public TH1, public TAtt3D {
41
42protected:
43 Double_t fTsumwy; ///< Total Sum of weight*Y
44 Double_t fTsumwy2; ///< Total Sum of weight*Y*Y
45 Double_t fTsumwxy; ///< Total Sum of weight*X*Y
46 Double_t fTsumwz; ///< Total Sum of weight*Z
47 Double_t fTsumwz2; ///< Total Sum of weight*Z*Z
48 Double_t fTsumwxz; ///< Total Sum of weight*X*Z
49 Double_t fTsumwyz; ///< Total Sum of weight*Y*Z
50
51 TH3();
52 TH3(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
55 TH3(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
57 ,Int_t nbinsz,const Float_t *zbins);
58 TH3(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
60 ,Int_t nbinsz,const Double_t *zbins);
62
64
65 Int_t BufferFill(Double_t, Double_t) override {return -2;} //may not use
66 virtual Int_t BufferFill(Double_t, Double_t, Double_t) {return -2;} //may not use
67 Int_t Fill(Double_t) override; //MayNotUse
68 Int_t Fill(Double_t,Double_t) override {return Fill(0.);} //MayNotUse
69 Int_t Fill(const char*, Double_t) override {return Fill(0);} //MayNotUse
70 Int_t Fill(Double_t,const char*,Double_t) {return Fill(0);} //MayNotUse
71 Int_t Fill(const char*,Double_t,Double_t) {return Fill(0);} //MayNotUse
72 Int_t Fill(const char*,const char*,Double_t) {return Fill(0);} //MayNotUse
73
74 Double_t Interpolate(Double_t x, Double_t y) const override; // May not use
75 Double_t Interpolate(Double_t x) const override; // MayNotUse
76
77private:
78
79 TH3(const TH3&) = delete;
80 TH3& operator=(const TH3&) = delete;
81
82 using TH1::Integral;
84
85public:
86 ~TH3() override;
88 /// Increment 3D bin content by 1.
89 /// Passing an out-of-range bin leads to undefined behavior
91 /// Increment 3D bin content by a weight w.
92 /// Passing an out-of-range bin leads to undefined behavior
94 Int_t BufferEmpty(Int_t action = 0) override;
95 void Copy(TObject &hnew) const override;
96 virtual Int_t Fill(Double_t x, Double_t y, Double_t z);
98
99 virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w);
100 virtual Int_t Fill(const char *namex, Double_t y, const char *namez, Double_t w);
101 virtual Int_t Fill(const char *namex, const char *namey, Double_t z, Double_t w);
102 virtual Int_t Fill(Double_t x, const char *namey, const char *namez, Double_t w);
103 virtual Int_t Fill(const char *namex, Double_t y, Double_t z, Double_t w);
104 virtual Int_t Fill(Double_t x, const char *namey, Double_t z, Double_t w);
105 virtual Int_t Fill(Double_t x, Double_t y, const char *namez, Double_t w);
106
107 using TH1::FillRandom;
108 void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng = nullptr) override;
109 void FillRandom(TH1 *h, Int_t ntimes=5000, TRandom *rng = nullptr) override;
110 virtual void FitSlicesZ(TF1 *f1 = nullptr, Int_t binminx = 1, Int_t binmaxx = 0, Int_t binminy = 1, Int_t binmaxy = 0,
111 Int_t cut = 0, Option_t *option = "QNR"); // *MENU*
112 Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override;
113 using TH1::GetBinContent;
116 using TH1::GetBinErrorUp;
121 virtual Double_t GetCovariance(Int_t axis1=1,Int_t axis2=2) const;
122 virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &, TRandom * rng = nullptr);
123 void GetStats(Double_t *stats) const override;
124 Double_t Integral(Option_t *option="") const override;
127 Double_t Interpolate(Double_t x, Double_t y, Double_t z) const override;
128 Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const override;
129 virtual TH1D *ProjectionX(const char *name="_px", Int_t iymin=0, Int_t iymax=-1, Int_t izmin=0,
130 Int_t izmax=-1, Option_t *option="") const; // *MENU*
131 virtual TH1D *ProjectionY(const char *name="_py", Int_t ixmin=0, Int_t ixmax=-1, Int_t izmin=0,
132 Int_t izmax=-1, Option_t *option="") const; // *MENU*
133 virtual TH1D *ProjectionZ(const char *name="_pz", Int_t ixmin=0, Int_t ixmax=-1, Int_t iymin=0,
134 Int_t iymax=-1, Option_t *option="") const; // *MENU*
135 virtual TH1 *Project3D(Option_t *option="x") const; // *MENU*
136 virtual TProfile2D *Project3DProfile(Option_t *option="xy") const; // *MENU*
137 void PutStats(Double_t *stats) override;
138 TH3 *RebinX(Int_t ngroup = 2, const char *newname = "") override;
139 virtual TH3 *RebinY(Int_t ngroup = 2, const char *newname = "");
140 virtual TH3 *RebinZ(Int_t ngroup = 2, const char *newname = "");
141 virtual TH3 *Rebin3D(Int_t nxgroup = 2, Int_t nygroup = 2, Int_t nzgroup = 2, const char *newname = "");
142 void Reset(Option_t *option="") override;
143 void SetBinContent(Int_t bin, Double_t content) override;
146 virtual void SetShowProjection(const char *option="xy",Int_t nbins=1); // *MENU*
147
148protected:
149
150 virtual TH1D *DoProject1D(const char* name, const char * title, int imin1, int imax1, int imin2, int imax2,
151 const TAxis* projAxis, const TAxis * axis1, const TAxis * axis2, Option_t * option) const;
152 virtual TH1D *DoProject1D(const char *name, const char *title, const TAxis *projAxis, const TAxis *axis1,
153 const TAxis *axis2, bool computeErrors, bool originalRange, bool useUF, bool useOF) const;
154 virtual TH2D *DoProject2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
155 bool computeErrors, bool originalRange, bool useUF, bool useOF) const;
156 virtual TProfile2D *DoProjectProfile2D(const char* name, const char * title, const TAxis* projX, const TAxis* projY,
157 bool originalRange, bool useUF, bool useOF) const;
158
159 // these functions are need to be used inside TProfile3D::DoProjectProfile2D
160 static TH1D *DoProject1D(const TH3 & h, const char* name, const char * title, const TAxis* projX,
161 bool computeErrors, bool originalRange, bool useUF, bool useOF);
162 static TH2D *DoProject2D(const TH3 & h, const char* name, const char * title, const TAxis* projX, const TAxis* projY,
163 bool computeErrors, bool originalRange, bool useUF, bool useOF);
164
165 ClassDefOverride(TH3,6) //3-Dim histogram base class
166};
167
168//________________________________________________________________________
169
170class TH3C : public TH3, public TArrayC {
171public:
172 TH3C();
173 TH3C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
174 ,Int_t nbinsy,Double_t ylow,Double_t yup
176 TH3C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
177 ,Int_t nbinsy,const Float_t *ybins
178 ,Int_t nbinsz,const Float_t *zbins);
179 TH3C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
180 ,Int_t nbinsy,const Double_t *ybins
181 ,Int_t nbinsz,const Double_t *zbins);
182 TH3C(const TH3C &h3c);
183 ~TH3C() override;
184
185 void AddBinContent(Int_t bin) override;
186 void AddBinContent(Int_t bin, Double_t w) override;
187 using TH3::AddBinContent;
188 void Copy(TObject &hnew) const override;
189 void Reset(Option_t *option="") override;
190 void SetBinsLength(Int_t n=-1) override;
191
192 TH3C& operator=(const TH3C &h1);
193 friend TH3C operator*(Float_t c1, TH3C const &h1);
194 friend TH3C operator*(TH3C const &h1, Float_t c1) {return operator*(c1,h1);}
195 friend TH3C operator+(TH3C const &h1, TH3C const &h2);
196 friend TH3C operator-(TH3C const &h1, TH3C const &h2);
197 friend TH3C operator*(TH3C const &h1, TH3C const &h2);
198 friend TH3C operator/(TH3C const &h1, TH3C const &h2);
199
200protected:
201 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
202 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Char_t (content); }
203
204 ClassDefOverride(TH3C,4) //3-Dim histograms (one char per channel)
205};
206
207//________________________________________________________________________
208
209class TH3S : public TH3, public TArrayS {
210public:
211 TH3S();
212 TH3S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
213 ,Int_t nbinsy,Double_t ylow,Double_t yup
215 TH3S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
216 ,Int_t nbinsy,const Float_t *ybins
217 ,Int_t nbinsz,const Float_t *zbins);
218 TH3S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
219 ,Int_t nbinsy,const Double_t *ybins
220 ,Int_t nbinsz,const Double_t *zbins);
221 TH3S(const TH3S &h3s);
222 ~TH3S() override;
223
224 void AddBinContent(Int_t bin) override;
225 void AddBinContent(Int_t bin, Double_t w) override;
226 using TH3::AddBinContent;
227 void Copy(TObject &hnew) const override;
228 void Reset(Option_t *option="") override;
229 void SetBinsLength(Int_t n=-1) override;
230
231 TH3S& operator=(const TH3S &h1);
232 friend TH3S operator*(Float_t c1, TH3S const &h1);
233 friend TH3S operator*(TH3S const &h1, Float_t c1) {return operator*(c1,h1);}
234 friend TH3S operator+(TH3S const &h1, TH3S const &h2);
235 friend TH3S operator-(TH3S const &h1, TH3S const &h2);
236 friend TH3S operator*(TH3S const &h1, TH3S const &h2);
237 friend TH3S operator/(TH3S const &h1, TH3S const &h2);
238
239protected:
240 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
241 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Short_t (content); }
242
243 ClassDefOverride(TH3S,4) //3-Dim histograms (one short per channel)
244};
245
246//________________________________________________________________________
247
248class TH3I : public TH3, public TArrayI {
249public:
250 TH3I();
251 TH3I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
252 ,Int_t nbinsy,Double_t ylow,Double_t yup
254 TH3I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
255 ,Int_t nbinsy,const Float_t *ybins
256 ,Int_t nbinsz,const Float_t *zbins);
257 TH3I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
258 ,Int_t nbinsy,const Double_t *ybins
259 ,Int_t nbinsz,const Double_t *zbins);
260 TH3I(const TH3I &h3i);
261 ~TH3I() override;
262
263 void AddBinContent(Int_t bin) override;
264 void AddBinContent(Int_t bin, Double_t w) override;
265 using TH3::AddBinContent;
266 void Copy(TObject &hnew) const override;
267 void Reset(Option_t *option="") override;
268 void SetBinsLength(Int_t n=-1) override;
269
270 TH3I& operator=(const TH3I &h1);
271 friend TH3I operator*(Float_t c1, TH3I const &h1);
272 friend TH3I operator*(TH3I const &h1, Float_t c1) {return operator*(c1,h1);}
273 friend TH3I operator+(TH3I const &h1, TH3I const &h2);
274 friend TH3I operator-(TH3I const &h1, TH3I const &h2);
275 friend TH3I operator*(TH3I const &h1, TH3I const &h2);
276 friend TH3I operator/(TH3I const &h1, TH3I const &h2);
277
278protected:
279 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
280 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
281
282 ClassDefOverride(TH3I,4) //3-Dim histograms (one 32 bit integer per channel)
283};
284
285
286//________________________________________________________________________
287
288class TH3L : public TH3, public TArrayL64 {
289public:
290 TH3L();
291 TH3L(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
292 ,Int_t nbinsy,Double_t ylow,Double_t yup
294 TH3L(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
295 ,Int_t nbinsy,const Float_t *ybins
296 ,Int_t nbinsz,const Float_t *zbins);
297 TH3L(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
298 ,Int_t nbinsy,const Double_t *ybins
299 ,Int_t nbinsz,const Double_t *zbins);
300 TH3L(const TH3L &h3l);
301 ~TH3L() override;
302 void AddBinContent(Int_t bin) override;
303 void AddBinContent(Int_t bin, Double_t w) override;
304 using TH3::AddBinContent;
305 void Copy(TObject &hnew) const override;
306 void Reset(Option_t *option="") override;
307 void SetBinsLength(Int_t n=-1) override;
308 TH3L& operator=(const TH3L &h1);
309 friend TH3L operator*(Float_t c1, TH3L const &h1);
310 friend TH3L operator*(TH3L const &h1, Float_t c1) {return operator*(c1,h1);}
311 friend TH3L operator+(TH3L const &h1, TH3L const &h2);
312 friend TH3L operator-(TH3L const &h1, TH3L const &h2);
313 friend TH3L operator*(TH3L const &h1, TH3L const &h2);
314 friend TH3L operator/(TH3L const &h1, TH3L const &h2);
315
316protected:
317 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
318 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
319
320 ClassDefOverride(TH3L,0) //3-Dim histograms (one 64 bit integer per channel)
321};
322
323
324//________________________________________________________________________
325
326class TH3F : public TH3, public TArrayF {
327public:
328 TH3F();
329 TH3F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
330 ,Int_t nbinsy,Double_t ylow,Double_t yup
332 TH3F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
333 ,Int_t nbinsy,const Float_t *ybins
334 ,Int_t nbinsz,const Float_t *zbins);
335 TH3F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
336 ,Int_t nbinsy,const Double_t *ybins
337 ,Int_t nbinsz,const Double_t *zbins);
338 TH3F(const TH3F &h3f);
339 ~TH3F() override;
340
341 /// Increment bin content by 1.
342 /// Passing an out-of-range bin leads to undefined behavior
343 void AddBinContent(Int_t bin) override {++fArray[bin];}
344 /// Increment bin content by a weight w.
345 /// \warning The value of w is cast to `Float_t` before being added.
346 /// Passing an out-of-range bin leads to undefined behavior
347 void AddBinContent(Int_t bin, Double_t w) override
348 {fArray[bin] += Float_t (w);}
349 using TH3::AddBinContent;
350 void Copy(TObject &hnew) const override;
351 void Reset(Option_t *option="") override;
352 void SetBinsLength(Int_t n=-1) override;
353
354 TH3F& operator=(const TH3F &h1);
355 friend TH3F operator*(Float_t c1, TH3F const &h1);
356 friend TH3F operator*(TH3F const &h1, Float_t c1) {return operator*(c1,h1);}
357 friend TH3F operator+(TH3F const &h1, TH3F const &h2);
358 friend TH3F operator-(TH3F const &h1, TH3F const &h2);
359 friend TH3F operator*(TH3F const &h1, TH3F const &h2);
360 friend TH3F operator/(TH3F const &h1, TH3F const &h2);
361
362protected:
363 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
364 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Float_t (content); }
365
366 ClassDefOverride(TH3F,4) //3-Dim histograms (one float per channel)
367};
368
369//________________________________________________________________________
370
371class TH3D : public TH3, public TArrayD {
372public:
373 TH3D();
374 TH3D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup
375 ,Int_t nbinsy,Double_t ylow,Double_t yup
377 TH3D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins
378 ,Int_t nbinsy,const Float_t *ybins
379 ,Int_t nbinsz,const Float_t *zbins);
380 TH3D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins
381 ,Int_t nbinsy,const Double_t *ybins
382 ,Int_t nbinsz,const Double_t *zbins);
383 TH3D(const TH3D &h3d);
384 ~TH3D() override;
385
386 /// Increment bin content by 1.
387 /// Passing an out-of-range bin leads to undefined behavior
388 void AddBinContent(Int_t bin) override {++fArray[bin];}
389 /// Increment bin content by a weight w
390 /// Passing an out-of-range bin leads to undefined behavior
391 void AddBinContent(Int_t bin, Double_t w) override
392 {fArray[bin] += Double_t (w);}
393 using TH3::AddBinContent;
394 void Copy(TObject &hnew) const override;
395 void Reset(Option_t *option="") override;
396 void SetBinsLength(Int_t n=-1) override;
397
398 TH3D& operator=(const TH3D &h1);
399 friend TH3D operator*(Float_t c1, TH3D const &h1);
400 friend TH3D operator*(TH3D const &h1, Float_t c1) {return operator*(c1,h1);}
401 friend TH3D operator+(TH3D const &h1, TH3D const &h2);
402 friend TH3D operator-(TH3D const &h1, TH3D const &h2);
403 friend TH3D operator*(TH3D const &h1, TH3D const &h2);
404 friend TH3D operator/(TH3D const &h1, TH3D const &h2);
405
406protected:
407 Double_t RetrieveBinContent(Int_t bin) const override { return fArray[bin]; }
408 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = content; }
409private:
410#ifdef __cpp_lib_atomic_ref
411 void FillThreadSafe(Double_t x, Double_t y, Double_t z, Double_t w = 1.);
412 template <typename T, typename... Args>
413 friend auto ROOT::Internal::FillThreadSafe(T &histo, Args... args)
414 -> decltype(histo.FillThreadSafe(args...), void());
415#endif
416
417 ClassDefOverride(TH3D,4) //3-Dim histograms (one double per channel)
418};
419
420#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:234
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:698
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:3500
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:7964
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition TH1.cxx:9075
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7937
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition TH1.cxx:5064
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition TH1.cxx:9106
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:170
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:3664
friend TH3C operator*(TH3C const &h1, Float_t c1)
Definition TH3.h:194
friend TH3C operator*(Float_t c1, TH3C const &h1)
Operator *.
Definition TH3.cxx:3748
~TH3C() override
Destructor.
Definition TH3.cxx:3557
friend TH3C operator-(TH3C const &h1, TH3C const &h2)
Operator -.
Definition TH3.cxx:3772
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Definition TH3.cxx:3652
friend TH3C operator+(TH3C const &h1, TH3C const &h2)
Operator +.
Definition TH3.cxx:3760
friend TH3C operator/(TH3C const &h1, TH3C const &h2)
Operator /.
Definition TH3.cxx:3796
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:201
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:3620
TH3C & operator=(const TH3C &h1)
Operator =.
Definition TH3.cxx:3737
TH3C()
Constructor.
Definition TH3.cxx:3547
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:202
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:3643
3-D histogram with a double per channel (see TH1 documentation)
Definition TH3.h:371
friend TH3D operator*(TH3D const &h1, Float_t c1)
Definition TH3.h:400
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:408
TH3D()
Constructor.
Definition TH3.cxx:4686
friend TH3D operator+(TH3D const &h1, TH3D const &h2)
Operator +.
Definition TH3.cxx:4848
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4780
~TH3D() override
Destructor.
Definition TH3.cxx:4696
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:391
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:407
friend TH3D operator-(TH3D const &h1, TH3D const &h2)
Operator -.
Definition TH3.cxx:4860
friend TH3D operator/(TH3D const &h1, TH3D const &h2)
Operator /.
Definition TH3.cxx:4884
friend TH3D operator*(Float_t c1, TH3D const &h1)
Operator *.
Definition TH3.cxx:4836
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4759
TH3D & operator=(const TH3D &h1)
Operator =.
Definition TH3.cxx:4824
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.h:388
3-D histogram with a float per channel (see TH1 documentation)
Definition TH3.h:326
friend TH3F operator/(TH3F const &h1, TH3F const &h2)
Operator /.
Definition TH3.cxx:4666
TH3F & operator=(const TH3F &h1)
Operator =.
Definition TH3.cxx:4607
friend TH3F operator+(TH3F const &h1, TH3F const &h2)
Operator +.
Definition TH3.cxx:4630
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.h:343
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:364
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w.
Definition TH3.h:347
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4563
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:363
TH3F()
Constructor.
Definition TH3.cxx:4470
~TH3F() override
Destructor.
Definition TH3.cxx:4480
friend TH3F operator-(TH3F const &h1, TH3F const &h2)
Operator -.
Definition TH3.cxx:4642
friend TH3F operator*(TH3F const &h1, Float_t c1)
Definition TH3.h:356
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4542
friend TH3F operator*(Float_t c1, TH3F const &h1)
Operator *.
Definition TH3.cxx:4618
3-D histogram with an int per channel (see TH1 documentation)
Definition TH3.h:248
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:279
TH3I & operator=(const TH3I &h1)
Operator =.
Definition TH3.cxx:4184
friend TH3I operator+(TH3I const &h1, TH3I const &h2)
Operator +.
Definition TH3.cxx:4207
friend TH3I operator-(TH3I const &h1, TH3I const &h2)
Operator _.
Definition TH3.cxx:4219
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:4129
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:280
TH3I()
Constructor.
Definition TH3.cxx:4056
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4152
friend TH3I operator*(Float_t c1, TH3I const &h1)
Operator *.
Definition TH3.cxx:4195
friend TH3I operator/(TH3I const &h1, TH3I const &h2)
Operator /.
Definition TH3.cxx:4243
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4173
~TH3I() override
Destructor.
Definition TH3.cxx:4066
friend TH3I operator*(TH3I const &h1, Float_t c1)
Definition TH3.h:272
3-D histogram with a long64 per channel (see TH1 documentation)
Definition TH3.h:288
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:318
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:317
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:4359
TH3L & operator=(const TH3L &h1)
Operator =.
Definition TH3.cxx:4391
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:4336
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:4380
friend TH3L operator+(TH3L const &h1, TH3L const &h2)
Operator +.
Definition TH3.cxx:4414
~TH3L() override
Destructor.
Definition TH3.cxx:4273
TH3L()
Constructor.
Definition TH3.cxx:4263
friend TH3L operator*(Float_t c1, TH3L const &h1)
Operator *.
Definition TH3.cxx:4402
friend TH3L operator-(TH3L const &h1, TH3L const &h2)
Operator _.
Definition TH3.cxx:4426
friend TH3L operator/(TH3L const &h1, TH3L const &h2)
Operator /.
Definition TH3.cxx:4450
friend TH3L operator*(TH3L const &h1, Float_t c1)
Definition TH3.h:310
3-D histogram with a short per channel (see TH1 documentation)
Definition TH3.h:209
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH3.cxx:3933
friend TH3S operator*(TH3S const &h1, Float_t c1)
Definition TH3.h:233
friend TH3S operator+(TH3S const &h1, TH3S const &h2)
Operator +.
Definition TH3.cxx:4000
friend TH3S operator/(TH3S const &h1, TH3S const &h2)
Operator /.
Definition TH3.cxx:4036
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH3.cxx:3889
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:241
~TH3S() override
Destructor.
Definition TH3.cxx:3826
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
Definition TH3.cxx:3912
friend TH3S operator*(Float_t c1, TH3S const &h1)
Operator *.
Definition TH3.cxx:3988
friend TH3S operator-(TH3S const &h1, TH3S const &h2)
Operator -.
Definition TH3.cxx:4012
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:240
TH3S & operator=(const TH3S &h1)
Operator =.
Definition TH3.cxx:3977
TH3S()
Constructor.
Definition TH3.cxx:3816
The 3-D histogram classes derived from the 1-D histogram classes.
Definition TH3.h:40
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:2974
Int_t BufferFill(Double_t, Double_t) override
accumulate arguments in buffer.
Definition TH3.h:65
Int_t BufferEmpty(Int_t action=0) override
Fill histogram with all entries in the buffer.
Definition TH3.cxx:231
Double_t fTsumwy
Total Sum of weight*Y.
Definition TH3.h:43
Int_t Fill(const char *, const char *, Double_t)
Definition TH3.h:72
virtual Int_t BufferFill(Double_t, Double_t, Double_t)
Definition TH3.h:66
Double_t fTsumwy2
Total Sum of weight*Y*Y.
Definition TH3.h:44
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
Definition TH3.cxx:1226
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:1324
void Copy(TObject &hnew) const override
Copy.
Definition TH3.cxx:211
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:2120
Double_t fTsumwxz
Total Sum of weight*X*Z.
Definition TH3.h:48
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
Definition TH3.h:118
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:1549
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:1797
Int_t Fill(const char *, Double_t) override
Increment bin with namex with a weight w.
Definition TH3.h:69
Double_t Interpolate(Double_t x, Double_t y) const override
Not yet implemented.
Definition TH3.cxx:1458
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:1276
void AddBinContent(Int_t binx, Int_t biny, Int_t binz)
Increment 3D bin content by 1.
Definition TH3.h:90
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Definition TH3.cxx:3466
~TH3() override
Destructor.
Definition TH3.cxx:203
Int_t Fill(Double_t) override
Invalid Fill method.
Definition TH3.cxx:335
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
Definition TH3.cxx:2933
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:1438
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:1829
void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) override
Definition TH3.h:145
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:1764
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:2823
Double_t fTsumwz2
Total Sum of weight*Z*Z.
Definition TH3.h:47
Double_t fTsumwxy
Total Sum of weight*X*Y.
Definition TH3.h:45
Int_t Fill(Double_t, Double_t) override
Increment bin with abscissa X with a weight w.
Definition TH3.h:68
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:2426
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Definition TH3.h:117
Int_t Fill(Double_t, const char *, Double_t)
Definition TH3.h:70
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:93
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:1168
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:2567
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Definition TH3.cxx:2943
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
Definition TH3.cxx:1407
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
Accumulate arguments in buffer.
Definition TH3.cxx:306
void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function fname.
Definition TH3.cxx:853
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:3693
Int_t Fill(const char *, Double_t, Double_t)
Definition TH3.h:71
TH3 * RebinX(Int_t ngroup=2, const char *newname="") override
Rebin only the X axis see Rebin3D.
Definition TH3.cxx:2923
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
Definition TH3.cxx:1208
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:1846
TH3(const TH3 &)=delete
Double_t fTsumwz
Total Sum of weight*Z.
Definition TH3.h:46
Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const override
Definition TH3.h:114
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Definition TH3.cxx:3485
void SetBinContent(Int_t bin, Int_t, Double_t content) override
Definition TH3.h:144
Double_t fTsumwyz
Total Sum of weight*Y*Z.
Definition TH3.h:49
TH3()
Default constructor.
Definition TH3.cxx:77
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override
See comments in TH1::GetBin.
Definition TH3.cxx:1134
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:995
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:2593
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
Definition TH3.cxx:2906
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
auto FillThreadSafe(T &histo, Args... args) -> decltype(histo.FillThreadSafe(args...), void())
Entrypoint for thread-safe filling from RDataFrame.
Definition TH3.h:34