31#if defined R__B64 && defined __cpp_lib_atomic_ref
33#define TH3D_FILL_THREADSAFE
38template <
typename T,
typename... Args>
39auto FillThreadSafe(T &histo, Args... args) ->
decltype(histo.FillThreadSafe(args...),
void())
41 histo.FillThreadSafe(args...);
104 virtual Int_t Fill(
const char *namex,
const char *namey,
const char *namez,
Double_t w);
124 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;
156 virtual TH1D *
DoProject1D(
const char*
name,
const char * title,
int imin1,
int imax1,
int imin2,
int imax2,
159 const TAxis *axis2,
bool computeErrors,
bool originalRange,
bool useUF,
bool useOF,
bool useWidth)
const;
161 bool computeErrors,
bool originalRange,
bool useUF,
bool useOF,
bool useWidth)
const;
163 bool originalRange,
bool useUF,
bool useOF,
bool useWidth)
const;
167 bool computeErrors,
bool originalRange,
bool useUF,
bool useOF,
bool useWidth);
169 bool computeErrors,
bool originalRange,
bool useUF,
bool useOF,
bool useWidth);
463#ifdef TH3D_FILL_THREADSAFE
465 template <
typename T,
typename... Args>
467 ->
decltype(histo.FillThreadSafe(args...),
void());
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
bool Bool_t
Boolean (0=false, 1=true) (bool).
short Short_t
Signed Short integer 2 bytes (short).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
#define ClassDefOverride(name, id)
TH3C operator*(Float_t c1, TH3C const &h1)
Operator *.
TH3C operator-(TH3C const &h1, TH3C const &h2)
Operator -.
TH3C operator+(TH3C const &h1, TH3C const &h2)
Operator +.
TH3C operator/(TH3C const &h1, TH3C const &h2)
Operator /.
TArrayC()
Default TArrayC ctor.
TArrayD()
Default TArrayD ctor.
TArrayF()
Default TArrayF ctor.
TArrayI()
Default TArrayI ctor.
TArrayL64()
Default TArrayL64 ctor.
TArrayS()
Default TArrayS ctor.
Class to manage histogram axis.
1-D histogram with a double per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
virtual void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr)
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.
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
virtual void AddBinContent(Int_t bin)=0
Increment bin content by 1.
2-D histogram with a double per channel (see TH1 documentation)
3-D histogram with a byte per channel (see TH1 documentation)
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
friend TH3C operator*(Float_t c1, TH3C const &h1)
Operator *.
~TH3C() override
Destructor.
friend TH3C operator-(TH3C const &h1, TH3C const &h2)
Operator -.
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
friend TH3C operator+(TH3C const &h1, TH3C const &h2)
Operator +.
friend TH3C operator/(TH3C const &h1, TH3C const &h2)
Operator /.
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...
void AddBinContent(Int_t bin) override
Increment bin content by 1.
TH3C & operator=(const TH3C &h1)
Operator =.
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...
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
3-D histogram with a double per channel (see TH1 documentation)
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...
friend TH3D operator+(TH3D const &h1, TH3D const &h2)
Operator +.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH3D() override
Destructor.
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.
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...
friend TH3D operator-(TH3D const &h1, TH3D const &h2)
Operator -.
friend TH3D operator/(TH3D const &h1, TH3D const &h2)
Operator /.
friend TH3D operator*(Float_t c1, TH3D const &h1)
Operator *.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
TH3D & operator=(const TH3D &h1)
Operator =.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
3-D histogram with a float per channel (see TH1 documentation)
friend TH3F operator/(TH3F const &h1, TH3F const &h2)
Operator /.
TH3F & operator=(const TH3F &h1)
Operator =.
friend TH3F operator+(TH3F const &h1, TH3F const &h2)
Operator +.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
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...
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
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...
~TH3F() override
Destructor.
friend TH3F operator-(TH3F const &h1, TH3F const &h2)
Operator -.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
friend TH3F operator*(Float_t c1, TH3F const &h1)
Operator *.
3-D histogram with an int per channel (see TH1 documentation)
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...
TH3I & operator=(const TH3I &h1)
Operator =.
friend TH3I operator+(TH3I const &h1, TH3I const &h2)
Operator +.
friend TH3I operator-(TH3I const &h1, TH3I const &h2)
Operator _.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
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...
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
friend TH3I operator*(Float_t c1, TH3I const &h1)
Operator *.
friend TH3I operator/(TH3I const &h1, TH3I const &h2)
Operator /.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
~TH3I() override
Destructor.
3-D histogram with a long64 per channel (see TH1 documentation)
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...
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...
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
TH3L & operator=(const TH3L &h1)
Operator =.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
friend TH3L operator+(TH3L const &h1, TH3L const &h2)
Operator +.
~TH3L() override
Destructor.
friend TH3L operator*(Float_t c1, TH3L const &h1)
Operator *.
friend TH3L operator-(TH3L const &h1, TH3L const &h2)
Operator _.
friend TH3L operator/(TH3L const &h1, TH3L const &h2)
Operator /.
3-D histogram with a short per channel (see TH1 documentation)
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
friend TH3S operator+(TH3S const &h1, TH3S const &h2)
Operator +.
friend TH3S operator/(TH3S const &h1, TH3S const &h2)
Operator /.
void AddBinContent(Int_t bin) override
Increment bin content by 1.
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...
~TH3S() override
Destructor.
void Copy(TObject &hnew) const override
Copy this 3-D histogram structure to newth3.
friend TH3S operator*(Float_t c1, TH3S const &h1)
Operator *.
friend TH3S operator-(TH3S const &h1, TH3S const &h2)
Operator -.
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...
TH3S & operator=(const TH3S &h1)
Operator =.
The 3-D histogram classes derived from the 1-D histogram classes.
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.
Int_t BufferFill(Double_t, Double_t) override
accumulate arguments in buffer.
Int_t BufferEmpty(Int_t action=0) override
Fill histogram with all entries in the buffer.
Double_t fTsumwy
Total Sum of weight*Y.
Int_t Fill(const char *, const char *, Double_t)
virtual Int_t BufferFill(Double_t, Double_t, Double_t)
Double_t fTsumwy2
Total Sum of weight*Y*Y.
virtual Double_t GetCovariance(Int_t axis1=1, Int_t axis2=2) const
Return covariance between axis1 and axis2.
void GetStats(Double_t *stats) const override
Fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
void Copy(TObject &hnew) const override
Copy.
Double_t fTsumwxz
Total Sum of weight*X*Z.
virtual Double_t GetBinErrorUp(Int_t binx, Int_t biny, Int_t binz)
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.
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 (integration along X and Z).
Int_t Fill(const char *, Double_t) override
Increment bin with namex with a weight w.
Double_t Interpolate(Double_t x, Double_t y) const override
Not yet implemented.
void AddBinContent(Int_t binx, Int_t biny, Int_t binz)
Increment 3D bin content by 1.
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
~TH3() override
Destructor.
Int_t Fill(Double_t) override
Invalid Fill method.
virtual TH3 * RebinY(Int_t ngroup=2, const char *newname="")
Rebin only the Y axis see Rebin3D.
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...
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 (integration along X and Y).
void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t content) override
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 (integration along Y and Z).
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...
Double_t fTsumwz2
Total Sum of weight*Z*Z.
Double_t fTsumwxy
Total Sum of weight*X*Y.
Int_t Fill(Double_t, Double_t) override
Increment bin with abscissa X with a weight w.
virtual TH1 * Project3D(Option_t *option="x") const
Project a 3-d histogram into 1 or 2-d histograms depending on the option parameter,...
virtual Double_t GetBinErrorLow(Int_t binx, Int_t biny, Int_t binz)
Int_t Fill(Double_t, const char *, Double_t)
void AddBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t w)
Increment 3D bin content by a weight w.
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,...
virtual TH2D * DoProject2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool computeErrors, bool originalRange, bool useUF, bool useOF, bool useWidth) const
internal method performing the projection to a 2D histogram called from TH3::Project3D
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...
virtual TH3 * RebinZ(Int_t ngroup=2, const char *newname="")
Rebin only the Z axis see Rebin3D.
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
virtual Int_t BufferFill(Double_t x, Double_t y, Double_t z, Double_t w)
Accumulate arguments in buffer.
void FillRandom(TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr) override
Fill histogram following distribution in function fname.
virtual void GetRandom3(Double_t &x, Double_t &y, Double_t &, TRandom *rng=nullptr, Option_t *option="")
Return 3 random numbers along axis x, y and z distributed according to the cell-contents of this 3-di...
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...
Int_t Fill(const char *, Double_t, Double_t)
TH3 * RebinX(Int_t ngroup=2, const char *newname="") override
Rebin only the X axis see Rebin3D.
virtual Double_t GetCorrelationFactor(Int_t axis1=1, Int_t axis2=2) const
Return correlation factor between axis1 and axis2.
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
Double_t fTsumwz
Total Sum of weight*Z.
Double_t GetBinContent(Int_t binx, Int_t biny, Int_t binz) const override
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
void SetBinContent(Int_t bin, Int_t, Double_t content) override
Double_t fTsumwyz
Total Sum of weight*Y*Z.
TH3()
Default constructor.
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz) const override
See comments in TH1::GetBin.
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-...
virtual TH1 * ShowBackground3D(Int_t nIterX=20, Int_t nIterY=20, Int_t nIterZ=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
virtual TProfile2D * DoProjectProfile2D(const char *name, const char *title, const TAxis *projX, const TAxis *projY, bool originalRange, bool useUF, bool useOF, bool useWidth) const
internal method to project to a 2D Profile called from TH3::Project3DProfile
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
Mother of all ROOT objects.
Profile2D histograms are used to display the mean value of Z and its error for each cell in X,...
This is the base class for the ROOT Random number generators.
auto FillThreadSafe(T &histo, Args... args) -> decltype(histo.FillThreadSafe(args...), void())
Entrypoint for thread-safe filling from RDataFrame.