Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TH1.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Rene Brun 26/12/94
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_TH1
13#define ROOT_TH1
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TH1 //
19// //
20// 1-Dim histogram base class. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TAxis.h"
25
26#include "TAttLine.h"
27
28#include "TAttFill.h"
29
30#include "TAttMarker.h"
31
32#include "TArrayC.h"
33#include "TArrayS.h"
34#include "TArrayI.h"
35#include "TArrayL64.h"
36#include "TArrayF.h"
37#include "TArrayD.h"
38#include "Foption.h"
39
40#include "TVectorFfwd.h"
41#include "TVectorDfwd.h"
42
43#include "TFitResultPtr.h"
44
45#include <cfloat>
46#include <string>
47
48class TF1;
49class TH1D;
50class TBrowser;
51class TDirectory;
52class TList;
53class TCollection;
54class TVirtualFFT;
56class TRandom;
57
58
59class TH1 : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
60
61public:
62
63 /// Enumeration specifying type of statistics for bin errors
65 kNormal = 0, ///< Errors with Normal (Wald) approximation: errorUp=errorLow= sqrt(N)
66 kPoisson = 1 , ///< Errors from Poisson interval at 68.3% (1 sigma)
67 kPoisson2 = 2 ///< Errors from Poisson interval at 95% CL (~ 2 sigma)
68 };
69
70 /// Enumeration specifying which axes can be extended
71 enum {
72 kNoAxis = 0, ///< NOTE: Must always be 0 !!!
73 kXaxis = BIT(0),
74 kYaxis = BIT(1),
75 kZaxis = BIT(2),
77 };
78
79 /// Enumeration specifying the way to treat statoverflow
81 kIgnore = 0, ///< Override global flag ignoring the overflows
82 kConsider = 1, ///< Override global flag considering the overflows
83 kNeutral = 2, ///< Adapt to the global flag
84 };
85
86 friend class TH1Merger;
87
88protected:
89 Int_t fNcells; ///< Number of bins(1D), cells (2D) +U/Overflows
90 TAxis fXaxis; ///< X axis descriptor
91 TAxis fYaxis; ///< Y axis descriptor
92 TAxis fZaxis; ///< Z axis descriptor
93 Short_t fBarOffset; ///< (1000*offset) for bar charts or legos
94 Short_t fBarWidth; ///< (1000*width) for bar charts or legos
95 Double_t fEntries; ///< Number of entries
96 Double_t fTsumw; ///< Total Sum of weights
97 Double_t fTsumw2; ///< Total Sum of squares of weights
98 Double_t fTsumwx; ///< Total Sum of weight*X
99 Double_t fTsumwx2; ///< Total Sum of weight*X*X
100 Double_t fMaximum; ///< Maximum value for plotting
101 Double_t fMinimum; ///< Minimum value for plotting
102 Double_t fNormFactor; ///< Normalization factor
103 TArrayD fContour; ///< Array to display contour levels
104 TArrayD fSumw2; ///< Array of sum of squares of weights
105 TString fOption; ///< Histogram options
106 TList *fFunctions; ///<->Pointer to list of functions (fits and user)
107 Int_t fBufferSize; ///< fBuffer size
108 Double_t *fBuffer; ///<[fBufferSize] entry buffer
109 TDirectory *fDirectory; ///<! Pointer to directory holding this histogram
110 Int_t fDimension; ///<! Histogram dimension (1, 2 or 3 dim)
111 Double_t *fIntegral; ///<! Integral of bins used by GetRandom
112 TVirtualHistPainter *fPainter; ///<! Pointer to histogram painter
113 EBinErrorOpt fBinStatErrOpt; ///< Option for bin statistical errors
114 EStatOverflows fStatOverflows; ///< Per object flag to use under/overflows in statistics
115 static Int_t fgBufferSize; ///<! Default buffer size for automatic histograms
116 static Bool_t fgAddDirectory; ///<! Flag to add histograms to the directory
117 static Bool_t fgStatOverflows; ///<! Flag to use under/overflows in statistics
118 static Bool_t fgDefaultSumw2; ///<! Flag to call TH1::Sumw2 automatically at histogram creation time
119
120public:
122
123private:
124 void Build();
125
126 TH1(const TH1&) = delete;
127 TH1& operator=(const TH1&) = delete;
128
129protected:
130 TH1();
131 TH1(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
132 TH1(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
133 TH1(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
134
135 Int_t AxisChoice(Option_t *axis) const;
137 virtual Bool_t FindNewAxisLimits(const TAxis* axis, const Double_t point, Double_t& newMin, Double_t &newMax);
138 virtual void SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option = "");
139 static Bool_t RecomputeAxisLimits(TAxis& destAxis, const TAxis& anAxis);
140 static Bool_t SameLimitsAndNBins(const TAxis& axis1, const TAxis& axis2);
141 Bool_t IsEmpty() const;
143
144 inline static Double_t AutoP2GetPower2(Double_t x, Bool_t next = kTRUE);
145 inline static Int_t AutoP2GetBins(Int_t n);
146 virtual Int_t AutoP2FindLimits(Double_t min, Double_t max);
147
148 virtual Double_t DoIntegral(Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Int_t iz1, Int_t iz2, Double_t & err,
149 Option_t * opt, Bool_t doerr = kFALSE) const;
150
151 virtual void DoFillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1);
153
154 static bool CheckAxisLimits(const TAxis* a1, const TAxis* a2);
155 static bool CheckBinLimits(const TAxis* a1, const TAxis* a2);
156 static bool CheckBinLabels(const TAxis* a1, const TAxis* a2);
157 static bool CheckEqualAxes(const TAxis* a1, const TAxis* a2);
158 static bool CheckConsistentSubAxes(const TAxis *a1, Int_t firstBin1, Int_t lastBin1, const TAxis *a2, Int_t firstBin2=0, Int_t lastBin2=0);
159 static int CheckConsistency(const TH1* h1, const TH1* h2);
160 int LoggedInconsistency(const char* name, const TH1* h1, const TH1* h2, bool useMerge=false) const;
161
162public:
163 /// TH1 status bits
165 kNoStats = BIT(9), ///< Don't draw stats box
166 kUserContour = BIT(10), ///< User specified contour levels
167 // kCanRebin = BIT(11), ///< FIXME DEPRECATED - to be removed, replaced by SetCanExtend / CanExtendAllAxes
168 kLogX = BIT(15), ///< X-axis in log scale
169 kIsZoomed = BIT(16), ///< Bit set when zooming on Y axis
170 kNoTitle = BIT(17), ///< Don't draw the histogram title
171 kIsAverage = BIT(18), ///< Bin contents are average (used by Add)
172 kIsNotW = BIT(19), ///< Histogram is forced to be not weighted even when the histogram is filled with weighted
173 /// different than 1.
174 kAutoBinPTwo = BIT(20), ///< Use Power(2)-based algorithm for autobinning
175 kIsHighlight = BIT(21) ///< bit set if histo is highlight
176 };
177 /// Size of statistics data (size of array used in GetStats()/ PutStats )
178 /// - s[0] = sumw s[1] = sumw2
179 /// - s[2] = sumwx s[3] = sumwx2
180 /// - s[4] = sumwy s[5] = sumwy2 s[6] = sumwxy
181 /// - s[7] = sumwz s[8] = sumwz2 s[9] = sumwxz s[10] = sumwyz
182 /// - s[11] = sumwt s[12] = sumwt2 (11 and 12 used only by TProfile3D)
183 enum {
184 kNstat = 13 ///< Size of statistics data (up to TProfile3D)
185 };
186
187
188 ~TH1() override;
189
190 virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="");
191 virtual Bool_t Add(const TH1 *h1, Double_t c1=1);
192 virtual Bool_t Add(const TH1 *h, const TH1 *h2, Double_t c1=1, Double_t c2=1); // *MENU*
193 virtual void AddBinContent(Int_t bin);
194 virtual void AddBinContent(Int_t bin, Double_t w);
195 static void AddDirectory(Bool_t add=kTRUE);
196 static Bool_t AddDirectoryStatus();
197 void Browse(TBrowser *b) override;
198 virtual Bool_t CanExtendAllAxes() const;
199 virtual Double_t Chi2Test(const TH1* h2, Option_t *option = "UU", Double_t *res = nullptr) const;
200 virtual Double_t Chi2TestX(const TH1* h2, Double_t &chi2, Int_t &ndf, Int_t &igood,Option_t *option = "UU", Double_t *res = nullptr) const;
201 virtual Double_t Chisquare(TF1 * f1, Option_t *option = "") const;
202 virtual void ClearUnderflowAndOverflow();
203 virtual Double_t ComputeIntegral(Bool_t onlyPositive = false);
204 TObject* Clone(const char *newname = "") const override;
205 void Copy(TObject &hnew) const override;
206 virtual void DirectoryAutoAdd(TDirectory *);
207 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
208 virtual Bool_t Divide(TF1 *f1, Double_t c1=1);
209 virtual Bool_t Divide(const TH1 *h1);
210 virtual Bool_t Divide(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
211 void Draw(Option_t *option = "") override;
212 virtual TH1 *DrawCopy(Option_t *option="", const char * name_postfix = "_copy") const;
213 virtual TH1 *DrawNormalized(Option_t *option="", Double_t norm=1) const;
214 virtual void DrawPanel(); // *MENU*
215 virtual Int_t BufferEmpty(Int_t action=0);
216 virtual void Eval(TF1 *f1, Option_t *option="");
217 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
218 virtual void ExtendAxis(Double_t x, TAxis *axis);
219 virtual TH1 *FFT(TH1* h_output, Option_t *option);
220 virtual Int_t Fill(Double_t x);
221 virtual Int_t Fill(Double_t x, Double_t w);
222 virtual Int_t Fill(const char *name, Double_t w);
223 virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1);
224 virtual void FillN(Int_t, const Double_t *, const Double_t *, const Double_t *, Int_t) {}
225 virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom * rng = nullptr);
226 virtual void FillRandom(TH1 *h, Int_t ntimes=5000, TRandom * rng = nullptr);
227 virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0);
228 virtual Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const;
229 virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const;
230 virtual Int_t FindLastBinAbove (Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const;
231 TObject *FindObject(const char *name) const override;
232 TObject *FindObject(const TObject *obj) const override;
233 virtual TFitResultPtr Fit(const char *formula ,Option_t *option="" ,Option_t *goption="", Double_t xmin=0, Double_t xmax=0); // *MENU*
234 virtual TFitResultPtr Fit(TF1 *f1 ,Option_t *option="" ,Option_t *goption="", Double_t xmin=0, Double_t xmax=0);
235 virtual void FitPanel(); // *MENU*
236 TH1 *GetAsymmetry(TH1* h2, Double_t c2=1, Double_t dc2=0);
237 Int_t GetBufferLength() const {return fBuffer ? (Int_t)fBuffer[0] : 0;}
238 Int_t GetBufferSize () const {return fBufferSize;}
239 const Double_t *GetBuffer() const {return fBuffer;}
241 virtual Double_t *GetIntegral();
242 TH1 *GetCumulative(Bool_t forward = kTRUE, const char* suffix = "_cumulative") const;
243
245
246 virtual Int_t GetNdivisions(Option_t *axis="X") const;
247 virtual Color_t GetAxisColor(Option_t *axis="X") const;
248 virtual Color_t GetLabelColor(Option_t *axis="X") const;
249 virtual Style_t GetLabelFont(Option_t *axis="X") const;
250 virtual Float_t GetLabelOffset(Option_t *axis="X") const;
251 virtual Float_t GetLabelSize(Option_t *axis="X") const;
252 virtual Style_t GetTitleFont(Option_t *axis="X") const;
253 virtual Float_t GetTitleOffset(Option_t *axis="X") const;
254 virtual Float_t GetTitleSize(Option_t *axis="X") const;
255 virtual Float_t GetTickLength(Option_t *axis="X") const;
256 virtual Float_t GetBarOffset() const {return Float_t(0.001*Float_t(fBarOffset));}
257 virtual Float_t GetBarWidth() const {return Float_t(0.001*Float_t(fBarWidth));}
258 virtual Int_t GetContour(Double_t *levels = nullptr);
259 virtual Double_t GetContourLevel(Int_t level) const;
260 virtual Double_t GetContourLevelPad(Int_t level) const;
261
262 virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const;
263 virtual void GetBinXYZ(Int_t binglobal, Int_t &binx, Int_t &biny, Int_t &binz) const;
264 virtual Double_t GetBinCenter(Int_t bin) const;
265 virtual Double_t GetBinContent(Int_t bin) const;
266 virtual Double_t GetBinContent(Int_t bin, Int_t) const { return GetBinContent(bin); }
267 virtual Double_t GetBinContent(Int_t bin, Int_t, Int_t) const { return GetBinContent(bin); }
268 virtual Double_t GetBinError(Int_t bin) const;
269 virtual Double_t GetBinError(Int_t binx, Int_t biny) const { return GetBinError(GetBin(binx, biny)); } // for 2D histograms only
270 virtual Double_t GetBinError(Int_t binx, Int_t biny, Int_t binz) const { return GetBinError(GetBin(binx, biny, binz)); } // for 3D histograms only
271 virtual Double_t GetBinErrorLow(Int_t bin) const;
272 virtual Double_t GetBinErrorUp(Int_t bin) const;
274 virtual Double_t GetBinLowEdge(Int_t bin) const;
275 virtual Double_t GetBinWidth(Int_t bin) const;
276 virtual Double_t GetBinWithContent(Double_t c, Int_t &binx, Int_t firstx = 0, Int_t lastx = 0,Double_t maxdiff = 0) const;
277 virtual void GetCenter(Double_t *center) const;
278 static Bool_t GetDefaultSumw2();
280 virtual Double_t GetEntries() const;
281 virtual Double_t GetEffectiveEntries() const;
282 virtual TF1 *GetFunction(const char *name) const;
283 virtual Int_t GetDimension() const { return fDimension; }
284 virtual Double_t GetKurtosis(Int_t axis=1) const;
285 virtual void GetLowEdge(Double_t *edge) const;
286 virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const;
287 virtual Int_t GetMaximumBin() const;
288 virtual Int_t GetMaximumBin(Int_t &locmax, Int_t &locmay, Int_t &locmaz) const;
289 virtual Double_t GetMaximumStored() const {return fMaximum;}
290 virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const;
291 virtual Int_t GetMinimumBin() const;
292 virtual Int_t GetMinimumBin(Int_t &locmix, Int_t &locmiy, Int_t &locmiz) const;
293 virtual Double_t GetMinimumStored() const {return fMinimum;}
294 virtual void GetMinimumAndMaximum(Double_t& min, Double_t& max) const;
295 virtual Double_t GetMean(Int_t axis=1) const;
296 virtual Double_t GetMeanError(Int_t axis=1) const;
297 virtual Int_t GetNbinsX() const {return fXaxis.GetNbins();}
298 virtual Int_t GetNbinsY() const {return fYaxis.GetNbins();}
299 virtual Int_t GetNbinsZ() const {return fZaxis.GetNbins();}
300 virtual Int_t GetNcells() const {return fNcells; }
301 virtual Double_t GetNormFactor() const {return fNormFactor;}
302 char *GetObjectInfo(Int_t px, Int_t py) const override;
303 Option_t *GetOption() const override { return fOption.Data(); }
304
306
307 virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum = nullptr);
308 virtual Double_t GetRandom(TRandom * rng = nullptr) const;
309 virtual void GetStats(Double_t *stats) const;
310 virtual Double_t GetStdDev(Int_t axis=1) const;
311 virtual Double_t GetStdDevError(Int_t axis=1) const;
312 virtual Double_t GetSumOfWeights() const;
313 virtual TArrayD *GetSumw2() {return &fSumw2;}
314 virtual const TArrayD *GetSumw2() const {return &fSumw2;}
315 virtual Int_t GetSumw2N() const {return fSumw2.fN;}
316 /// This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RMS).
317 /// The name "RMS" is been often used as a synonym for the Standard Deviation and it was introduced many years ago (Hbook/PAW times).
318 /// We keep the name GetRMS for continuity as an alias to GetStdDev. GetStdDev() should be used instead.
319 Double_t GetRMS(Int_t axis=1) const { return GetStdDev(axis); }
320 Double_t GetRMSError(Int_t axis=1) const { return GetStdDevError(axis); }
321
322 virtual Double_t GetSkewness(Int_t axis=1) const;
323 EStatOverflows GetStatOverflows() const { return fStatOverflows; } ///< Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more information.
324 TAxis* GetXaxis() { return &fXaxis; }
325 TAxis* GetYaxis() { return &fYaxis; }
326 TAxis* GetZaxis() { return &fZaxis; }
327 const TAxis* GetXaxis() const { return &fXaxis; }
328 const TAxis* GetYaxis() const { return &fYaxis; }
329 const TAxis* GetZaxis() const { return &fZaxis; }
330 virtual Double_t Integral(Option_t *option="") const;
331 virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const;
332 virtual Double_t IntegralAndError(Int_t binx1, Int_t binx2, Double_t & err, Option_t *option="") const;
333 virtual Double_t Interpolate(Double_t x) const;
334 virtual Double_t Interpolate(Double_t x, Double_t y) const;
335 virtual Double_t Interpolate(Double_t x, Double_t y, Double_t z) const;
336 Bool_t IsBinOverflow(Int_t bin, Int_t axis = 0) const;
337 Bool_t IsBinUnderflow(Int_t bin, Int_t axis = 0) const;
338 virtual Bool_t IsHighlight() const { return TestBit(kIsHighlight); }
339 virtual Double_t AndersonDarlingTest(const TH1 *h2, Option_t *option="") const;
340 virtual Double_t AndersonDarlingTest(const TH1 *h2, Double_t &advalue) const;
341 virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const;
342 virtual void LabelsDeflate(Option_t *axis="X");
343 virtual void LabelsInflate(Option_t *axis="X");
344 virtual void LabelsOption(Option_t *option="h", Option_t *axis="X");
345 virtual Long64_t Merge(TCollection *list) { return Merge(list,""); }
347 virtual Bool_t Multiply(TF1 *f1, Double_t c1=1);
348 virtual Bool_t Multiply(const TH1 *h1);
349 virtual Bool_t Multiply(const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option=""); // *MENU*
350 void Paint(Option_t *option = "") override;
351 void Print(Option_t *option = "") const override;
352 virtual void PutStats(Double_t *stats);
353 virtual TH1 *Rebin(Int_t ngroup = 2, const char *newname = "", const Double_t *xbins = nullptr); // *MENU*
354 virtual TH1 *RebinX(Int_t ngroup = 2, const char *newname = "") { return Rebin(ngroup,newname, (Double_t*) nullptr); }
355 virtual void Rebuild(Option_t *option = "");
356 void RecursiveRemove(TObject *obj) override;
357 virtual void Reset(Option_t *option = "");
358 virtual void ResetStats();
359 void SaveAs(const char *filename = "hist", Option_t *option = "") const override; // *MENU*
360 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
361 virtual void Scale(Double_t c1=1, Option_t *option="");
362 virtual void SetAxisColor(Color_t color=1, Option_t *axis="X");
363 virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X");
364 virtual void SetBarOffset(Float_t offset=0.25) {fBarOffset = Short_t(1000*offset);}
365 virtual void SetBarWidth(Float_t width=0.5) {fBarWidth = Short_t(1000*width);}
366 virtual void SetBinContent(Int_t bin, Double_t content);
367 virtual void SetBinContent(Int_t bin, Int_t, Double_t content) { SetBinContent(bin, content); }
368 virtual void SetBinContent(Int_t bin, Int_t, Int_t, Double_t content) { SetBinContent(bin, content); }
369 virtual void SetBinError(Int_t bin, Double_t error);
370 virtual void SetBinError(Int_t binx, Int_t biny, Double_t error);
371 virtual void SetBinError(Int_t binx, Int_t biny, Int_t binz, Double_t error);
372 virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax);
373 virtual void SetBins(Int_t nx, const Double_t *xBins);
375 virtual void SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins);
377 Int_t nz, Double_t zmin, Double_t zmax);
378 virtual void SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t * yBins, Int_t nz,
379 const Double_t *zBins);
380 virtual void SetBinsLength(Int_t = -1) { } //redefined in derived classes
382 virtual void SetBuffer(Int_t buffersize, Option_t *option="");
383 virtual UInt_t SetCanExtend(UInt_t extendBitMask);
384 virtual void SetContent(const Double_t *content);
385 virtual void SetContour(Int_t nlevels, const Double_t *levels = nullptr);
386 virtual void SetContourLevel(Int_t level, Double_t value);
387 virtual void SetColors(Color_t linecolor = -1, Color_t markercolor = -1, Color_t fillcolor = -1);
388 static void SetDefaultBufferSize(Int_t buffersize=1000);
389 static void SetDefaultSumw2(Bool_t sumw2=kTRUE);
390 virtual void SetDirectory(TDirectory *dir);
391 virtual void SetEntries(Double_t n) { fEntries = n; }
392 virtual void SetError(const Double_t *error);
393 virtual void SetHighlight(Bool_t set = kTRUE); // *TOGGLE* *GETTER=IsHighlight
394 virtual void SetLabelColor(Color_t color=1, Option_t *axis="X");
395 virtual void SetLabelFont(Style_t font=62, Option_t *axis="X");
396 virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X");
397 virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="X");
398
399 /*
400 * Set the minimum / maximum value for the Y axis (1-D histograms) or Z axis (2-D histograms)
401 * By default the maximum / minimum value used in drawing is the maximum / minimum value of the histogram
402 * plus a margin of 10%. If these functions are called, the values are used without any extra margin.
403 */
404 virtual void SetMaximum(Double_t maximum = -1111) { fMaximum = maximum; } // *MENU*
405 virtual void SetMinimum(Double_t minimum = -1111) { fMinimum = minimum; } // *MENU*
406
407 void SetName(const char *name) override; // *MENU*
408 void SetNameTitle(const char *name, const char *title) override;
409 virtual void SetNdivisions(Int_t n=510, Option_t *axis="X");
410 virtual void SetNormFactor(Double_t factor=1) {fNormFactor = factor;}
411 virtual void SetStats(Bool_t stats=kTRUE); // *MENU*
412 virtual void SetOption(Option_t *option=" ") {fOption = option;}
413 virtual void SetTickLength(Float_t length=0.02, Option_t *axis="X");
414 virtual void SetTitleFont(Style_t font=62, Option_t *axis="X");
415 virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="X");
416 virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X");
417 void SetStatOverflows(EStatOverflows statOverflows) { fStatOverflows = statOverflows; } ///< See GetStatOverflows for more information.
418 void SetTitle(const char *title) override; // *MENU*
419 virtual void SetXTitle(const char *title) {fXaxis.SetTitle(title);}
420 virtual void SetYTitle(const char *title) {fYaxis.SetTitle(title);}
421 virtual void SetZTitle(const char *title) {fZaxis.SetTitle(title);}
422 virtual TH1 *ShowBackground(Int_t niter=20, Option_t *option="same"); // *MENU*
423 virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05); // *MENU*
424 virtual void Smooth(Int_t ntimes=1, Option_t *option=""); // *MENU*
425 static void SmoothArray(Int_t NN, Double_t *XX, Int_t ntimes=1);
426 static void StatOverflows(Bool_t flag=kTRUE);
427 virtual void Sumw2(Bool_t flag = kTRUE);
428 void UseCurrentStyle() override;
429 static TH1 *TransformHisto(TVirtualFFT *fft, TH1* h_output, Option_t *option);
430
431
432 // TODO: Remove obsolete methods in v6-04
433 virtual Double_t GetCellContent(Int_t binx, Int_t biny) const
434 { Obsolete("GetCellContent", "v6-00", "v6-04"); return GetBinContent(GetBin(binx, biny)); }
435 virtual Double_t GetCellError(Int_t binx, Int_t biny) const
436 { Obsolete("GetCellError", "v6-00", "v6-04"); return GetBinError(binx, biny); }
437 virtual void RebinAxis(Double_t x, TAxis *axis)
438 { Obsolete("RebinAxis", "v6-00", "v6-04"); ExtendAxis(x, axis); }
439 virtual void SetCellContent(Int_t binx, Int_t biny, Double_t content)
440 { Obsolete("SetCellContent", "v6-00", "v6-04"); SetBinContent(GetBin(binx, biny), content); }
441 virtual void SetCellError(Int_t binx, Int_t biny, Double_t content)
442 { Obsolete("SetCellError", "v6-00", "v6-04"); SetBinError(binx, biny, content); }
443
444 ClassDefOverride(TH1,8) //1-Dim histogram base class
445
446protected:
447 virtual Double_t RetrieveBinContent(Int_t bin) const;
448 virtual void UpdateBinContent(Int_t bin, Double_t content);
449 virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const { return fSumw2.fN ? fSumw2.fArray[bin] : RetrieveBinContent(bin); }
450};
451
452namespace cling {
453 std::string printValue(TH1 *val);
454}
455
456//________________________________________________________________________
457
458class TH1C : public TH1, public TArrayC {
459
460public:
461 TH1C();
462 TH1C(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
463 TH1C(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
464 TH1C(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
465 TH1C(const TH1C &h1c);
466 TH1C& operator=(const TH1C &h1);
467 ~TH1C() override;
468
469 void AddBinContent(Int_t bin) override;
470 void AddBinContent(Int_t bin, Double_t w) override;
471 void Copy(TObject &hnew) const override;
472 void Reset(Option_t *option="") override;
473 void SetBinsLength(Int_t n=-1) override;
474
475 ClassDefOverride(TH1C,3) //1-Dim histograms (one char per channel)
476
477 friend TH1C operator*(Double_t c1, const TH1C &h1);
478 friend TH1C operator*(const TH1C &h1, Double_t c1);
479 friend TH1C operator+(const TH1C &h1, const TH1C &h2);
480 friend TH1C operator-(const TH1C &h1, const TH1C &h2);
481 friend TH1C operator*(const TH1C &h1, const TH1C &h2);
482 friend TH1C operator/(const TH1C &h1, const TH1C &h2);
483
484protected:
485 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
486 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Char_t (content); }
487};
488
490inline
492TH1C operator+(const TH1C &h1, const TH1C &h2);
493TH1C operator-(const TH1C &h1, const TH1C &h2);
494TH1C operator*(const TH1C &h1, const TH1C &h2);
495TH1C operator/(const TH1C &h1, const TH1C &h2);
496
497//________________________________________________________________________
498
499class TH1S : public TH1, public TArrayS {
500
501public:
502 TH1S();
503 TH1S(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
504 TH1S(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
505 TH1S(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
506 TH1S(const TH1S &h1s);
507 TH1S& operator=(const TH1S &h1);
508 ~TH1S() override;
509
510 void AddBinContent(Int_t bin) override;
511 void AddBinContent(Int_t bin, Double_t w) override;
512 void Copy(TObject &hnew) const override;
513 void Reset(Option_t *option="") override;
514 void SetBinsLength(Int_t n=-1) override;
515
516 ClassDefOverride(TH1S,3) //1-Dim histograms (one short per channel)
517
518 friend TH1S operator*(Double_t c1, const TH1S &h1);
519 friend TH1S operator*(const TH1S &h1, Double_t c1);
520 friend TH1S operator+(const TH1S &h1, const TH1S &h2);
521 friend TH1S operator-(const TH1S &h1, const TH1S &h2);
522 friend TH1S operator*(const TH1S &h1, const TH1S &h2);
523 friend TH1S operator/(const TH1S &h1, const TH1S &h2);
524
525protected:
526 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
527 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Short_t (content); }
528};
529
531inline
533TH1S operator+(const TH1S &h1, const TH1S &h2);
534TH1S operator-(const TH1S &h1, const TH1S &h2);
535TH1S operator*(const TH1S &h1, const TH1S &h2);
536TH1S operator/(const TH1S &h1, const TH1S &h2);
537
538//________________________________________________________________________
539
540class TH1I: public TH1, public TArrayI {
541
542public:
543 TH1I();
544 TH1I(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
545 TH1I(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
546 TH1I(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
547 TH1I(const TH1I &h1i);
548 TH1I& operator=(const TH1I &h1);
549 ~TH1I() override;
550
551 void AddBinContent(Int_t bin) override;
552 void AddBinContent(Int_t bin, Double_t w) override;
553 void Copy(TObject &hnew) const override;
554 void Reset(Option_t *option="") override;
555 void SetBinsLength(Int_t n=-1) override;
556
557 ClassDefOverride(TH1I,3) //1-Dim histograms (one 32 bit integer per channel)
558
559 friend TH1I operator*(Double_t c1, const TH1I &h1);
560 friend TH1I operator*(const TH1I &h1, Double_t c1);
561 friend TH1I operator+(const TH1I &h1, const TH1I &h2);
562 friend TH1I operator-(const TH1I &h1, const TH1I &h2);
563 friend TH1I operator*(const TH1I &h1, const TH1I &h2);
564 friend TH1I operator/(const TH1I &h1, const TH1I &h2);
565
566protected:
567 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
568 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
569};
570
572inline
574TH1I operator+(const TH1I &h1, const TH1I &h2);
575TH1I operator-(const TH1I &h1, const TH1I &h2);
576TH1I operator*(const TH1I &h1, const TH1I &h2);
577TH1I operator/(const TH1I &h1, const TH1I &h2);
578
579//________________________________________________________________________
580
581class TH1L: public TH1, public TArrayL64 {
582
583public:
584 TH1L();
585 TH1L(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
586 TH1L(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
587 TH1L(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
588 TH1L(const TH1L &h1l);
589 TH1L& operator=(const TH1L &h1);
590 ~TH1L() override;
591
592 void AddBinContent(Int_t bin) override;
593 void AddBinContent(Int_t bin, Double_t w) override;
594 void Copy(TObject &hnew) const override;
595 void Reset(Option_t *option="") override;
596 void SetBinsLength(Int_t n=-1) override;
597
598 ClassDefOverride(TH1L,0) //1-Dim histograms (one 64 bit integer per channel)
599
600 friend TH1L operator*(Double_t c1, const TH1L &h1);
601 friend TH1L operator*(const TH1L &h1, Double_t c1);
602 friend TH1L operator+(const TH1L &h1, const TH1L &h2);
603 friend TH1L operator-(const TH1L &h1, const TH1L &h2);
604 friend TH1L operator*(const TH1L &h1, const TH1L &h2);
605 friend TH1L operator/(const TH1L &h1, const TH1L &h2);
606
607protected:
608 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
609 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Int_t (content); }
610};
611
613inline
615TH1L operator+(const TH1L &h1, const TH1L &h2);
616TH1L operator-(const TH1L &h1, const TH1L &h2);
617TH1L operator*(const TH1L &h1, const TH1L &h2);
618TH1L operator/(const TH1L &h1, const TH1L &h2);
619
620//________________________________________________________________________
621
622class TH1F : public TH1, public TArrayF {
623
624public:
625 TH1F();
626 TH1F(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
627 TH1F(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
628 TH1F(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
629 explicit TH1F(const TVectorF &v);
630 TH1F(const TH1F &h1f);
631 TH1F& operator=(const TH1F &h1);
632 ~TH1F() override;
633
634 /// Increment bin content by 1.
635 /// Passing an out-of-range bin leads to undefined behavior
636 void AddBinContent(Int_t bin) override {++fArray[bin];}
637 /// Increment bin content by a weight w.
638 /// \warning The value of w is cast to `Float_t` before being added.
639 /// Passing an out-of-range bin leads to undefined behavior
640 void AddBinContent(Int_t bin, Double_t w) override
641 { fArray[bin] += Float_t (w); }
642 void Copy(TObject &hnew) const override;
643 void Reset(Option_t *option = "") override;
644 void SetBinsLength(Int_t n=-1) override;
645
646 ClassDefOverride(TH1F,3) //1-Dim histograms (one float per channel)
647
648 friend TH1F operator*(Double_t c1, const TH1F &h1);
649 friend TH1F operator*(const TH1F &h1, Double_t c1);
650 friend TH1F operator+(const TH1F &h1, const TH1F &h2);
651 friend TH1F operator-(const TH1F &h1, const TH1F &h2);
652 friend TH1F operator*(const TH1F &h1, const TH1F &h2);
653 friend TH1F operator/(const TH1F &h1, const TH1F &h2);
654
655protected:
656 Double_t RetrieveBinContent(Int_t bin) const override { return Double_t (fArray[bin]); }
657 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = Float_t (content); }
658};
659
661inline
663TH1F operator+(const TH1F &h1, const TH1F &h2);
664TH1F operator-(const TH1F &h1, const TH1F &h2);
665TH1F operator*(const TH1F &h1, const TH1F &h2);
666TH1F operator/(const TH1F &h1, const TH1F &h2);
667
668//________________________________________________________________________
669
670class TH1D : public TH1, public TArrayD {
671
672public:
673 TH1D();
674 TH1D(const char *name,const char *title,Int_t nbinsx,Double_t xlow,Double_t xup);
675 TH1D(const char *name,const char *title,Int_t nbinsx,const Float_t *xbins);
676 TH1D(const char *name,const char *title,Int_t nbinsx,const Double_t *xbins);
677 explicit TH1D(const TVectorD &v);
678 TH1D(const TH1D &h1d);
679 TH1D& operator=(const TH1D &h1);
680 ~TH1D() override;
681
682 /// Increment bin content by 1.
683 /// Passing an out-of-range bin leads to undefined behavior
684 void AddBinContent(Int_t bin) override {++fArray[bin];}
685 /// Increment bin content by a weight w
686 /// Passing an out-of-range bin leads to undefined behavior
687 void AddBinContent(Int_t bin, Double_t w) override
688 {fArray[bin] += Double_t (w);}
689 void Copy(TObject &hnew) const override;
690 void Reset(Option_t *option = "") override;
691 void SetBinsLength(Int_t n=-1) override;
692
693 ClassDefOverride(TH1D,3) //1-Dim histograms (one double per channel)
694
695 friend TH1D operator*(Double_t c1, const TH1D &h1);
696 friend TH1D operator*(const TH1D &h1, Double_t c1);
697 friend TH1D operator+(const TH1D &h1, const TH1D &h2);
698 friend TH1D operator-(const TH1D &h1, const TH1D &h2);
699 friend TH1D operator*(const TH1D &h1, const TH1D &h2);
700 friend TH1D operator/(const TH1D &h1, const TH1D &h2);
701
702protected:
703 Double_t RetrieveBinContent(Int_t bin) const override { return fArray[bin]; }
704 void UpdateBinContent(Int_t bin, Double_t content) override { fArray[bin] = content; }
705};
706
708inline
710TH1D operator+(const TH1D &h1, const TH1D &h2);
711TH1D operator-(const TH1D &h1, const TH1D &h2);
712TH1D operator*(const TH1D &h1, const TH1D &h2);
713TH1D operator/(const TH1D &h1, const TH1D &h2);
714
715 extern TH1 *R__H(Int_t hid);
716 extern TH1 *R__H(const char *hname);
717
718#endif
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Style_t
Definition RtypesCore.h:89
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
char Char_t
Definition RtypesCore.h:37
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
short Short_t
Definition RtypesCore.h:39
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
TH1C operator+(const TH1C &h1, const TH1C &h2)
Operator +.
Definition TH1.cxx:9599
TH1C operator-(const TH1C &h1, const TH1C &h2)
Operator -.
Definition TH1.cxx:9610
TH1C operator/(const TH1C &h1, const TH1C &h2)
Operator /.
Definition TH1.cxx:9632
TH1 * R__H(Int_t hid)
return pointer to histogram with name hid if id >=0 h_id if id <0
Definition TH1.cxx:10570
TH1C operator*(Double_t c1, const TH1C &h1)
Operator *.
Definition TH1.cxx:9588
float xmin
float * q
float ymin
float xmax
float ymax
R__EXTERN Foption_t Foption
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
Int_t fN
Definition TArray.h:38
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
Marker Attributes class.
Definition TAttMarker.h:19
Class to manage histogram axis.
Definition TAxis.h:31
Int_t GetNbins() const
Definition TAxis.h:125
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Collection abstract base class.
Definition TCollection.h:65
Describe directory structure in memory.
Definition TDirectory.h:45
1-Dim function class
Definition TF1.h:233
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
1-D histogram with a byte per channel (see TH1 documentation)
Definition TH1.h:458
~TH1C() override
Destructor.
Definition TH1.cxx:9512
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH1.cxx:9568
TH1C & operator=(const TH1C &h1)
Operator =.
Definition TH1.cxx:9578
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 TH1.h:485
TH1C()
Constructor.
Definition TH1.cxx:9464
void Copy(TObject &hnew) const override
Copy this to newth1.
Definition TH1.cxx:9550
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH1.cxx:9529
void Reset(Option_t *option="") override
Reset.
Definition TH1.cxx:9558
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 TH1.h:486
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:670
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 TH1.h:703
~TH1D() override
Destructor.
Definition TH1.cxx:10458
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH1.cxx:10492
void Copy(TObject &hnew) const override
Copy this to newth1.
Definition TH1.cxx:10474
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 TH1.h:704
TH1D()
Constructor.
Definition TH1.cxx:10393
TH1D & operator=(const TH1D &h1)
Operator =.
Definition TH1.cxx:10502
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 TH1.h:687
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH1.h:684
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:622
void AddBinContent(Int_t bin, Double_t w) override
Increment bin content by a weight w.
Definition TH1.h:640
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH1.h:636
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 TH1.h:656
TH1F & operator=(const TH1F &h1)
Operator =.
Definition TH1.cxx:10321
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 TH1.h:657
void Copy(TObject &hnew) const override
Copy this to newth1.
Definition TH1.cxx:10293
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH1.cxx:10311
~TH1F() override
Destructor.
Definition TH1.cxx:10286
TH1F()
Constructor.
Definition TH1.cxx:10212
1-D histogram with an int per channel (see TH1 documentation)
Definition TH1.h:540
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH1.cxx:9941
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH1.cxx:9902
~TH1I() override
Destructor.
Definition TH1.cxx:9885
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 TH1.h:568
TH1I()
Constructor.
Definition TH1.cxx:9837
void Copy(TObject &hnew) const override
Copy this to newth1.
Definition TH1.cxx:9923
TH1I & operator=(const TH1I &h1)
Operator =.
Definition TH1.cxx:9951
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 TH1.h:567
1-D histogram with a long64 per channel (see TH1 documentation)
Definition TH1.h:581
TH1L & operator=(const TH1L &h1)
Operator =.
Definition TH1.cxx:10139
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 TH1.h:608
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH1.cxx:10090
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH1.cxx:10129
~TH1L() override
Destructor.
Definition TH1.cxx:10073
TH1L()
Constructor.
Definition TH1.cxx:10025
void Copy(TObject &hnew) const override
Copy this to newth1.
Definition TH1.cxx:10111
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 TH1.h:609
1-D histogram with a short per channel (see TH1 documentation)
Definition TH1.h:499
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 TH1.h:527
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 TH1.h:526
TH1S & operator=(const TH1S &h1)
Operator =.
Definition TH1.cxx:9764
void Copy(TObject &hnew) const override
Copy this to newth1.
Definition TH1.cxx:9736
TH1S()
Constructor.
Definition TH1.cxx:9650
void SetBinsLength(Int_t n=-1) override
Set total number of bins including under/overflow Reallocate bin contents array.
Definition TH1.cxx:9754
~TH1S() override
Destructor.
Definition TH1.cxx:9698
void AddBinContent(Int_t bin) override
Increment bin content by 1.
Definition TH1.cxx:9715
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
~TH1() override
Histogram default destructor.
Definition TH1.cxx:643
virtual void SetLabelFont(Style_t font=62, Option_t *axis="X")
Set font number used to draw axis labels.
Definition Haxis.cxx:249
virtual void SetError(const Double_t *error)
Replace bin errors by values in array error.
Definition TH1.cxx:8942
virtual void SetDirectory(TDirectory *dir)
By default, when a histogram is created, it is added to the list of histogram objects in the current ...
Definition TH1.cxx:8928
virtual void FitPanel()
Display a panel with all histogram fit options.
Definition TH1.cxx:4284
Double_t * fBuffer
[fBufferSize] entry buffer
Definition TH1.h:108
virtual Int_t AutoP2FindLimits(Double_t min, Double_t max)
Buffer-based estimate of the histogram range using the power of 2 algorithm.
Definition TH1.cxx:1343
void SetStatOverflows(EStatOverflows statOverflows)
See GetStatOverflows for more information.
Definition TH1.h:417
virtual Double_t GetEffectiveEntries() const
Number of effective entries of the histogram.
Definition TH1.cxx:4448
char * GetObjectInfo(Int_t px, Int_t py) const override
Redefines TObject::GetObjectInfo.
Definition TH1.cxx:4502
virtual void Smooth(Int_t ntimes=1, Option_t *option="")
Smooth bin contents of this histogram.
Definition TH1.cxx:6870
virtual void SetNormFactor(Double_t factor=1)
Definition TH1.h:410
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
Definition TH1.cxx:9132
virtual void Rebuild(Option_t *option="")
Using the current bin info, recompute the arrays for contents and errors.
Definition TH1.cxx:7078
virtual void SetBarOffset(Float_t offset=0.25)
Set the bar offset as fraction of the bin width for drawing mode "B".
Definition TH1.h:364
virtual Color_t GetLabelColor(Option_t *axis="X") const
Return the "axis" label color.
Definition Haxis.cxx:53
static Bool_t fgStatOverflows
! Flag to use under/overflows in statistics
Definition TH1.h:117
virtual Int_t FindLastBinAbove(Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const
Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold i...
Definition TH1.cxx:3797
virtual void SetTitleSize(Float_t size=0.02, Option_t *axis="X")
Set the axis' title size.
Definition Haxis.cxx:365
TAxis * GetZaxis()
Definition TH1.h:326
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Compute distance from point px,py to a line.
Definition TH1.cxx:2823
virtual Bool_t Multiply(TF1 *f1, Double_t c1=1)
Performs the operation:
Definition TH1.cxx:6040
virtual void SetLabelOffset(Float_t offset=0.005, Option_t *axis="X")
Set offset between axis and axis' labels.
Definition Haxis.cxx:267
@ kXaxis
Definition TH1.h:73
@ kAllAxes
Definition TH1.h:76
@ kNoAxis
NOTE: Must always be 0 !!!
Definition TH1.h:72
@ kZaxis
Definition TH1.h:75
@ kYaxis
Definition TH1.h:74
Int_t fNcells
Number of bins(1D), cells (2D) +U/Overflows.
Definition TH1.h:89
virtual void GetStats(Double_t *stats) const
fill the array stats from the contents of this histogram The array stats must be correctly dimensione...
Definition TH1.cxx:7824
void Copy(TObject &hnew) const override
Copy this histogram structure to newth1.
Definition TH1.cxx:2671
virtual Double_t GetCellContent(Int_t binx, Int_t biny) const
Definition TH1.h:433
void SetTitle(const char *title) override
Change/set the title.
Definition TH1.cxx:6709
virtual Double_t GetBinError(Int_t binx, Int_t biny) const
Definition TH1.h:269
Double_t fTsumw
Total Sum of weights.
Definition TH1.h:96
virtual EBinErrorOpt GetBinErrorOption() const
Definition TH1.h:273
virtual Float_t GetBarWidth() const
Definition TH1.h:257
Double_t fTsumw2
Total Sum of squares of weights.
Definition TH1.h:97
static void StatOverflows(Bool_t flag=kTRUE)
if flag=kTRUE, underflows and overflows are used by the Fill functions in the computation of statisti...
Definition TH1.cxx:6916
TDirectory * GetDirectory() const
Definition TH1.h:279
virtual Double_t GetMinimumStored() const
Definition TH1.h:293
virtual Float_t GetBarOffset() const
Definition TH1.h:256
TList * fFunctions
->Pointer to list of functions (fits and user)
Definition TH1.h:106
virtual void RebinAxis(Double_t x, TAxis *axis)
Definition TH1.h:437
EStatOverflows GetStatOverflows() const
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
Definition TH1.h:323
static Bool_t fgAddDirectory
! Flag to add histograms to the directory
Definition TH1.h:116
static int CheckConsistency(const TH1 *h1, const TH1 *h2)
Check histogram compatibility.
Definition TH1.cxx:1677
static Int_t GetDefaultBufferSize()
Static function return the default buffer size for automatic histograms the parameter fgBufferSize ma...
Definition TH1.cxx:4406
virtual Double_t DoIntegral(Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Int_t iz1, Int_t iz2, Double_t &err, Option_t *opt, Bool_t doerr=kFALSE) const
Internal function compute integral and optionally the error between the limits specified by the bin n...
Definition TH1.cxx:7968
Double_t fTsumwx2
Total Sum of weight*X*X.
Definition TH1.h:99
virtual Double_t GetStdDev(Int_t axis=1) const
Returns the Standard Deviation (Sigma).
Definition TH1.cxx:7598
TH1()
Histogram default constructor.
Definition TH1.cxx:615
static TH1 * TransformHisto(TVirtualFFT *fft, TH1 *h_output, Option_t *option)
For a given transform (first parameter), fills the histogram (second parameter) with the transform ou...
Definition TH1.cxx:9310
void UseCurrentStyle() override
Copy current attributes from/to current style.
Definition TH1.cxx:7460
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Sort bins with labels or set option(s) to draw axis with labels.
Definition TH1.cxx:5373
virtual Int_t GetNbinsY() const
Definition TH1.h:298
Short_t fBarOffset
(1000*offset) for bar charts or legos
Definition TH1.h:93
virtual Double_t Chi2TestX(const TH1 *h2, Double_t &chi2, Int_t &ndf, Int_t &igood, Option_t *option="UU", Double_t *res=nullptr) const
The computation routine of the Chisquare test.
Definition TH1.cxx:2067
static bool CheckBinLimits(const TAxis *a1, const TAxis *a2)
Check bin limits.
Definition TH1.cxx:1541
virtual void AddBinContent(Int_t bin)
Increment bin content by 1.
Definition TH1.cxx:1268
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
Definition TH1.cxx:9054
static Int_t FitOptionsMake(Option_t *option, Foption_t &Foption)
Decode string choptin and fill fitOption structure.
Definition TH1.cxx:4643
virtual Int_t GetNbinsZ() const
Definition TH1.h:299
virtual Double_t GetNormFactor() const
Definition TH1.h:301
virtual Double_t GetMean(Int_t axis=1) const
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
Definition TH1.cxx:7526
TH1(const TH1 &)=delete
virtual Double_t GetSkewness(Int_t axis=1) const
Definition TH1.cxx:7662
virtual void ClearUnderflowAndOverflow()
Remove all the content from the underflow and overflow bins, without changing the number of entries A...
Definition TH1.cxx:2517
virtual Double_t GetContourLevelPad(Int_t level) const
Return the value of contour number "level" in Pad coordinates.
Definition TH1.cxx:8431
virtual void SetXTitle(const char *title)
Definition TH1.h:419
virtual TH1 * DrawNormalized(Option_t *option="", Double_t norm=1) const
Draw a normalized copy of this histogram.
Definition TH1.cxx:3144
EStatOverflows
Enumeration specifying the way to treat statoverflow.
Definition TH1.h:80
@ kNeutral
Adapt to the global flag.
Definition TH1.h:83
@ kIgnore
Override global flag ignoring the overflows.
Definition TH1.h:81
@ kConsider
Override global flag considering the overflows.
Definition TH1.h:82
virtual Int_t GetDimension() const
Definition TH1.h:283
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
Definition TH1.cxx:1294
virtual Double_t GetBinContent(Int_t bin, Int_t) const
Definition TH1.h:266
EStatusBits
TH1 status bits.
Definition TH1.h:164
@ kLogX
X-axis in log scale.
Definition TH1.h:168
@ kIsAverage
Bin contents are average (used by Add)
Definition TH1.h:171
@ kNoTitle
Don't draw the histogram title.
Definition TH1.h:170
@ kUserContour
User specified contour levels.
Definition TH1.h:166
@ kNoStats
Don't draw stats box.
Definition TH1.h:165
@ kIsZoomed
Bit set when zooming on Y axis.
Definition TH1.h:169
@ kAutoBinPTwo
different than 1.
Definition TH1.h:174
@ kIsNotW
Histogram is forced to be not weighted even when the histogram is filled with weighted.
Definition TH1.h:172
@ kIsHighlight
bit set if histo is highlight
Definition TH1.h:175
virtual void SetContourLevel(Int_t level, Double_t value)
Set value for one contour level.
Definition TH1.cxx:8513
virtual Bool_t CanExtendAllAxes() const
Returns true if all axes are extendable.
Definition TH1.cxx:6627
TDirectory * fDirectory
! Pointer to directory holding this histogram
Definition TH1.h:109
Option_t * GetOption() const override
Definition TH1.h:303
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
Definition TH1.cxx:7094
void SetNameTitle(const char *name, const char *title) override
Change the name and title of this histogram.
Definition TH1.cxx:8965
TAxis * GetXaxis()
Definition TH1.h:324
virtual void GetBinXYZ(Int_t binglobal, Int_t &binx, Int_t &biny, Int_t &binz) const
Return binx, biny, binz corresponding to the global bin number globalbin see TH1::GetBin function abo...
Definition TH1.cxx:4965
TH1 * GetCumulative(Bool_t forward=kTRUE, const char *suffix="_cumulative") const
Return a pointer to a histogram containing the cumulative content.
Definition TH1.cxx:2616
static Double_t AutoP2GetPower2(Double_t x, Bool_t next=kTRUE)
Auxiliary function to get the power of 2 next (larger) or previous (smaller) a given x.
Definition TH1.cxx:1308
virtual Int_t GetNcells() const
Definition TH1.h:300
virtual Int_t ShowPeaks(Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
Interface to TSpectrum::Search.
Definition TH1.cxx:9292
Int_t GetBufferLength() const
Definition TH1.h:237
static Bool_t RecomputeAxisLimits(TAxis &destAxis, const TAxis &anAxis)
Finds new limits for the axis for the Merge function.
Definition TH1.cxx:5899
virtual Style_t GetTitleFont(Option_t *axis="X") const
Return the "axis" title font.
Definition Haxis.cxx:118
virtual void SetNdivisions(Int_t n=510, Option_t *axis="X")
Set the number of divisions to draw an axis.
Definition Haxis.cxx:170
virtual Style_t GetLabelFont(Option_t *axis="X") const
Return the "axis" label font.
Definition Haxis.cxx:66
virtual Float_t GetTickLength(Option_t *axis="X") const
Return the "axis" tick length.
Definition Haxis.cxx:105
Int_t GetBufferSize() const
Definition TH1.h:238
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
Definition TH1.cxx:7875
TVirtualHistPainter * GetPainter(Option_t *option="")
Return pointer to painter.
Definition TH1.cxx:4511
TObject * FindObject(const char *name) const override
Search object named name in the list of functions.
Definition TH1.cxx:3857
virtual Float_t GetTitleSize(Option_t *axis="X") const
Return the "axis" title size.
Definition Haxis.cxx:144
virtual void FillRandom(const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
Fill histogram following distribution in function fname.
Definition TH1.cxx:3519
void Print(Option_t *option="") const override
Print some global quantities for this histogram.
Definition TH1.cxx:7000
static Bool_t GetDefaultSumw2()
Return kTRUE if TH1::Sumw2 must be called when creating new histograms.
Definition TH1.cxx:4415
virtual Int_t FindFirstBinAbove(Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const
Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold ...
Definition TH1.cxx:3734
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
Definition TH1.cxx:3898
virtual Int_t GetBin(Int_t binx, Int_t biny=0, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
Definition TH1.cxx:4952
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden b...
Definition TH1.cxx:8536
Double_t GetRMSError(Int_t axis=1) const
Definition TH1.h:320
virtual Int_t GetNbinsX() const
Definition TH1.h:297
virtual void SetMaximum(Double_t maximum=-1111)
Definition TH1.h:404
virtual TH1 * FFT(TH1 *h_output, Option_t *option)
This function allows to do discrete Fourier transforms of TH1 and TH2.
Definition TH1.cxx:3284
virtual void LabelsInflate(Option_t *axis="X")
Double the number of bins for axis.
Definition TH1.cxx:5306
virtual TH1 * ShowBackground(Int_t niter=20, Option_t *option="same")
This function calculates the background spectrum in this histogram.
Definition TH1.cxx:9278
virtual void FillN(Int_t, const Double_t *, const Double_t *, const Double_t *, Int_t)
Definition TH1.h:224
static Bool_t SameLimitsAndNBins(const TAxis &axis1, const TAxis &axis2)
Same limits and bins.
Definition TH1.cxx:5889
virtual Bool_t Add(TF1 *h1, Double_t c1=1, Option_t *option="")
Performs the operation: this = this + c1*f1 if errors are defined (see TH1::Sumw2),...
Definition TH1.cxx:826
Double_t fMaximum
Maximum value for plotting.
Definition TH1.h:100
Int_t fBufferSize
fBuffer size
Definition TH1.h:107
virtual Double_t RetrieveBinContent(Int_t bin) const
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::Get...
Definition TH1.cxx:9430
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:7959
Int_t fDimension
! Histogram dimension (1, 2 or 3 dim)
Definition TH1.h:110
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
Definition TH1.cxx:9197
EBinErrorOpt fBinStatErrOpt
Option for bin statistical errors.
Definition TH1.h:113
static Int_t fgBufferSize
! Default buffer size for automatic histograms
Definition TH1.h:115
virtual void SetBinsLength(Int_t=-1)
Definition TH1.h:380
Double_t fNormFactor
Normalization factor.
Definition TH1.h:102
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3344
TAxis * GetYaxis()
Definition TH1.h:325
TArrayD fContour
Array to display contour levels.
Definition TH1.h:103
virtual Double_t GetBinErrorLow(Int_t bin) const
Return lower error associated to bin number bin.
Definition TH1.cxx:9070
virtual TH1 * RebinX(Int_t ngroup=2, const char *newname="")
Definition TH1.h:354
void Browse(TBrowser *b) override
Browse the Histogram object.
Definition TH1.cxx:762
virtual Double_t GetBinContent(Int_t bin, Int_t, Int_t) const
Definition TH1.h:267
virtual void SetContent(const Double_t *content)
Replace bin contents by the contents of array content.
Definition TH1.cxx:8389
virtual Float_t GetLabelSize(Option_t *axis="X") const
Return the "axis" label size.
Definition Haxis.cxx:92
virtual void SavePrimitiveHelp(std::ostream &out, const char *hname, Option_t *option="")
Helper function for the SavePrimitive functions from TH1 or classes derived from TH1,...
Definition TH1.cxx:7370
Short_t fBarWidth
(1000*width) for bar charts or legos
Definition TH1.h:94
virtual Double_t GetBinErrorSqUnchecked(Int_t bin) const
Definition TH1.h:449
virtual Double_t GetCellError(Int_t binx, Int_t biny) const
Definition TH1.h:435
virtual Int_t GetNdivisions(Option_t *axis="X") const
Return the number of divisions for "axis".
Definition Haxis.cxx:27
Int_t AxisChoice(Option_t *axis) const
Choose an axis according to "axis".
Definition Haxis.cxx:14
virtual void SetMinimum(Double_t minimum=-1111)
Definition TH1.h:405
Bool_t IsBinUnderflow(Int_t bin, Int_t axis=0) const
Return true if the bin is underflow.
Definition TH1.cxx:5205
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitive as a C++ statement(s) on output stream out.
Definition TH1.cxx:7228
virtual void SetCellContent(Int_t binx, Int_t biny, Double_t content)
Definition TH1.h:439
static bool CheckBinLabels(const TAxis *a1, const TAxis *a2)
Check that axis have same labels.
Definition TH1.cxx:1568
static void SetDefaultSumw2(Bool_t sumw2=kTRUE)
When this static function is called with sumw2=kTRUE, all new histograms will automatically activate ...
Definition TH1.cxx:6694
Bool_t IsBinOverflow(Int_t bin, Int_t axis=0) const
Return true if the bin is overflow.
Definition TH1.cxx:5173
UInt_t GetAxisLabelStatus() const
Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e.
Definition TH1.cxx:6666
Double_t GetRMS(Int_t axis=1) const
This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RM...
Definition TH1.h:319
Double_t * fIntegral
! Integral of bins used by GetRandom
Definition TH1.h:111
Double_t fMinimum
Minimum value for plotting.
Definition TH1.h:101
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
Definition TH1.cxx:7932
TH1 & operator=(const TH1 &)=delete
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
Definition TH1.cxx:9213
virtual void DirectoryAutoAdd(TDirectory *)
Perform the automatic addition of the histogram to the given directory.
Definition TH1.cxx:2801
virtual void GetLowEdge(Double_t *edge) const
Fill array with low edge of bins for 1D histogram Better to use h1.GetXaxis()->GetLowEdge(edge)
Definition TH1.cxx:9178
virtual Double_t GetBinLowEdge(Int_t bin) const
Return bin lower edge for 1D histogram.
Definition TH1.cxx:9143
void Build()
Creates histogram basic data structure.
Definition TH1.cxx:771
virtual Double_t GetEntries() const
Return the current number of entries.
Definition TH1.cxx:4423
const TAxis * GetZaxis() const
Definition TH1.h:329
virtual void SetZTitle(const char *title)
Definition TH1.h:421
virtual TF1 * GetFunction(const char *name) const
Return pointer to function with name.
Definition TH1.cxx:9042
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
Rebin this histogram.
Definition TH1.cxx:6266
virtual Int_t BufferFill(Double_t x, Double_t w)
accumulate arguments in buffer.
Definition TH1.cxx:1506
virtual Double_t GetBinWithContent(Double_t c, Int_t &binx, Int_t firstx=0, Int_t lastx=0, Double_t maxdiff=0) const
Compute first binx in the range [firstx,lastx] for which diff = abs(bin_content-c) <= maxdiff.
Definition TH1.cxx:5077
virtual UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
Definition TH1.cxx:6640
TList * GetListOfFunctions() const
Definition TH1.h:244
void SetName(const char *name) override
Change the name of this histogram.
Definition TH1.cxx:8951
virtual TH1 * DrawCopy(Option_t *option="", const char *name_postfix="_copy") const
Copy this histogram and Draw in the current pad.
Definition TH1.cxx:3113
virtual Float_t GetTitleOffset(Option_t *axis="X") const
Return the "axis" title offset.
Definition Haxis.cxx:131
Bool_t IsEmpty() const
Check if a histogram is empty (this is a protected method used mainly by TH1Merger )
Definition TH1.cxx:5155
virtual Double_t GetMeanError(Int_t axis=1) const
Return standard error of mean of this histogram along the X axis.
Definition TH1.cxx:7566
void Paint(Option_t *option="") override
Control routine to paint any kind of histograms.
Definition TH1.cxx:6197
virtual Double_t AndersonDarlingTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using the Anderson-Darling ...
Definition TH1.cxx:8053
virtual void ResetStats()
Reset the statistics including the number of entries and replace with values calculated from bin cont...
Definition TH1.cxx:7893
virtual void SetBinContent(Int_t bin, Int_t, Int_t, Double_t content)
Definition TH1.h:368
static void SetDefaultBufferSize(Int_t buffersize=1000)
Static function to set the default buffer size for automatic histograms.
Definition TH1.cxx:6684
virtual void SetBinErrorOption(EBinErrorOpt type)
Definition TH1.h:381
virtual void SetBuffer(Int_t buffersize, Option_t *option="")
Set the maximum number of entries to be kept in the buffer.
Definition TH1.cxx:8449
virtual void DrawPanel()
Display a panel with all histogram drawing options.
Definition TH1.cxx:3175
virtual Double_t GetRandom(TRandom *rng=nullptr) const
Return a random number distributed according the histogram bin contents.
Definition TH1.cxx:5001
const TAxis * GetXaxis() const
Definition TH1.h:327
virtual Double_t Chisquare(TF1 *f1, Option_t *option="") const
Compute and return the chisquare of this histogram with respect to a function The chisquare is comput...
Definition TH1.cxx:2496
virtual Double_t Chi2Test(const TH1 *h2, Option_t *option="UU", Double_t *res=nullptr) const
test for comparing weighted and unweighted histograms.
Definition TH1.cxx:2008
virtual Double_t GetMaximumStored() const
Definition TH1.h:289
virtual void DoFillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1)
Internal method to fill histogram content from a vector called directly by TH1::BufferEmpty.
Definition TH1.cxx:3473
virtual void GetMinimumAndMaximum(Double_t &min, Double_t &max) const
Retrieve the minimum and maximum values in the histogram.
Definition TH1.cxx:8722
@ kNstat
Size of statistics data (up to TProfile3D)
Definition TH1.h:184
virtual const TArrayD * GetSumw2() const
Definition TH1.h:314
virtual Int_t GetMaximumBin() const
Return location of bin with maximum value in the range.
Definition TH1.cxx:8568
static Int_t AutoP2GetBins(Int_t n)
Auxiliary function to get the next power of 2 integer value larger then n.
Definition TH1.cxx:1321
Double_t fEntries
Number of entries.
Definition TH1.h:95
virtual Long64_t Merge(TCollection *list)
Definition TH1.h:345
virtual void SetColors(Color_t linecolor=-1, Color_t markercolor=-1, Color_t fillcolor=-1)
Shortcut to set the three histogram colors with a single call.
Definition TH1.cxx:4467
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Definition TH1.cxx:3240
virtual Double_t * GetIntegral()
Return a pointer to the array of bins integral.
Definition TH1.cxx:2586
TAxis fZaxis
Z axis descriptor.
Definition TH1.h:92
EStatOverflows fStatOverflows
Per object flag to use under/overflows in statistics.
Definition TH1.h:114
virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1)
Fill this histogram with an array x and weights w.
Definition TH1.cxx:3447
virtual void UpdateBinContent(Int_t bin, Double_t content)
Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin...
Definition TH1.cxx:9440
virtual Float_t GetLabelOffset(Option_t *axis="X") const
Return the "axis" label offset.
Definition Haxis.cxx:79
static bool CheckEqualAxes(const TAxis *a1, const TAxis *a2)
Check that the axis are the same.
Definition TH1.cxx:1611
EBinErrorOpt
Enumeration specifying type of statistics for bin errors.
Definition TH1.h:64
@ kPoisson2
Errors from Poisson interval at 95% CL (~ 2 sigma)
Definition TH1.h:67
@ kNormal
Errors with Normal (Wald) approximation: errorUp=errorLow= sqrt(N)
Definition TH1.h:65
@ kPoisson
Errors from Poisson interval at 68.3% (1 sigma)
Definition TH1.h:66
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition TH1.cxx:5052
virtual TArrayD * GetSumw2()
Definition TH1.h:313
virtual Int_t GetContour(Double_t *levels=nullptr)
Return contour values into array levels if pointer levels is non zero.
Definition TH1.cxx:8402
TAxis fXaxis
X axis descriptor.
Definition TH1.h:90
virtual void SetTitleOffset(Float_t offset=1, Option_t *axis="X")
Specify a parameter offset to control the distance between the axis and the axis' title.
Definition Haxis.cxx:345
const Double_t * GetBuffer() const
Definition TH1.h:239
virtual Bool_t IsHighlight() const
Definition TH1.h:338
virtual void SetLabelColor(Color_t color=1, Option_t *axis="X")
Set axis labels color.
Definition Haxis.cxx:226
virtual Double_t GetBinError(Int_t binx, Int_t biny, Int_t binz) const
Definition TH1.h:270
virtual void ExtendAxis(Double_t x, TAxis *axis)
Histogram is resized along axis such that x is in the axis range.
Definition TH1.cxx:6495
virtual void SetAxisColor(Color_t color=1, Option_t *axis="X")
Set color to draw the axis line and tick marks.
Definition Haxis.cxx:187
virtual Double_t GetBinWidth(Int_t bin) const
Return bin width for 1D histogram.
Definition TH1.cxx:9154
const TAxis * GetYaxis() const
Definition TH1.h:328
TArrayD fSumw2
Array of sum of squares of weights.
Definition TH1.h:104
virtual void SetOption(Option_t *option=" ")
Definition TH1.h:412
TH1 * GetAsymmetry(TH1 *h2, Double_t c2=1, Double_t dc2=0)
Return a histogram containing the asymmetry of this histogram with h2, where the asymmetry is defined...
Definition TH1.cxx:4339
virtual Double_t GetContourLevel(Int_t level) const
Return value of contour number level.
Definition TH1.cxx:8421
virtual void SetContour(Int_t nlevels, const Double_t *levels=nullptr)
Set the number and values of contour levels.
Definition TH1.cxx:8474
virtual void SetHighlight(Bool_t set=kTRUE)
Set highlight (enable/disable) mode for the histogram by default highlight mode is disable.
Definition TH1.cxx:4482
virtual Int_t GetQuantiles(Int_t nprobSum, Double_t *q, const Double_t *probSum=nullptr)
Compute Quantiles for this histogram Quantile x_q of a probability distribution Function F is defined...
Definition TH1.cxx:4602
virtual void SetAxisRange(Double_t xmin, Double_t xmax, Option_t *axis="X")
Set the "axis" range.
Definition Haxis.cxx:201
virtual Double_t GetBinErrorUp(Int_t bin) const
Return upper error associated to bin number bin.
Definition TH1.cxx:9101
virtual void SetYTitle(const char *title)
Definition TH1.h:420
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Definition TH1.cxx:6595
virtual Int_t GetMinimumBin() const
Return location of bin with minimum value in the range.
Definition TH1.cxx:8656
virtual Int_t GetSumw2N() const
Definition TH1.h:315
virtual void SetCellError(Int_t binx, Int_t biny, Double_t content)
Definition TH1.h:441
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
Definition TH1.cxx:3672
Bool_t GetStatOverflowsBehaviour() const
Definition TH1.h:152
void SaveAs(const char *filename="hist", Option_t *option="") const override
Save the histogram as .csv, .tsv or .txt.
Definition TH1.cxx:7172
virtual void SetTitleFont(Style_t font=62, Option_t *axis="X")
Set the axis' title font.
Definition Haxis.cxx:323
virtual Color_t GetAxisColor(Option_t *axis="X") const
Return the number of divisions for "axis".
Definition Haxis.cxx:40
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
Definition TH1.cxx:2752
virtual Double_t GetStdDevError(Int_t axis=1) const
Return error of standard deviation estimation for Normal distribution.
Definition TH1.cxx:7646
virtual Bool_t Divide(TF1 *f1, Double_t c1=1)
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2),...
Definition TH1.cxx:2840
virtual Double_t GetMinimum(Double_t minval=-FLT_MAX) const
Return minimum value larger than minval of bins in the range, unless the value has been overridden by...
Definition TH1.cxx:8626
int LoggedInconsistency(const char *name, const TH1 *h1, const TH1 *h2, bool useMerge=false) const
Definition TH1.cxx:883
static bool CheckConsistentSubAxes(const TAxis *a1, Int_t firstBin1, Int_t lastBin1, const TAxis *a2, Int_t firstBin2=0, Int_t lastBin2=0)
Check that two sub axis are the same.
Definition TH1.cxx:1640
void RecursiveRemove(TObject *obj) override
Recursively remove object from the list of functions.
Definition TH1.cxx:6567
TAxis fYaxis
Y axis descriptor.
Definition TH1.h:91
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test.
Definition TH1.cxx:8169
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
Definition TH1.cxx:7908
static void SmoothArray(Int_t NN, Double_t *XX, Int_t ntimes=1)
Smooth array xx, translation of Hbook routine hsmoof.F.
Definition TH1.cxx:6759
virtual void GetCenter(Double_t *center) const
Fill array with center of bins for 1D histogram Better to use h1.GetXaxis()->GetCenter(center)
Definition TH1.cxx:9165
TVirtualHistPainter * fPainter
! Pointer to histogram painter
Definition TH1.h:112
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
Definition TH1.cxx:8758
virtual Int_t FindFixBin(Double_t x, Double_t y=0, Double_t z=0) const
Return Global bin number corresponding to x,y,z.
Definition TH1.cxx:3705
virtual void SetBinContent(Int_t bin, Int_t, Double_t content)
Definition TH1.h:367
virtual void SetLabelSize(Float_t size=0.02, Option_t *axis="X")
Set size of axis' labels.
Definition Haxis.cxx:285
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Definition TH1.cxx:9011
virtual void SetEntries(Double_t n)
Definition TH1.h:391
virtual Bool_t FindNewAxisLimits(const TAxis *axis, const Double_t point, Double_t &newMin, Double_t &newMax)
finds new limits for the axis so that point is within the range and the limits are compatible with th...
Definition TH1.cxx:6451
static bool CheckAxisLimits(const TAxis *a1, const TAxis *a2)
Check that the axis limits of the histograms are the same.
Definition TH1.cxx:1597
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
Definition TH1.cxx:754
static Bool_t fgDefaultSumw2
! Flag to call TH1::Sumw2 automatically at histogram creation time
Definition TH1.h:118
Double_t fTsumwx
Total Sum of weight*X.
Definition TH1.h:98
virtual void LabelsDeflate(Option_t *axis="X")
Reduce the number of bins for the axis passed in the option to the number of bins having a label.
Definition TH1.cxx:5236
virtual Double_t ComputeIntegral(Bool_t onlyPositive=false)
Compute integral (normalized cumulative sum of bins) w/o under/overflows The result is stored in fInt...
Definition TH1.cxx:2537
TString fOption
Histogram options.
Definition TH1.h:105
virtual void Eval(TF1 *f1, Option_t *option="")
Evaluate function f1 at the center of bins of this histogram.
Definition TH1.cxx:3192
virtual void SetBarWidth(Float_t width=0.5)
Set the width of bars as fraction of the bin width for drawing mode "B".
Definition TH1.h:365
virtual Int_t BufferEmpty(Int_t action=0)
Fill histogram with all entries in the buffer.
Definition TH1.cxx:1414
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
Definition TH1.cxx:8981
virtual void SetTickLength(Float_t length=0.02, Option_t *axis="X")
Set the axis' tick marks length.
Definition Haxis.cxx:302
virtual Double_t GetKurtosis(Int_t axis=1) const
Definition TH1.cxx:7735
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition TNamed.cxx:164
Mother of all ROOT objects.
Definition TObject.h:41
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:199
void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
Use this method to declare a method obsolete.
Definition TObject.cxx:1049
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
TVectorT.
Definition TVectorT.h:27
TVirtualFFT is an interface class for Fast Fourier Transforms.
Definition TVirtualFFT.h:88
Abstract interface to a histogram painter.
#define Interpolate(a, x, b, y)
Definition geom.c:179
const Double_t sigma
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
return c2
Definition legend2.C:14
th1 Draw()