Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TProfile2Poly Class Reference

2D Profile Histogram with Polygonal Bins.

tprofile2polyRealisticModuleError.C and tprofile2polyRealistic.C illustrate how to use this class.

Definition at line 58 of file TProfile2Poly.h.

Public Types

enum  {
  kNoAxis = 0 , kXaxis = (1ULL << (0)) , kYaxis = (1ULL << (1)) , kZaxis = (1ULL << (2)) ,
  kAllAxes = kXaxis | kYaxis | kZaxis
}
 Enumeration specifying which axes can be extended. More...
enum  { kSingleKey = (1ULL << (0)) , kOverwrite = (1ULL << (1)) , kWriteDelete = (1ULL << (2)) }
enum  { kNstat = 13 }
 Size of statistics data (size of array used in GetStats()/ PutStats ). More...
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
enum  EBinErrorOpt { kNormal = 0 , kPoisson = 1 , kPoisson2 = 2 }
 Enumeration specifying type of statistics for bin errors. More...
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << (3)) }
enum  EInconsistencyBits {
  kFullyConsistent = 0 , kDifferentLabels = (1ULL << (0)) , kDifferentBinLimits = (1ULL << (1)) , kDifferentAxisLimits = (1ULL << (2)) ,
  kDifferentNumberOfBins = (1ULL << (3)) , kDifferentDimensions = (1ULL << (4))
}
 Enumeration specifying inconsistencies between two histograms, in increasing severity. More...
enum  EStatOverflows { kIgnore = 0 , kConsider = 1 , kNeutral = 2 }
 Enumeration specifying the way to treat statoverflow. More...
enum  EStatusBits {
  kNoStats = (1ULL << (9)) , kUserContour = (1ULL << (10)) , kLogX = (1ULL << (15)) , kIsZoomed = (1ULL << (16)) ,
  kNoTitle = (1ULL << (17)) , kIsAverage = (1ULL << (18)) , kIsNotW = (1ULL << (19)) , kAutoBinPTwo = (1ULL << (20)) ,
  kIsHighlight = (1ULL << (21))
}
 TH1 status bits. More...

Public Member Functions

 TProfile2Poly ()
 TProfile2Poly (const char *name, const char *title, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup)
 TProfile2Poly constructor.
 TProfile2Poly (const char *name, const char *title, Int_t nX, Double_t xlow, Double_t xup, Int_t nY, Double_t ylow, Double_t yup)
 TProfile2Poly constructor.
 ~TProfile2Poly () override
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
Bool_t Add (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1) override
 NOT IMPLEMENTED for TH2Poly.
Bool_t Add (const TH1 *h1, Double_t c1) override
 Performs the operation: this = this + c1*h1.
Bool_t Add (TF1 *h1, Double_t c1=1, Option_t *option="") override
 NOT IMPLEMENTED for TH2Poly.
Int_t AddBin (Double_t x1, Double_t y1, Double_t x2, Double_t y2)
 Add a new bin to the histogram.
Int_t AddBin (Int_t n, const Double_t *x, const Double_t *y)
 Adds a new bin to the histogram.
virtual Int_t AddBin (TObject *poly)
 Adds a new bin to the histogram.
void AddBinContent (Int_t binx, Int_t biny)
 Increment 2D bin content by 1.
void AddBinContent (Int_t binx, Int_t biny, Double_t w)
 Increment 2D bin content by a weight w.
virtual Double_t AndersonDarlingTest (const TH1 *h2, Double_t &advalue) const
 Same function as above but returning also the test statistic value.
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 2 sample test.
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
void Browse (TBrowser *b) override
 Browse the Histogram object.
Int_t BufferEmpty (Int_t action=0) override
 Fill histogram with all entries in the buffer.
virtual Bool_t CanExtendAllAxes () const
 Returns true if all axes are extendable.
void ChangePartition (Int_t n, Int_t m)
 Changes the number of partition cells in the histogram.
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
virtual Double_t Chi2Test (const TH1 *h2, Option_t *option="UU", Double_t *res=nullptr) const
 \( \chi^{2} \) test for comparing weighted and unweighted histograms.
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.
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 computed by weighting each histogram point by the bin error By default the full range of the histogram is used, unless TAxis::SetRange or TAxis::SetRangeUser was called before.
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
void Clear (Option_t *option="") override
 Set name and title to empty strings ("").
void ClearBinContents ()
 Clears the contents of all bins in the histogram.
virtual void ClearUnderflowAndOverflow ()
 Remove all the content from the underflow and overflow bins, without changing the number of entries After calling this method, every undeflow and overflow bins will have content 0.0 The Sumw2 is also cleared, since there is no more content in the bins.
TObjectClone (const char *newname="") const override
 Make a complete copy of the underlying object.
Int_t Compare (const TObject *obj) const override
 Compare two TNamed objects.
Double_t ComputeIntegral (Bool_t, Option_t *) override
 NOT IMPLEMENTED for TH2Poly.
void Copy (TAttFill &attfill) const
void Copy (TAttLine &attline) const
void Copy (TAttMarker &attmarker) const
void Copy (TObject &newth2p) const override
 Copy function for TH2Poly.
virtual void Delete (Option_t *option="")
 Delete this object.
virtual void DirectoryAutoAdd (TDirectory *)
 Callback to perform the automatic addition of the histogram to the given directory.
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
Int_t DistancetoPrimitive (Int_t px, Int_t py) override
 Compute distance from point px,py to a line.
virtual Bool_t Divide (const TH1 *h1)
 Divide this histogram by h1.
virtual Bool_t Divide (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="")
 Replace contents of this histogram by the division of h1 by h2.
Bool_t Divide (TF1 *, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
void Draw (Option_t *option="") override
 Draw this histogram with options.
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
virtual TH1DrawCopy (Option_t *option="", const char *name_postfix="_copy") const
 Copy this histogram and Draw in the current pad.
virtual TH1DrawNormalized (Option_t *option="", Double_t norm=1) const
 Draw a normalized copy of this histogram.
virtual void DrawPanel ()
 Display a panel with all histogram drawing options.
virtual void Dump () const
 Dump contents of object on stdout.
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
virtual void Eval (TF1 *f1, Option_t *option="")
 Evaluate function f1 at the center of bins of this histogram.
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
void ExecuteEvent (Int_t event, Int_t px, Int_t py) override
 Execute action corresponding to one event.
virtual void ExtendAxis (Double_t x, TAxis *axis)
 Histogram is resized along axis such that x is in the axis range.
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
TH1FFT (TH1 *, Option_t *) override
 NOT IMPLEMENTED for TH2Poly.
Int_t Fill (const char *, const char *, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
Int_t Fill (const char *, Double_t, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
Int_t Fill (const char *name, Double_t w) override
 Increment the bin named "name" by w.
Int_t Fill (Double_t x, Double_t y) override
 Increment the bin containing (x,y) by 1.
Int_t Fill (Double_t xcoord, Double_t ycoord, Double_t value) override
 Fill.
virtual Int_t Fill (Double_t xcoord, Double_t ycoord, Double_t value, Double_t weight)
 Fill.
Int_t Fill (Double_t) override
 NOT IMPLEMENTED for TH2Poly.
Int_t Fill (Double_t, const char *, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer.
void FillN (Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1) override
 Fills a 2-D histogram with an array of values and weights.
void FillRandom (const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr)
 Fill histogram following distribution in function fname.
void FillRandom (TF1 *function, Int_t ntimes=5000, TRandom *rng=nullptr) override
 Fill histogram following distribution in function function.
void FillRandom (TH1 *h, Int_t ntimes=5000, TRandom *rng=nullptr) override
 Fill histogram following distribution in histogram h.
Int_t FindBin (Double_t x, Double_t y, Double_t z=0) override
 Returns the bin number of the bin at the given coordinate.
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 is found the function returns -1.
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.
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 is found the function returns -1.
TObjectFindObject (const char *name) const override
 Search object named name in the list of functions.
TObjectFindObject (const TObject *obj) const override
 Search object obj in the list of functions.
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.
virtual TFitResultPtr Fit (TF1 *f1, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
 Fit histogram with the function pointer f1.
virtual void FitPanel ()
 Display a panel with all histogram fit options.
virtual void FitSlicesX (TF1 *f1=nullptr, Int_t firstybin=0, Int_t lastybin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=nullptr)
 Project slices along X in case of a 2-D histogram, then fit each slice with function f1 and make a histogram for each fit parameter Only bins along Y between firstybin and lastybin are considered.
virtual void FitSlicesY (TF1 *f1=nullptr, Int_t firstxbin=0, Int_t lastxbin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=nullptr)
 Project slices along Y in case of a 2-D histogram, then fit each slice with function f1 and make a histogram for each fit parameter Only bins along X between firstxbin and lastxbin are considered.
virtual TH1GetAsymmetry (TH1 *, Double_t, Double_t)
 NOT IMPLEMENTED for TH2Poly.
virtual Color_t GetAxisColor (Option_t *axis="X") const
 Return the number of divisions for "axis".
virtual Float_t GetBarOffset () const
virtual Float_t GetBarWidth () const
Int_t GetBin (Int_t binx, Int_t biny, Int_t binz=0) const override
 Return Global bin number corresponding to binx,y,z.
virtual Double_t GetBinCenter (Int_t bin) const
 Return bin center for 1D histogram.
Double_t GetBinContent (Int_t bin) const override
 Get bin content.
Double_t GetBinContent (Int_t, Int_t) const override
 NOT IMPLEMENTED for TH2Poly.
Double_t GetBinContent (Int_t, Int_t, Int_t) const override
 NOT IMPLEMENTED for TH2Poly.
Bool_t GetBinContentChanged () const
Double_t GetBinEffectiveEntries (Int_t bin) const
 Get bin effective entries.
Double_t GetBinEntries (Int_t bin) const
 Get bin entries.
Double_t GetBinEntriesVW (Int_t bin) const
 Get bin entries VW.
Double_t GetBinEntriesW2 (Int_t bin) const
 Get bin entries W2.
Double_t GetBinEntriesWV2 (Int_t bin) const
 Get bin entries WV2.
Double_t GetBinError (Int_t bin) const override
 Get bin error.
Double_t GetBinError (Int_t, Int_t) const override
 NOT IMPLEMENTED for TH2Poly.
Double_t GetBinError (Int_t, Int_t, Int_t) const override
 NOT IMPLEMENTED for TH2Poly.
virtual Double_t GetBinErrorLow (Int_t bin) const
 Return lower error associated to bin number bin.
virtual Double_t GetBinErrorLow (Int_t binx, Int_t biny)
virtual EBinErrorOpt GetBinErrorOption () const
virtual Double_t GetBinErrorUp (Int_t bin) const
 Return upper error associated to bin number bin.
virtual Double_t GetBinErrorUp (Int_t binx, Int_t biny)
virtual Double_t GetBinLowEdge (Int_t bin) const
 Return bin lower edge for 1D histogram.
const char * GetBinName (Int_t bin) const
 Returns the bin name.
TListGetBins ()
 Returns the TList of all bins in the histogram.
const char * GetBinTitle (Int_t bin) const
 Returns the bin title.
virtual Double_t GetBinWidth (Int_t bin) const
 Return bin width for 1D histogram.
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.
virtual Double_t GetBinWithContent2 (Double_t c, Int_t &binx, Int_t &biny, Int_t firstxbin=1, Int_t lastxbin=-1, Int_t firstybin=1, Int_t lastybin=-1, Double_t maxdiff=0) const
 compute first cell (binx,biny) in the range [firstxbin,lastxbin][firstybin,lastybin] for which diff = abs(cell_content-c) <= maxdiff In case several cells in the specified range with diff=0 are found the first cell found is returned in binx,biny.
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 above.
const Double_tGetBuffer () const
Int_t GetBufferLength () const
Int_t GetBufferSize () const
virtual Double_t GetCellContent (Int_t binx, Int_t biny) const
virtual Double_t GetCellError (Int_t binx, Int_t biny) const
virtual void GetCenter (Double_t *center) const
 Fill array with center of bins for 1D histogram Better to use h1.GetXaxis()->GetCenter(center).
virtual Int_t GetContour (Double_t *levels=nullptr)
 Return contour values into array levels if pointer levels is non zero.
virtual Double_t GetContourLevel (Int_t level) const
 Return value of contour number level.
virtual Double_t GetContourLevelPad (Int_t level) const
 Return the value of contour number "level" in Pad coordinates.
virtual Double_t GetCorrelationFactor (Int_t axis1=1, Int_t axis2=2) const
 Return correlation factor between axis1 and axis2.
virtual Double_t GetCovariance (Int_t axis1=1, Int_t axis2=2) const
 Return covariance between axis1 and axis2.
TH1GetCumulative (Bool_t forward=kTRUE, const char *suffix="_cumulative") const
 Return a pointer to a histogram containing the cumulative content.
virtual Int_t GetDimension () const
TDirectoryGetDirectory () const
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
virtual Double_t GetEffectiveEntries () const
 Number of effective entries of the histogram.
virtual Double_t GetEntries () const
 Return the current number of entries.
virtual Color_t GetFillColor () const
 Return the fill area color.
virtual Style_t GetFillStyle () const
 Return the fill area style.
Bool_t GetFloat ()
virtual TF1GetFunction (const char *name) const
 Return pointer to function with name.
virtual const char * GetIconName () const
 Returns mime type name of object.
virtual Double_tGetIntegral ()
 Return a pointer to the array of bins integral.
virtual Double_t GetKurtosis (Int_t axis=1) const
virtual Color_t GetLabelColor (Option_t *axis="X") const
 Return the "axis" label color.
virtual Style_t GetLabelFont (Option_t *axis="X") const
 Return the "axis" label font.
virtual Float_t GetLabelOffset (Option_t *axis="X") const
 Return the "axis" label offset.
virtual Float_t GetLabelSize (Option_t *axis="X") const
 Return the "axis" label size.
virtual Color_t GetLineColor () const
 Return the line color.
virtual Style_t GetLineStyle () const
 Return the line style.
virtual Width_t GetLineWidth () const
 Return the line width.
TListGetListOfFunctions () const
virtual void GetLowEdge (Double_t *edge) const
 Fill array with low edge of bins for 1D histogram Better to use h1.GetXaxis()->GetLowEdge(edge).
virtual Color_t GetMarkerColor () const
 Return the marker color.
virtual Size_t GetMarkerSize () const
 Return the marker size.
virtual Style_t GetMarkerStyle () const
 Return the marker style.
Double_t GetMaximum () const
 Returns the maximum value of the histogram.
Double_t GetMaximum (Double_t maxval) const override
 Returns the maximum value of the histogram that is less than maxval.
virtual Int_t GetMaximumBin () const
 Return location of bin with maximum value in the range.
virtual Int_t GetMaximumBin (Int_t &locmax, Int_t &locmay, Int_t &locmaz) const
 Return location of bin with maximum value in the range.
virtual Double_t GetMaximumStored () const
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.
virtual Double_t GetMeanError (Int_t axis=1) const
 Return standard error of mean of this histogram along the X axis.
Double_t GetMinimum () const
 Returns the minimum value of the histogram.
Double_t GetMinimum (Double_t minval) const override
 Returns the minimum value of the histogram that is greater than minval.
virtual void GetMinimumAndMaximum (Double_t &min, Double_t &max) const
 Retrieve the minimum and maximum values in the histogram.
virtual Int_t GetMinimumBin () const
 Return location of bin with minimum value in the range.
virtual Int_t GetMinimumBin (Int_t &locmix, Int_t &locmiy, Int_t &locmiz) const
 Return location of bin with minimum value in the range.
virtual Double_t GetMinimumStored () const
const char * GetName () const override
 Returns name of object.
virtual Int_t GetNbinsX () const
virtual Int_t GetNbinsY () const
virtual Int_t GetNbinsZ () const
virtual Int_t GetNcells () const
virtual Int_t GetNdivisions (Option_t *axis="X") const
 Return the number of divisions for "axis".
Bool_t GetNewBinAdded () const
virtual Double_t GetNormFactor () const
Int_t GetNumberOfBins () const
 Return the number of bins : it should be the size of the bin list.
char * GetObjectInfo (Int_t px, Int_t py) const override
 Redefines TObject::GetObjectInfo.
Option_tGetOption () const override
Double_t GetOverflowContent (Int_t idx)
TVirtualHistPainterGetPainter (Option_t *option="")
 Return pointer to painter.
virtual Int_t GetQuantiles (Int_t n, Double_t *xp, const Double_t *p=nullptr)
 Compute Quantiles for this histogram.
virtual Double_t GetRandom (TRandom *rng=nullptr, Option_t *option="") const
 Return a random number distributed according the histogram bin contents.
virtual void GetRandom2 (Double_t &x, Double_t &y, TRandom *rng=nullptr, Option_t *option="")
 Return 2 random numbers along axis x and y distributed according to the cell-contents of this 2-D histogram.
Double_t GetRMS (Int_t axis=1) const
 This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RMS).
Double_t GetRMSError (Int_t axis=1) const
virtual Double_t GetSkewness (Int_t axis=1) const
EStatOverflows GetStatOverflows () const
 Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more information.
void GetStats (Double_t *stats) const override
 Fill the array stats from the contents of this profile.
virtual Double_t GetStdDev (Int_t axis=1) const
 Returns the Standard Deviation (Sigma).
virtual Double_t GetStdDevError (Int_t axis=1) const
 Return error of standard deviation estimation for Normal distribution.
Double_t GetSumOfAllWeights (const bool includeOverflow, Double_t *sumWeightSquare=nullptr) const
 Return the sum of all weights and optionally also the sum of weight squares.
virtual Double_t GetSumOfWeights () const
 Return the sum of weights across all bins excluding under/overflows.
virtual TArrayDGetSumw2 ()
virtual const TArrayDGetSumw2 () const
virtual Int_t GetSumw2N () const
virtual Float_t GetTickLength (Option_t *axis="X") const
 Return the "axis" tick length.
const char * GetTitle () const override
 Returns title of object.
virtual Style_t GetTitleFont (Option_t *axis="X") const
 Return the "axis" title font.
virtual Float_t GetTitleOffset (Option_t *axis="X") const
 Return the "axis" title offset.
virtual Float_t GetTitleSize (Option_t *axis="X") const
 Return the "axis" title size.
virtual UInt_t GetUniqueID () const
 Return the unique object id.
TAxisGetXaxis ()
const TAxisGetXaxis () const
TAxisGetYaxis ()
const TAxisGetYaxis () const
TAxisGetZaxis ()
const TAxisGetZaxis () const
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
ULong_t Hash () const override
 Return hash value for this object.
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
void Honeycomb (Double_t xstart, Double_t ystart, Double_t a, Int_t k, Int_t s, Option_t *option="v")
 Bins the histogram using a honeycomb structure If the option "v" is specified, the hexagons are drawn "vertically" (default).
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
virtual Double_t Integral (Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Option_t *option="") const
 Return integral of bin contents in range [firstxbin,lastxbin],[firstybin,lastybin] for a 2-D histogram By default the integral is computed as the sum of bin contents in the range.
virtual Double_t Integral (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t *="") const
Double_t Integral (Option_t *option="") const override
 Returns the integral of bin contents.
virtual Double_t IntegralAndError (Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Double_t &err, Option_t *option="") const
 Return integral of bin contents in range [firstxbin,lastxbin],[firstybin,lastybin] for a 2-D histogram.
Double_t Interpolate (Double_t x) const override
 illegal for a TH2
Double_t Interpolate (Double_t x, Double_t y) const override
 Given a point P(x,y), Interpolate approximates the value via bilinear interpolation based on the four nearest bin centers see Wikipedia, Bilinear Interpolation Andy Mastbaum 10/8/2008 vaguely based on R.Raja 6-Sep-2008.
Double_t Interpolate (Double_t x, Double_t y, Double_t z) const override
 illegal for a TH2
virtual Double_t Interpolate (Double_t, Double_t)
 NOT IMPLEMENTED for TH2Poly.
void InvertBit (UInt_t f)
TClassIsA () const override
Bool_t IsBinOverflow (Int_t bin, Int_t axis=0) const
 Return true if the bin is overflow.
Bool_t IsBinUnderflow (Int_t bin, Int_t axis=0) const
 Return true if the bin is underflow.
Bool_t IsDestructed () const
 IsDestructed.
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
virtual Bool_t IsHighlight () const
Bool_t IsInsideBin (Int_t binnr, Double_t x, Double_t y)
 Return "true" if the point (x,y) is inside the bin of binnr.
Bool_t IsOnHeap () const
Bool_t IsSortable () const override
virtual Bool_t IsTransparent () const
Bool_t IsZombie () const
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 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.
virtual void LabelsInflate (Option_t *axis="X")
 Double the number of bins for axis.
virtual void LabelsOption (Option_t *option="h", Option_t *axis="X")
 Sort bins with labels or set option(s) to draw axis with labels.
void ls (Option_t *option="") const override
 List TNamed name and title.
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
Long64_t Merge (TCollection *list, Option_t *option)
 Add all histograms in the collection to this histogram.
Long64_t Merge (const std::vector< TProfile2Poly * > &list)
 Merge.
Long64_t Merge (TCollection *in) override
 Merge.
virtual void Modify ()
virtual void Modify ()
virtual void Modify ()
virtual void ModifyOn (TVirtualPad &pad)
virtual void ModifyOn (TVirtualPad &pad)
virtual void ModifyOn (TVirtualPad &pad)
virtual Bool_t Multiply (const TH1 *h1)
 Multiply this histogram by h1.
virtual Bool_t Multiply (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="")
 Replace contents of this histogram by multiplication of h1 by h2.
Bool_t Multiply (TF1 *, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
virtual void Normalize (Option_t *option="")
 Normalize a histogram to its integral or to its maximum.
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
void operator delete (void *ptr)
 Operator delete.
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
void operator delete[] (void *ptr)
 Operator delete [].
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
void * operator new (size_t sz)
void * operator new (size_t sz, void *vp)
void * operator new[] (size_t sz)
void * operator new[] (size_t sz, void *vp)
void Paint (Option_t *option="") override
 Control routine to paint any kind of histograms.
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
void Print (Option_t *option="") const override
 Print some global quantities for this histogram.
void PrintOverflowRegions ()
 Print overflow regions.
TProfileProfileX (const char *name="_pfx", Int_t firstybin=1, Int_t lastybin=-1, Option_t *option="") const
 Project a 2-D histogram into a profile histogram along X (integration along Y).
TProfileProfileY (const char *name="_pfy", Int_t firstxbin=1, Int_t lastxbin=-1, Option_t *option="") const
 Project a 2-D histogram into a profile histogram along Y (integration along X).
TH1DProjectionX (const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
 Project a 2-D histogram into a 1-D histogram along X (integration along Y).
TH1DProjectionY (const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
 Project a 2-D histogram into a 1-D histogram along Y (integration along X).
void PutStats (Double_t *stats) override
 Replace current statistics with the values in array stats.
TH1DQuantilesX (Double_t prob=0.5, const char *name="_qx") const
 Compute the X distribution of quantiles in the other variable Y name is the name of the returned histogram prob is the probability content for the quantile (0.5 is the default for the median) An approximate error for the quantile is computed assuming that the distribution in the other variable is normal.
TH1DQuantilesY (Double_t prob=0.5, const char *name="_qy") const
 Compute the Y distribution of quantiles in the other variable X name is the name of the returned histogram prob is the probability content for the quantile (0.5 is the default for the median) An approximate error for the quantile is computed assuming that the distribution in the other variable is normal.
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
TH2Rebin (Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr) override
 Override TH1::Rebin as TH2::RebinX Rebinning in variable binning as for TH1 is not allowed If a non-null pointer is given an error is flagged see RebinX and Rebin2D.
virtual TH2Rebin2D (Int_t nxgroup=2, Int_t nygroup=2, const char *newname="")
 Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.
virtual void RebinAxis (Double_t x, TAxis *axis)
TH2RebinX (Int_t ngroup=2, const char *newname="") override
 Rebin only the X axis see Rebin2D.
virtual TH2RebinY (Int_t ngroup=2, const char *newname="")
 Rebin only the Y axis see Rebin2D.
virtual void Rebuild (Option_t *option="")
 Using the current bin info, recompute the arrays for contents and errors.
void RecursiveRemove (TObject *obj) override
 Recursively remove object from the list of functions.
void Reset (Option_t *option="") override
 Reset.
virtual void ResetAttFill (Option_t *option="")
virtual void ResetAttLine (Option_t *option="")
virtual void ResetAttMarker (Option_t *toption="")
void ResetBit (UInt_t f)
virtual void ResetStats ()
 Reset the statistics including the number of entries and replace with values calculated from bin content.
void SaveAs (const char *filename="hist", Option_t *option="") const override
 Save the histogram as .csv, .tsv or .txt.
virtual void SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
void SavePrimitive (std::ostream &out, Option_t *option="") override
 Save primitive as a C++ statement(s) on output stream out.
void Scale (Double_t c1=1, Option_t *option="") override
 Multiply this histogram by a constant c1.
virtual void SetAxisColor (Color_t color=1, Option_t *axis="X")
 Set color to draw the axis line and tick marks.
virtual void SetAxisRange (Double_t xmin, Double_t xmax, Option_t *axis="X")
 Set the "axis" range.
virtual void SetBarOffset (Float_t offset=0.25)
 Set the bar offset as fraction of the bin width for drawing mode "B".
virtual void SetBarWidth (Float_t width=0.5)
 Set the width of bars as fraction of the bin width for drawing mode "B".
void SetBinContent (Int_t bin, Double_t content) override
 Sets the contents of the input bin to the input content Negative values between -1 and -9 are for the overflows and the sea.
void SetBinContentChanged (Bool_t flag)
void SetBinError (Int_t bin, Double_t error) override
 Set the bin Error.
virtual void SetBinErrorOption (EBinErrorOpt type)
virtual void SetBins (Int_t nx, const Double_t *xBins)
 Redefine x axis parameters with variable bin sizes.
virtual void SetBins (Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins)
 Redefine x and y axis parameters with variable bin sizes.
virtual void SetBins (Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBins, Int_t nz, const Double_t *zBins)
 Redefine x, y and z axis parameters with variable bin sizes.
virtual void SetBins (Int_t nx, Double_t xmin, Double_t xmax)
 Redefine x axis parameters.
virtual void SetBins (Int_t nx, Double_t xmin, Double_t xmax, Int_t ny, Double_t ymin, Double_t ymax)
 Redefine x and y axis parameters.
virtual void SetBins (Int_t nx, Double_t xmin, Double_t xmax, Int_t ny, Double_t ymin, Double_t ymax, Int_t nz, Double_t zmin, Double_t zmax)
 Redefine x, y and z axis parameters.
virtual void SetBinsLength (Int_t=-1)
void SetBit (UInt_t f)
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
virtual void SetBuffer (Int_t bufsize, Option_t *option="")
 Set the maximum number of entries to be kept in the buffer.
virtual UInt_t SetCanExtend (UInt_t extendBitMask)
 Make the histogram axes extendable / not extendable according to the bit mask returns the previous bit mask specifying which axes are extendable.
virtual void SetCellContent (Int_t binx, Int_t biny, Double_t content)
virtual void SetCellError (Int_t binx, Int_t biny, Double_t content)
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.
virtual void SetContent (const Double_t *content)
 Replace bin contents by the contents of array content.
void SetContentToAverage ()
 Set content to average.
void SetContentToError ()
 Set content to error.
virtual void SetContour (Int_t nlevels, const Double_t *levels=nullptr)
 Set the number and values of contour levels.
virtual void SetContourLevel (Int_t level, Double_t value)
 Set value for one contour level.
virtual void SetDirectory (TDirectory *dir)
 By default, when a histogram is created, it is added to the list of histogram objects in the current directory in memory.
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
virtual void SetEntries (Double_t n)
virtual void SetError (const Double_t *error)
 Replace bin errors by values in array error.
void SetErrorOption (EErrorType type)
 Set error option.
virtual void SetFillAttributes ()
virtual void SetFillColor (Color_t fcolor)
 Set the fill area color.
void SetFillColor (TColorNumber)
virtual void SetFillColorAlpha (Color_t fcolor, Float_t falpha)
virtual void SetFillStyle (Style_t fstyle)
 Set the fill area style.
void SetFloat (Bool_t flag=true)
 When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.
virtual void SetHighlight (Bool_t set=kTRUE)
 Set highlight (enable/disable) mode for the histogram by default highlight mode is disable.
virtual void SetLabelColor (Color_t color=1, Option_t *axis="X")
 Set axis labels color.
virtual void SetLabelFont (Style_t font=62, Option_t *axis="X")
 Set font number used to draw axis labels.
virtual void SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")
 Set offset between axis and axis' labels.
virtual void SetLabelSize (Float_t size=0.02, Option_t *axis="X")
 Set size of axis' labels.
virtual void SetLineAttributes ()
virtual void SetLineColor (Color_t lcolor)
 Set the line color.
void SetLineColor (TColorNumber lcolor)
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
virtual void SetLineStyle (Style_t lstyle)
 Set the line style.
virtual void SetLineWidth (Width_t lwidth)
 Set the line width.
virtual void SetMarkerAttributes ()
virtual void SetMarkerColor (Color_t mcolor=1)
 Set the marker color.
void SetMarkerColor (TColorNumber lcolor)
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
virtual void SetMarkerSize (Size_t msize=1)
 Set the marker size.
virtual void SetMarkerStyle (Style_t mstyle=1)
 Set the marker style.
virtual void SetMaximum (Double_t maximum=-1111)
virtual void SetMinimum (Double_t minimum=-1111)
void SetName (const char *name) override
 Change the name of this histogram.
void SetNameTitle (const char *name, const char *title) override
 Change the name and title of this histogram.
virtual void SetNdivisions (Int_t n=510, Option_t *axis="X")
 Set the number of divisions to draw an axis.
void SetNewBinAdded (Bool_t flag)
virtual void SetNormFactor (Double_t factor=1)
virtual void SetOption (Option_t *option=" ")
virtual void SetShowProjectionX (Int_t nbins=1)
 When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the projection along X corresponding to the mouse position along Y.
virtual void SetShowProjectionXY (Int_t nbinsY=1, Int_t nbinsX=1)
 When the mouse is moved in a pad containing a 2-d view of this histogram two canvases show the projection along X and Y corresponding to the mouse position along Y and X, respectively.
virtual void SetShowProjectionY (Int_t nbins=1)
 When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the projection along Y corresponding to the mouse position along X.
void SetStatOverflows (EStatOverflows statOverflows)
 See GetStatOverflows for more information.
virtual void SetStats (Bool_t stats=kTRUE)
 Set statistics option on/off.
virtual void SetTickLength (Float_t length=0.02, Option_t *axis="X")
 Set the axis' tick marks length.
void SetTitle (const char *title) override
 Change/set the title.
virtual void SetTitleFont (Style_t font=62, Option_t *axis="X")
 Set the axis' title font.
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.
virtual void SetTitleSize (Float_t size=0.02, Option_t *axis="X")
 Set the axis' title size.
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
virtual void SetXTitle (const char *title)
virtual void SetYTitle (const char *title)
virtual void SetZTitle (const char *title)
virtual TH1ShowBackground (Int_t niter=20, Option_t *option="same")
 This function calculates the background spectrum in this histogram.
virtual TH1ShowBackground2D (Int_t nIterX=20, Int_t nIterY=20, Option_t *option="same")
 This function calculates the background spectrum in this histogram.
Int_t ShowPeaks (Double_t sigma=2, Option_t *option="", Double_t threshold=0.05) override
 Interface to TSpectrum2::Search the function finds peaks in this histogram where the width is > sigma and the peak maximum greater than threshold*maximum bin content of this.
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject.
void Smooth (Int_t ntimes=1, Option_t *option="") override
 Smooth bin contents of this 2-d histogram using kernel algorithms similar to the ones used in the raster graphics community.
void Streamer (TBuffer &) override
 Stream an object of class TH2.
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
virtual void Sumw2 (Bool_t flag=kTRUE)
 Create structure to store sum of squares of weights.
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
Bool_t TestBit (UInt_t f) const
Int_t TestBits (UInt_t f) const
void UseCurrentStyle () override
 Copy current attributes from/to current style.
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.

Static Public Member Functions

static void AddDirectory (Bool_t add=kTRUE)
 Sets the flag controlling the automatic add of histograms in memory.
static Bool_t AddDirectoryStatus ()
 Check whether TH1-derived classes should register themselves to the current gDirectory.
static Int_t CheckConsistency (const TH1 *h1, const TH1 *h2)
 Check histogram compatibility.
static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static const char * DeclFileName ()
static Int_t FitOptionsMake (Option_t *option, Foption_t &Foption)
 Decode string choptin and fill fitOption structure.
static Int_t GetDefaultBufferSize ()
 Static function return the default buffer size for automatic histograms the parameter fgBufferSize may be changed via SetDefaultBufferSize.
static Bool_t GetDefaultSumw2 ()
 Return kTRUE if TH1::Sumw2 must be called when creating new histograms.
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
static Width_t GetMarkerLineWidth (Style_t style)
static Style_t GetMarkerStyleBase (Style_t style)
static Bool_t GetObjectStat ()
 Get status of object stat flag.
static void SavePrimitiveFunctions (std::ostream &out, const char *varname, TList *lst)
 Save list of functions Also can be used by TGraph classes.
static void SetDefaultBufferSize (Int_t bufsize=1000)
 Static function to set the default buffer size for automatic histograms.
static void SetDefaultSumw2 (Bool_t sumw2=kTRUE)
 When this static function is called with sumw2=kTRUE, all new histograms will automatically activate the storage of the sum of squares of errors, ie TH1::Sumw2 is automatically called.
static void SetDtorOnly (void *obj)
 Set destructor only flag.
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
static void SmoothArray (Int_t NN, Double_t *XX, Int_t ntimes=1)
 Smooth array xx, translation of Hbook routine hsmoof.F.
static void StatOverflows (Bool_t flag=kTRUE)
 if flag=kTRUE, underflows and overflows are used by the Fill functions in the computation of statistics (mean value, StdDev).
static TH1TransformHisto (TVirtualFFT *fft, TH1 *h_output, Option_t *option)
 For a given transform (first parameter), fills the histogram (second parameter) with the transform output data, specified in the third parameter If the 2nd parameter h_output is empty, a new histogram (TH1D or TH2D) is created and the user is responsible for deleting it.

Protected Types

enum  { kNOverflow = 9 }
enum  { kOnlyPrepStep = (1ULL << (3)) }

Protected Member Functions

void AddBinContent (Int_t) override
 NOT IMPLEMENTED for TH2Poly.
void AddBinContent (Int_t, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
void AddBinToPartition (TH2PolyBin *bin)
 Adds the input bin into the partition cell matrix.
virtual Int_t AutoP2FindLimits (Double_t min, Double_t max)
 Buffer-based estimate of the histogram range using the power of 2 algorithm.
Int_t AxisChoice (Option_t *axis) const
 Choose an axis according to "axis".
virtual Int_t BufferFill (Double_t x, Double_t y, Double_t w)
 accumulate arguments in buffer.
Int_t BufferFill (Double_t, Double_t) override
 accumulate arguments in buffer.
TProfile2PolyBinCreateBin (TObject *poly) override
 Create bin.
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
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.
virtual void DoFitSlices (bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray *arr)
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 number values working for all histograms (1D, 2D and 3D).
virtual TProfileDoProfile (bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
virtual TH1DDoProjection (bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const
 Internal (protected) method for performing projection on the X or Y axis called by ProjectionX or ProjectionY.
virtual TH1DDoQuantiles (bool onX, const char *name, Double_t prob) const
 Implementation of quantiles for x or y.
void FillN (Int_t, const Double_t *, const Double_t *, Int_t) override
 NOT IMPLEMENTED for TH2Poly.
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 the previous ones (see TH1::Merge).
UInt_t GetAxisLabelStatus () const
 Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e.
virtual Double_t GetBinErrorSqUnchecked (Int_t bin) const
Int_t GetOverflowRegionFromCoordinates (Double_t x, Double_t y)
 The overflow regions are calculated by considering x, y coordinates.
Bool_t GetStatOverflowsBehaviour () const
void Initialize (Double_t xlow, Double_t xup, Double_t ylow, Double_t yup, Int_t n, Int_t m)
 Initializes the TH2Poly object. This method is called by the constructor.
Double_t Integral (Int_t, Int_t, const Option_t *) const override
 NOT IMPLEMENTED for TH2Poly.
Double_t Integral (Int_t, Int_t, Int_t, Int_t, const Option_t *) const override
 NOT IMPLEMENTED for TH2Poly.
Double_t Integral (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, const Option_t *) const override
 NOT IMPLEMENTED for TH2Poly.
Bool_t IsEmpty () const
 Check if a histogram is empty (this is a protected method used mainly by TH1Merger ).
Bool_t IsIntersecting (TH2PolyBin *bin, Double_t xclipl, Double_t xclipr, Double_t yclipb, Double_t yclipt)
 Returns kTRUE if the input bin is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt).
Bool_t IsIntersectingPolygon (Int_t bn, Double_t *x, Double_t *y, Double_t xclipl, Double_t xclipr, Double_t yclipb, Double_t yclipt)
 Returns kTRUE if the input polygon (bn, x, y) is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt).
int LoggedInconsistency (const char *name, const TH1 *h1, const TH1 *h2, bool useMerge=false) const
void MakeZombie ()
Int_t OverflowIdxToArrayIdx (Int_t val)
TString ProvideSaveName (Option_t *option, Bool_t testfdir=kFALSE)
 Provide variable name for histogram for saving as primitive Histogram pointer has by default the histogram name with an incremental suffix.
Double_t RetrieveBinContent (Int_t bin) const override
 Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::GetBin.
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, eg TProfile, TProfile2D.
void SavePrimitiveNameTitle (std::ostream &out, const char *variable_name)
 Save object name and title into the output stream "out".
void SetBinContent (Int_t, Int_t, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
void SetBinContent (Int_t, Int_t, Int_t, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
void SetBinError (Int_t, Int_t, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
void SetBinError (Int_t, Int_t, Int_t, Double_t) override
 NOT IMPLEMENTED for TH2Poly.
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.

Static Protected Member Functions

static Int_t AutoP2GetBins (Int_t n)
 Auxiliary function to get the next power of 2 integer value larger then n.
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.
static bool CheckAxisLimits (const TAxis *a1, const TAxis *a2)
 Check that the axis limits of the histograms are the same.
static bool CheckBinLabels (const TAxis *a1, const TAxis *a2)
 Check that axis have same labels.
static bool CheckBinLimits (const TAxis *a1, const TAxis *a2)
 Check bin limits.
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.
static bool CheckEqualAxes (const TAxis *a1, const TAxis *a2)
 Check that the axis are the same.
static Bool_t RecomputeAxisLimits (TAxis &destAxis, const TAxis &anAxis)
 Finds new limits for the axis for the Merge function.
static Bool_t SameLimitsAndNBins (const TAxis &axis1, const TAxis &axis2)
 Same limits and bins.
static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.

Protected Attributes

Short_t fBarOffset
 (1000*offset) for bar charts or legos
Short_t fBarWidth
 (1000*width) for bar charts or legos
Bool_t fBinContentChanged
 !For the 3D Painter
TListfBins
 List of bins. The list owns the contained objects.
EBinErrorOpt fBinStatErrOpt
 Option for bin statistical errors.
Double_tfBuffer
 [fBufferSize] entry buffer
Int_t fBufferSize
 fBuffer size
TListfCells
 [fNCells] The array of TLists that store the bins that intersect with each cell. List do not own the contained objects
Int_t fCellX
 Number of partition cells in the x-direction of the histogram.
Int_t fCellY
 Number of partition cells in the y-direction of the histogram.
Bool_tfCompletelyInside
 [fNCells] The array that returns true if the cell at the given coordinate is completely inside a bin
TArrayD fContour
 Array to display contour levels.
Int_t fDimension
 ! Histogram dimension (1, 2 or 3 dim)
TDirectoryfDirectory
 ! Pointer to directory holding this histogram
Double_t fEntries
 Number of entries.
Color_t fFillColor
 Fill area color.
Style_t fFillStyle
 Fill area style.
Bool_t fFloat
 When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.
TListfFunctions
 ->Pointer to list of functions (fits and user)
Double_tfIntegral
 ! Integral of bins used by GetRandom
Bool_tfIsEmpty
 [fNCells] The array that returns true if the cell at the given coordinate is empty
Color_t fLineColor
 Line color.
Style_t fLineStyle
 Line style.
Width_t fLineWidth
 Line width.
Color_t fMarkerColor
 Marker color.
Size_t fMarkerSize
 Marker size.
Style_t fMarkerStyle
 Marker style.
Double_t fMaximum
 Maximum value for plotting.
Double_t fMinimum
 Minimum value for plotting.
TString fName
Int_t fNCells
 Number of partition cells: fCellX*fCellY.
Int_t fNcells
 Number of bins(1D), cells (2D) +U/Overflows.
Bool_t fNewBinAdded
 !For the 3D Painter
Double_t fNormFactor
 Normalization factor.
TString fOption
 Histogram options.
Double_t fOverflow [kNOverflow]
 Overflow bins.
TVirtualHistPainterfPainter
 ! Pointer to histogram painter
Double_t fScalefactor
 Scale factor.
EStatOverflows fStatOverflows
 Per object flag to use under/overflows in statistics.
Double_t fStepX
Double_t fStepY
 Dimensions of a partition cell.
TArrayD fSumw2
 Array of sum of squares of weights.
TString fTitle
Double_t fTsumw
 Total Sum of weights.
Double_t fTsumw2
 Total Sum of squares of weights.
Double_t fTsumwx
 Total Sum of weight*X.
Double_t fTsumwx2
 Total Sum of weight*X*X.
Double_t fTsumwxy
 Total Sum of weight*X*Y.
Double_t fTsumwy
 Total Sum of weight*Y.
Double_t fTsumwy2
 Total Sum of weight*Y*Y.
TAxis fXaxis
 X axis descriptor.
TAxis fYaxis
 Y axis descriptor.
TAxis fZaxis
 Z axis descriptor.

Static Protected Attributes

static Bool_t fgAddDirectory = kTRUE
 ! Flag to add histograms to the directory
static Int_t fgBufferSize = 1000
 ! Default buffer size for automatic histograms
static Bool_t fgDefaultSumw2 = kFALSE
 ! Flag to call TH1::Sumw2 automatically at histogram creation time
static Bool_t fgStatOverflows = kFALSE
 ! Flag to use under/overflows in statistics

Private Member Functions

void Build ()
 Creates histogram basic data structure.
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.
template<typename ValueType>
void SetSliceContent (const std::vector< Double_t > &values, const std::vector< std::pair< Int_t, Int_t > > &sliceEdges, ValueType *dataArray)
 Sets the content of a slice of bins in a histogram.
template<typename ValueType>
void SliceHistoInPlace (std::vector< Int_t > &args, ValueType *&dataArray, Int_t &fN)
 Slices a histogram in place based on the specified bin ranges for each dimension.

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.

Private Attributes

UInt_t fBits
 bit field status word
EErrorType fErrorMode = kERRORMEAN
TProfile2PolyBin fOverflowBins [kNOverflow]
Double_t fTsumwz
Double_t fTsumwz2
UInt_t fUniqueID
 object unique identifier

Static Private Attributes

static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable

Friends

class TProfile2PolyBin
class TProfileHelper

#include <TProfile2Poly.h>

Inheritance diagram for TProfile2Poly:
TH2Poly TH2 TH1 TNamed TAttLine TAttFill TAttMarker TObject

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kNOverflow 

Definition at line 158 of file TH2Poly.h.

◆ anonymous enum

anonymous enum
inherited

Enumeration specifying which axes can be extended.

Enumerator
kNoAxis 

NOTE: Must always be 0 !!!

kXaxis 
kYaxis 
kZaxis 
kAllAxes 

Definition at line 121 of file TH1.h.

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited

Size of statistics data (size of array used in GetStats()/ PutStats ).

  • s[0] = sumw s[1] = sumw2
  • s[2] = sumwx s[3] = sumwx2
  • s[4] = sumwy s[5] = sumwy2 s[6] = sumwxy
  • s[7] = sumwz s[8] = sumwz2 s[9] = sumwxz s[10] = sumwyz
  • s[11] = sumwt s[12] = sumwt2 (11 and 12 used only by TProfile3D)
Enumerator
kNstat 

Size of statistics data (up to TProfile3D).

Definition at line 421 of file TH1.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ EBinErrorOpt

enum TH1::EBinErrorOpt
inherited

Enumeration specifying type of statistics for bin errors.

Enumerator
kNormal 

Errors with Normal (Wald) approximation: errorUp=errorLow= sqrt(N).

kPoisson 

Errors from Poisson interval at 68.3% (1 sigma).

kPoisson2 

Errors from Poisson interval at 95% CL (~ 2 sigma).

Definition at line 114 of file TH1.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ EInconsistencyBits

enum TH1::EInconsistencyBits
inherited

Enumeration specifying inconsistencies between two histograms, in increasing severity.

Enumerator
kFullyConsistent 
kDifferentLabels 
kDifferentBinLimits 
kDifferentAxisLimits 
kDifferentNumberOfBins 
kDifferentDimensions 

Definition at line 138 of file TH1.h.

◆ EStatOverflows

enum TH1::EStatOverflows
inherited

Enumeration specifying the way to treat statoverflow.

Enumerator
kIgnore 

Override global flag ignoring the overflows.

kConsider 

Override global flag considering the overflows.

kNeutral 

Adapt to the global flag.

Definition at line 130 of file TH1.h.

◆ EStatusBits

enum TH1::EStatusBits
inherited

TH1 status bits.

Enumerator
kNoStats 

Don't draw stats box.

kUserContour 

User specified contour levels.

kLogX 

X-axis in log scale.

kIsZoomed 

Bit set when zooming on Y axis.

kNoTitle 

Don't draw the histogram title.

kIsAverage 

Bin contents are average (used by Add).

kIsNotW 

Histogram is forced to be not weighted even when the histogram is filled with weighted.

kAutoBinPTwo 

different than 1.

Use Power(2)-based algorithm for autobinning

kIsHighlight 

bit set if histo is highlight

Definition at line 402 of file TH1.h.

Constructor & Destructor Documentation

◆ TProfile2Poly() [1/3]

TProfile2Poly::TProfile2Poly ( )
inline

Definition at line 64 of file TProfile2Poly.h.

◆ TProfile2Poly() [2/3]

TProfile2Poly::TProfile2Poly ( const char * name,
const char * title,
Double_t xlow,
Double_t xup,
Double_t ylow,
Double_t yup )

TProfile2Poly constructor.

Definition at line 135 of file TProfile2Poly.cxx.

◆ TProfile2Poly() [3/3]

TProfile2Poly::TProfile2Poly ( const char * name,
const char * title,
Int_t nX,
Double_t xlow,
Double_t xup,
Int_t nY,
Double_t ylow,
Double_t yup )

TProfile2Poly constructor.

Definition at line 144 of file TProfile2Poly.cxx.

◆ ~TProfile2Poly()

TProfile2Poly::~TProfile2Poly ( )
inlineoverride

Definition at line 68 of file TProfile2Poly.h.

Member Function Documentation

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ Add() [1/3]

Bool_t TH2Poly::Add ( const TH1 * h1,
const TH1 * h2,
Double_t c1 = 1,
Double_t c2 = 1 )
overridevirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 1675 of file TH2Poly.cxx.

◆ Add() [2/3]

Bool_t TH2Poly::Add ( const TH1 * h1,
Double_t c1 )
overridevirtualinherited

Performs the operation: this = this + c1*h1.

Reimplemented from TH1.

Definition at line 364 of file TH2Poly.cxx.

◆ Add() [3/3]

Bool_t TH2Poly::Add ( TF1 * h1,
Double_t c1 = 1,
Option_t * option = "" )
overridevirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 1667 of file TH2Poly.cxx.

◆ AddBin() [1/3]

Int_t TH2Poly::AddBin ( Double_t x1,
Double_t y1,
Double_t x2,
Double_t y2 )
inherited

Add a new bin to the histogram.

The bin shape is a rectangle. It returns the bin number of the bin in the histogram.

Definition at line 352 of file TH2Poly.cxx.

◆ AddBin() [2/3]

Int_t TH2Poly::AddBin ( Int_t n,
const Double_t * x,
const Double_t * y )
inherited

Adds a new bin to the histogram.

The number of vertices and their (x,y) coordinates are required as input. It returns the bin number in the histogram.

Definition at line 341 of file TH2Poly.cxx.

◆ AddBin() [3/3]

Int_t TH2Poly::AddBin ( TObject * poly)
virtualinherited

Adds a new bin to the histogram.

It can be any object having the method IsInside(). It returns the bin number in the histogram. It returns 0 if it failed to add. To allow the histogram limits to expand when a bin outside the limits is added, call SetFloat() before adding the bin.

Definition at line 296 of file TH2Poly.cxx.

◆ AddBinContent() [1/4]

void TH2::AddBinContent ( Int_t binx,
Int_t biny )
inlineinherited

Increment 2D bin content by 1.

Passing an out-of-range bin leads to undefined behavior

Definition at line 76 of file TH2.h.

◆ AddBinContent() [2/4]

void TH2::AddBinContent ( Int_t binx,
Int_t biny,
Double_t w )
inlineinherited

Increment 2D bin content by a weight w.

Passing an out-of-range bin leads to undefined behavior

Definition at line 79 of file TH2.h.

◆ AddBinContent() [3/4]

void TH2Poly::AddBinContent ( Int_t )
overrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2.

Definition at line 1726 of file TH2Poly.cxx.

◆ AddBinContent() [4/4]

void TH2Poly::AddBinContent ( Int_t ,
Double_t  )
overrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2.

Definition at line 1732 of file TH2Poly.cxx.

◆ AddBinToPartition()

void TH2Poly::AddBinToPartition ( TH2PolyBin * bin)
protectedinherited

Adds the input bin into the partition cell matrix.

This method is called in AddBin() and ChangePartition().

Definition at line 442 of file TH2Poly.cxx.

◆ AddDirectory()

void TH1::AddDirectory ( Bool_t add = kTRUE)
staticinherited

Sets the flag controlling the automatic add of histograms in memory.

By default (fAddDirectory = kTRUE), histograms are automatically added to the current directory (gDirectory). Note that one histogram can be removed from its support directory by calling h->SetDirectory(nullptr) or h->SetDirectory(dir) to add it to the list of objects in the directory dir.

This is a static function. To call it, use TH1::AddDirectory

Deprecated
Use ROOT::Experimental::ObjectAutoRegistrationEnabled(). It can be set using an entry in rootrc or an environment variable, is initialised in a thread-safe manner and covers more cases.

Definition at line 1309 of file TH1.cxx.

◆ AddDirectoryStatus()

Bool_t TH1::AddDirectoryStatus ( )
staticinherited

Check whether TH1-derived classes should register themselves to the current gDirectory.

Note
Even if this returns true, the state of ROOT::Experimental::ObjectAutoRegistrationEnabled() might prevent the registration of histograms, since it has higher precedence.

Definition at line 764 of file TH1.cxx.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AndersonDarlingTest() [1/2]

Double_t TH1::AndersonDarlingTest ( const TH1 * h2,
Double_t & advalue ) const
virtualinherited

Same function as above but returning also the test statistic value.

Definition at line 8213 of file TH1.cxx.

◆ AndersonDarlingTest() [2/2]

Double_t TH1::AndersonDarlingTest ( const TH1 * h2,
Option_t * option = "" ) const
virtualinherited

Statistical test of compatibility in shape between this histogram and h2, using the Anderson-Darling 2 sample test.

The AD 2 sample test formula are derived from the paper F.W Scholz, M.A. Stephens "k-Sample Anderson-Darling Test".

The test is implemented in root in the ROOT::Math::GoFTest class It is the same formula ( (6) in the paper), and also shown in this preprint

Binned data are considered as un-binned data with identical observation happening in the bin center.

Parameters
[in]h2Pointer to 1D histogram
[in]optionis a character string to specify options
  • "D" Put out a line of "Debug" printout
  • "T" Return the normalized A-D test statistic
  • Note1: Underflow and overflow are not considered in the test
  • Note2: The test works only for un-weighted histogram (i.e. representing counts)
  • Note3: The histograms are not required to have the same X axis
  • Note4: The test works only for 1-dimensional histograms

Definition at line 8195 of file TH1.cxx.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ AutoP2FindLimits()

Int_t TH1::AutoP2FindLimits ( Double_t xmi,
Double_t xma )
protectedvirtualinherited

Buffer-based estimate of the histogram range using the power of 2 algorithm.

Used by the autobin power of 2 algorithm.

Works on arguments (min and max from fBuffer) and internal inputs: fXmin, fXmax, NBinsX (from fXaxis), ... Result save internally in fXaxis.

Overloaded by TH2 and TH3.

Return -1 if internal inputs are inconsistent, 0 otherwise.

Definition at line 1358 of file TH1.cxx.

◆ AutoP2GetBins()

Int_t TH1::AutoP2GetBins ( Int_t n)
inlinestaticprotectedinherited

Auxiliary function to get the next power of 2 integer value larger then n.

Used by the autobin power of 2 algorithm

Definition at line 1336 of file TH1.cxx.

◆ AutoP2GetPower2()

Double_t TH1::AutoP2GetPower2 ( Double_t x,
Bool_t next = kTRUE )
inlinestaticprotectedinherited

Auxiliary function to get the power of 2 next (larger) or previous (smaller) a given x.

next = kTRUE : next larger next = kFALSE : previous smaller

Used by the autobin power of 2 algorithm

Definition at line 1323 of file TH1.cxx.

◆ AxisChoice()

Int_t TH1::AxisChoice ( Option_t * axis) const
protectedinherited

Choose an axis according to "axis".

Definition at line 14 of file Haxis.cxx.

◆ Browse()

void TH1::Browse ( TBrowser * b)
overridevirtualinherited

Browse the Histogram object.

Reimplemented from TObject.

Definition at line 772 of file TH1.cxx.

◆ BufferEmpty()

Int_t TH2::BufferEmpty ( Int_t action = 0)
overridevirtualinherited

Fill histogram with all entries in the buffer.

  • action = -1 histogram is reset and refilled from the buffer (called by THistPainter::Paint)
  • action = 0 histogram is filled from the buffer
  • action = 1 histogram is filled and buffer is deleted The buffer is automatically deleted when the number of entries in the buffer is greater than the number of entries in the histogram

Reimplemented from TH1.

Reimplemented in TProfile2D.

Definition at line 241 of file TH2.cxx.

◆ BufferFill() [1/2]

Int_t TH2::BufferFill ( Double_t x,
Double_t y,
Double_t w )
protectedvirtualinherited

accumulate arguments in buffer.

When buffer is full, empty the buffer

fBuffer[0] = number of entries in buffer
fBuffer[1] = w of first entry
fBuffer[2] = x of first entry
fBuffer[3] = y of first entry
Double_t * fBuffer
[fBufferSize] entry buffer
Definition TH1.h:169
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17

Reimplemented in TProfile2D.

Definition at line 322 of file TH2.cxx.

◆ BufferFill() [2/2]

Int_t TH2::BufferFill ( Double_t x,
Double_t w )
inlineoverrideprotectedvirtualinherited

accumulate arguments in buffer.

When buffer is full, empty the buffer

  • fBuffer[0] = number of entries in buffer
  • fBuffer[1] = w of first entry
  • fBuffer[2] = x of first entry

Reimplemented from TH1.

Reimplemented in TProfile2D.

Definition at line 56 of file TH2.h.

◆ Build()

void TH1::Build ( )
privateinherited

Creates histogram basic data structure.

Definition at line 781 of file TH1.cxx.

◆ CanExtendAllAxes()

Bool_t TH1::CanExtendAllAxes ( ) const
virtualinherited

Returns true if all axes are extendable.

Definition at line 6751 of file TH1.cxx.

◆ ChangePartition()

void TH2Poly::ChangePartition ( Int_t n,
Int_t m )
inherited

Changes the number of partition cells in the histogram.

Deletes the old partition and constructs a new one.

Definition at line 514 of file TH2Poly.cxx.

◆ CheckAxisLimits()

bool TH1::CheckAxisLimits ( const TAxis * a1,
const TAxis * a2 )
staticprotectedinherited

Check that the axis limits of the histograms are the same.

If a first and last bin is passed the axis is compared between the given range

Definition at line 1612 of file TH1.cxx.

◆ CheckBinLabels()

bool TH1::CheckBinLabels ( const TAxis * a1,
const TAxis * a2 )
staticprotectedinherited

Check that axis have same labels.

Definition at line 1583 of file TH1.cxx.

◆ CheckBinLimits()

bool TH1::CheckBinLimits ( const TAxis * a1,
const TAxis * a2 )
staticprotectedinherited

Check bin limits.

Definition at line 1556 of file TH1.cxx.

◆ CheckConsistency()

Int_t TH1::CheckConsistency ( const TH1 * h1,
const TH1 * h2 )
staticinherited

Check histogram compatibility.

The returned integer is part of EInconsistencyBits The value 0 means that the histograms are compatible

Definition at line 1694 of file TH1.cxx.

◆ CheckConsistentSubAxes()

bool TH1::CheckConsistentSubAxes ( const TAxis * a1,
Int_t firstBin1,
Int_t lastBin1,
const TAxis * a2,
Int_t firstBin2 = 0,
Int_t lastBin2 = 0 )
staticprotectedinherited

Check that two sub axis are the same.

The limits are defined by first bin and last bin N.B. no check is done in this case for variable bins

Definition at line 1655 of file TH1.cxx.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ CheckEqualAxes()

bool TH1::CheckEqualAxes ( const TAxis * a1,
const TAxis * a2 )
staticprotectedinherited

Check that the axis are the same.

Definition at line 1626 of file TH1.cxx.

◆ Chi2Test()

Double_t TH1::Chi2Test ( const TH1 * h2,
Option_t * option = "UU",
Double_t * res = nullptr ) const
virtualinherited

\( \chi^{2} \) test for comparing weighted and unweighted histograms.

Compares the histograms' adjusted (normalized) residuals. Function: Returns p-value. Other return values are specified by the 3rd parameter

Parameters
[in]h2the second histogram
[in]option
  • "UU" = experiment experiment comparison (unweighted-unweighted)
  • "UW" = experiment MC comparison (unweighted-weighted). Note that the first histogram should be unweighted
  • "WW" = MC MC comparison (weighted-weighted)
  • "NORM" = to be used when one or both of the histograms is scaled but the histogram originally was unweighted
  • by default underflows and overflows are not included:
    • "OF" = overflows included
    • "UF" = underflows included
  • "P" = print chi2, ndf, p_value, igood
  • "CHI2" = returns chi2 instead of p-value
  • "CHI2/NDF" = returns \( \chi^{2} \)/ndf
[in]resnot empty - computes normalized residuals and returns them in this array

The current implementation is based on the papers \( \chi^{2} \) test for comparison of weighted and unweighted histograms" in Proceedings of PHYSTAT05 and "Comparison weighted and unweighted histograms", arXiv:physics/0605123 by N.Gagunashvili. This function has been implemented by Daniel Haertl in August 2006.

Introduction:

A frequently used technique in data analysis is the comparison of histograms. First suggested by Pearson [1] the \( \chi^{2} \) test of homogeneity is used widely for comparing usual (unweighted) histograms. This paper describes the implementation modified \( \chi^{2} \) tests for comparison of weighted and unweighted histograms and two weighted histograms [2] as well as usual Pearson's \( \chi^{2} \) test for comparison two usual (unweighted) histograms.

Overview:

Comparison of two histograms expect hypotheses that two histograms represent identical distributions. To make a decision p-value should be calculated. The hypotheses of identity is rejected if the p-value is lower then some significance level. Traditionally significance levels 0.1, 0.05 and 0.01 are used. The comparison procedure should include an analysis of the residuals which is often helpful in identifying the bins of histograms responsible for a significant overall \( \chi^{2} \) value. Residuals are the difference between bin contents and expected bin contents. Most convenient for analysis are the normalized residuals. If hypotheses of identity are valid then normalized residuals are approximately independent and identically distributed random variables having N(0,1) distribution. Analysis of residuals expect test of above mentioned properties of residuals. Notice that indirectly the analysis of residuals increase the power of \( \chi^{2} \) test.

Methods of comparison:

\( \chi^{2} \) test for comparison two (unweighted) histograms: Let us consider two histograms with the same binning and the number of bins equal to r. Let us denote the number of events in the ith bin in the first histogram as ni and as mi in the second one. The total number of events in the first histogram is equal to:

\[ N = \sum_{i=1}^{r} n_{i} \]

and

\[ M = \sum_{i=1}^{r} m_{i} \]

in the second histogram. The hypothesis of identity (homogeneity) [3] is that the two histograms represent random values with identical distributions. It is equivalent that there exist r constants p1,...,pr, such that

\[\sum_{i=1}^{r} p_{i}=1 \]

and the probability of belonging to the ith bin for some measured value in both experiments is equal to pi. The number of events in the ith bin is a random variable with a distribution approximated by a Poisson probability distribution

\[\frac{e^{-Np_{i}}(Np_{i})^{n_{i}}}{n_{i}!} \]

for the first histogram and with distribution

\[\frac{e^{-Mp_{i}}(Mp_{i})^{m_{i}}}{m_{i}!} \]

for the second histogram. If the hypothesis of homogeneity is valid, then the maximum likelihood estimator of pi, i=1,...,r, is

\[\hat{p}_{i}= \frac{n_{i}+m_{i}}{N+M} \]

and then

\[ X^{2} = \sum_{i=1}^{r}\frac{(n_{i}-N\hat{p}_{i})^{2}}{N\hat{p}_{i}} + \sum_{i=1}^{r}\frac{(m_{i}-M\hat{p}_{i})^{2}}{M\hat{p}_{i}} =\frac{1}{MN} \sum_{i=1}^{r}\frac{(Mn_{i}-Nm_{i})^{2}}{n_{i}+m_{i}} \]

has approximately a \( \chi^{2}_{(r-1)} \) distribution [3]. The comparison procedure can include an analysis of the residuals which is often helpful in identifying the bins of histograms responsible for a significant overall \( \chi^{2} \) value. Most convenient for analysis are the adjusted (normalized) residuals [4]

\[ r_{i} = \frac{n_{i}-N\hat{p}_{i}}{\sqrt{N\hat{p}_{i}}\sqrt{(1-N/(N+M))(1-(n_{i}+m_{i})/(N+M))}} \]

If hypotheses of homogeneity are valid then residuals ri are approximately independent and identically distributed random variables having N(0,1) distribution. The application of the \( \chi^{2} \) test has restrictions related to the value of the expected frequencies Npi, Mpi, i=1,...,r. A conservative rule formulated in [5] is that all the expectations must be 1 or greater for both histograms. In practical cases when expected frequencies are not known the estimated expected frequencies \( M\hat{p}_{i}, N\hat{p}_{i}, i=1,...,r \) can be used.

Unweighted and weighted histograms comparison:

A simple modification of the ideas described above can be used for the comparison of the usual (unweighted) and weighted histograms. Let us denote the number of events in the ith bin in the unweighted histogram as ni and the common weight of events in the ith bin of the weighted histogram as wi. The total number of events in the unweighted histogram is equal to

\[ N = \sum_{i=1}^{r} n_{i} \]

and the total weight of events in the weighted histogram is equal to

\[ W = \sum_{i=1}^{r} w_{i} \]

Let us formulate the hypothesis of identity of an unweighted histogram to a weighted histogram so that there exist r constants p1,...,pr, such that

\[ \sum_{i=1}^{r} p_{i} = 1 \]

for the unweighted histogram. The weight wi is a random variable with a distribution approximated by the normal probability distribution \( N(Wp_{i},\sigma_{i}^{2}) \) where \( \sigma_{i}^{2} \) is the variance of the weight wi. If we replace the variance \( \sigma_{i}^{2} \) with estimate \( s_{i}^{2} \) (sum of squares of weights of events in the ith bin) and the hypothesis of identity is valid, then the maximum likelihood estimator of pi,i=1,...,r, is

\[ \hat{p}_{i} = \frac{Ww_{i}-Ns_{i}^{2}+\sqrt{(Ww_{i}-Ns_{i}^{2})^{2}+4W^{2}s_{i}^{2}n_{i}}}{2W^{2}} \]

We may then use the test statistic

\[ X^{2} = \sum_{i=1}^{r} \frac{(n_{i}-N\hat{p}_{i})^{2}}{N\hat{p}_{i}} + \sum_{i=1}^{r} \frac{(w_{i}-W\hat{p}_{i})^{2}}{s_{i}^{2}} \]

and it has approximately a \( \sigma^{2}_{(r-1)} \) distribution [2]. This test, as well as the original one [3], has a restriction on the expected frequencies. The expected frequencies recommended for the weighted histogram is more than 25. The value of the minimal expected frequency can be decreased down to 10 for the case when the weights of the events are close to constant. In the case of a weighted histogram if the number of events is unknown, then we can apply this recommendation for the equivalent number of events as

\[ n_{i}^{equiv} = \frac{ w_{i}^{2} }{ s_{i}^{2} } \]

The minimal expected frequency for an unweighted histogram must be 1. Notice that any usual (unweighted) histogram can be considered as a weighted histogram with events that have constant weights equal to 1. The variance \( z_{i}^{2} \) of the difference between the weight wi and the estimated expectation value of the weight is approximately equal to:

\[ z_{i}^{2} = Var(w_{i}-W\hat{p}_{i}) = N\hat{p}_{i}(1-N\hat{p}_{i})\left(\frac{Ws_{i}^{2}}{\sqrt{(Ns_{i}^{2}-w_{i}W)^{2}+4W^{2}s_{i}^{2}n_{i}}}\right)^{2}+\frac{s_{i}^{2}}{4}\left(1+\frac{Ns_{i}^{2}-w_{i}W}{\sqrt{(Ns_{i}^{2}-w_{i}W)^{2}+4W^{2}s_{i}^{2}n_{i}}}\right)^{2} \]

The residuals

\[ r_{i} = \frac{w_{i}-W\hat{p}_{i}}{z_{i}} \]

have approximately a normal distribution with mean equal to 0 and standard deviation equal to 1.

Two weighted histograms comparison:

Let us denote the common weight of events of the ith bin in the first histogram as w1i and as w2i in the second one. The total weight of events in the first histogram is equal to

\[ W_{1} = \sum_{i=1}^{r} w_{1i} \]

and

\[ W_{2} = \sum_{i=1}^{r} w_{2i} \]

in the second histogram. Let us formulate the hypothesis of identity of weighted histograms so that there exist r constants p1,...,pr, such that

\[ \sum_{i=1}^{r} p_{i} = 1 \]

and also expectation value of weight w1i equal to W1pi and expectation value of weight w2i equal to W2pi. Weights in both the histograms are random variables with distributions which can be approximated by a normal probability distribution \( N(W_{1}p_{i},\sigma_{1i}^{2}) \) for the first histogram and by a distribution \( N(W_{2}p_{i},\sigma_{2i}^{2}) \) for the second. Here \( \sigma_{1i}^{2} \) and \( \sigma_{2i}^{2} \) are the variances of w1i and w2i with estimators \( s_{1i}^{2} \) and \( s_{2i}^{2} \) respectively. If the hypothesis of identity is valid, then the maximum likelihood and Least Square Method estimator of pi,i=1,...,r, is

\[ \hat{p}_{i} = \frac{w_{1i}W_{1}/s_{1i}^{2}+w_{2i}W_{2} /s_{2i}^{2}}{W_{1}^{2}/s_{1i}^{2}+W_{2}^{2}/s_{2i}^{2}} \]

We may then use the test statistic

\[ X^{2} = \sum_{i=1}^{r} \frac{(w_{1i}-W_{1}\hat{p}_{i})^{2}}{s_{1i}^{2}} + \sum_{i=1}^{r} \frac{(w_{2i}-W_{2}\hat{p}_{i})^{2}}{s_{2i}^{2}} = \sum_{i=1}^{r} \frac{(W_{1}w_{2i}-W_{2}w_{1i})^{2}}{W_{1}^{2}s_{2i}^{2}+W_{2}^{2}s_{1i}^{2}} \]

and it has approximately a \( \chi^{2}_{(r-1)} \) distribution [2]. The normalized or studentised residuals [6]

\[ r_{i} = \frac{w_{1i}-W_{1}\hat{p}_{i}}{s_{1i}\sqrt{1 - \frac{1}{(1+W_{2}^{2}s_{1i}^{2}/W_{1}^{2}s_{2i}^{2})}}} \]

have approximately a normal distribution with mean equal to 0 and standard deviation 1. A recommended minimal expected frequency is equal to 10 for the proposed test.

Numerical examples:

The method described herein is now illustrated with an example. We take a distribution

\[ \phi(x) = \frac{2}{(x-10)^{2}+1} + \frac{1}{(x-14)^{2}+1} (1) \]

defined on the interval [4,16]. Events distributed according to the formula (1) are simulated to create the unweighted histogram. Uniformly distributed events are simulated for the weighted histogram with weights calculated by formula (1). Each histogram has the same number of bins: 20. Fig.1 shows the result of comparison of the unweighted histogram with 200 events (minimal expected frequency equal to one) and the weighted histogram with 500 events (minimal expected frequency equal to 25)

/// End_Macro Fig 1. An example of comparison of the unweighted histogram with 200 events and the weighted histogram with 500 events:

  1. unweighted histogram;
  2. weighted histogram;
  3. normalized residuals plot;
  4. normal Q-Q plot of residuals.

The value of the test statistic \( \chi^{2} \) is equal to 21.09 with p-value equal to 0.33, therefore the hypothesis of identity of the two histograms can be accepted for 0.05 significant level. The behavior of the normalized residuals plot (see Fig. 1c) and the normal Q-Q plot (see Fig. 1d) of residuals are regular and we cannot identify the outliers or bins with a big influence on \( \chi^{2} \).

The second example presents the same two histograms but 17 events was added to content of bin number 15 in unweighted histogram. Fig.2 shows the result of comparison of the unweighted histogram with 217 events (minimal expected frequency equal to one) and the weighted histogram with 500 events (minimal expected frequency equal to 25)

/// End_Macro Fig 2. An example of comparison of the unweighted histogram with 217 events and the weighted histogram with 500 events:

  1. unweighted histogram;
  2. weighted histogram;
  3. normalized residuals plot;
  4. normal Q-Q plot of residuals.

The value of the test statistic \( \chi^{2} \) is equal to 32.33 with p-value equal to 0.029, therefore the hypothesis of identity of the two histograms is rejected for 0.05 significant level. The behavior of the normalized residuals plot (see Fig. 2c) and the normal Q-Q plot (see Fig. 2d) of residuals are not regular and we can identify the outlier or bin with a big influence on \( \chi^{2} \).

References:

  • [1] Pearson, K., 1904. On the Theory of Contingency and Its Relation to Association and Normal Correlation. Drapers' Co. Memoirs, Biometric Series No. 1, London.
  • [2] Gagunashvili, N., 2006. \( \sigma^{2} \) test for comparison of weighted and unweighted histograms. Statistical Problems in Particle Physics, Astrophysics and Cosmology, Proceedings of PHYSTAT05, Oxford, UK, 12-15 September 2005, Imperial College Press, London, 43-44. Gagunashvili,N., Comparison of weighted and unweighted histograms, arXiv:physics/0605123, 2006.
  • [3] Cramer, H., 1946. Mathematical methods of statistics. Princeton University Press, Princeton.
  • [4] Haberman, S.J., 1973. The analysis of residuals in cross-classified tables. Biometrics 29, 205-220.
  • [5] Lewontin, R.C. and Felsenstein, J., 1965. The robustness of homogeneity test in 2xN tables. Biometrics 21, 19-33.
  • [6] Seber, G.A.F., Lee, A.J., 2003, Linear Regression Analysis. John Wiley & Sons Inc., New York.

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 2025 of file TH1.cxx.

◆ Chi2TestX()

Double_t TH1::Chi2TestX ( const TH1 * h2,
Double_t & chi2,
Int_t & ndf,
Int_t & igood,
Option_t * option = "UU",
Double_t * res = nullptr ) const
virtualinherited

The computation routine of the Chisquare test.

For the method description, see Chi2Test() function.

Returns
p-value
Parameters
[in]h2the second histogram
[in]option
  • "UU" = experiment experiment comparison (unweighted-unweighted)
  • "UW" = experiment MC comparison (unweighted-weighted). Note that the first histogram should be unweighted
  • "WW" = MC MC comparison (weighted-weighted)
  • "NORM" = if one or both histograms is scaled
  • "OF" = overflows included
  • "UF" = underflows included by default underflows and overflows are not included
[out]igoodtest output
  • igood=0 - no problems
  • For unweighted unweighted comparison
    • igood=1'There is a bin in the 1st histogram with less than 1 event'
    • igood=2'There is a bin in the 2nd histogram with less than 1 event'
    • igood=3'when the conditions for igood=1 and igood=2 are satisfied'
  • For unweighted weighted comparison
    • igood=1'There is a bin in the 1st histogram with less then 1 event'
    • igood=2'There is a bin in the 2nd histogram with less then 10 effective number of events'
    • igood=3'when the conditions for igood=1 and igood=2 are satisfied'
  • For weighted weighted comparison
    • igood=1'There is a bin in the 1st histogram with less then 10 effective number of events'
    • igood=2'There is a bin in the 2nd histogram with less then 10 effective number of events'
    • igood=3'when the conditions for igood=1 and igood=2 are satisfied'
[out]chi2chisquare of the test
[out]ndfnumber of degrees of freedom (important, when both histograms have the same empty bins)
[out]resnormalized residuals for further analysis

Definition at line 2084 of file TH1.cxx.

◆ Chisquare()

Double_t TH1::Chisquare ( TF1 * func,
Option_t * option = "" ) const
virtualinherited

Compute and return the chisquare of this histogram with respect to a function The chisquare is computed by weighting each histogram point by the bin error By default the full range of the histogram is used, unless TAxis::SetRange or TAxis::SetRangeUser was called before.

Use option "R" for restricting the chisquare calculation to the given range of the function Use option "L" for using the chisquare based on the poisson likelihood (Baker-Cousins Chisquare) Use option "P" for using the Pearson chisquare based on the expected bin errors Use option "I" for using the integral of the function in each bin instead of the value at the bin center

Definition at line 2518 of file TH1.cxx.

◆ Class()

TClass * TProfile2Poly::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

const char * TProfile2Poly::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

constexpr Version_t TProfile2Poly::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 115 of file TProfile2Poly.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ Clear()

void TNamed::Clear ( Option_t * option = "")
overridevirtualinherited

Set name and title to empty strings ("").

Reimplemented from TObject.

Reimplemented in TPrincipal, TProcessID, TStreamerInfo, TTask, TVirtualFitter, and TVirtualStreamerInfo.

Definition at line 63 of file TNamed.cxx.

◆ ClearBinContents()

void TH2Poly::ClearBinContents ( )
inherited

Clears the contents of all bins in the histogram.

Definition at line 552 of file TH2Poly.cxx.

◆ ClearUnderflowAndOverflow()

void TH1::ClearUnderflowAndOverflow ( )
virtualinherited

Remove all the content from the underflow and overflow bins, without changing the number of entries After calling this method, every undeflow and overflow bins will have content 0.0 The Sumw2 is also cleared, since there is no more content in the bins.

Definition at line 2540 of file TH1.cxx.

◆ Clone()

TObject * TH1::Clone ( const char * newname = "") const
overridevirtualinherited

Make a complete copy of the underlying object.

If 'newname' is set, the copy's name will be set to that name.

Reimplemented from TObject.

Definition at line 2786 of file TH1.cxx.

◆ Compare()

Int_t TNamed::Compare ( const TObject * obj) const
overridevirtualinherited

Compare two TNamed objects.

Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp).

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 84 of file TNamed.cxx.

◆ ComputeIntegral()

Double_t TH2Poly::ComputeIntegral ( Bool_t ,
Option_t *  )
overridevirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 1698 of file TH2Poly.cxx.

◆ Copy() [1/4]

void TAttFill::Copy ( TAttFill & attfill) const
inherited

◆ Copy() [2/4]

void TAttLine::Copy ( TAttLine & attline) const
inherited

◆ Copy() [3/4]

void TAttMarker::Copy ( TAttMarker & attmarker) const
inherited

◆ Copy() [4/4]

void TH2Poly::Copy ( TObject & newth2p) const
overridevirtualinherited

Copy function for TH2Poly.

Reimplemented from TH2.

Definition at line 211 of file TH2Poly.cxx.

◆ CreateBin()

TProfile2PolyBin * TProfile2Poly::CreateBin ( TObject * poly)
overrideprotectedvirtual

Create bin.

Reimplemented from TH2Poly.

Definition at line 153 of file TProfile2Poly.cxx.

◆ DeclFileName()

const char * TProfile2Poly::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 115 of file TProfile2Poly.h.

◆ Delete()

void TObject::Delete ( Option_t * option = "")
virtualinherited

◆ DirectoryAutoAdd()

void TH1::DirectoryAutoAdd ( TDirectory * dir)
virtualinherited

Callback to perform the automatic addition of the histogram to the given directory.

This callback is used to register a histogram to the current directory when a TKey is read or an object is being cloned using TDirectory::CloneObject().

Definition at line 2834 of file TH1.cxx.

◆ DistancetoLine()

Int_t TAttLine::DistancetoLine ( Int_t px,
Int_t py,
Double_t xp1,
Double_t yp1,
Double_t xp2,
Double_t yp2 )
inherited

◆ DistancetoPrimitive()

Int_t TH1::DistancetoPrimitive ( Int_t px,
Int_t py )
overridevirtualinherited

Compute distance from point px,py to a line.

Compute the closest distance of approach from point px,py to elements of a histogram. The distance is computed in pixels units.

Algorithm:

Currently, this simple model computes the distance from the mouse to the histogram contour only.

Reimplemented from TObject.

Definition at line 2856 of file TH1.cxx.

◆ Divide() [1/3]

Bool_t TH1::Divide ( const TH1 * h1)
virtualinherited

Divide this histogram by h1.

this = this/h1 if errors are defined (see TH1::Sumw2), errors are also recalculated. Note that if h1 has Sumw2 set, Sumw2 is automatically called for this if not already set. The resulting errors are calculated assuming uncorrelated histograms. See the other TH1::Divide that gives the possibility to optionally compute binomial errors.

IMPORTANT NOTE: If you intend to use the errors of this histogram later you should call Sumw2 before making this operation. This is particularly important if you fit the histogram after TH1::Scale

The function return kFALSE if the divide operation failed

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 2941 of file TH1.cxx.

◆ Divide() [2/3]

Bool_t TH1::Divide ( const TH1 * h1,
const TH1 * h2,
Double_t c1 = 1,
Double_t c2 = 1,
Option_t * option = "" )
virtualinherited

Replace contents of this histogram by the division of h1 by h2.

this = c1*h1/(c2*h2)

If errors are defined (see TH1::Sumw2), errors are also recalculated Note that if h1 or h2 have Sumw2 set, Sumw2 is automatically called for this if not already set. The resulting errors are calculated assuming uncorrelated histograms. However, if option ="B" is specified, Binomial errors are computed. In this case c1 and c2 do not make real sense and they are ignored.

IMPORTANT NOTE: If you intend to use the errors of this histogram later you should call Sumw2 before making this operation. This is particularly important if you fit the histogram after TH1::Divide

Please note also that in the binomial case errors are calculated using standard binomial statistics, which means when b1 = b2, the error is zero. If you prefer to have efficiency errors not going to zero when the efficiency is 1, you must use the function TGraphAsymmErrors::BayesDivide, which will return an asymmetric and non-zero lower error for the case b1=b2.

The function return kFALSE if the divide operation failed

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 2999 of file TH1.cxx.

◆ Divide() [3/3]

Bool_t TH2Poly::Divide ( TF1 * ,
Double_t  )
overridevirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 1683 of file TH2Poly.cxx.

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TThread, and TTreeViewer.

Definition at line 1059 of file TObject.cxx.

◆ DoFillN()

void TH1::DoFillN ( Int_t ntimes,
const Double_t * x,
const Double_t * w,
Int_t stride = 1 )
protectedvirtualinherited

Internal method to fill histogram content from a vector called directly by TH1::BufferEmpty.

Definition at line 3522 of file TH1.cxx.

◆ DoFitSlices()

void TH2::DoFitSlices ( bool onX,
TF1 * f1,
Int_t firstbin,
Int_t lastbin,
Int_t cut,
Option_t * option,
TObjArray * arr )
protectedvirtualinherited

Definition at line 781 of file TH2.cxx.

◆ DoIntegral()

Double_t TH1::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
protectedvirtualinherited

Internal function compute integral and optionally the error between the limits specified by the bin number values working for all histograms (1D, 2D and 3D).

Definition at line 8110 of file TH1.cxx.

◆ DoProfile()

TProfile * TH2::DoProfile ( bool onX,
const char * name,
Int_t firstbin,
Int_t lastbin,
Option_t * option ) const
protectedvirtualinherited

Reimplemented in TProfile2D.

Definition at line 1851 of file TH2.cxx.

◆ DoProjection()

TH1D * TH2::DoProjection ( bool onX,
const char * name,
Int_t firstbin,
Int_t lastbin,
Option_t * option ) const
protectedvirtualinherited

Internal (protected) method for performing projection on the X or Y axis called by ProjectionX or ProjectionY.

The histograms created are added to gDirectory.

Definition at line 2147 of file TH2.cxx.

◆ DoQuantiles()

TH1D * TH2::DoQuantiles ( bool onX,
const char * name,
Double_t prob ) const
protectedvirtualinherited

Implementation of quantiles for x or y.

Definition at line 2514 of file TH2.cxx.

◆ Draw()

void TH1::Draw ( Option_t * option = "")
overridevirtualinherited

Draw this histogram with options.

Histograms are drawn via the THistPainter class. Each histogram has a pointer to its own painter (to be usable in a multithreaded program). The same histogram can be drawn with different options in different pads. If a histogram is updated after it has been drawn, the updated data will be shown the next time the pad is updated. One does not need to redraw the histogram.

When a histogram is deleted, the histogram is automatically removed from all pads where it was drawn. If a histogram should be modified or deleted without affecting what is drawn, it should be drawn using DrawCopy().

By default, TH1::Draw clears the current pad. Passing the option "SAME", the histogram will be drawn on top of what's in the pad. One can use TH1::SetMaximum and TH1::SetMinimum to force a particular value for the maximum or the minimum scale on the plot.

TH1::UseCurrentStyle can be used to change all histogram graphics attributes to correspond to the current selected style. This function must be called for each histogram. In case one reads and draws many histograms from a file, one can force the histograms to inherit automatically the current graphics style by calling before gROOT->ForceStyle();

See the THistPainter class for a description of all the drawing options.

Reimplemented from TObject.

Definition at line 3097 of file TH1.cxx.

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TGFrame, TSystemDirectory, and TSystemFile.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TAxis, TCanvas, TGFrame, TSystemDirectory, and TSystemFile.

Definition at line 319 of file TObject.cxx.

◆ DrawCopy()

TH1 * TH1::DrawCopy ( Option_t * option = "",
const char * name_postfix = "_copy" ) const
virtualinherited

Copy this histogram and Draw in the current pad.

Once the histogram is drawn into the pad, the original and its drawn copy can be modified or deleted without affecting each other. The copied histogram will be owned by the pad, and is deleted when the pad is cleared.

DrawCopy() is useful if the original histogram is a temporary, e.g. from code such as

void someFunction(...) {
TH1D histogram(...);
histogram.DrawCopy();
// or equivalently
std::unique_ptr<TH1F> histogram(...);
histogram->DrawCopy();
}
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:926

If Draw() has been used, the histograms would disappear from the canvas at the end of this function.

By default a postfix "_copy" is added to the histogram name. Pass an empty postfix in case you want to draw a histogram with the same name.

See Draw() for the list of options.

In contrast to TObject::DrawClone(), DrawCopy

  • Ignores gROOT->SetSelectedPad().
  • Does not register the histogram to any directory.
  • And can cycle through a colour palette when multiple objects are drawn with auto colouring.

Definition at line 3162 of file TH1.cxx.

◆ DrawNormalized()

TH1 * TH1::DrawNormalized ( Option_t * option = "",
Double_t norm = 1 ) const
virtualinherited

Draw a normalized copy of this histogram.

A clone of this histogram is normalized to norm and drawn with option. A pointer to the normalized histogram is returned. The contents of the histogram copy are scaled such that the new sum of weights (excluding under and overflow) is equal to norm. Note that the returned normalized histogram is not added to the list of histograms in the current directory in memory. It is the user's responsibility to delete this histogram. The kCanDelete bit is set for the returned object. If a pad containing this copy is cleared, the histogram will be automatically deleted.

See Draw for the list of options

Definition at line 3193 of file TH1.cxx.

◆ DrawPanel()

void TH1::DrawPanel ( )
virtualinherited

Display a panel with all histogram drawing options.

See class TDrawPanelHist for example

Definition at line 3224 of file TH1.cxx.

◆ Dump()

void TObject::Dump ( ) const
virtualinherited

Dump contents of object on stdout.

Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed

The following output is the Dump of a TArrow object:

fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fUniqueID 0 object unique identifier
fBits 50331648 bit field status word
fFillColor 19 fill area color
fFillStyle 1001 fill area style
#define X(type, name)
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:25
Color_t fFillColor
Fill area color.
Definition TAttFill.h:24
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
Style_t fLineStyle
Line style.
Definition TAttLine.h:25
Color_t fLineColor
Line color.
Definition TAttLine.h:24
TString fOption
Histogram options.
Definition TH1.h:166
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
UInt_t fBits
bit field status word
Definition TObject.h:47
TLine * line
TCanvas * style()
Definition style.C:1

Reimplemented in TClass, TCollection, TGFrame, TGPack, and TSystemFile.

Definition at line 367 of file TObject.cxx.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Eval()

void TH1::Eval ( TF1 * f1,
Option_t * option = "" )
virtualinherited

Evaluate function f1 at the center of bins of this histogram.

  • If option "R" is specified, the function is evaluated only for the bins included in the function range.
  • If option "A" is specified, the value of the function is added to the existing bin contents
  • If option "S" is specified, the value of the function is used to generate a value, distributed according to the Poisson distribution, with f1 as the mean.

Definition at line 3241 of file TH1.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

void TH1::ExecuteEvent ( Int_t event,
Int_t px,
Int_t py )
overridevirtualinherited

Execute action corresponding to one event.

This member function is called when a histogram is clicked with the locator

If Left button clicked on the bin top value, then the content of this bin is modified according to the new position of the mouse when it is released.

Reimplemented from TObject.

Definition at line 3289 of file TH1.cxx.

◆ ExtendAxis()

void TH1::ExtendAxis ( Double_t x,
TAxis * axis )
virtualinherited

Histogram is resized along axis such that x is in the axis range.

The new axis limits are recomputed by doubling iteratively the current axis range until the specified value x is within the limits. The algorithm makes a copy of the histogram, then loops on all bins of the old histogram to fill the extended histogram. Takes into account errors (Sumw2) if any. The algorithm works for 1-d, 2-D and 3-D histograms. The axis must be extendable before invoking this function. Ex:

h->GetXaxis()->SetCanExtend(kTRUE);
#define h(i)
Definition RSha256.hxx:106
constexpr Bool_t kTRUE
Definition RtypesCore.h:107

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 6619 of file TH1.cxx.

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ FFT()

TH1 * TH2Poly::FFT ( TH1 * ,
Option_t *  )
overridevirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 1705 of file TH2Poly.cxx.

◆ Fill() [1/8]

Int_t TH2Poly::Fill ( const char * ,
const char * ,
Double_t  )
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 138 of file TH2Poly.h.

◆ Fill() [2/8]

Int_t TH2Poly::Fill ( const char * ,
Double_t ,
Double_t  )
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 137 of file TH2Poly.h.

◆ Fill() [3/8]

Int_t TH2Poly::Fill ( const char * name,
Double_t w )
overridevirtual

Increment the bin named "name" by w.

Reimplemented from TH2Poly.

Definition at line 97 of file TH2Poly.cxx.

◆ Fill() [4/8]

Int_t TH2Poly::Fill ( Double_t x,
Double_t y )
overridevirtual

Increment the bin containing (x,y) by 1.

Uses the partitioning algorithm.

Reimplemented from TH2Poly.

Definition at line 95 of file TH2Poly.cxx.

◆ Fill() [5/8]

Int_t TProfile2Poly::Fill ( Double_t xcoord,
Double_t ycoord,
Double_t value )
overridevirtual

Fill.

Reimplemented from TH2Poly.

Definition at line 170 of file TProfile2Poly.cxx.

◆ Fill() [6/8]

Int_t TProfile2Poly::Fill ( Double_t xcoord,
Double_t ycoord,
Double_t value,
Double_t weight )
virtual

Fill.

Definition at line 178 of file TProfile2Poly.cxx.

◆ Fill() [7/8]

Int_t TH2Poly::Fill ( Double_t )
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 135 of file TH2Poly.h.

◆ Fill() [8/8]

Int_t TH2Poly::Fill ( Double_t ,
const char * ,
Double_t  )
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 136 of file TH2Poly.h.

◆ FillBuffer()

void TNamed::FillBuffer ( char *& buffer)
virtualinherited

Encode TNamed into output buffer.

Reimplemented in TDirectoryFile, TFile, TKey, TKeySQL, TKeyXML, TSQLFile, and TXMLFile.

Definition at line 103 of file TNamed.cxx.

◆ FillN() [1/2]

void TH2Poly::FillN ( Int_t ntimes,
const Double_t * x,
const Double_t * y,
const Double_t * w,
Int_t stride = 1 )
overridevirtualinherited

Fills a 2-D histogram with an array of values and weights.

Parameters
[in]ntimesnumber of entries in arrays x and w (array size must be ntimes*stride)
[in]xarray of x values to be histogrammed
[in]yarray of y values to be histogrammed
[in]warray of weights
[in]stridestep size through arrays x, y and w

Reimplemented from TH2.

Definition at line 772 of file TH2Poly.cxx.

◆ FillN() [2/2]

void TH2Poly::FillN ( Int_t ,
const Double_t * ,
const Double_t * ,
Int_t  )
inlineoverrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2.

Definition at line 139 of file TH2Poly.h.

◆ FillRandom() [1/3]

void TH1::FillRandom ( const char * fname,
Int_t ntimes = 5000,
TRandom * rng = nullptr )
inherited

Fill histogram following distribution in function fname.

Parameters
fname: Function name used for filling the histogram
ntimes: number of times the histogram is filled
rng: (optional) Random number generator used to sample

The distribution contained in the function fname (TF1) is integrated over the channel contents for the bin range of this histogram. It is normalized to 1.

Getting one random number implies:

  • Generating a random number between 0 and 1 (say r1)
  • Look in which bin in the normalized integral r1 corresponds to
  • Fill histogram channel ntimes random numbers are generated

One can also call TF1::GetRandom to get a random variate from a function.

Definition at line 469 of file TH1.cxx.

◆ FillRandom() [2/3]

void TH2::FillRandom ( TF1 * function,
Int_t ntimes = 5000,
TRandom * rng = nullptr )
overridevirtualinherited

Fill histogram following distribution in function function.

Parameters
functionFunction name used for filling the histogram
ntimes: number of times the histogram is filled
rng: (optional) Random number generator used to sample

The distribution contained in the function fname (TF2) is integrated over the channel contents. It is normalized to 1. Getting one random number implies:

  • Generating a random number between 0 and 1 (say r1)
  • Look in which bin in the normalized integral r1 corresponds to
  • Fill histogram channel ntimes random numbers are generated

One can also call TF2::GetRandom2 to get a random variate from a function.

Reimplemented from TH1.

Definition at line 684 of file TH2.cxx.

◆ FillRandom() [3/3]

void TH2::FillRandom ( TH1 * h,
Int_t ntimes = 5000,
TRandom * rng = nullptr )
overridevirtualinherited

Fill histogram following distribution in histogram h.

Parameters
h: Histogram pointer used for sampling random number
ntimes: number of times the histogram is filled
rng: (optional) Random number generator used for sampling

The distribution contained in the histogram h (TH2) is integrated over the channel contents. It is normalized to 1. Getting one random number implies:

  • Generating a random number between 0 and 1 (say r1)
  • Look in which bin in the normalized integral r1 corresponds to
  • Fill histogram channel ntimes random numbers are generated

Reimplemented from TH1.

Definition at line 760 of file TH2.cxx.

◆ FindBin()

Int_t TH2Poly::FindBin ( Double_t x,
Double_t y,
Double_t z = 0 )
overridevirtualinherited

Returns the bin number of the bin at the given coordinate.

-1 to -9 are the overflow and underflow bins. overflow bin -5 is the unbinned areas in the histogram (also called "the sea"). The third parameter can be left blank. The overflow/underflow bins are:

-1 | -2 | -3
-------------
-4 | -5 | -6
-------------
-7 | -8 | -9

where -5 means is the "sea" bin (i.e. unbinned areas)

Reimplemented from TH1.

Definition at line 607 of file TH2Poly.cxx.

◆ FindFirstBinAbove()

Int_t TH1::FindFirstBinAbove ( Double_t threshold = 0,
Int_t axis = 1,
Int_t firstBin = 1,
Int_t lastBin = -1 ) const
virtualinherited

Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold is found the function returns -1.

The search will occur between the specified first and last bin. Specifying the value of the last bin to search to less than zero will search until the last defined bin.

Definition at line 3789 of file TH1.cxx.

◆ FindFixBin()

Int_t TH1::FindFixBin ( Double_t x,
Double_t y = 0,
Double_t z = 0 ) const
virtualinherited

Return Global bin number corresponding to x,y,z.

2-D and 3-D histograms are represented with a one dimensional structure. This has the advantage that all existing functions, such as GetBinContent, GetBinError, GetBinFunction work for all dimensions. This function DOES NOT try to extend the axis if the given point belongs to an under-/overflow bin.

See also TH1::GetBin, TAxis::FindBin and TAxis::FindFixBin

Definition at line 3760 of file TH1.cxx.

◆ FindLastBinAbove()

Int_t TH1::FindLastBinAbove ( Double_t threshold = 0,
Int_t axis = 1,
Int_t firstBin = 1,
Int_t lastBin = -1 ) const
virtualinherited

Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold is found the function returns -1.

The search will occur between the specified first and last bin. Specifying the value of the last bin to search to less than zero will search until the last defined bin.

Definition at line 3852 of file TH1.cxx.

◆ FindNewAxisLimits()

Bool_t TH1::FindNewAxisLimits ( const TAxis * axis,
const Double_t point,
Double_t & newMin,
Double_t & newMax )
protectedvirtualinherited

finds new limits for the axis so that point is within the range and the limits are compatible with the previous ones (see TH1::Merge).

new limits are put into newMin and newMax variables. axis - axis whose limits are to be recomputed point - point that should fit within the new axis limits newMin - new minimum will be stored here newMax - new maximum will be stored here. false if failed (e.g. if the initial axis limits are wrong or the new range is more than \( 2^{64} \) times the old one).

Definition at line 6575 of file TH1.cxx.

◆ FindObject() [1/2]

TObject * TH1::FindObject ( const char * name) const
overridevirtualinherited

Search object named name in the list of functions.

Reimplemented from TObject.

Definition at line 3912 of file TH1.cxx.

◆ FindObject() [2/2]

TObject * TH1::FindObject ( const TObject * obj) const
overridevirtualinherited

Search object obj in the list of functions.

Reimplemented from TObject.

Definition at line 3921 of file TH1.cxx.

◆ Fit() [1/2]

TFitResultPtr TH1::Fit ( const char * fname,
Option_t * option = "",
Option_t * goption = "",
Double_t xxmin = 0,
Double_t xxmax = 0 )
virtualinherited

Fit histogram with function fname.

fname is the name of a function available in the global ROOT list of functions gROOT->GetListOfFunctions. Note that this is not thread safe. The list include any TF1 object created by the user plus some pre-defined functions which are automatically created by ROOT the first time a pre-defined function is requested from gROOT (i.e. when calling gROOT->GetFunction(const char *name)). These pre-defined functions are:

  • gaus, gausn where gausn is the normalized Gaussian
  • landau, landaun
  • expo
  • pol1,...9, chebyshev1,...9.

For printing the list of all available functions do:

  TF1::InitStandardFunctions();   // not needed if `gROOT->GetFunction` is called before
  TF2::InitStandardFunctions(); TF3::InitStandardFunctions(); // For 2D or 3D
  gROOT->GetListOfFunctions()->ls()

fname can also be a formula that is accepted by the linear fitter containing the special operator ++, representing linear components separated by ++ sign, for example x++sin(x) for fitting [0]*x+[1]*sin(x)

This function finds a pointer to the TF1 object with name fname and calls TH1::Fit(TF1 *, Option_t *, Option_t *, Double_t, Double_t). See there for the fitting options and the details about fitting histograms

Definition at line 3954 of file TH1.cxx.

◆ Fit() [2/2]

TFitResultPtr TH1::Fit ( TF1 * f1,
Option_t * option = "",
Option_t * goption = "",
Double_t xxmin = 0,
Double_t xxmax = 0 )
virtualinherited

Fit histogram with the function pointer f1.

Parameters
[in]f1pointer to the function object
[in]optionstring defining the fit options (see table below).
[in]goptionspecify a list of graphics options. See TH1::Draw for a complete list of these options.
[in]xxminlower fitting range
[in]xxmaxupper fitting range
Returns
A smart pointer to the TFitResult class

Histogram Fitting Options

Here is the full list of fit options that can be given in the parameter option. Several options can be used together by concatanating the strings without the need of any delimiters.

option description
"L" Uses a log likelihood method (default is chi-square method). To be used when the histogram represents counts.
"WL" Weighted log likelihood method. To be used when the histogram has been filled with weights different than 1. This is needed for getting correct parameter uncertainties for weighted fits.
"P" Uses Pearson chi-square method. Uses expected errors instead of the observed one (default case). The expected error is instead estimated from the square-root of the bin function value.
"MULTI" Uses Loglikelihood method based on multi-nomial distribution. In this case the function must be normalized and one fits only the function shape.
"W" Fit using the chi-square method and ignoring the bin uncertainties and skip empty bins.
"WW" Fit using the chi-square method and ignoring the bin uncertainties and include the empty bins.
"I" Uses the integral of function in the bin instead of the default bin center value.
"F" Uses the default minimizer (e.g. Minuit) when fitting a linear function (e.g. polN) instead of the linear fitter.
"U" Uses a user specified objective function (e.g. user providedlikelihood function) defined using TVirtualFitter::SetFCN
"E" Performs a better parameter errors estimation using the Minos technique for all fit parameters.
"M" Uses the IMPROVE algorithm (available only in TMinuit). This algorithm attempts improve the found local minimum by searching for a better one.
"S" The full result of the fit is returned in the TFitResultPtr. This is needed to get the covariance matrix of the fit. See TFitResult and the base class ROOT::Math::FitResult.
"Q" Quiet mode (minimum printing)
"V" Verbose mode (default is between Q and V)
"+" Adds this new fitted function to the list of fitted functions. By default, the previous function is deleted and only the last one is kept.
"N" Does not store the graphics function, does not draw the histogram with the function after fitting.
"0" Does not draw the histogram and the fitted function after fitting, but in contrast to option "N", it stores the fitted function in the histogram list of functions.
"R" Fit using a fitting range specified in the function range with TF1::SetRange.
"B" Use this option when you want to fix or set limits on one or more parameters and the fitting function is a predefined one (e.g gaus, expo,..), otherwise in case of pre-defined functions, some default initial values and limits will be used.
"C" In case of linear fitting, do no calculate the chisquare (saves CPU time).
"G" Uses the gradient implemented in TF1::GradientPar for the minimization. This allows to use Automatic Differentiation when it is supported by the provided TF1 function.
"WIDTH" Scales the histogran bin content by the bin width (useful for variable bins histograms)
"SERIAL" Runs in serial mode. By default if ROOT is built with MT support and MT is enables, the fit is perfomed in multi-thread - "E" Perform better Errors estimation using Minos technique
"MULTITHREAD" Forces usage of multi-thread execution whenever possible

The default fitting of an histogram (when no option is given) is perfomed as following:

  • a chi-square fit (see below Chi-square Fits) computed using the bin histogram errors and excluding bins with zero errors (empty bins);
  • the full range of the histogram is used, unless TAxis::SetRange or TAxis::SetRangeUser was called before;
  • the default Minimizer with its default configuration is used (see below Minimizer Configuration) except for linear function;
  • for linear functions (polN, chenbyshev or formula expressions combined using operator ++) a linear minimization is used.
  • only the status of the fit is returned;
  • the fit is performed in Multithread whenever is enabled in ROOT;
  • only the last fitted function is saved in the histogram;
  • the histogram is drawn after fitting overalyed with the resulting fitting function

Minimizer Configuration

The Fit is perfomed using the default Minimizer, defined in the ROOT::Math::MinimizerOptions class. It is possible to change the default minimizer and its configuration parameters by calling these static functions before fitting (before calling TH1::Fit):

  • ROOT::Math::MinimizerOptions::SetDefaultMinimizer(minimizerName, minimizerAgorithm) for changing the minmizer and/or the corresponding algorithm. For example ROOT::Math::MinimizerOptions::SetDefaultMinimizer("GSLMultiMin","BFGS"); will set the usage of the BFGS algorithm of the GSL multi-dimensional minimization The current defaults are ("Minuit","Migrad"). See the documentation of the ROOT::Math::MinimizerOptions for the available minimizers in ROOT and their corresponding algorithms.
  • ROOT::Math::MinimizerOptions::SetDefaultTolerance for setting a different tolerance value for the minimization.
  • ROOT::Math::MinimizerOptions::SetDefaultMaxFunctionCalls for setting the maximum number of function calls.
  • ROOT::Math::MinimizerOptions::SetDefaultPrintLevel for changing the minimizer print level from level=0 (minimal printing) to level=3 maximum printing

Other options are possible depending on the Minimizer used, see the corresponding documentation. The default minimizer can be also set in the resource file in etc/system.rootrc. For example

Root.Fitter: Minuit2

Chi-square Fits

By default a chi-square (least-square) fit is performed on the histogram. The so-called modified least-square method is used where the residual for each bin is computed using as error the observed value (the bin error) returned by TH1::GetBinError

\[ Chi2 = \sum_{i}{ \left(\frac{y(i) - f(x(i) | p )}{e(i)} \right)^2 } \]

where y(i) is the bin content for each bin i, x(i) is the bin center and e(i) is the bin error (sqrt(y(i) for an un-weighted histogram). Bins with zero errors are excluded from the fit. See also later the note on the treatment of empty bins. When using option "I" the residual is computed not using the function value at the bin center, f(x(i)|p), but the integral of the function in the bin, Integral{ f(x|p)dx }, divided by the bin volume. When using option P (Pearson chi2), the expected error computed as e(i) = sqrt(f(x(i)|p)) is used. In this case empty bins are considered in the fit. Both chi-square methods should not be used when the bin content represent counts, especially in case of low bin statistics, because they could return a biased result.

Likelihood Fits

When using option "L" a likelihood fit is used instead of the default chi-square fit. The likelihood is built assuming a Poisson probability density function for each bin. The negative log-likelihood to be minimized is

\[ NLL = - \sum_{i}{ \log {\mathrm P} ( y(i) | f(x(i) | p ) ) } \]

where P(y|f) is the Poisson distribution of observing a count y(i) in the bin when the expected count is f(x(i)|p). The exact likelihood used is the Poisson likelihood described in this paper: S. Baker and R. D. Cousins, “Clarification of the use of chi-square and likelihood functions in fits to histograms,” Nucl. Instrum. Meth. 221 (1984) 437.

\[ NLL = \sum_{i}{( f(x(i) | p ) + y(i)\log(y(i)/ f(x(i) | p )) - y(i)) } \]

By using this formulation, 2*NLL can be interpreted as the chi-square resulting from the fit.

This method should be always used when the bin content represents counts (i.e. errors are sqrt(N) ). The likelihood method has the advantage of treating correctly bins with low statistics. In case of high statistics/bin the distribution of the bin content becomes a normal distribution and the likelihood and the chi2 fit give the same result.

The likelihood method, although a bit slower, it is therefore the recommended method, when the histogram represent counts (Poisson statistics), where the chi-square methods may give incorrect results, especially in case of low statistics. In case of a weighted histogram, it is possible to perform also a likelihood fit by using the option "WL". Note a weighted histogram is a histogram which has been filled with weights and it has the information on the sum of the weight square for each bin ( TH1::Sumw2() has been called). The bin error for a weighted histogram is the square root of the sum of the weight square.

Fit Result

The function returns a TFitResultPtr which can hold a pointer to a TFitResult object. By default the TFitResultPtr contains only the status of the fit which is return by an automatic conversion of the TFitResultPtr to an integer. One can write in this case directly:

Int_t fitStatus = h->Fit(myFunc);
Double_t myFunc(Double_t x)
Definition ROOTR.C:4
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59

If the option "S" is instead used, TFitResultPtr behaves as a smart pointer to the TFitResult object. This is useful for retrieving the full result information from the fit, such as the covariance matrix, as shown in this example code:

TFitResultPtr r = h->Fit(myFunc,"S");
TMatrixDSym cov = r->GetCovarianceMatrix(); // to access the covariance matrix
Double_t chi2 = r->Chi2(); // to retrieve the fit chi2
Double_t par0 = r->Parameter(0); // retrieve the value for the parameter 0
Double_t err0 = r->ParError(0); // retrieve the error for the parameter 0
r->Print("V"); // print full information of fit including covariance matrix
r->Write(); // store the result in a file
ROOT::R::TRInterface & r
Definition Object.C:4
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
TMatrixTSym< Double_t > TMatrixDSym
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...

The fit parameters, error and chi-square (but not covariance matrix) can be retrieved also directly from the fitted function that is passed to this call. Given a pointer to an associated fitted function myfunc, one can retrieve the function/fit parameters with calls such as:

Double_t chi2 = myfunc->GetChisquare();
Double_t par0 = myfunc->GetParameter(0); //value of 1st parameter
Double_t err0 = myfunc->GetParError(0); //error on first parameter
Associated functions

One or more objects (typically a TF1*) can be added to the list of functions (fFunctions) associated to each histogram. When TH1::Fit is invoked, the fitted function is added to the histogram list of functions (fFunctions). If the histogram is made persistent, the list of associated functions is also persistent. Given a histogram h, one can retrieve an associated function with:

TF1 *myfunc = h->GetFunction("myfunc");
Definition TF1.h:182

or by quering directly the list obtained by calling TH1::GetListOfFunctions.

Fit status

The status of the fit is obtained converting the TFitResultPtr to an integer independently if the fit option "S" is used or not:

TFitResultPtr r = h->Fit(myFunc,opt);
Int_t fitStatus = r;
  • status = 0 : the fit has been performed successfully (i.e no error occurred).
  • status < 0 : there is an error not connected with the minimization procedure, for example when a wrong function is used.
  • status > 0 : return status from Minimizer, depends on used Minimizer. For example for TMinuit and Minuit2 we have:
    • status = migradStatus + 10*minosStatus + 100*hesseStatus + 1000*improveStatus. TMinuit returns 0 (for migrad, minos, hesse or improve) in case of success and 4 in case of error (see the documentation of TMinuit::mnexcm). For example, for an error only in Minos but not in Migrad a fitStatus of 40 will be returned. Minuit2 returns 0 in case of success and different values in migrad,minos or hesse depending on the error. See in this case the documentation of Minuit2Minimizer::Minimize for the migrad return status, Minuit2Minimizer::GetMinosError for the minos return status and Minuit2Minimizer::Hesse for the hesse return status. If other minimizers are used see their specific documentation for the status code returned. For example in the case of Fumili, see TFumili::Minimize.

Fitting in a range

In order to fit in a sub-range of the histogram you have two options:

  • pass to this function the lower (xxmin) and upper (xxmax) values for the fitting range;
  • define a specific range in the fitted function and use the fitting option "R". For example, if your histogram has a defined range between -4 and 4 and you want to fit a gaussian only in the interval 1 to 3, you can do:
TF1 *f1 = new TF1("f1", "gaus", 1, 3);
histo->Fit("f1", "R");
TF1 * f1
Definition legend1.C:11

The fitting range is also limited by the histogram range defined using TAxis::SetRange or TAxis::SetRangeUser. Therefore the fitting range is the smallest range between the histogram one and the one defined by one of the two previous options described above.

Setting initial conditions

Parameters must be initialized before invoking the Fit function. The setting of the parameter initial values is automatic for the predefined functions such as poln, expo, gaus, landau. One can however disable this automatic computation by using the option "B". Note that if a predefined function is defined with an argument, eg, gaus(0), expo(1), you must specify the initial values for the parameters. You can specify boundary limits for some or all parameters via

f1->SetParLimits(p_number, parmin, parmax);

if parmin >= parmax, the parameter is fixed Note that you are not forced to fix the limits for all parameters. For example, if you fit a function with 6 parameters, you can do:

func->SetParameters(0, 3.1, 1.e-6, -8, 0, 100);
func->SetParLimits(3, -10, -4);
func->FixParameter(4, 0);
func->SetParLimits(5, 1, 1);

With this setup, parameters 0->2 can vary freely Parameter 3 has boundaries [-10,-4] with initial value -8 Parameter 4 is fixed to 0 Parameter 5 is fixed to 100. When the lower limit and upper limit are equal, the parameter is fixed. However to fix a parameter to 0, one must call the FixParameter function.

Fit Statistics Box

The statistics box can display the result of the fit. You can change the statistics box to display the fit parameters with the TStyle::SetOptFit(mode) method. This mode has four digits. mode = pcev (default = 0111)

v = 1;  print name/values of parameters
e = 1;  print errors (if e=1, v must be 1)
c = 1;  print Chisquare/Number of degrees of freedom
p = 1;  print Probability

For example: gStyle->SetOptFit(1011); prints the fit probability, parameter names/values, and errors. You can change the position of the statistics box with these lines (where g is a pointer to the TGraph):

TPaveStats *st = (TPaveStats*)g->GetListOfFunctions()->FindObject("stats");
st->SetX1NDC(newx1); //new x start position
st->SetX2NDC(newx2); //new x end position

Additional Notes on Fitting

Fitting a histogram of dimension N with a function of dimension N-1

It is possible to fit a TH2 with a TF1 or a TH3 with a TF2. In this case the chi-square is computed from the squared error distance between the function values and the bin centers weighted by the bin content. For correct error scaling, the obtained parameter error are corrected as in the case when the option "W" is used.

User defined objective functions

By default when fitting a chi square function is used for fitting. When option "L" is used a Poisson likelihood function is used. Using option "MULTI" a multinomial likelihood fit is used. Thes functions are defined in the header Fit/Chi2Func.h or Fit/PoissonLikelihoodFCN and they are implemented using the routines FitUtil::EvaluateChi2 or FitUtil::EvaluatePoissonLogL in the file math/mathcore/src/FitUtil.cxx. It is possible to specify a user defined fitting function, using option "U" and calling the following functions:

TVirtualFitter::Fitter(myhist)->SetFCN(MyFittingFunction);
virtual void SetFCN(void(*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
To set the address of the minimization objective function called by the native compiler (see function...
static TVirtualFitter * Fitter(TObject *obj, Int_t maxpar=25)
Static function returning a pointer to the current fitter.

where MyFittingFunction is of type:

extern void MyFittingFunction(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
#define f(i)
Definition RSha256.hxx:104

Note on treatment of empty bins

Empty bins, which have the content equal to zero AND error equal to zero, are excluded by default from the chi-square fit, but they are considered in the likelihood fit. since they affect the likelihood if the function value in these bins is not negligible. Note that if the histogram is having bins with zero content and non zero-errors they are considered as any other bins in the fit. Instead bins with zero error and non-zero content are by default excluded in the chi-squared fit. In general, one should not fit a histogram with non-empty bins and zero errors.

If the bin errors are not known, one should use the fit option "W", which gives a weight=1 for each bin (it is an unweighted least-square fit). When using option "WW" the empty bins will be also considered in the chi-square fit with an error of 1. Note that in this fitting case (option "W" or "WW") the resulting fitted parameter errors are corrected by the obtained chi2 value using this scaling expression: errorp *= sqrt(chisquare/(ndf-1)) as it is done when fitting a TGraph with no point errors.

Excluding points

You can use TF1::RejectPoint inside your fitting function to exclude some points within a certain range from the fit. See the tutorial fit/fitExclude.C.

Warning when using the option "0"

When selecting the option "0", the fitted function is added to the list of functions of the histogram, but it is not drawn when the histogram is drawn. You can undo this behaviour resetting its corresponding bit in the TF1 object as following:

h.Fit("myFunction", "0"); // fit, store function but do not draw
h.Draw(); // function is not drawn
h.GetFunction("myFunction")->ResetBit(TF1::kNotDraw);
h.Draw(); // function is visible again
@ kNotDraw
Definition TF1.h:297

Definition at line 4318 of file TH1.cxx.

◆ FitOptionsMake()

Int_t TH1::FitOptionsMake ( Option_t * option,
Foption_t & Foption )
staticinherited

Decode string choptin and fill fitOption structure.

Definition at line 4732 of file TH1.cxx.

◆ FitPanel()

void TH1::FitPanel ( )
virtualinherited

Display a panel with all histogram fit options.

See class TFitPanel for example

Definition at line 4340 of file TH1.cxx.

◆ FitSlicesX()

void TH2::FitSlicesX ( TF1 * f1 = nullptr,
Int_t firstybin = 0,
Int_t lastybin = -1,
Int_t cut = 0,
Option_t * option = "QNR",
TObjArray * arr = nullptr )
virtualinherited

Project slices along X in case of a 2-D histogram, then fit each slice with function f1 and make a histogram for each fit parameter Only bins along Y between firstybin and lastybin are considered.

By default (firstybin == 0, lastybin == -1), all bins in y including over- and underflows are taken into account. If f1=0, a gaussian is assumed Before invoking this function, one can set a subrange to be fitted along X via f1->SetRange(xmin,xmax) The argument option (default="QNR") can be used to change the fit options.

  • "Q" means Quiet mode
  • "N" means do not show the result of the fit
  • "R" means fit the function in the specified function range
  • "G2" merge 2 consecutive bins along X
  • "G3" merge 3 consecutive bins along X
  • "G4" merge 4 consecutive bins along X
  • "G5" merge 5 consecutive bins along X
  • "S" sliding merge: merge n consecutive bins along X accordingly to what Gn is given. It makes sense when used together with a Gn option

The generated histograms are returned by adding them to arr, if arr is not NULL. arr's SetOwner() is called, to signal that it is the user's responsibility to delete the histograms, possibly by deleting the array.

TObjArray aSlices;
h2->FitSlicesX(func, 0, -1, 0, "QNR", &aSlices);
An array of TObjects.
Definition TObjArray.h:31

will already delete the histograms once aSlice goes out of scope. aSlices will contain the histogram for the i-th parameter of the fit function at aSlices[i]; aSlices[n] (n being the number of parameters) contains the chi2 distribution of the fits.

If arr is NULL, the generated histograms are added to the list of objects in the current directory. It is the user's responsibility to delete these histograms.

Example: Assume a 2-d histogram h2

Root > h2->FitSlicesX(); produces 4 TH1D histograms
with h2_0 containing parameter 0(Constant) for a Gaus fit
of each bin in Y projected along X
with h2_1 containing parameter 1(Mean) for a gaus fit
with h2_2 containing parameter 2(StdDev) for a gaus fit
with h2_chi2 containing the chisquare/number of degrees of freedom for a gaus fit
Root > h2->FitSlicesX(0,15,22,10);
same as above, but only for bins 15 to 22 along Y
and only for bins in Y for which the corresponding projection
along X has more than cut bins filled.
#define a(i)
Definition RSha256.hxx:99

NOTE: To access the generated histograms in the current directory, do eg:

TH1D *h2_1 = (TH1D*)gDirectory->Get("h2_1");
#define gDirectory
Definition TDirectory.h:385

Definition at line 985 of file TH2.cxx.

◆ FitSlicesY()

void TH2::FitSlicesY ( TF1 * f1 = nullptr,
Int_t firstxbin = 0,
Int_t lastxbin = -1,
Int_t cut = 0,
Option_t * option = "QNR",
TObjArray * arr = nullptr )
virtualinherited

Project slices along Y in case of a 2-D histogram, then fit each slice with function f1 and make a histogram for each fit parameter Only bins along X between firstxbin and lastxbin are considered.

By default (firstxbin == 0, lastxbin == -1), all bins in x including over- and underflows are taken into account. If f1=0, a gaussian is assumed Before invoking this function, one can set a subrange to be fitted along Y via f1->SetRange(ymin,ymax) The argument option (default="QNR") can be used to change the fit options.

  • "Q" means Quiet mode
  • "N" means do not show the result of the fit
  • "R" means fit the function in the specified function range
  • "G2" merge 2 consecutive bins along Y
  • "G3" merge 3 consecutive bins along Y
  • "G4" merge 4 consecutive bins along Y
  • "G5" merge 5 consecutive bins along Y
  • "S" sliding merge: merge n consecutive bins along Y accordingly to what Gn is given. It makes sense when used together with a Gn option

The generated histograms are returned by adding them to arr, if arr is not NULL. arr's SetOwner() is called, to signal that it is the user's responsibility to delete the histograms, possibly by deleting the array.

TObjArray aSlices;
h2->FitSlicesY(func, 0, -1, 0, "QNR", &aSlices);

will already delete the histograms once aSlice goes out of scope. aSlices will contain the histogram for the i-th parameter of the fit function at aSlices[i]; aSlices[n] (n being the number of parameters) contains the chi2 distribution of the fits.

If arr is NULL, the generated histograms are added to the list of objects in the current directory. It is the user's responsibility to delete these histograms.

Example: Assume a 2-d histogram h2

Root > h2->FitSlicesY(); produces 4 TH1D histograms
with h2_0 containing parameter 0(Constant) for a Gaus fit
of each bin in X projected along Y
with h2_1 containing parameter 1(Mean) for a gaus fit
with h2_2 containing parameter 2(StdDev) for a gaus fit
with h2_chi2 containing the chisquare/number of degrees of freedom for a gaus fit
Root > h2->FitSlicesY(0,15,22,10);
same as above, but only for bins 15 to 22 along X
and only for bins in X for which the corresponding projection
along Y has more than cut bins filled.

NOTE: To access the generated histograms in the current directory, do eg:

TH1D *h2_1 = (TH1D*)gDirectory->Get("h2_1");

A complete example of this function is given in tutorial:fitslicesy.C.

Definition at line 1050 of file TH2.cxx.

◆ GetAsymmetry()

TH1 * TH2Poly::GetAsymmetry ( TH1 * ,
Double_t ,
Double_t  )
virtualinherited

NOT IMPLEMENTED for TH2Poly.

Definition at line 1712 of file TH2Poly.cxx.

◆ GetAxisColor()

Color_t TH1::GetAxisColor ( Option_t * axis = "X") const
virtualinherited

Return the number of divisions for "axis".

Definition at line 40 of file Haxis.cxx.

◆ GetAxisLabelStatus()

UInt_t TH1::GetAxisLabelStatus ( ) const
protectedinherited

Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e.

can be extended and is alphanumeric

Definition at line 6790 of file TH1.cxx.

◆ GetBarOffset()

virtual Float_t TH1::GetBarOffset ( ) const
inlinevirtualinherited

Definition at line 500 of file TH1.h.

◆ GetBarWidth()

virtual Float_t TH1::GetBarWidth ( ) const
inlinevirtualinherited

Definition at line 501 of file TH1.h.

◆ GetBin()

Int_t TH2::GetBin ( Int_t binx,
Int_t biny,
Int_t binz = 0 ) const
overridevirtualinherited

Return Global bin number corresponding to binx,y,z.

2-D and 3-D histograms are represented with a one dimensional structure. This has the advantage that all existing functions, such as GetBinContent, GetBinError, GetBinFunction work for all dimensions.

In case of a TH1x, returns binx directly. see TH1::GetBinXYZ for the inverse transformation.

Convention for numbering bins

For all histogram types: nbins, xlow, xup

  • bin = 0; underflow bin
  • bin = 1; first bin with low-edge xlow INCLUDED
  • bin = nbins; last bin with upper-edge xup EXCLUDED
  • bin = nbins+1; overflow bin

In case of 2-D or 3-D histograms, a "global bin" number is defined. For example, assuming a 3-D histogram with binx,biny,binz, the function

Int_t bin = h->GetBin(binx,biny,binz);

returns a global/linearized bin number. This global bin is useful to access the bin information independently of the dimension.

Reimplemented from TH1.

Definition at line 1055 of file TH2.cxx.

◆ GetBinCenter()

Double_t TH1::GetBinCenter ( Int_t bin) const
virtualinherited

Return bin center for 1D histogram.

Better to use h1.GetXaxis()->GetBinCenter(bin)

Definition at line 9275 of file TH1.cxx.

◆ GetBinContent() [1/3]

Double_t TProfile2Poly::GetBinContent ( Int_t bin) const
overridevirtual

Get bin content.

Reimplemented from TH2Poly.

Definition at line 339 of file TProfile2Poly.cxx.

◆ GetBinContent() [2/3]

Double_t TH2Poly::GetBinContent ( Int_t ,
Int_t  ) const
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 145 of file TH2Poly.h.

◆ GetBinContent() [3/3]

Double_t TH2Poly::GetBinContent ( Int_t ,
Int_t ,
Int_t  ) const
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 146 of file TH2Poly.h.

◆ GetBinContentChanged()

Bool_t TH2Poly::GetBinContentChanged ( ) const
inlineinherited

Definition at line 102 of file TH2Poly.h.

◆ GetBinEffectiveEntries()

Double_t TProfile2Poly::GetBinEffectiveEntries ( Int_t bin) const

Get bin effective entries.

Definition at line 350 of file TProfile2Poly.cxx.

◆ GetBinEntries()

Double_t TProfile2Poly::GetBinEntries ( Int_t bin) const

Get bin entries.

Definition at line 360 of file TProfile2Poly.cxx.

◆ GetBinEntriesVW()

Double_t TProfile2Poly::GetBinEntriesVW ( Int_t bin) const

Get bin entries VW.

Definition at line 380 of file TProfile2Poly.cxx.

◆ GetBinEntriesW2()

Double_t TProfile2Poly::GetBinEntriesW2 ( Int_t bin) const

Get bin entries W2.

Definition at line 370 of file TProfile2Poly.cxx.

◆ GetBinEntriesWV2()

Double_t TProfile2Poly::GetBinEntriesWV2 ( Int_t bin) const

Get bin entries WV2.

Definition at line 390 of file TProfile2Poly.cxx.

◆ GetBinError() [1/3]

Double_t TProfile2Poly::GetBinError ( Int_t bin) const
overridevirtual

Get bin error.

Reimplemented from TH2Poly.

Definition at line 400 of file TProfile2Poly.cxx.

◆ GetBinError() [2/3]

Double_t TH2Poly::GetBinError ( Int_t ,
Int_t  ) const
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 148 of file TH2Poly.h.

◆ GetBinError() [3/3]

Double_t TH2Poly::GetBinError ( Int_t ,
Int_t ,
Int_t  ) const
inlineoverridevirtual

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2Poly.

Definition at line 149 of file TH2Poly.h.

◆ GetBinErrorLow() [1/2]

Double_t TH1::GetBinErrorLow ( Int_t bin) const
virtualinherited

Return lower error associated to bin number bin.

The error will depend on the statistic option used will return the binContent - lower interval value

Reimplemented from TH1.

Definition at line 515 of file TH1.cxx.

◆ GetBinErrorLow() [2/2]

virtual Double_t TH2::GetBinErrorLow ( Int_t binx,
Int_t biny )
inlinevirtualinherited

Definition at line 101 of file TH2.h.

◆ GetBinErrorOption()

virtual EBinErrorOpt TH1::GetBinErrorOption ( ) const
inlinevirtualinherited

Definition at line 517 of file TH1.h.

◆ GetBinErrorSqUnchecked()

virtual Double_t TH1::GetBinErrorSqUnchecked ( Int_t bin) const
inlineprotectedvirtualinherited

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 705 of file TH1.h.

◆ GetBinErrorUp() [1/2]

Double_t TH1::GetBinErrorUp ( Int_t bin) const
virtualinherited

Return upper error associated to bin number bin.

The error will depend on the statistic option used will return the binContent - upper interval value

Reimplemented from TH1.

Definition at line 516 of file TH1.cxx.

◆ GetBinErrorUp() [2/2]

virtual Double_t TH2::GetBinErrorUp ( Int_t binx,
Int_t biny )
inlinevirtualinherited

Definition at line 102 of file TH2.h.

◆ GetBinLowEdge()

Double_t TH1::GetBinLowEdge ( Int_t bin) const
virtualinherited

Return bin lower edge for 1D histogram.

Better to use h1.GetXaxis()->GetBinLowEdge(bin)

Definition at line 9286 of file TH1.cxx.

◆ GetBinName()

const char * TH2Poly::GetBinName ( Int_t bin) const
inherited

Returns the bin name.

Definition at line 894 of file TH2Poly.cxx.

◆ GetBins()

TList * TH2Poly::GetBins ( )
inlineinherited

Returns the TList of all bins in the histogram.

Definition at line 100 of file TH2Poly.h.

◆ GetBinTitle()

const char * TH2Poly::GetBinTitle ( Int_t bin) const
inherited

Returns the bin title.

Definition at line 904 of file TH2Poly.cxx.

◆ GetBinWidth()

Double_t TH1::GetBinWidth ( Int_t bin) const
virtualinherited

Return bin width for 1D histogram.

Better to use h1.GetXaxis()->GetBinWidth(bin)

Definition at line 9297 of file TH1.cxx.

◆ GetBinWithContent()

Double_t TH1::GetBinWithContent ( Double_t c,
Int_t & binx,
Int_t firstx = 0,
Int_t lastx = 0,
Double_t maxdiff = 0 ) const
virtualinherited

Compute first binx in the range [firstx,lastx] for which diff = abs(bin_content-c) <= maxdiff.

In case several bins in the specified range with diff=0 are found the first bin found is returned in binx. In case several bins in the specified range satisfy diff <=maxdiff the bin with the smallest difference is returned in binx. In all cases the function returns the smallest difference.

NOTE1: if firstx <= 0, firstx is set to bin 1 if (lastx < firstx then firstx is set to the number of bins ie if firstx=0 and lastx=0 (default) the search is on all bins.

NOTE2: if maxdiff=0 (default), the first bin with content=c is returned.

Definition at line 5168 of file TH1.cxx.

◆ GetBinWithContent2()

Double_t TH2::GetBinWithContent2 ( Double_t c,
Int_t & binx,
Int_t & biny,
Int_t firstxbin = 1,
Int_t lastxbin = -1,
Int_t firstybin = 1,
Int_t lastybin = -1,
Double_t maxdiff = 0 ) const
virtualinherited

compute first cell (binx,biny) in the range [firstxbin,lastxbin][firstybin,lastybin] for which diff = abs(cell_content-c) <= maxdiff In case several cells in the specified range with diff=0 are found the first cell found is returned in binx,biny.

In case several cells in the specified range satisfy diff <=maxdiff the cell with the smallest difference is returned in binx,biny. In all cases the function returns the smallest difference.

NOTE1: if firstxbin < 0, firstxbin is set to 1 if (lastxbin < firstxbin then lastxbin is set to the number of bins in X ie if firstxbin=1 and lastxbin=0 (default) the search is on all bins in X except for X's under- and overflow bins. if firstybin < 0, firstybin is set to 1 if (lastybin < firstybin then lastybin is set to the number of bins in Y ie if firstybin=1 and lastybin=0 (default) the search is on all bins in Y except for Y's under- and overflow bins.

NOTE2: if maxdiff=0 (default), the first cell with content=c is returned.

Definition at line 1086 of file TH2.cxx.

◆ GetBinXYZ()

void TH1::GetBinXYZ ( Int_t binglobal,
Int_t & binx,
Int_t & biny,
Int_t & binz ) const
virtualinherited

Return binx, biny, binz corresponding to the global bin number globalbin see TH1::GetBin function above.

Definition at line 5054 of file TH1.cxx.

◆ GetBuffer()

const Double_t * TH1::GetBuffer ( ) const
inlineinherited

Definition at line 483 of file TH1.h.

◆ GetBufferLength()

Int_t TH1::GetBufferLength ( ) const
inlineinherited

Definition at line 481 of file TH1.h.

◆ GetBufferSize()

Int_t TH1::GetBufferSize ( ) const
inlineinherited

Definition at line 482 of file TH1.h.

◆ GetCellContent()

virtual Double_t TH1::GetCellContent ( Int_t binx,
Int_t biny ) const
inlinevirtualinherited

Definition at line 682 of file TH1.h.

◆ GetCellError()

virtual Double_t TH1::GetCellError ( Int_t binx,
Int_t biny ) const
inlinevirtualinherited

Definition at line 684 of file TH1.h.

◆ GetCenter()

void TH1::GetCenter ( Double_t * center) const
virtualinherited

Fill array with center of bins for 1D histogram Better to use h1.GetXaxis()->GetCenter(center).

Definition at line 9308 of file TH1.cxx.

◆ GetContour()

Int_t TH1::GetContour ( Double_t * levels = nullptr)
virtualinherited

Return contour values into array levels if pointer levels is non zero.

The function returns the number of contour levels. see GetContourLevel to return one contour only

Definition at line 8544 of file TH1.cxx.

◆ GetContourLevel()

Double_t TH1::GetContourLevel ( Int_t level) const
virtualinherited

Return value of contour number level.

Use GetContour to return the array of all contour levels

Definition at line 8563 of file TH1.cxx.

◆ GetContourLevelPad()

Double_t TH1::GetContourLevelPad ( Int_t level) const
virtualinherited

Return the value of contour number "level" in Pad coordinates.

ie: if the Pad is in log scale along Z it returns le log of the contour level value. See GetContour to return the array of all contour levels

Definition at line 8573 of file TH1.cxx.

◆ GetCorrelationFactor()

Double_t TH2::GetCorrelationFactor ( Int_t axis1 = 1,
Int_t axis2 = 2 ) const
virtualinherited

Return correlation factor between axis1 and axis2.

Definition at line 1114 of file TH2.cxx.

◆ GetCovariance()

Double_t TH2::GetCovariance ( Int_t axis1 = 1,
Int_t axis2 = 2 ) const
virtualinherited

Return covariance between axis1 and axis2.

Definition at line 1132 of file TH2.cxx.

◆ GetCumulative()

TH1 * TH1::GetCumulative ( Bool_t forward = kTRUE,
const char * suffix = "_cumulative" ) const
inherited

Return a pointer to a histogram containing the cumulative content.

The cumulative can be computed both in the forward (default) or backward direction; the name of the new histogram is constructed from the name of this histogram with the suffix "suffix" appended provided by the user. If not provided a default suffix="_cumulative" is used.

The cumulative distribution is formed by filling each bin of the resulting histogram with the sum of that bin and all previous (forward == kTRUE) or following (forward = kFALSE) bins.

Note: while cumulative distributions make sense in one dimension, you may not be getting what you expect in more than 1D because the concept of a cumulative distribution is much trickier to define; make sure you understand the order of summation before you use this method with histograms of dimension >= 2.

Note 2: By default the cumulative is computed from bin 1 to Nbins If an axis range is set, values between the minimum and maximum of the range are set. Setting an axis range can also be used for including underflow and overflow in the cumulative (e.g. by setting h->GetXaxis()->SetRange(0, h->GetNbinsX()+1); )

Definition at line 2650 of file TH1.cxx.

◆ GetDefaultBufferSize()

Int_t TH1::GetDefaultBufferSize ( )
staticinherited

Static function return the default buffer size for automatic histograms the parameter fgBufferSize may be changed via SetDefaultBufferSize.

Definition at line 4461 of file TH1.cxx.

◆ GetDefaultSumw2()

Bool_t TH1::GetDefaultSumw2 ( )
staticinherited

Return kTRUE if TH1::Sumw2 must be called when creating new histograms.

see TH1::SetDefaultSumw2.

Definition at line 4470 of file TH1.cxx.

◆ GetDimension()

virtual Int_t TH1::GetDimension ( ) const
inlinevirtualinherited

Definition at line 527 of file TH1.h.

◆ GetDirectory()

TDirectory * TH1::GetDirectory ( ) const
inlineinherited

Definition at line 523 of file TH1.h.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetEffectiveEntries()

Double_t TH1::GetEffectiveEntries ( ) const
virtualinherited

Number of effective entries of the histogram.

\[neff = \frac{(\sum Weights )^2}{(\sum Weight^2 )} \]

In case of an unweighted histogram this number is equivalent to the number of entries of the histogram. For a weighted histogram, this number corresponds to the hypothetical number of unweighted entries a histogram would need to have the same statistical power as this weighted histogram. Note: The underflow/overflow are included if one has set the TH1::StatOverFlows flag and if the statistics has been computed at filling time. If a range is set in the histogram the number is computed from the given range.

Definition at line 4503 of file TH1.cxx.

◆ GetEntries()

Double_t TH1::GetEntries ( ) const
virtualinherited

Return the current number of entries.

Definition at line 4478 of file TH1.cxx.

◆ GetFillColor()

virtual Color_t TAttFill::GetFillColor ( ) const
inlinevirtualinherited

Return the fill area color.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 32 of file TAttFill.h.

◆ GetFillStyle()

virtual Style_t TAttFill::GetFillStyle ( ) const
inlinevirtualinherited

Return the fill area style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 33 of file TAttFill.h.

◆ GetFloat()

Bool_t TH2Poly::GetFloat ( )
inlineinherited

Definition at line 106 of file TH2Poly.h.

◆ GetFunction()

TF1 * TH1::GetFunction ( const char * name) const
virtualinherited

Return pointer to function with name.

Functions such as TH1::Fit store the fitted function in the list of functions of this histogram.

Definition at line 9185 of file TH1.cxx.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TASImage, TBranch, TBranchElement, TGeoVolume, TGMainFrame, TKey, TMethodBrowsable, TSystemFile, and TVirtualBranchBrowsable.

Definition at line 472 of file TObject.cxx.

◆ GetIntegral()

Double_t * TH1::GetIntegral ( )
virtualinherited

Return a pointer to the array of bins integral.

if the pointer fIntegral is null, TH1::ComputeIntegral is called The array dimension is the number of bins in the histograms including underflow and overflow (fNCells) the last value integral[fNCells] is set to the number of entries of the histogram

Definition at line 2620 of file TH1.cxx.

◆ GetKurtosis()

Double_t TH1::GetKurtosis ( Int_t axis = 1) const
virtualinherited
  • For axis =1, 2 or 3 returns kurtosis of the histogram along x, y or z axis. Kurtosis(gaussian(0, 1)) = 0.
  • For axis =11, 12 or 13 returns the approximate standard error of kurtosis of the histogram along x, y or z axis

Note, that since third and fourth moment are not calculated at the fill time, kurtosis and its standard error are computed bin by bin

IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. See TH1::GetMean and TH1::GetStdDev.

Definition at line 7857 of file TH1.cxx.

◆ GetLabelColor()

Color_t TH1::GetLabelColor ( Option_t * axis = "X") const
virtualinherited

Return the "axis" label color.

Definition at line 53 of file Haxis.cxx.

◆ GetLabelFont()

Style_t TH1::GetLabelFont ( Option_t * axis = "X") const
virtualinherited

Return the "axis" label font.

Definition at line 66 of file Haxis.cxx.

◆ GetLabelOffset()

Float_t TH1::GetLabelOffset ( Option_t * axis = "X") const
virtualinherited

Return the "axis" label offset.

Definition at line 79 of file Haxis.cxx.

◆ GetLabelSize()

Float_t TH1::GetLabelSize ( Option_t * axis = "X") const
virtualinherited

Return the "axis" label size.

Definition at line 92 of file Haxis.cxx.

◆ GetLineColor()

virtual Color_t TAttLine::GetLineColor ( ) const
inlinevirtualinherited

Return the line color.

Reimplemented in TGraphMultiErrors, and TGWin32VirtualXProxy.

Definition at line 36 of file TAttLine.h.

◆ GetLineStyle()

virtual Style_t TAttLine::GetLineStyle ( ) const
inlinevirtualinherited

Return the line style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 37 of file TAttLine.h.

◆ GetLineWidth()

virtual Width_t TAttLine::GetLineWidth ( ) const
inlinevirtualinherited

Return the line width.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 38 of file TAttLine.h.

◆ GetListOfFunctions()

TList * TH1::GetListOfFunctions ( ) const
inlineinherited

Definition at line 488 of file TH1.h.

◆ GetLowEdge()

void TH1::GetLowEdge ( Double_t * edge) const
virtualinherited

Fill array with low edge of bins for 1D histogram Better to use h1.GetXaxis()->GetLowEdge(edge).

Definition at line 9321 of file TH1.cxx.

◆ GetMarkerColor()

virtual Color_t TAttMarker::GetMarkerColor ( ) const
inlinevirtualinherited

Return the marker color.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 33 of file TAttMarker.h.

◆ GetMarkerLineWidth()

Width_t TAttMarker::GetMarkerLineWidth ( Style_t style)
staticinherited

◆ GetMarkerSize()

virtual Size_t TAttMarker::GetMarkerSize ( ) const
inlinevirtualinherited

Return the marker size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 35 of file TAttMarker.h.

◆ GetMarkerStyle()

virtual Style_t TAttMarker::GetMarkerStyle ( ) const
inlinevirtualinherited

Return the marker style.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 34 of file TAttMarker.h.

◆ GetMarkerStyleBase()

Style_t TAttMarker::GetMarkerStyleBase ( Style_t style)
staticinherited

◆ GetMaximum() [1/2]

Double_t TH2Poly::GetMaximum ( ) const
inherited

Returns the maximum value of the histogram.

Definition at line 914 of file TH2Poly.cxx.

◆ GetMaximum() [2/2]

Double_t TH2Poly::GetMaximum ( Double_t maxval) const
overridevirtualinherited

Returns the maximum value of the histogram that is less than maxval.

Reimplemented from TH1.

Definition at line 938 of file TH2Poly.cxx.

◆ GetMaximumBin() [1/2]

Int_t TH1::GetMaximumBin ( ) const
virtualinherited

Return location of bin with maximum value in the range.

TH1::GetMaximum can be used to get the maximum value.

Definition at line 8714 of file TH1.cxx.

◆ GetMaximumBin() [2/2]

Int_t TH1::GetMaximumBin ( Int_t & locmax,
Int_t & locmay,
Int_t & locmaz ) const
virtualinherited

Return location of bin with maximum value in the range.

Definition at line 8723 of file TH1.cxx.

◆ GetMaximumStored()

virtual Double_t TH1::GetMaximumStored ( ) const
inlinevirtualinherited

Definition at line 533 of file TH1.h.

◆ GetMean()

Double_t TH1::GetMean ( Int_t axis = 1) const
virtualinherited

For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.

For axis = 11, 12, 13 returns the standard error of the mean value of the histogram along X, Y or Z axis

Note that the mean value/StdDev is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes all bins from 1 to nbins included, excluding underflows and overflows. To force the underflows and overflows in the computation, one must call the static function TH1::StatOverflows(kTRUE) before filling the histogram.

IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned mean is the (unbinned) one calculated at fill time. If a range has been set, however, the mean is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned mean (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.

Return mean value of this histogram along the X axis.

Definition at line 7648 of file TH1.cxx.

◆ GetMeanError()

Double_t TH1::GetMeanError ( Int_t axis = 1) const
virtualinherited

Return standard error of mean of this histogram along the X axis.

Note that the mean value/StdDev is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes all bins from 1 to nbins included, excluding underflows and overflows. To force the underflows and overflows in the computation, one must call the static function TH1::StatOverflows(kTRUE) before filling the histogram.

Also note, that although the definition of standard error doesn't include the assumption of normality, many uses of this feature implicitly assume it.

IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned value is the (unbinned) one calculated at fill time. If a range has been set, however, the value is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned value (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.

Definition at line 7688 of file TH1.cxx.

◆ GetMinimum() [1/2]

Double_t TH2Poly::GetMinimum ( ) const
inherited

Returns the minimum value of the histogram.

Definition at line 962 of file TH2Poly.cxx.

◆ GetMinimum() [2/2]

Double_t TH2Poly::GetMinimum ( Double_t minval) const
overridevirtualinherited

Returns the minimum value of the histogram that is greater than minval.

Reimplemented from TH1.

Definition at line 986 of file TH2Poly.cxx.

◆ GetMinimumAndMaximum()

void TH1::GetMinimumAndMaximum ( Double_t & min,
Double_t & max ) const
virtualinherited

Retrieve the minimum and maximum values in the histogram.

This will not return a cached value and will always search the histogram for the min and max values. The user can condition whether or not to call this with the GetMinimumStored() and GetMaximumStored() methods. If the cache is empty, then the value will be -1111. Users can then use the SetMinimum() or SetMaximum() methods to cache the results. For example, the following recipe will make efficient use of this method and the cached minimum and maximum values.

Double_t currentMin = pHist->GetMinimumStored();
Double_t currentMax = pHist->GetMaximumStored();
if ((currentMin == -1111) || (currentMax == -1111)) {
pHist->GetMinimumAndMaximum(currentMin, currentMax);
pHist->SetMinimum(currentMin);
pHist->SetMaximum(currentMax);
}
Parameters
minreference to variable that will hold found minimum value
maxreference to variable that will hold found maximum value

Definition at line 8868 of file TH1.cxx.

◆ GetMinimumBin() [1/2]

Int_t TH1::GetMinimumBin ( ) const
virtualinherited

Return location of bin with minimum value in the range.

Definition at line 8802 of file TH1.cxx.

◆ GetMinimumBin() [2/2]

Int_t TH1::GetMinimumBin ( Int_t & locmix,
Int_t & locmiy,
Int_t & locmiz ) const
virtualinherited

Return location of bin with minimum value in the range.

Definition at line 8811 of file TH1.cxx.

◆ GetMinimumStored()

virtual Double_t TH1::GetMinimumStored ( ) const
inlinevirtualinherited

Definition at line 537 of file TH1.h.

◆ GetName()

const char * TNamed::GetName ( ) const
inlineoverridevirtualinherited

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 49 of file TNamed.h.

◆ GetNbinsX()

virtual Int_t TH1::GetNbinsX ( ) const
inlinevirtualinherited

Definition at line 541 of file TH1.h.

◆ GetNbinsY()

virtual Int_t TH1::GetNbinsY ( ) const
inlinevirtualinherited

Definition at line 542 of file TH1.h.

◆ GetNbinsZ()

virtual Int_t TH1::GetNbinsZ ( ) const
inlinevirtualinherited

Definition at line 543 of file TH1.h.

◆ GetNcells()

virtual Int_t TH1::GetNcells ( ) const
inlinevirtualinherited

Definition at line 544 of file TH1.h.

◆ GetNdivisions()

Int_t TH1::GetNdivisions ( Option_t * axis = "X") const
virtualinherited

Return the number of divisions for "axis".

Definition at line 27 of file Haxis.cxx.

◆ GetNewBinAdded()

Bool_t TH2Poly::GetNewBinAdded ( ) const
inlineinherited

Definition at line 111 of file TH2Poly.h.

◆ GetNormFactor()

virtual Double_t TH1::GetNormFactor ( ) const
inlinevirtualinherited

Definition at line 545 of file TH1.h.

◆ GetNumberOfBins()

Int_t TH2Poly::GetNumberOfBins ( ) const
inherited

Return the number of bins : it should be the size of the bin list.

Definition at line 863 of file TH2Poly.cxx.

◆ GetObjectInfo()

char * TH1::GetObjectInfo ( Int_t px,
Int_t py ) const
overridevirtualinherited

Redefines TObject::GetObjectInfo.

Displays the histogram info (bin number, contents, integral up to bin corresponding to cursor position px,py

Reimplemented from TObject.

Definition at line 4557 of file TH1.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

Option_t * TH1::GetOption ( ) const
inlineoverridevirtualinherited

Reimplemented from TObject.

Definition at line 547 of file TH1.h.

◆ GetOverflowContent()

Double_t TProfile2Poly::GetOverflowContent ( Int_t idx)
inline

Definition at line 99 of file TProfile2Poly.h.

◆ GetOverflowRegionFromCoordinates()

Int_t TProfile2Poly::GetOverflowRegionFromCoordinates ( Double_t x,
Double_t y )
protected

The overflow regions are calculated by considering x, y coordinates.

The Middle bin at -5 contains all the TProfile2Poly bins.

-0 -1 -2
________
-1: |__|__|__|
-4: |__|__|__|
-7: |__|__|__|

Definition at line 492 of file TProfile2Poly.cxx.

◆ GetPainter()

TVirtualHistPainter * TH1::GetPainter ( Option_t * option = "")
inherited

Return pointer to painter.

If painter does not exist, it is created

Definition at line 4566 of file TH1.cxx.

◆ GetQuantiles()

Int_t TH1::GetQuantiles ( Int_t n,
Double_t * xp,
const Double_t * p = nullptr )
virtualinherited

Compute Quantiles for this histogram.

A quantile x_p := Q(p) is defined as the value x_p such that the cumulative probability distribution Function F of variable X yields:

F(x_p) = Pr(X <= x_p) = p with 0 <= p <= 1.
x_p = Q(p) = F_inv(p)
#define F(x, y, z)

For instance the median x_0.5 of a distribution is defined as that value of the random variable X for which the distribution function equals 0.5:

F(x_0.5) = Probability(X < x_0.5) = 0.5
x_0.5 = Q(0.5)
Author
Eddy Offermann code from Eddy Offermann, Renaissance
Parameters
[in]nmaximum size of the arrays xp and p (if given)
[out]xparray to be filled with nq quantiles evaluated at (p). Memory has to be preallocated by caller.
  • If p == nullptr, the quantiles are computed at the (first n) probabilities p given by the CDF of the histogram; n must thus be smaller or equal Nbins+1, otherwise the extra values of xp will not be filled and nq will be smaller than n. If all bins have non-zero entries, the quantiles happen to be the bin centres. Empty bins will, however, be skipped in the quantiles. If the CDF is e.g. [0., 0., 0.1, ...], the quantiles would be, [3., 3., 3., ...], with the third bin starting at 3.
[in]parray of cumulative probabilities where quantiles should be evaluated.
  • if p == nullptr, the CDF of the histogram will be used to compute the quantiles, and will have a size of n.
  • Otherwise, it is assumed to contain at least n values.
Returns
number of quantiles computed
Note
Unlike in TF1::GetQuantiles, p is here an optional argument

Note that the Integral of the histogram is automatically recomputed if the number of entries is different of the number of entries when the integral was computed last time. In case you do not use the Fill functions to fill your histogram, but SetBinContent, you must call TH1::ComputeIntegral before calling this function.

Getting quantiles xp from two histograms and storing results in a TGraph, a so-called QQ-plot

TGraph *gr = new TGraph(nprob);
h1->GetQuantiles(nprob,gr->GetX());
h2->GetQuantiles(nprob,gr->GetY());
gr->Draw("alp");
TGraphErrors * gr
Definition legend1.C:25
TH1F * h1
Definition legend1.C:5

Example:

void quantiles() {
// demo for quantiles
const Int_t nq = 20;
TH1F *h = new TH1F("h","demo quantiles",100,-3,3);
h->FillRandom("gaus",5000);
h->GetXaxis()->SetTitle("x");
h->GetYaxis()->SetTitle("Counts");
Double_t p[nq]; // probabilities where to evaluate the quantiles in [0,1]
Double_t xp[nq]; // array of positions X to store the resulting quantiles
for (Int_t i=0;i<nq;i++) p[i] = Float_t(i+1)/nq;
h->GetQuantiles(nq,xp,p);
//show the original histogram in the top pad
TCanvas *c1 = new TCanvas("c1","demo quantiles",10,10,700,900);
c1->Divide(1,2);
c1->cd(1);
h->Draw();
// show the quantiles in the bottom pad
c1->cd(2);
gPad->SetGrid();
TGraph *gr = new TGraph(nq,p,xp);
gr->SetMarkerStyle(21);
gr->GetXaxis()->SetTitle("p");
gr->GetYaxis()->SetTitle("x");
gr->Draw("alp");
}
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
#define gPad
The Canvas class.
Definition TCanvas.h:23
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:878
return c1
Definition legend1.C:41

Definition at line 4670 of file TH1.cxx.

◆ GetRandom()

Double_t TH1::GetRandom ( TRandom * rng = nullptr,
Option_t * option = "" ) const
virtualinherited

Return a random number distributed according the histogram bin contents.

This function checks if the bins integral exists. If not, the integral is evaluated, normalized to one.

Parameters
rng(optional) Random number generator pointer used (default is gRandom)
option(optional) Set it to "width" if your non-uniform bin contents represent a density rather than counts

The integral is automatically recomputed if the number of entries is not the same then when the integral was computed.

Note
Only valid for 1-d histograms. Use GetRandom2 or GetRandom3 otherwise. If the histogram has a bin with negative content, a NaN is returned.

Definition at line 5091 of file TH1.cxx.

◆ GetRandom2()

void TH2::GetRandom2 ( Double_t & x,
Double_t & y,
TRandom * rng = nullptr,
Option_t * option = "" )
virtualinherited

Return 2 random numbers along axis x and y distributed according to the cell-contents of this 2-D histogram.

Return a NaN if the histogram has a bin with negative content

Parameters
[out]xreference to random generated x value
[out]yreference to random generated y value
[in]rng(optional) Random number generator pointer used (default is gRandom)
[in]option(optional) Set it to "width" if your non-uniform bin contents represent a density rather than counts

Definition at line 1170 of file TH2.cxx.

◆ GetRMS()

Double_t TH1::GetRMS ( Int_t axis = 1) const
inlineinherited

This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RMS).

The name "RMS" is been often used as a synonym for the Standard Deviation and it was introduced many years ago (Hbook/PAW times). We keep the name GetRMS for continuity as an alias to GetStdDev. GetStdDev() should be used instead.

Definition at line 566 of file TH1.h.

◆ GetRMSError()

Double_t TH1::GetRMSError ( Int_t axis = 1) const
inlineinherited

Definition at line 567 of file TH1.h.

◆ GetSkewness()

Double_t TH1::GetSkewness ( Int_t axis = 1) const
virtualinherited
  • For axis = 1, 2 or 3 returns skewness of the histogram along x, y or z axis.
  • For axis = 11, 12 or 13 returns the approximate standard error of skewness of the histogram along x, y or z axis

Note, that since third and fourth moment are not calculated at the fill time, skewness and its standard error are computed bin by bin

IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. See TH1::GetMean and TH1::GetStdDev.

Definition at line 7784 of file TH1.cxx.

◆ GetStatOverflows()

EStatOverflows TH1::GetStatOverflows ( ) const
inlineinherited

Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more information.

Definition at line 570 of file TH1.h.

◆ GetStatOverflowsBehaviour()

Bool_t TH1::GetStatOverflowsBehaviour ( ) const
inlineprotectedinherited

Definition at line 391 of file TH1.h.

◆ GetStats()

void TProfile2Poly::GetStats ( Double_t * stats) const
overridevirtual

Fill the array stats from the contents of this profile.

The array stats must be correctly dimensioned in the calling program.

  • stats[0] = sumw
  • stats[1] = sumw2
  • stats[2] = sumwx
  • stats[3] = sumwx2
  • stats[4] = sumwy
  • stats[5] = sumwy2
  • stats[6] = sumwxy
  • stats[7] = sumwz
  • stats[8] = sumwz2

If no axis-subrange is specified (via TAxis::SetRange), the array stats is simply a copy of the statistics quantities computed at filling time. If a sub-range is specified, the function recomputes these quantities from the bin contents in the current axis range.

Reimplemented from TH2Poly.

Definition at line 432 of file TProfile2Poly.cxx.

◆ GetStdDev()

Double_t TH1::GetStdDev ( Int_t axis = 1) const
virtualinherited

Returns the Standard Deviation (Sigma).

The Sigma estimate is computed as

\[\sqrt{\frac{1}{N}(\sum(x_i-x_{mean})^2)} \]

For axis = 1,2 or 3 returns the Sigma value of the histogram along X, Y or Z axis For axis = 11, 12 or 13 returns the error of StdDev estimation along X, Y or Z axis for Normal distribution

Note that the mean value/sigma is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes all bins from 1 to nbins included, excluding underflows and overflows. To force the underflows and overflows in the computation, one must call the static function TH1::StatOverflows(kTRUE) before filling the histogram.

IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned standard deviation is the (unbinned) one calculated at fill time. If a range has been set, however, the standard deviation is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned standard deviation (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.

Definition at line 7720 of file TH1.cxx.

◆ GetStdDevError()

Double_t TH1::GetStdDevError ( Int_t axis = 1) const
virtualinherited

Return error of standard deviation estimation for Normal distribution.

Note that the mean value/StdDev is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes all bins from 1 to nbins included, excluding underflows and overflows. To force the underflows and overflows in the computation, one must call the static function TH1::StatOverflows(kTRUE) before filling the histogram.

Value returned is standard deviation of sample standard deviation. Note that it is an approximated value which is valid only in the case that the original data distribution is Normal. The correct one would require the 4-th momentum value, which cannot be accurately estimated from a histogram since the x-information for all entries is not kept.

IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned value is the (unbinned) one calculated at fill time. If a range has been set, however, the value is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned value (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.

Definition at line 7768 of file TH1.cxx.

◆ GetSumOfAllWeights()

Double_t TH1::GetSumOfAllWeights ( const bool includeOverflow,
Double_t * sumWeightSquare = nullptr ) const
inherited

Return the sum of all weights and optionally also the sum of weight squares.

Parameters
includeOverflowtrue to include under/overflows bins, false to exclude those.
Note
Different from TH1::GetSumOfWeights, that always excludes those

Definition at line 8039 of file TH1.cxx.

◆ GetSumOfWeights()

virtual Double_t TH1::GetSumOfWeights ( ) const
inlinevirtualinherited

Return the sum of weights across all bins excluding under/overflows.

See also
TH1::GetSumOfAllWeights()

Definition at line 559 of file TH1.h.

◆ GetSumw2() [1/2]

virtual TArrayD * TH1::GetSumw2 ( )
inlinevirtualinherited

Definition at line 560 of file TH1.h.

◆ GetSumw2() [2/2]

virtual const TArrayD * TH1::GetSumw2 ( ) const
inlinevirtualinherited

Definition at line 561 of file TH1.h.

◆ GetSumw2N()

virtual Int_t TH1::GetSumw2N ( ) const
inlinevirtualinherited

Definition at line 562 of file TH1.h.

◆ GetTickLength()

Float_t TH1::GetTickLength ( Option_t * axis = "X") const
virtualinherited

Return the "axis" tick length.

Definition at line 105 of file Haxis.cxx.

◆ GetTitle()

const char * TNamed::GetTitle ( ) const
inlineoverridevirtualinherited

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented from TObject.

Definition at line 50 of file TNamed.h.

◆ GetTitleFont()

Style_t TH1::GetTitleFont ( Option_t * axis = "X") const
virtualinherited

Return the "axis" title font.

Definition at line 118 of file Haxis.cxx.

◆ GetTitleOffset()

Float_t TH1::GetTitleOffset ( Option_t * axis = "X") const
virtualinherited

Return the "axis" title offset.

Definition at line 131 of file Haxis.cxx.

◆ GetTitleSize()

Float_t TH1::GetTitleSize ( Option_t * axis = "X") const
virtualinherited

Return the "axis" title size.

Definition at line 144 of file Haxis.cxx.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GetXaxis() [1/2]

TAxis * TH1::GetXaxis ( )
inlineinherited

Definition at line 571 of file TH1.h.

◆ GetXaxis() [2/2]

const TAxis * TH1::GetXaxis ( ) const
inlineinherited

Definition at line 574 of file TH1.h.

◆ GetYaxis() [1/2]

TAxis * TH1::GetYaxis ( )
inlineinherited

Definition at line 572 of file TH1.h.

◆ GetYaxis() [2/2]

const TAxis * TH1::GetYaxis ( ) const
inlineinherited

Definition at line 575 of file TH1.h.

◆ GetZaxis() [1/2]

TAxis * TH1::GetZaxis ( )
inlineinherited

Definition at line 573 of file TH1.h.

◆ GetZaxis() [2/2]

const TAxis * TH1::GetZaxis ( ) const
inlineinherited

Definition at line 576 of file TH1.h.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGCommandPlugin, TGDNDManager, TGFileContainer, TGHtml, TGLEventHandler, TGPopupMenu, TGraphTime, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGuiBldDragManager, TGWindow, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TNamed::Hash ( ) const
inlineoverridevirtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

Error in <ROOT::Internal::TCheckHashRecursiveRemoveConsistency::CheckRecursiveRemove>: The class SomeName overrides
TObject::Hash but does not call TROOT::RecursiveRemove in its destructor.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
ULong_t Hash() const override
Return hash value for this object.
Definition TNamed.h:51
Mother of all ROOT objects.
Definition TObject.h:42
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented from TObject.

Definition at line 51 of file TNamed.h.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ Honeycomb()

void TH2Poly::Honeycomb ( Double_t xstart,
Double_t ystart,
Double_t a,
Int_t k,
Int_t s,
Option_t * option = "v" )
inherited

Bins the histogram using a honeycomb structure If the option "v" is specified, the hexagons are drawn "vertically" (default).

If the option "h" is selected they are drawn "horizontally".

Definition at line 1012 of file TH2Poly.cxx.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ Initialize()

void TH2Poly::Initialize ( Double_t xlow,
Double_t xup,
Double_t ylow,
Double_t yup,
Int_t n,
Int_t m )
protectedinherited

Initializes the TH2Poly object. This method is called by the constructor.

Definition at line 1099 of file TH2Poly.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TGFrame, TInspectorObject, and TSystemFile.

Definition at line 570 of file TObject.cxx.

◆ Integral() [1/6]

Double_t TH2::Integral ( Int_t firstxbin,
Int_t lastxbin,
Int_t firstybin,
Int_t lastybin,
Option_t * option = "" ) const
virtualinherited

Return integral of bin contents in range [firstxbin,lastxbin],[firstybin,lastybin] for a 2-D histogram By default the integral is computed as the sum of bin contents in the range.

if option "width" is specified, the integral is the sum of the bin contents multiplied by the bin width in x and in y.

Definition at line 1302 of file TH2.cxx.

◆ Integral() [2/6]

virtual Double_t TH2::Integral ( Int_t ,
Int_t ,
Int_t ,
Int_t ,
Int_t ,
Int_t ,
Option_t * = "" ) const
inlinevirtualinherited

Definition at line 110 of file TH2.h.

◆ Integral() [3/6]

Double_t TH2Poly::Integral ( Int_t ,
Int_t ,
const Option_t *  ) const
inlineoverrideprotectedinherited

NOT IMPLEMENTED for TH2Poly.

Definition at line 141 of file TH2Poly.h.

◆ Integral() [4/6]

Double_t TH2Poly::Integral ( Int_t ,
Int_t ,
Int_t ,
Int_t ,
const Option_t *  ) const
inlineoverrideprotectedinherited

NOT IMPLEMENTED for TH2Poly.

Definition at line 142 of file TH2Poly.h.

◆ Integral() [5/6]

Double_t TH2Poly::Integral ( Int_t ,
Int_t ,
Int_t ,
Int_t ,
Int_t ,
Int_t ,
const Option_t *  ) const
inlineoverrideprotectedinherited

NOT IMPLEMENTED for TH2Poly.

Definition at line 143 of file TH2Poly.h.

◆ Integral() [6/6]

Double_t TH2Poly::Integral ( Option_t * option = "") const
overridevirtualinherited

Returns the integral of bin contents.

By default the integral is computed as the sum of bin contents. If option "width" or "area" is specified, the integral is the sum of the bin contents multiplied by the area of the bin.

Reimplemented from TH2.

Definition at line 786 of file TH2Poly.cxx.

◆ IntegralAndError() [1/2]

Double_t TH1::IntegralAndError ( Int_t binx1,
Int_t binx2,
Double_t & error,
Option_t * option = "" ) const
privatevirtualinherited

Return integral of bin contents in range [binx1,binx2] and its error.

By default the integral is computed as the sum of bin contents in the range. if option "width" is specified, the integral is the sum of the bin contents multiplied by the bin width in x. the error is computed using error propagation from the bin errors assuming that all the bins are uncorrelated

Reimplemented from TH1.

Definition at line 579 of file TH1.cxx.

◆ IntegralAndError() [2/2]

Double_t TH2::IntegralAndError ( Int_t firstxbin,
Int_t lastxbin,
Int_t firstybin,
Int_t lastybin,
Double_t & error,
Option_t * option = "" ) const
virtualinherited

Return integral of bin contents in range [firstxbin,lastxbin],[firstybin,lastybin] for a 2-D histogram.

Calculates also the integral error using error propagation from the bin errors assuming that all the bins are uncorrelated. By default the integral is computed as the sum of bin contents in the range. if option "width" is specified, the integral is the sum of the bin contents multiplied by the bin width in x and in y.

Definition at line 1316 of file TH2.cxx.

◆ Interpolate() [1/4]

Double_t TH2::Interpolate ( Double_t x) const
overridevirtualinherited

illegal for a TH2

Reimplemented from TH2.

Definition at line 60 of file TH2.cxx.

◆ Interpolate() [2/4]

Double_t TH2::Interpolate ( Double_t x,
Double_t y ) const
overridevirtualinherited

Given a point P(x,y), Interpolate approximates the value via bilinear interpolation based on the four nearest bin centers see Wikipedia, Bilinear Interpolation Andy Mastbaum 10/8/2008 vaguely based on R.Raja 6-Sep-2008.

Reimplemented from TH2.

Definition at line 112 of file TH2.cxx.

◆ Interpolate() [3/4]

Double_t TH2::Interpolate ( Double_t x,
Double_t y,
Double_t z ) const
overridevirtualinherited

illegal for a TH2

Reimplemented from TH2.

Definition at line 113 of file TH2.cxx.

◆ Interpolate() [4/4]

Double_t TH2Poly::Interpolate ( Double_t ,
Double_t  )
virtualinherited

NOT IMPLEMENTED for TH2Poly.

Definition at line 1719 of file TH2Poly.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TProfile2Poly::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TH2Poly.

Definition at line 115 of file TProfile2Poly.h.

◆ IsBinOverflow()

Bool_t TH1::IsBinOverflow ( Int_t bin,
Int_t axis = 0 ) const
inherited

Return true if the bin is overflow.

Definition at line 5264 of file TH1.cxx.

◆ IsBinUnderflow()

Bool_t TH1::IsBinUnderflow ( Int_t bin,
Int_t iaxis = 0 ) const
inherited

Return true if the bin is underflow.

If iaxis = 0 make OR with all axes otherwise check only for the given axis

Definition at line 5296 of file TH1.cxx.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEmpty()

Bool_t TH1::IsEmpty ( ) const
protectedinherited

Check if a histogram is empty (this is a protected method used mainly by TH1Merger ).

Definition at line 5246 of file TH1.cxx.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TGObject, TObjString, TPair, and TQCommand.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

◆ IsHighlight()

virtual Bool_t TH1::IsHighlight ( ) const
inlinevirtualinherited

Definition at line 585 of file TH1.h.

◆ IsInsideBin()

Bool_t TH2Poly::IsInsideBin ( Int_t binnr,
Double_t x,
Double_t y )
inherited

Return "true" if the point (x,y) is inside the bin of binnr.

Definition at line 1402 of file TH2Poly.cxx.

◆ IsIntersecting()

Bool_t TH2Poly::IsIntersecting ( TH2PolyBin * bin,
Double_t xclipl,
Double_t xclipr,
Double_t yclipb,
Double_t yclipt )
protectedinherited

Returns kTRUE if the input bin is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt).

Definition at line 1150 of file TH2Poly.cxx.

◆ IsIntersectingPolygon()

Bool_t TH2Poly::IsIntersectingPolygon ( Int_t bn,
Double_t * x,
Double_t * y,
Double_t xclipl,
Double_t xclipr,
Double_t yclipb,
Double_t yclipt )
protectedinherited

Returns kTRUE if the input polygon (bn, x, y) is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt).

Definition at line 1191 of file TH2Poly.cxx.

◆ IsOnHeap()

Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsSortable()

Bool_t TNamed::IsSortable ( ) const
inlineoverridevirtualinherited

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 52 of file TNamed.h.

◆ IsTransparent()

Bool_t TAttFill::IsTransparent ( ) const
inlinevirtualinherited

Reimplemented in TGWin32VirtualXProxy.

Definition at line 49 of file TAttFill.h.

◆ IsZombie()

Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ KolmogorovTest()

Double_t TH2::KolmogorovTest ( const TH1 * h2,
Option_t * option = "" ) const
overridevirtualinherited

Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test.

Default: Ignore under- and overflow bins in comparison

option is a character string to specify options

  • "U" include Underflows in test
  • "O" include Overflows
  • "N" include comparison of normalizations
  • "D" Put out a line of "Debug" printout
  • "M" Return the Maximum Kolmogorov distance instead of prob

The returned function value is the probability of test (much less than one means NOT compatible)

The KS test uses the distance between the pseudo-CDF's obtained from the histogram. Since in 2D the order for generating the pseudo-CDF is arbitrary, two pairs of pseudo-CDF are used, one starting from the x axis the other from the y axis and the maximum distance is the average of the two maximum distances obtained.

Code adapted by Rene Brun from original HBOOK routine HDIFF

Reimplemented from TH1.

Definition at line 1441 of file TH2.cxx.

◆ LabelsDeflate()

void TH1::LabelsDeflate ( Option_t * ax = "X")
virtualinherited

Reduce the number of bins for the axis passed in the option to the number of bins having a label.

The method will remove only the extra bins existing after the last "labeled" bin. Note that if there are "un-labeled" bins present between "labeled" bins they will not be removed

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 5327 of file TH1.cxx.

◆ LabelsInflate()

void TH1::LabelsInflate ( Option_t * ax = "X")
virtualinherited

Double the number of bins for axis.

Refill histogram. This function is called by TAxis::FindBin(const char *label)

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 5397 of file TH1.cxx.

◆ LabelsOption()

void TH1::LabelsOption ( Option_t * option = "h",
Option_t * ax = "X" )
virtualinherited

Sort bins with labels or set option(s) to draw axis with labels.

Parameters
[in]option
  • "a" sort by alphabetic order
  • ">" sort by decreasing values
  • "<" sort by increasing values
  • "h" draw labels horizontal
  • "v" draw labels vertical
  • "u" draw labels up (end of label right adjusted)
  • "d" draw labels down (start of label left adjusted)

In case not all bins have labels sorting will work only in the case the first n consecutive bins have all labels and sorting will be performed on those label bins.

Parameters
[in]axaxis

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 5464 of file TH1.cxx.

◆ LoggedInconsistency()

int TH1::LoggedInconsistency ( const char * name,
const TH1 * h1,
const TH1 * h2,
bool useMerge = false ) const
protectedinherited

Definition at line 893 of file TH1.cxx.

◆ ls()

void TNamed::ls ( Option_t * option = "") const
overridevirtualinherited

List TNamed name and title.

Reimplemented from TObject.

Reimplemented in ROOT::Experimental::XRooFit::xRooBrowser, TNode, TROOT, TStreamerBase, TStreamerElement, TStreamerInfo, TStreamerSTL, TTask, TText, and TVirtualStreamerInfo.

Definition at line 112 of file TNamed.cxx.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).

Definition at line 1160 of file TObject.cxx.

◆ Merge() [1/3]

Long64_t TH1::Merge ( TCollection * li,
Option_t * opt )
inherited

Add all histograms in the collection to this histogram.

This function computes the min/max for the x axis, compute a new number of bins, if necessary, add bin contents, errors and statistics. If all histograms have bin labels, bins with identical labels will be merged, no matter what their order is. If overflows are present and limits are different the function will fail. The function returns the total number of entries in the result histogram if the merge is successful, -1 otherwise.

Possible option: -NOL : the merger will ignore the labels and merge the histograms bin by bin using bin center values to match bins -NOCHECK: the histogram will not perform a check for duplicate labels in case of axes with labels. The check (enabled by default) slows down the merging

IMPORTANT remark. The axis x may have different number of bins and different limits, BUT the largest bin width must be a multiple of the smallest bin width and the upper limit must also be a multiple of the bin width. Example:

void atest() {
TH1F *h1 = new TH1F("h1","h1",110,-110,0);
TH1F *h2 = new TH1F("h2","h2",220,0,110);
TH1F *h3 = new TH1F("h3","h3",330,-55,55);
for (Int_t i=0;i<10000;i++) {
h1->Fill(r.Gaus(-55,10));
h2->Fill(r.Gaus(55,10));
h3->Fill(r.Gaus(0,10));
}
TList *list = new TList;
list->Add(h1);
list->Add(h2);
list->Add(h3);
TH1F *h = (TH1F*)h1->Clone("h");
h->Reset();
h->Merge(list);
h->Draw();
}
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
Definition TH1.cxx:3393
A doubly linked list.
Definition TList.h:38
void Add(TObject *obj) override
Definition TList.h:81
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27

Definition at line 6104 of file TH1.cxx.

◆ Merge() [2/3]

Long64_t TProfile2Poly::Merge ( const std::vector< TProfile2Poly * > & list)

Merge.

Definition at line 245 of file TProfile2Poly.cxx.

◆ Merge() [3/3]

Long64_t TProfile2Poly::Merge ( TCollection * in)
overridevirtual

Merge.

Reimplemented from TH2Poly.

Definition at line 229 of file TProfile2Poly.cxx.

◆ Modify() [1/3]

virtual void TAttFill::Modify ( )
virtualinherited

◆ Modify() [2/3]

virtual void TAttLine::Modify ( )
virtualinherited

◆ Modify() [3/3]

virtual void TAttMarker::Modify ( )
virtualinherited

◆ ModifyOn() [1/3]

virtual void TAttFill::ModifyOn ( TVirtualPad & pad)
virtualinherited

◆ ModifyOn() [2/3]

virtual void TAttLine::ModifyOn ( TVirtualPad & pad)
virtualinherited

◆ ModifyOn() [3/3]

virtual void TAttMarker::ModifyOn ( TVirtualPad & pad)
virtualinherited

◆ Multiply() [1/3]

Bool_t TH1::Multiply ( const TH1 * h1)
virtualinherited

Multiply this histogram by h1.

this = this*h1

If errors of this are available (TH1::Sumw2), errors are recalculated. Note that if h1 has Sumw2 set, Sumw2 is automatically called for this if not already set.

IMPORTANT NOTE: If you intend to use the errors of this histogram later you should call Sumw2 before making this operation. This is particularly important if you fit the histogram after TH1::Multiply

The function return kFALSE if the Multiply operation failed

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 6193 of file TH1.cxx.

◆ Multiply() [2/3]

Bool_t TH1::Multiply ( const TH1 * h1,
const TH1 * h2,
Double_t c1 = 1,
Double_t c2 = 1,
Option_t * option = "" )
virtualinherited

Replace contents of this histogram by multiplication of h1 by h2.

this = (c1*h1)*(c2*h2)

If errors of this are available (TH1::Sumw2), errors are recalculated. Note that if h1 or h2 have Sumw2 set, Sumw2 is automatically called for this if not already set.

IMPORTANT NOTE: If you intend to use the errors of this histogram later you should call Sumw2 before making this operation. This is particularly important if you fit the histogram after TH1::Multiply

The function return kFALSE if the Multiply operation failed

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 6242 of file TH1.cxx.

◆ Multiply() [3/3]

Bool_t TH2Poly::Multiply ( TF1 * ,
Double_t  )
overridevirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 1691 of file TH2Poly.cxx.

◆ Normalize()

void TH1::Normalize ( Option_t * option = "")
virtualinherited

Normalize a histogram to its integral or to its maximum.

Note
Works for TH1, TH2, TH3, ...
Parameters
optionnormalization strategy ("", "max" or "sum")
  • "": Scale to 1/(sum*bin_width).
  • max: Scale to 1/GetMaximum()
  • sum: Scale to 1/sum.

In case the norm is zero, it raises an error.

See also
https://root-forum.cern.ch/t/different-ways-of-normalizing-histograms/15582/

Definition at line 6293 of file TH1.cxx.

◆ Notify()

Bool_t TObject::Notify ( )
virtualinherited

This method must be overridden to handle object notification (the base implementation is no-op).

Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.

For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.

Reimplemented in h1analysis, h1analysisTreeReader, TARInterruptHandler, TASInputHandler, TASInterruptHandler, TASLogHandler, TASSigPipeHandler, TBlinkTimer, TBranchElement, TBranchRef, TBreakLineCom, TBrowserTimer, TCollection, TDelCharCom, TDelTextCom, TFileHandler, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TGLRedrawTimer, TGTextEditHist, TGuiBldDragManagerRepeatTimer, TIdleTimer, TInsCharCom, TInsTextCom, TInterruptHandler, TLeafObject, TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TPopupDelayTimer, TProcessEventTimer, TRefTable, TRepeatTimer, TSBRepeatTimer, TSelector, TSelectorDraw, TSelectorEntries, TSignalHandler, TSingleShotCleaner, TSocketHandler, TStdExceptionHandler, TSysEvtHandler, TTermInputHandler, TThreadTimer, TTimeOutTimer, TTimer, TTipDelayTimer, TTree, TTreeFormula, TTreeFormulaManager, TTreeReader, TViewTimer, and TViewUpdateTimer.

Definition at line 618 of file TObject.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ OverflowIdxToArrayIdx()

Int_t TProfile2Poly::OverflowIdxToArrayIdx ( Int_t val)
inlineprotected

Definition at line 112 of file TProfile2Poly.h.

◆ Paint()

void TH1::Paint ( Option_t * option = "")
overridevirtualinherited

Control routine to paint any kind of histograms.

This function is automatically called by TCanvas::Update. (see TH1::Draw for the list of options)

Reimplemented from TObject.

Definition at line 6321 of file TH1.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TFrame, TPad, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Print()

void TH1::Print ( Option_t * option = "") const
overridevirtualinherited

Print some global quantities for this histogram.

Parameters
[in]option
  • "base" is given, number of bins and ranges are also printed
  • "range" is given, bin contents and errors are also printed for all bins in the current range (default 1-->nbins)
  • "all" is given, bin contents and errors are also printed for all bins including under and overflows.

Reimplemented from TObject.

Definition at line 7134 of file TH1.cxx.

◆ PrintOverflowRegions()

void TProfile2Poly::PrintOverflowRegions ( )

Print overflow regions.

Definition at line 448 of file TProfile2Poly.cxx.

◆ ProfileX()

TProfile * TH2::ProfileX ( const char * name = "_pfx",
Int_t firstybin = 1,
Int_t lastybin = -1,
Option_t * option = "" ) const
inherited

Project a 2-D histogram into a profile histogram along X (integration along Y).

The projection is made from summing the channels along the Y axis ranging from firstybin to lastybin included. By default, bins 1 to ny are included When all bins are included, the number of entries in the projection is set to the number of entries of the 2-D histogram, otherwise the number of entries is incremented by 1 for all non empty cells.

if option "d" is specified, the profile is drawn in the current pad.

if option "o" original axis range of the target axes will be kept, but only bins inside the selected range will be filled.

if option "width" is specified, each bin content is multiplied by its Y bin-width during projection

The option can also be used to specify the projected profile error type. Values which can be used are 's', 'i', or 'g'. See TProfile::BuildOptions for details

Using a TCutG object, it is possible to select a sub-range of a 2-D histogram. One must create a graphical cut (mouse or C++) and specify the name of the cut between [] in the option. For example, with a TCutG named "cutg", one can call: myhist->ProfileX(" ",firstybin,lastybin,"[cutg]"); To invert the cut, it is enough to put a "-" in front of its name: myhist->ProfileX(" ",firstybin,lastybin,"[-cutg]"); It is possible to apply several cuts ("," means logical AND): myhist->ProfileX(" ",firstybin,lastybin,"[cutg1,cutg2]");

NOTE that if a TProfile named "name" exists in the current directory or pad with a compatible axis the profile is reset and filled again with the projected contents of the TH2. In the case of axis incompatibility an error is reported and a NULL pointer is returned.

NOTE that the X axis attributes of the TH2 are copied to the X axis of the profile.

NOTE that the default under- / overflow behavior differs from what ProjectionX does! Profiles take the bin center into account, so here the under- and overflow bins are ignored by default.

NOTE that the return profile histogram is computed using the Y bin center values instead of the real Y values which are used to fill the 2d histogram. Therefore the obtained profile is just an approximation of the correct profile histogram that would be obtained when filling it directly with the original data (see ROOT-7770)

Definition at line 2084 of file TH2.cxx.

◆ ProfileY()

TProfile * TH2::ProfileY ( const char * name = "_pfy",
Int_t firstxbin = 1,
Int_t lastxbin = -1,
Option_t * option = "" ) const
inherited

Project a 2-D histogram into a profile histogram along Y (integration along X).

The projection is made from summing the channels along the X axis ranging from firstxbin to lastxbin included. By default, bins 1 to nx are included When all bins are included, the number of entries in the projection is set to the number of entries of the 2-D histogram, otherwise the number of entries is incremented by 1 for all non empty cells.

if option "d" is specified, the profile is drawn in the current pad.

if option "o" , the original axis range of the target axis will be kept, but only bins inside the selected range will be filled.

if option "width" is specified, each bin content is multiplied by its X bin-width during projection

The option can also be used to specify the projected profile error type. Values which can be used are 's', 'i', or 'g'. See TProfile::BuildOptions for details Using a TCutG object, it is possible to select a sub-range of a 2-D histogram.

One must create a graphical cut (mouse or C++) and specify the name of the cut between [] in the option. For example, with a TCutG named "cutg", one can call: myhist->ProfileY(" ",firstybin,lastybin,"[cutg]"); To invert the cut, it is enough to put a "-" in front of its name: myhist->ProfileY(" ",firstybin,lastybin,"[-cutg]"); It is possible to apply several cuts: myhist->ProfileY(" ",firstybin,lastybin,"[cutg1,cutg2]");

NOTE that if a TProfile named "name" exists in the current directory or pad with a compatible axis the profile is reset and filled again with the projected contents of the TH2. In the case of axis incompatibility an error is reported and a NULL pointer is returned.

NOTE that the Y axis attributes of the TH2 are copied to the X axis of the profile.

NOTE that the default under- / overflow behavior differs from what ProjectionX does! Profiles take the bin center into account, so here the under- and overflow bins are ignored by default.

NOTE that the return profile histogram is computed using the X bin center values instead of the real X values which are used to fill the 2d histogram. Therefore the obtained profile is just an approximation of the correct profile histogram that would be obtained when filling it directly with the original data (see ROOT-7770)

Definition at line 2137 of file TH2.cxx.

◆ ProjectionX()

TH1D * TH2::ProjectionX ( const char * name = "_px",
Int_t firstybin = 0,
Int_t lastybin = -1,
Option_t * option = "" ) const
inherited

Project a 2-D histogram into a 1-D histogram along X (integration along Y).

The projection is always of the type TH1D. The projection is made from summing the channels along the Y axis ranging from firstybin to lastybin included. By default, all bins including under- and overflow are included. The number of entries in the projection is estimated from the number of effective entries for all the cells included in the projection.

To exclude the underflow bins in Y, use firstybin=1. To exclude the overflow bins in Y, use lastybin=nx.

if option "e" is specified, the errors are computed. if option "d" is specified, the projection is drawn in the current pad. if option "o" original axis range of the target axes will be kept, but only bins inside the selected range will be filled.

if option "width" is specified, each bin content is multiplied by its Y bin-width during projection

Using a TCutG object, it is possible to select a sub-range of a 2-D histogram. One must create a graphical cut (mouse or C++) and specify the name of the cut between [] in the option. For example, with a TCutG named "cutg", one can call: myhist->ProjectionX(" ",firstybin,lastybin,"[cutg]"); To invert the cut, it is enough to put a "-" in front of its name: myhist->ProjectionX(" ",firstybin,lastybin,"[-cutg]"); It is possible to apply several cuts: myhist->ProjectionX(" ",firstybin,lastybin,"[cutg1,cutg2]");

NOTE that if a TH1D named "name" exists in the current directory or pad the histogram is reset and filled again with the projected contents of the TH2.

NOTE that the X axis attributes of the TH2 are copied to the X axis of the projection.

Definition at line 2420 of file TH2.cxx.

◆ ProjectionY()

TH1D * TH2::ProjectionY ( const char * name = "_py",
Int_t firstxbin = 0,
Int_t lastxbin = -1,
Option_t * option = "" ) const
inherited

Project a 2-D histogram into a 1-D histogram along Y (integration along X).

The projection is always of the type TH1D. The projection is made from summing the channels along the X axis ranging from firstxbin to lastxbin included. By default, all bins including under- and overflow are included. The number of entries in the projection is estimated from the number of effective entries for all the cells included in the projection

To exclude the underflow bins in X, use firstxbin=1. To exclude the overflow bins in X, use lastxbin=nx.

if option "e" is specified, the errors are computed. if option "d" is specified, the projection is drawn in the current pad. if option "o" original axis range of the target axes will be kept, but only bins inside the selected range will be filled.

if option "width" is specified, each bin content is multiplied by its X bin-width during projection

Using a TCutG object, it is possible to select a sub-range of a 2-D histogram. One must create a graphical cut (mouse or C++) and specify the name of the cut between [] in the option. For example, with a TCutG named "cutg", one can call: myhist->ProjectionY(" ",firstxbin,lastxbin,"[cutg]"); To invert the cut, it is enough to put a "-" in front of its name: myhist->ProjectionY(" ",firstxbin,lastxbin,"[-cutg]"); It is possible to apply several cuts: myhist->ProjectionY(" ",firstxbin,lastxbin,"[cutg1,cutg2]");

NOTE that if a TH1D named "name" exists in the current directory or pad and having a compatible axis, the histogram is reset and filled again with the projected contents of the TH2. In the case of axis incompatibility, an error is reported and a NULL pointer is returned.

NOTE that the Y axis attributes of the TH2 are copied to the X axis of the projection.

Definition at line 2463 of file TH2.cxx.

◆ ProvideSaveName()

TString TH1::ProvideSaveName ( Option_t * option,
Bool_t testfdir = kFALSE )
protectedinherited

Provide variable name for histogram for saving as primitive Histogram pointer has by default the histogram name with an incremental suffix.

If the histogram belongs to a graph or a stack the suffix is not added because the graph and stack objects are not aware of this new name. Same thing if the histogram is drawn with the option COLZ because the TPaletteAxis drawn when this option is selected, does not know this new name either.

Definition at line 7367 of file TH1.cxx.

◆ PutStats()

void TH2::PutStats ( Double_t * stats)
overridevirtualinherited

Replace current statistics with the values in array stats.

Reimplemented from TH1.

Reimplemented in TProfile2D.

Definition at line 2472 of file TH2.cxx.

◆ QuantilesX()

TH1D * TH2::QuantilesX ( Double_t prob = 0.5,
const char * name = "_qx" ) const
inherited

Compute the X distribution of quantiles in the other variable Y name is the name of the returned histogram prob is the probability content for the quantile (0.5 is the default for the median) An approximate error for the quantile is computed assuming that the distribution in the other variable is normal.

According to this approximate formula the error on the quantile is estimated as sqrt( p (1-p) / ( n * f(q)^2) ), where p is the probability content of the quantile and n is the number of events used to compute the quantile and f(q) is the probability distribution for the other variable evaluated at the obtained quantile. In the error estimation the probability is then assumed to be a normal distribution.

Definition at line 2492 of file TH2.cxx.

◆ QuantilesY()

TH1D * TH2::QuantilesY ( Double_t prob = 0.5,
const char * name = "_qy" ) const
inherited

Compute the Y distribution of quantiles in the other variable X name is the name of the returned histogram prob is the probability content for the quantile (0.5 is the default for the median) An approximate error for the quantile is computed assuming that the distribution in the other variable is normal.

Definition at line 2505 of file TH2.cxx.

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TBuffer, TKey, TKeySQL, and TKeyXML.

Definition at line 673 of file TObject.cxx.

◆ Rebin()

TH2 * TH2::Rebin ( Int_t ngroup = 2,
const char * newname = "",
const Double_t * xbins = nullptr )
overridevirtualinherited

Override TH1::Rebin as TH2::RebinX Rebinning in variable binning as for TH1 is not allowed If a non-null pointer is given an error is flagged see RebinX and Rebin2D.

Reimplemented from TH1.

Definition at line 1634 of file TH2.cxx.

◆ Rebin2D()

TH2 * TH2::Rebin2D ( Int_t nxgroup = 2,
Int_t nygroup = 2,
const char * newname = "" )
virtualinherited

Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together.

if newname is not blank a new temporary histogram hnew is created. else the current histogram is modified (default) The parameter nxgroup/nygroup indicate how many bins along the xaxis/yaxis of this have to me merged into one bin of hnew If the original histogram has errors stored (via Sumw2), the resulting histograms has new errors correctly calculated.

examples: if hpxpy is an existing TH2 histogram with 40 x 40 bins

hpxpy->Rebin2D(); // merges two bins along the xaxis and yaxis in one in hpxpy
// Carefull: previous contents of hpxpy are lost
hpxpy->RebinX(5); //merges five bins along the xaxis in one in hpxpy
TH2 *hnew = hpxpy->RebinY(5,"hnew"); // creates a new histogram hnew
// merging 5 bins of h1 along the yaxis in one bin
TH2()
2-D histogram default constructor.
Definition TH2.cxx:72

NOTE : If nxgroup/nygroup is not an exact divider of the number of bins, along the xaxis/yaxis the top limit(s) of the rebinned histogram is changed to the upper edge of the xbin=newxbins*nxgroup resp. ybin=newybins*nygroup and the corresponding bins are added to the overflow bin. Statistics will be recomputed from the new bin contents.

Reimplemented in TProfile2D.

Definition at line 1669 of file TH2.cxx.

◆ RebinAxis()

virtual void TH1::RebinAxis ( Double_t x,
TAxis * axis )
inlinevirtualinherited

Definition at line 686 of file TH1.h.

◆ RebinX()

TH2 * TH2::RebinX ( Int_t ngroup = 2,
const char * newname = "" )
overridevirtualinherited

Rebin only the X axis see Rebin2D.

Reimplemented from TH1.

Reimplemented in TProfile2D.

Definition at line 1613 of file TH2.cxx.

◆ RebinY()

TH2 * TH2::RebinY ( Int_t ngroup = 2,
const char * newname = "" )
virtualinherited

Rebin only the Y axis see Rebin2D.

Reimplemented in TProfile2D.

Definition at line 1623 of file TH2.cxx.

◆ Rebuild()

void TH1::Rebuild ( Option_t * option = "")
virtualinherited

Using the current bin info, recompute the arrays for contents and errors.

Definition at line 7212 of file TH1.cxx.

◆ RecomputeAxisLimits()

Bool_t TH1::RecomputeAxisLimits ( TAxis & destAxis,
const TAxis & anAxis )
staticprotectedinherited

Finds new limits for the axis for the Merge function.

returns false if the limits are incompatible

Definition at line 5990 of file TH1.cxx.

◆ RecursiveRemove()

void TH1::RecursiveRemove ( TObject * obj)
overridevirtualinherited

Recursively remove object from the list of functions.

Reimplemented from TObject.

Definition at line 6691 of file TH1.cxx.

◆ Reset()

void TProfile2Poly::Reset ( Option_t * option = "")
overridevirtual

Reset.

Reimplemented from TH2Poly.

Definition at line 465 of file TProfile2Poly.cxx.

◆ ResetAttFill()

virtual void TAttFill::ResetAttFill ( Option_t * option = "")
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ ResetAttLine()

virtual void TAttLine::ResetAttLine ( Option_t * option = "")
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ ResetAttMarker()

virtual void TAttMarker::ResetAttMarker ( Option_t * toption = "")
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ ResetStats()

void TH1::ResetStats ( )
virtualinherited

Reset the statistics including the number of entries and replace with values calculated from bin content.

The number of entries is set to the total bin content or (in case of weighted histogram) to number of effective entries

Note
By default, before calling this function, statistics are those computed at fill time, which are unbinned. See TH1::GetStats.

Definition at line 8015 of file TH1.cxx.

◆ RetrieveBinContent()

Double_t TH2Poly::RetrieveBinContent ( Int_t bin) const
inlineoverrideprotectedvirtualinherited

Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::GetBin.

Implements TH1.

Definition at line 179 of file TH2Poly.h.

◆ SameLimitsAndNBins()

Bool_t TH1::SameLimitsAndNBins ( const TAxis & axis1,
const TAxis & axis2 )
staticprotectedinherited

Same limits and bins.

Definition at line 5980 of file TH1.cxx.

◆ SaveAs()

void TH1::SaveAs ( const char * filename = "hist",
Option_t * option = "" ) const
overridevirtualinherited

Save the histogram as .csv, .tsv or .txt.

In case of any other extension, fall back to TObject::SaveAs, which saves as a .C macro (but with the file name extension specified by the user)

The Under/Overflow bins are also exported (as first and last lines) The fist 2 columns are the lower and upper edges of the bins Column 3 contains the bin contents The last column contains the error in y. If errors are not present, the column is left empty

The result can be immediately imported into Excel, gnuplot, Python or whatever, without the needing to install pyroot, etc.

Parameters
filenamethe name of the file where to store the histogram
optionsome tuning options

The file extension defines the delimiter used:

  • .csv : comma
  • .tsv : tab
  • .txt : space

If option = "title" a title line is generated. If the y-axis has a title, this title is displayed as column 3 name, otherwise, it shows "BinContent"

Reimplemented from TObject.

Definition at line 7306 of file TH1.cxx.

◆ SaveFillAttributes()

virtual void TAttFill::SaveFillAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1001 )
virtualinherited

◆ SaveLineAttributes()

virtual void TAttLine::SaveLineAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t widdef = 1 )
virtualinherited

◆ SaveMarkerAttributes()

virtual void TAttMarker::SaveMarkerAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t sizdef = 1 )
virtualinherited

◆ SavePrimitive()

void TH2Poly::SavePrimitive ( std::ostream & out,
Option_t * option = "" )
overridevirtualinherited

Save primitive as a C++ statement(s) on output stream out.

Reimplemented from TH1.

Definition at line 1319 of file TH2Poly.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveFunctions()

void TH1::SavePrimitiveFunctions ( std::ostream & out,
const char * varname,
TList * lst )
staticinherited

Save list of functions Also can be used by TGraph classes.

Definition at line 7548 of file TH1.cxx.

◆ SavePrimitiveHelp()

void TH1::SavePrimitiveHelp ( std::ostream & out,
const char * hname,
Option_t * option = "" )
protectedvirtualinherited

Helper function for the SavePrimitive functions from TH1 or classes derived from TH1, eg TProfile, TProfile2D.

Definition at line 7494 of file TH1.cxx.

◆ SavePrimitiveNameTitle()

void TNamed::SavePrimitiveNameTitle ( std::ostream & out,
const char * variable_name )
protectedinherited

Save object name and title into the output stream "out".

Definition at line 135 of file TNamed.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ Scale()

void TH2Poly::Scale ( Double_t c1 = 1,
Option_t * option = "" )
overridevirtualinherited

Multiply this histogram by a constant c1.

Reimplemented from TH1.

Definition at line 1363 of file TH2Poly.cxx.

◆ SetAxisColor()

void TH1::SetAxisColor ( Color_t color = 1,
Option_t * axis = "X" )
virtualinherited

Set color to draw the axis line and tick marks.

axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 187 of file Haxis.cxx.

◆ SetAxisRange()

void TH1::SetAxisRange ( Double_t xmin,
Double_t xmax,
Option_t * axis = "X" )
virtualinherited

Set the "axis" range.

Definition at line 201 of file Haxis.cxx.

◆ SetBarOffset()

virtual void TH1::SetBarOffset ( Float_t offset = 0.25)
inlinevirtualinherited

Set the bar offset as fraction of the bin width for drawing mode "B".

This shifts bars to the right on the x axis, and helps to draw bars next to each other.

See also
THistPainter, SetBarWidth()

Definition at line 612 of file TH1.h.

◆ SetBarWidth()

virtual void TH1::SetBarWidth ( Float_t width = 0.5)
inlinevirtualinherited

Set the width of bars as fraction of the bin width for drawing mode "B".

This allows for making bars narrower than the bin width. With SetBarOffset(), this helps to draw multiple bars next to each other.

See also
THistPainter, SetBarOffset()

Definition at line 613 of file TH1.h.

◆ SetBinContent() [1/3]

void TH2Poly::SetBinContent ( Int_t bin,
Double_t content )
overridevirtualinherited

Sets the contents of the input bin to the input content Negative values between -1 and -9 are for the overflows and the sea.

Reimplemented from TH2.

Definition at line 1377 of file TH2Poly.cxx.

◆ SetBinContent() [2/3]

void TH2Poly::SetBinContent ( Int_t ,
Int_t ,
Double_t  )
inlineoverrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2.

Definition at line 151 of file TH2Poly.h.

◆ SetBinContent() [3/3]

void TH2Poly::SetBinContent ( Int_t ,
Int_t ,
Int_t ,
Double_t  )
inlineoverrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH2.

Definition at line 152 of file TH2Poly.h.

◆ SetBinContentChanged()

void TH2Poly::SetBinContentChanged ( Bool_t flag)
inlineinherited

Definition at line 121 of file TH2Poly.h.

◆ SetBinError() [1/3]

void TH2Poly::SetBinError ( Int_t bin,
Double_t error )
overridevirtualinherited

Set the bin Error.

Re-implementation for TH2Poly given the different bin indexing in the stored squared error array. See also notes in TH1::SetBinError

Bins are in range [1:nbins] and for bin < 0 in the range [-9:-1] the errors is set for the overflow bins

Reimplemented from TH1.

Definition at line 879 of file TH2Poly.cxx.

◆ SetBinError() [2/3]

void TH2Poly::SetBinError ( Int_t ,
Int_t ,
Double_t  )
inlineoverrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 153 of file TH2Poly.h.

◆ SetBinError() [3/3]

void TH2Poly::SetBinError ( Int_t ,
Int_t ,
Int_t ,
Double_t  )
inlineoverrideprotectedvirtualinherited

NOT IMPLEMENTED for TH2Poly.

Reimplemented from TH1.

Definition at line 154 of file TH2Poly.h.

◆ SetBinErrorOption()

virtual void TH1::SetBinErrorOption ( EBinErrorOpt type)
inlinevirtualinherited

Definition at line 629 of file TH1.h.

◆ SetBins() [1/6]

void TH1::SetBins ( Int_t nx,
const Double_t * xBins )
virtualinherited

Redefine x axis parameters with variable bin sizes.

The X axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange xBins is supposed to be of length nx+1

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 8931 of file TH1.cxx.

◆ SetBins() [2/6]

void TH1::SetBins ( Int_t nx,
const Double_t * xBins,
Int_t ny,
const Double_t * yBins )
virtualinherited

Redefine x and y axis parameters with variable bin sizes.

The X and Y axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange xBins is supposed to be of length nx+1, yBins is supposed to be of length ny+1

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 8985 of file TH1.cxx.

◆ SetBins() [3/6]

void TH1::SetBins ( Int_t nx,
const Double_t * xBins,
Int_t ny,
const Double_t * yBins,
Int_t nz,
const Double_t * zBins )
virtualinherited

Redefine x, y and z axis parameters with variable bin sizes.

The X, Y and Z axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange xBins is supposed to be of length nx+1, yBins is supposed to be of length ny+1, zBins is supposed to be of length nz+1

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 9042 of file TH1.cxx.

◆ SetBins() [4/6]

void TH1::SetBins ( Int_t nx,
Double_t xmin,
Double_t xmax )
virtualinherited

Redefine x axis parameters.

The X axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 8904 of file TH1.cxx.

◆ SetBins() [5/6]

void TH1::SetBins ( Int_t nx,
Double_t xmin,
Double_t xmax,
Int_t ny,
Double_t ymin,
Double_t ymax )
virtualinherited

Redefine x and y axis parameters.

The X and Y axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 8957 of file TH1.cxx.

◆ SetBins() [6/6]

void TH1::SetBins ( Int_t nx,
Double_t xmin,
Double_t xmax,
Int_t ny,
Double_t ymin,
Double_t ymax,
Int_t nz,
Double_t zmin,
Double_t zmax )
virtualinherited

Redefine x, y and z axis parameters.

The X, Y and Z axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 9012 of file TH1.cxx.

◆ SetBinsLength()

virtual void TH1::SetBinsLength ( Int_t = -1)
inlinevirtualinherited

Reimplemented in TH1C, TH1D, TH1F, TH1I, TH1L, TH1S, TH2C, TH2D, TH2F, TH2I, TH2L, TH2S, TH3C, TH3D, TH3F, TH3I, TH3L, TH3S, TProfile2D, TProfile3D, and TProfile.

Definition at line 628 of file TH1.h.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetBuffer()

void TH1::SetBuffer ( Int_t bufsize,
Option_t * option = "" )
virtualinherited

Set the maximum number of entries to be kept in the buffer.

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 8591 of file TH1.cxx.

◆ SetCanExtend()

UInt_t TH1::SetCanExtend ( UInt_t extendBitMask)
virtualinherited

Make the histogram axes extendable / not extendable according to the bit mask returns the previous bit mask specifying which axes are extendable.

Definition at line 6764 of file TH1.cxx.

◆ SetCellContent()

virtual void TH1::SetCellContent ( Int_t binx,
Int_t biny,
Double_t content )
inlinevirtualinherited

Definition at line 688 of file TH1.h.

◆ SetCellError()

virtual void TH1::SetCellError ( Int_t binx,
Int_t biny,
Double_t content )
inlinevirtualinherited

Definition at line 690 of file TH1.h.

◆ SetColors()

void TH1::SetColors ( Color_t linecolor = -1,
Color_t markercolor = -1,
Color_t fillcolor = -1 )
virtualinherited

Shortcut to set the three histogram colors with a single call.

By default: linecolor = markercolor = fillcolor = -1 If a color is < 0 this method does not change the corresponding color if positive or null it set the color.

For instance:

h->SetColors(kRed, kRed);
@ kRed
Definition Rtypes.h:67

will set the line color and the marker color to red.

Definition at line 4522 of file TH1.cxx.

◆ SetContent()

void TH1::SetContent ( const Double_t * content)
virtualinherited

Replace bin contents by the contents of array content.

Definition at line 8531 of file TH1.cxx.

◆ SetContentToAverage()

void TProfile2Poly::SetContentToAverage ( )

Set content to average.

Definition at line 303 of file TProfile2Poly.cxx.

◆ SetContentToError()

void TProfile2Poly::SetContentToError ( )

Set content to error.

Definition at line 321 of file TProfile2Poly.cxx.

◆ SetContour()

void TH1::SetContour ( Int_t nlevels,
const Double_t * levels = nullptr )
virtualinherited

Set the number and values of contour levels.

By default the number of contour levels is set to 20. The contours values in the array "levels" should be specified in increasing order.

if argument levels = 0 or missing, nlevels equidistant contours are computed between zmin and zmax - dz, both included, with step dz = (zmax - zmin)/nlevels. Note that contour lines are not centered, but contour surfaces (when drawing with COLZ) will be, since contour color i covers the region of values between contour line i and i+1.

Definition at line 8620 of file TH1.cxx.

◆ SetContourLevel()

void TH1::SetContourLevel ( Int_t level,
Double_t value )
virtualinherited

Set value for one contour level.

Definition at line 8659 of file TH1.cxx.

◆ SetDefaultBufferSize()

void TH1::SetDefaultBufferSize ( Int_t bufsize = 1000)
staticinherited

Static function to set the default buffer size for automatic histograms.

When a histogram is created with one of its axis lower limit greater or equal to its upper limit, the function SetBuffer is automatically called with the default buffer size.

Definition at line 6808 of file TH1.cxx.

◆ SetDefaultSumw2()

void TH1::SetDefaultSumw2 ( Bool_t sumw2 = kTRUE)
staticinherited

When this static function is called with sumw2=kTRUE, all new histograms will automatically activate the storage of the sum of squares of errors, ie TH1::Sumw2 is automatically called.

Definition at line 6818 of file TH1.cxx.

◆ SetDirectory()

void TH1::SetDirectory ( TDirectory * dir)
virtualinherited

By default, when a histogram is created, it is added to the list of histogram objects in the current directory in memory.

Remove reference to this histogram from current directory and add reference to new directory dir. dir can be 0 in which case the histogram does not belong to any directory.

Note that the directory is not a real property of the histogram and it will not be copied when the histogram is copied or cloned. If the user wants to have the copied (cloned) histogram in the same directory, he needs to set again the directory using SetDirectory to the copied histograms

Definition at line 9074 of file TH1.cxx.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in RooPlot, TAxis, TBrowser, TGedFrame, TGFrame, TPad, TPaveStats, TRootBrowserLite, TSystemDirectory, and TSystemFile.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetEntries()

virtual void TH1::SetEntries ( Double_t n)
inlinevirtualinherited

Definition at line 639 of file TH1.h.

◆ SetError()

void TH1::SetError ( const Double_t * error)
virtualinherited

Replace bin errors by values in array error.

Definition at line 9088 of file TH1.cxx.

◆ SetErrorOption()

void TProfile2Poly::SetErrorOption ( EErrorType type)

Set error option.

Definition at line 522 of file TProfile2Poly.cxx.

◆ SetFillAttributes()

virtual void TAttFill::SetFillAttributes ( )
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ SetFillColor() [1/2]

virtual void TAttFill::SetFillColor ( Color_t fcolor)
inlinevirtualinherited

Set the fill area color.

Reimplemented in TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSpider, TSVG, TTeXDump, and TVirtualX.

Definition at line 40 of file TAttFill.h.

◆ SetFillColor() [2/2]

void TAttFill::SetFillColor ( TColorNumber )
inherited

◆ SetFillColorAlpha()

virtual void TAttFill::SetFillColorAlpha ( Color_t fcolor,
Float_t falpha )
virtualinherited

Reimplemented in TGraphMultiErrors.

◆ SetFillStyle()

virtual void TAttFill::SetFillStyle ( Style_t fstyle)
inlinevirtualinherited

Set the fill area style.

Reimplemented in TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPad, TSpider, and TVirtualX.

Definition at line 42 of file TAttFill.h.

◆ SetFloat()

void TH2Poly::SetFloat ( Bool_t flag = true)
inherited

When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.

Definition at line 1394 of file TH2Poly.cxx.

◆ SetHighlight()

void TH1::SetHighlight ( Bool_t set = kTRUE)
virtualinherited

Set highlight (enable/disable) mode for the histogram by default highlight mode is disable.

Definition at line 4537 of file TH1.cxx.

◆ SetLabelColor()

void TH1::SetLabelColor ( Color_t color = 1,
Option_t * axis = "X" )
virtualinherited

Set axis labels color.

axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 226 of file Haxis.cxx.

◆ SetLabelFont()

void TH1::SetLabelFont ( Style_t font = 62,
Option_t * axis = "X" )
virtualinherited

Set font number used to draw axis labels.

font : Text font code = 10*fontnumber + precision Font numbers must be between 1 and 14 precision = 1 fast hardware fonts (steps in the size) precision = 2 scalable and rotatable hardware fonts

The default font number is 62. axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 249 of file Haxis.cxx.

◆ SetLabelOffset()

void TH1::SetLabelOffset ( Float_t offset = 0.005,
Option_t * axis = "X" )
virtualinherited

Set offset between axis and axis' labels.

The offset is expressed as a percent of the pad height. axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 267 of file Haxis.cxx.

◆ SetLabelSize()

void TH1::SetLabelSize ( Float_t size = 0.02,
Option_t * axis = "X" )
virtualinherited

Set size of axis' labels.

The size is expressed as a percent of the pad height. axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 285 of file Haxis.cxx.

◆ SetLineAttributes()

virtual void TAttLine::SetLineAttributes ( )
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ SetLineColor() [1/2]

◆ SetLineColor() [2/2]

void TAttLine::SetLineColor ( TColorNumber lcolor)
inherited

◆ SetLineColorAlpha()

virtual void TAttLine::SetLineColorAlpha ( Color_t lcolor,
Float_t lalpha )
virtualinherited

Reimplemented in TGraphMultiErrors.

◆ SetLineStyle()

virtual void TAttLine::SetLineStyle ( Style_t lstyle)
inlinevirtualinherited

◆ SetLineWidth()

virtual void TAttLine::SetLineWidth ( Width_t lwidth)
inlinevirtualinherited

◆ SetMarkerAttributes()

virtual void TAttMarker::SetMarkerAttributes ( )
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ SetMarkerColor() [1/2]

virtual void TAttMarker::SetMarkerColor ( Color_t mcolor = 1)
inlinevirtualinherited

◆ SetMarkerColor() [2/2]

void TAttMarker::SetMarkerColor ( TColorNumber lcolor)
inherited

◆ SetMarkerColorAlpha()

virtual void TAttMarker::SetMarkerColorAlpha ( Color_t mcolor,
Float_t malpha )
virtualinherited

◆ SetMarkerSize()

virtual void TAttMarker::SetMarkerSize ( Size_t msize = 1)
inlinevirtualinherited

Set the marker size.

Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. They are meant to be very fast to draw and are always drawn with the same number of pixels; therefore this method does not apply on them.

Reimplemented in ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, ROOT::Experimental::REveTrackList, TEvePointSet, TEvePointSetArray, TEveTrackList, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TTeXDump, and TVirtualX.

Definition at line 48 of file TAttMarker.h.

◆ SetMarkerStyle()

virtual void TAttMarker::SetMarkerStyle ( Style_t mstyle = 1)
inlinevirtualinherited

◆ SetMaximum()

virtual void TH1::SetMaximum ( Double_t maximum = -1111)
inlinevirtualinherited

Definition at line 652 of file TH1.h.

◆ SetMinimum()

virtual void TH1::SetMinimum ( Double_t minimum = -1111)
inlinevirtualinherited

Definition at line 653 of file TH1.h.

◆ SetName()

void TH1::SetName ( const char * name)
overridevirtualinherited

Change the name of this histogram.

Reimplemented from TNamed.

Definition at line 9097 of file TH1.cxx.

◆ SetNameTitle()

void TH1::SetNameTitle ( const char * name,
const char * title )
overridevirtualinherited

Change the name and title of this histogram.

Reimplemented from TNamed.

Definition at line 9111 of file TH1.cxx.

◆ SetNdivisions()

void TH1::SetNdivisions ( Int_t n = 510,
Option_t * axis = "X" )
virtualinherited

Set the number of divisions to draw an axis.

ndiv : Number of divisions.

 n = N1 + 100*N2 + 10000*N3
 N1=number of primary divisions.
 N2=number of secondary divisions.
 N3=number of 3rd divisions.
     e.g.:
     nndi=0 --> no tick marks.
     nndi=2 --> 2 divisions, one tick mark in the middle
                of the axis.

axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 170 of file Haxis.cxx.

◆ SetNewBinAdded()

void TH2Poly::SetNewBinAdded ( Bool_t flag)
inlineinherited

Definition at line 123 of file TH2Poly.h.

◆ SetNormFactor()

virtual void TH1::SetNormFactor ( Double_t factor = 1)
inlinevirtualinherited

Definition at line 658 of file TH1.h.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetOption()

virtual void TH1::SetOption ( Option_t * option = " ")
inlinevirtualinherited

Definition at line 660 of file TH1.h.

◆ SetShowProjectionX()

void TH2::SetShowProjectionX ( Int_t nbins = 1)
virtualinherited

When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the projection along X corresponding to the mouse position along Y.

To stop the generation of the projections, delete the canvas containing the projection.

Parameters
nbinsnumber of bins in Y to sum across for the projection

Definition at line 2621 of file TH2.cxx.

◆ SetShowProjectionXY()

void TH2::SetShowProjectionXY ( Int_t nbinsY = 1,
Int_t nbinsX = 1 )
virtualinherited

When the mouse is moved in a pad containing a 2-d view of this histogram two canvases show the projection along X and Y corresponding to the mouse position along Y and X, respectively.

To stop the generation of the projections, delete the canvas containing the projection.

Parameters
nbinsYnumber of bins in Y to sum across for the x projection
nbinsXnumber of bins in X to sum across for the y projection

Definition at line 2654 of file TH2.cxx.

◆ SetShowProjectionY()

void TH2::SetShowProjectionY ( Int_t nbins = 1)
virtualinherited

When the mouse is moved in a pad containing a 2-d view of this histogram a second canvas shows the projection along Y corresponding to the mouse position along X.

To stop the generation of the projections, delete the canvas containing the projection.

Parameters
nbinsnumber of bins in X to sum across for the projection

Definition at line 2637 of file TH2.cxx.

◆ SetSliceContent()

template<typename ValueType>
void TH1::SetSliceContent ( const std::vector< Double_t > & values,
const std::vector< std::pair< Int_t, Int_t > > & sliceEdges,
ValueType * dataArray )
inlineprivateinherited

Sets the content of a slice of bins in a histogram.

This function allows setting the content of a slice of bins in a histogram by specifying the edges of the slice and the corresponding values to assign.

Template Parameters
ValueTypeThe type of the histogram's data.
Parameters
valuesA vector of values to assign to the bins in the specified slice.
sliceEdgesA vector of pairs specifying the low and upper edges of the slice for each dimension.
dataArrayA pointer to the histogram's data array.

Definition at line 301 of file TH1.h.

◆ SetStatOverflows()

void TH1::SetStatOverflows ( EStatOverflows statOverflows)
inlineinherited

See GetStatOverflows for more information.

Definition at line 665 of file TH1.h.

◆ SetStats()

void TH1::SetStats ( Bool_t stats = kTRUE)
virtualinherited

Set statistics option on/off.

By default, the statistics box is drawn. The paint options can be selected via gStyle->SetOptStat. This function sets/resets the kNoStats bit in the histogram object. It has priority over the Style option.

Definition at line 9127 of file TH1.cxx.

◆ SetTickLength()

void TH1::SetTickLength ( Float_t length = 0.02,
Option_t * axis = "X" )
virtualinherited

Set the axis' tick marks length.

axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 302 of file Haxis.cxx.

◆ SetTitle()

void TH1::SetTitle ( const char * title)
overridevirtualinherited

Change/set the title.

If title is in the form stringt;stringx;stringy;stringz;stringc the histogram title is set to stringt, the x axis title to stringx, the y axis title to stringy, the z axis title to stringz, and the c axis title for the palette is ignored at this stage. Note that you can use e.g. stringt;stringx if you only want to specify title and x axis title.

To insert the character ; in one of the titles, one should use #; or #semicolon.

Reimplemented from TNamed.

Definition at line 6836 of file TH1.cxx.

◆ SetTitleFont()

void TH1::SetTitleFont ( Style_t font = 62,
Option_t * axis = "X" )
virtualinherited

Set the axis' title font.

  • if axis =="x" set the X axis title font
  • if axis =="y" set the Y axis title font
  • if axis =="z" set the Z axis title font any other value of axis will set the pad title font

if axis="xyz" set all 3 axes

Definition at line 323 of file Haxis.cxx.

◆ SetTitleOffset()

void TH1::SetTitleOffset ( Float_t offset = 1,
Option_t * axis = "X" )
virtualinherited

Specify a parameter offset to control the distance between the axis and the axis' title.

  • offset = 1 means : use the default distance
  • offset = 1.2 means: the distance will be 1.2*(default distance)
  • offset = 0.8 means: the distance will be 0.8*(default distance)

axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes

Definition at line 345 of file Haxis.cxx.

◆ SetTitleSize()

void TH1::SetTitleSize ( Float_t size = 0.02,
Option_t * axis = "X" )
virtualinherited

Set the axis' title size.

  • if axis = "x" set the X axis title size
  • if axis = "y" set the Y axis title size
  • if axis = "z" set the Z axis title size

if axis ="xyz" set all 3 axes

Definition at line 365 of file Haxis.cxx.

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ SetXTitle()

virtual void TH1::SetXTitle ( const char * title)
inlinevirtualinherited

Definition at line 667 of file TH1.h.

◆ SetYTitle()

virtual void TH1::SetYTitle ( const char * title)
inlinevirtualinherited

Definition at line 668 of file TH1.h.

◆ SetZTitle()

virtual void TH1::SetZTitle ( const char * title)
inlinevirtualinherited

Definition at line 669 of file TH1.h.

◆ ShowBackground()

TH1 * TH1::ShowBackground ( Int_t niter = 20,
Option_t * option = "same" )
virtualinherited

This function calculates the background spectrum in this histogram.

The background is returned as a histogram.

Parameters
[in]niternumber of iterations (default value = 2) Increasing niter make the result smoother and lower.
[in]optionmay contain one of the following options
  • to set the direction parameter "BackDecreasingWindow". By default the direction is BackIncreasingWindow
  • filterOrder-order of clipping filter (default "BackOrder2") possible values= "BackOrder4" "BackOrder6" "BackOrder8"
  • "nosmoothing" - if selected, the background is not smoothed By default the background is smoothed.
  • smoothWindow - width of smoothing window, (default is "BackSmoothing3") possible values= "BackSmoothing5" "BackSmoothing7" "BackSmoothing9" "BackSmoothing11" "BackSmoothing13" "BackSmoothing15"
  • "nocompton" - if selected the estimation of Compton edge will be not be included (by default the compton estimation is set)
  • "same" if this option is specified, the resulting background histogram is superimposed on the picture in the current pad. This option is given by default.

NOTE that the background is only evaluated in the current range of this histogram. i.e., if this has a bin range (set via h->GetXaxis()->SetRange(binmin, binmax), the returned histogram will be created with the same number of bins as this input histogram, but only bins from binmin to binmax will be filled with the estimated background.

Definition at line 9421 of file TH1.cxx.

◆ ShowBackground2D()

TH1 * TH2::ShowBackground2D ( Int_t nIterX = 20,
Int_t nIterY = 20,
Option_t * option = "same" )
virtualinherited

This function calculates the background spectrum in this histogram.

The background is returned as a histogram.

Definition at line 2665 of file TH2.cxx.

◆ ShowPeaks()

Int_t TH2::ShowPeaks ( Double_t sigma = 2,
Option_t * option = "",
Double_t threshold = 0.05 )
overridevirtualinherited

Interface to TSpectrum2::Search the function finds peaks in this histogram where the width is > sigma and the peak maximum greater than threshold*maximum bin content of this.

for more details see TSpectrum::Search. note the difference in the default value for option compared to TSpectrum2::Search option="" by default (instead of "goff")

Reimplemented from TH1.

Definition at line 2682 of file TH2.cxx.

◆ Sizeof()

Int_t TNamed::Sizeof ( ) const
virtualinherited

Return size of the TNamed part of the TObject.

Reimplemented in TDirectory, TDirectoryFile, TFile, TKey, TSQLFile, and TXMLFile.

Definition at line 182 of file TNamed.cxx.

◆ SliceHistoInPlace()

template<typename ValueType>
void TH1::SliceHistoInPlace ( std::vector< Int_t > & args,
ValueType *& dataArray,
Int_t & fN )
inlineprivateinherited

Slices a histogram in place based on the specified bin ranges for each dimension.

This function modifies the histogram by extracting a sub-region defined by the provided bin ranges for each dimension. The resulting histogram will have updated bin counts, edges, and contents. Bin contents outside the range fall into the flow bins. The histogram's internal data array is freed and reallocated by this function. This function is used by the python implementation of the Unified Histogram Interface (UHI) for slicing.

Template Parameters
ValueTypeThe type of the histogram's data.
Parameters
argsA vector of integers specifying the low and upper edges of the slice for each dimension.
dataArrayA pointer to the histogram's data array.
fNThe size of dataArray.

Definition at line 206 of file TH1.h.

◆ Smooth()

void TH2::Smooth ( Int_t ntimes = 1,
Option_t * option = "" )
overridevirtualinherited

Smooth bin contents of this 2-d histogram using kernel algorithms similar to the ones used in the raster graphics community.

Bin contents in the active range are replaced by their smooth values. The algorithm retains the input dimension by using Kernel Crop at the input boundaries. Kernel Crop sets any pixel in the kernel that extends past the input to zero and adjusts the normalization accordingly. If Errors are defined via Sumw2, they are also scaled and computed. However, note the resulting errors will be correlated between different-bins, so the errors should not be used blindly to perform any calculation involving several bins, like fitting the histogram. One would need to compute also the bin by bin correlation matrix.

3 kernels are proposed k5a, k5b and k3a. k5a and k5b act on 5x5 cells (i-2,i-1,i,i+1,i+2, and same for j) k5b is a bit more stronger in smoothing k3a acts only on 3x3 cells (i-1,i,i+1, and same for j). By default the kernel "k5a" is used. You can select the kernels "k5b" or "k3a" via the option argument. If TAxis::SetRange has been called on the x or/and y axis, only the bins in the specified range are smoothed. In the current implementation if the first argument is not used (default value=1).

implementation by David McKee (dmcke.nosp@m.e@ba.nosp@m.ma.ua.nosp@m..edu). Extended by Rene Brun

Reimplemented from TH1.

Definition at line 2714 of file TH2.cxx.

◆ SmoothArray()

void TH1::SmoothArray ( Int_t nn,
Double_t * xx,
Int_t ntimes = 1 )
staticinherited

Smooth array xx, translation of Hbook routine hsmoof.F.

Based on algorithm 353QH twice presented by J. Friedman in Proc. of the 1974 CERN School of Computing, Norway, 11-24 August, 1974. See also Section 4.2 in J. Friedman, Data Analysis Techniques for High Energy Physics.

Definition at line 6893 of file TH1.cxx.

◆ StatOverflows()

void TH1::StatOverflows ( Bool_t flag = kTRUE)
staticinherited

if flag=kTRUE, underflows and overflows are used by the Fill functions in the computation of statistics (mean value, StdDev).

By default, underflows or overflows are not used.

Definition at line 7050 of file TH1.cxx.

◆ Streamer()

void TProfile2Poly::Streamer ( TBuffer & R__b)
overridevirtual

Stream an object of class TH2.

Reimplemented from TH2Poly.

◆ StreamerNVirtual()

void TProfile2Poly::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 115 of file TProfile2Poly.h.

◆ Sumw2()

void TH1::Sumw2 ( Bool_t flag = kTRUE)
virtualinherited

Create structure to store sum of squares of weights.

if histogram is already filled, the sum of squares of weights is filled with the existing bin contents

The error per bin will be computed as sqrt(sum of squares of weight) for each bin.

This function is automatically called when the histogram is created if the static function TH1::SetDefaultSumw2 has been called before. If flag = false the structure containing the sum of the square of weights is rest and it will be empty, but it is not deleted (i.e. GetSumw2()->fN = 0)

Reimplemented in TProfile2D, TProfile3D, and TProfile.

Definition at line 9157 of file TH1.cxx.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ TransformHisto()

TH1 * TH1::TransformHisto ( TVirtualFFT * fft,
TH1 * h_output,
Option_t * option )
staticinherited

For a given transform (first parameter), fills the histogram (second parameter) with the transform output data, specified in the third parameter If the 2nd parameter h_output is empty, a new histogram (TH1D or TH2D) is created and the user is responsible for deleting it.

Available options:

  • "RE" - real part of the output
  • "IM" - imaginary part of the output
  • "MAG" - magnitude of the output
  • "PH" - phase of the output

Definition at line 9453 of file TH1.cxx.

◆ UpdateBinContent()

void TH2Poly::UpdateBinContent ( Int_t bin,
Double_t content )
inlineoverrideprotectedvirtualinherited

Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin.

Implements TH1.

Definition at line 182 of file TH2Poly.h.

◆ UseCurrentStyle()

void TH1::UseCurrentStyle ( )
overridevirtualinherited

Copy current attributes from/to current style.

Reimplemented from TObject.

Definition at line 7582 of file TH1.cxx.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Write() [1/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
virtualinherited

Write this object to the current directory.

For more see the const version of this method.

Reimplemented in ROOT::TBufferMergerFile, TBuffer, TCollection, TDirectory, TDirectoryFile, TFile, TMap, TParallelMergingFile, TSQLFile, TTree, and TXMLFile.

Definition at line 989 of file TObject.cxx.

◆ Write() [2/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
virtualinherited

Write this object to the current directory.

The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".

Writing an object to a file involves the following steps:

  • Creation of a support TKey object in the current directory. The TKey object creates a TBuffer object.
  • The TBuffer object is filled via the class::Streamer function.
  • If the file is compressed (default) a second buffer is created to hold the compressed buffer.
  • Reservation of the corresponding space in the file by looking in the TFree list of free blocks of the file.
  • The buffer is written to the file.

Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.

If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().

The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.

An object is read from the file into memory via TKey::Read() or via TObject::Read().

The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.

Reimplemented in TBuffer, TCollection, TDirectory, TDirectoryFile, TFile, TMap, TParallelMergingFile, TSQLFile, TTree, and TXMLFile.

Definition at line 964 of file TObject.cxx.

◆ TProfile2PolyBin

friend class TProfile2PolyBin
friend

Definition at line 59 of file TProfile2Poly.h.

◆ TProfileHelper

friend class TProfileHelper
friend

Definition at line 62 of file TProfile2Poly.h.

Member Data Documentation

◆ fBarOffset

Short_t TH1::fBarOffset
protectedinherited

(1000*offset) for bar charts or legos

Definition at line 154 of file TH1.h.

◆ fBarWidth

Short_t TH1::fBarWidth
protectedinherited

(1000*width) for bar charts or legos

Definition at line 155 of file TH1.h.

◆ fBinContentChanged

Bool_t TH2Poly::fBinContentChanged
protectedinherited

!For the 3D Painter

Definition at line 171 of file TH2Poly.h.

◆ fBins

TList* TH2Poly::fBins
protectedinherited

List of bins. The list owns the contained objects.

Definition at line 172 of file TH2Poly.h.

◆ fBinStatErrOpt

EBinErrorOpt TH1::fBinStatErrOpt
protectedinherited

Option for bin statistical errors.

Definition at line 174 of file TH1.h.

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fBuffer

Double_t* TH1::fBuffer
protectedinherited

[fBufferSize] entry buffer

Definition at line 169 of file TH1.h.

◆ fBufferSize

Int_t TH1::fBufferSize
protectedinherited

fBuffer size

Definition at line 168 of file TH1.h.

◆ fCells

TList* TH2Poly::fCells
protectedinherited

[fNCells] The array of TLists that store the bins that intersect with each cell. List do not own the contained objects

Definition at line 165 of file TH2Poly.h.

◆ fCellX

Int_t TH2Poly::fCellX
protectedinherited

Number of partition cells in the x-direction of the histogram.

Definition at line 162 of file TH2Poly.h.

◆ fCellY

Int_t TH2Poly::fCellY
protectedinherited

Number of partition cells in the y-direction of the histogram.

Definition at line 163 of file TH2Poly.h.

◆ fCompletelyInside

Bool_t* TH2Poly::fCompletelyInside
protectedinherited

[fNCells] The array that returns true if the cell at the given coordinate is completely inside a bin

Definition at line 168 of file TH2Poly.h.

◆ fContour

TArrayD TH1::fContour
protectedinherited

Array to display contour levels.

Definition at line 164 of file TH1.h.

◆ fDimension

Int_t TH1::fDimension
protectedinherited

! Histogram dimension (1, 2 or 3 dim)

Definition at line 171 of file TH1.h.

◆ fDirectory

TDirectory* TH1::fDirectory
protectedinherited

! Pointer to directory holding this histogram

Definition at line 170 of file TH1.h.

◆ fEntries

Double_t TH1::fEntries
protectedinherited

Number of entries.

Definition at line 156 of file TH1.h.

◆ fErrorMode

EErrorType TProfile2Poly::fErrorMode = kERRORMEAN
private

Definition at line 104 of file TProfile2Poly.h.

◆ fFillColor

Color_t TAttFill::fFillColor
protectedinherited

Fill area color.

Definition at line 24 of file TAttFill.h.

◆ fFillStyle

Style_t TAttFill::fFillStyle
protectedinherited

Fill area style.

Definition at line 25 of file TAttFill.h.

◆ fFloat

Bool_t TH2Poly::fFloat
protectedinherited

When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.

Definition at line 169 of file TH2Poly.h.

◆ fFunctions

TList* TH1::fFunctions
protectedinherited

->Pointer to list of functions (fits and user)

Definition at line 167 of file TH1.h.

◆ fgAddDirectory

Bool_t TH1::fgAddDirectory = kTRUE
staticprotectedinherited

! Flag to add histograms to the directory

Definition at line 177 of file TH1.h.

◆ fgBufferSize

Int_t TH1::fgBufferSize = 1000
staticprotectedinherited

! Default buffer size for automatic histograms

Definition at line 176 of file TH1.h.

◆ fgDefaultSumw2

Bool_t TH1::fgDefaultSumw2 = kFALSE
staticprotectedinherited

! Flag to call TH1::Sumw2 automatically at histogram creation time

Definition at line 179 of file TH1.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fgStatOverflows

Bool_t TH1::fgStatOverflows = kFALSE
staticprotectedinherited

! Flag to use under/overflows in statistics

Definition at line 178 of file TH1.h.

◆ fIntegral

Double_t* TH1::fIntegral
protectedinherited

! Integral of bins used by GetRandom

Definition at line 172 of file TH1.h.

◆ fIsEmpty

Bool_t* TH2Poly::fIsEmpty
protectedinherited

[fNCells] The array that returns true if the cell at the given coordinate is empty

Definition at line 167 of file TH2Poly.h.

◆ fLineColor

Color_t TAttLine::fLineColor
protectedinherited

Line color.

Definition at line 24 of file TAttLine.h.

◆ fLineStyle

Style_t TAttLine::fLineStyle
protectedinherited

Line style.

Definition at line 25 of file TAttLine.h.

◆ fLineWidth

Width_t TAttLine::fLineWidth
protectedinherited

Line width.

Definition at line 26 of file TAttLine.h.

◆ fMarkerColor

Color_t TAttMarker::fMarkerColor
protectedinherited

Marker color.

Definition at line 24 of file TAttMarker.h.

◆ fMarkerSize

Size_t TAttMarker::fMarkerSize
protectedinherited

Marker size.

Definition at line 26 of file TAttMarker.h.

◆ fMarkerStyle

Style_t TAttMarker::fMarkerStyle
protectedinherited

Marker style.

Definition at line 25 of file TAttMarker.h.

◆ fMaximum

Double_t TH1::fMaximum
protectedinherited

Maximum value for plotting.

Definition at line 161 of file TH1.h.

◆ fMinimum

Double_t TH1::fMinimum
protectedinherited

Minimum value for plotting.

Definition at line 162 of file TH1.h.

◆ fName

TString TNamed::fName
protectedinherited

Definition at line 32 of file TNamed.h.

◆ fNCells

Int_t TH2Poly::fNCells
protectedinherited

Number of partition cells: fCellX*fCellY.

Definition at line 164 of file TH2Poly.h.

◆ fNcells

Int_t TH1::fNcells
protectedinherited

Number of bins(1D), cells (2D) +U/Overflows.

Definition at line 150 of file TH1.h.

◆ fNewBinAdded

Bool_t TH2Poly::fNewBinAdded
protectedinherited

!For the 3D Painter

Definition at line 170 of file TH2Poly.h.

◆ fNormFactor

Double_t TH1::fNormFactor
protectedinherited

Normalization factor.

Definition at line 163 of file TH1.h.

◆ fOption

TString TH1::fOption
protectedinherited

Histogram options.

Definition at line 166 of file TH1.h.

◆ fOverflow

Double_t TH2Poly::fOverflow[kNOverflow]
protectedinherited

Overflow bins.

Definition at line 161 of file TH2Poly.h.

◆ fOverflowBins

TProfile2PolyBin TProfile2Poly::fOverflowBins[kNOverflow]
private

Definition at line 103 of file TProfile2Poly.h.

◆ fPainter

TVirtualHistPainter* TH1::fPainter
protectedinherited

! Pointer to histogram painter

Definition at line 173 of file TH1.h.

◆ fScalefactor

Double_t TH2::fScalefactor
protectedinherited

Scale factor.

Definition at line 33 of file TH2.h.

◆ fStatOverflows

EStatOverflows TH1::fStatOverflows
protectedinherited

Per object flag to use under/overflows in statistics.

Definition at line 175 of file TH1.h.

◆ fStepX

Double_t TH2Poly::fStepX
protectedinherited

Definition at line 166 of file TH2Poly.h.

◆ fStepY

Double_t TH2Poly::fStepY
protectedinherited

Dimensions of a partition cell.

Definition at line 166 of file TH2Poly.h.

◆ fSumw2

TArrayD TH1::fSumw2
protectedinherited

Array of sum of squares of weights.

Definition at line 165 of file TH1.h.

◆ fTitle

TString TNamed::fTitle
protectedinherited

Definition at line 33 of file TNamed.h.

◆ fTsumw

Double_t TH1::fTsumw
protectedinherited

Total Sum of weights.

Definition at line 157 of file TH1.h.

◆ fTsumw2

Double_t TH1::fTsumw2
protectedinherited

Total Sum of squares of weights.

Definition at line 158 of file TH1.h.

◆ fTsumwx

Double_t TH1::fTsumwx
protectedinherited

Total Sum of weight*X.

Definition at line 159 of file TH1.h.

◆ fTsumwx2

Double_t TH1::fTsumwx2
protectedinherited

Total Sum of weight*X*X.

Definition at line 160 of file TH1.h.

◆ fTsumwxy

Double_t TH2::fTsumwxy
protectedinherited

Total Sum of weight*X*Y.

Definition at line 36 of file TH2.h.

◆ fTsumwy

Double_t TH2::fTsumwy
protectedinherited

Total Sum of weight*Y.

Definition at line 34 of file TH2.h.

◆ fTsumwy2

Double_t TH2::fTsumwy2
protectedinherited

Total Sum of weight*Y*Y.

Definition at line 35 of file TH2.h.

◆ fTsumwz

Double_t TProfile2Poly::fTsumwz
private

Definition at line 105 of file TProfile2Poly.h.

◆ fTsumwz2

Double_t TProfile2Poly::fTsumwz2
private

Definition at line 106 of file TProfile2Poly.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.

◆ fXaxis

TAxis TH1::fXaxis
protectedinherited

X axis descriptor.

Definition at line 151 of file TH1.h.

◆ fYaxis

TAxis TH1::fYaxis
protectedinherited

Y axis descriptor.

Definition at line 152 of file TH1.h.

◆ fZaxis

TAxis TH1::fZaxis
protectedinherited

Z axis descriptor.

Definition at line 153 of file TH1.h.


The documentation for this class was generated from the following files: