ROOT
6.06/09
Reference Guide
|
2D Histogram with Polygonal Bins
TH2Poly
is a 2D Histogram class (TH2) allowing to define polygonal bins of arbitrary shape.
Each bin in the TH2Poly
histogram is a TH2PolyBin
object. TH2PolyBin
is a very simple class containing the vertices (stored as TGraph
s or TMultiGraph
s ) and contents of the polygonal bin as well as several related functions.
Essentially, a TH2Poly
is a TList of TH2PolyBin
objects with methods to manipulate them.
Bins are defined using one of the AddBin()
methods. The bin definition should be done before filling.
The histogram can be filled with Fill(Double_t x, Double_t y, Double_t w)
. w
is the weight. If no weight is specified, it is assumed to be 1.
Not all histogram's area need to be binned. Filling an area without bins, will falls into the overflows. Adding a bin is not retroactive; it doesn't affect previous fillings. A Fill()
call, that was previously ignored due to the lack of a bin at the specified location, is not reconsidered when that location is binned later.
If there are two overlapping bins, the first one in the list will be incremented by Fill()
.
The histogram may automatically extends its limits if a bin outside the histogram limits is added. This is done when the default constructor (with no arguments) is used. It generates a histogram with no limits along the X and Y axis. Adding bins to it will extend it up to a proper size.
TH2Poly
implements a partitioning algorithm to speed up bins' filling. The partitioning algorithm divides the histogram into regions called cells. The bins that each cell intersects are recorded in an array of TList
s. When a coordinate in the histogram is to be filled; the method (quickly) finds which cell the coordinate belongs. It then only loops over the bins intersecting that cell to find the bin the input coordinate corresponds to. The partitioning of the histogram is updated continuously as each bin is added. The default number of cells on each axis is 25. This number could be set to another value in the constructor or adjusted later by calling the ChangePartition(Int_t, Int_t)
method. The partitioning algorithm is considerably faster than the brute force algorithm (i.e. checking if each bin contains the input coordinates), especially if the histogram is to be filled many times.
The following very simple macro shows how to build and fill a TH2Poly
:
More examples can bin found in $ROOTSYS/tutorials/hist/th2poly*.C
The partitioning algorithm forms an essential part of the TH2Poly
class. It is implemented to speed up the filling of bins.
With the brute force approach, the filling is done in the following way: An iterator loops over all bins in the TH2Poly
and invokes the method IsInside()
for each of them. This method checks if the input location is in that bin. If the filling coordinate is inside, the bin is filled. Looping over all the bin is very slow.
The alternative is to divide the histogram into virtual rectangular regions called "cells". Each cell stores the pointers of the bins intersecting it. When a coordinate is to be filled, the method finds which cell the coordinate falls into. Since the cells are rectangular, this can be done very quickly. It then only loops over the bins associated with that cell.
The addition of bins to the appropriate cells is done when the bin is added to the histogram. To do this, AddBin()
calls the AddBinToPartition()
method. This method adds the input bin to the partitioning matrix.
The number of partition cells per axis can be specified in the constructor. If it is not specified, the default value of 25 along each axis will be assigned. This value was chosen because it is small enough to avoid slowing down AddBin(), while being large enough to enhance Fill() by a considerable amount. Regardless of how it is initialized at construction time, it can be changed later with the ChangePartition()
method. ChangePartition()
deletes the old partition matrix and generates a new one with the specified number of cells on each axis.
The optimum number of partition cells per axis changes with the number of times Fill()
will be called. Although partitioning greatly speeds up filling, it also adds a constant time delay into the code. When Fill()
is to be called many times, it is more efficient to divide the histogram into a large number cells. However, if the histogram is to be filled only a few times, it is better to divide into a small number of cells.
Public Member Functions | |
TH2Poly () | |
TH2Poly (const char *name, const char *title, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup) | |
Constructor with specified name and boundaries, but no partition cell number. More... | |
TH2Poly (const char *name, const char *title, Int_t nX, Double_t xlow, Double_t xup, Int_t nY, Double_t ylow, Double_t yup) | |
Constructor with specified name and boundaries and partition cell number. More... | |
virtual | ~TH2Poly () |
Destructor. More... | |
Int_t | AddBin (TObject *poly) |
Adds a new bin to the histogram. More... | |
Int_t | AddBin (Int_t n, const Double_t *x, const Double_t *y) |
Adds a new bin to the histogram. More... | |
Int_t | AddBin (Double_t x1, Double_t y1, Double_t x2, Double_t y2) |
Add a new bin to the histogram. More... | |
virtual Bool_t | Add (const TH1 *h1, Double_t c1) |
Performs the operation: this = this + c1*h1. More... | |
virtual Bool_t | Add (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1) |
Replace contents of this histogram by the addition of h1 and h2. More... | |
virtual Bool_t | Add (TF1 *h1, Double_t c1=1, Option_t *option="") |
Performs the operation: this = this + c1*f1. More... | |
void | ClearBinContents () |
Clears the contents of all bins in the histogram. More... | |
TObject * | Clone (const char *newname="") const |
Make a complete copy of the underlying object. More... | |
void | ChangePartition (Int_t n, Int_t m) |
Changes the number of partition cells in the histogram. More... | |
Int_t | Fill (Double_t x, Double_t y) |
Increment the bin containing (x,y) by 1. More... | |
Int_t | Fill (Double_t x, Double_t y, Double_t w) |
Increment the bin containing (x,y) by w. More... | |
Int_t | Fill (const char *name, Double_t w) |
Increment the bin named "name" by w. More... | |
void | FillN (Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1) |
Fills a 2-D histogram with an array of values and weights. More... | |
Int_t | Fill (Double_t) |
Invalid Fill method. More... | |
Int_t | Fill (Double_t, const char *, Double_t) |
Increment cell defined by x,namey by a weight w. More... | |
Int_t | Fill (const char *, Double_t, Double_t) |
Increment cell defined by namex,y by a weight w. More... | |
Int_t | Fill (const char *, const char *, Double_t) |
Increment cell defined by namex,namey by a weight w. More... | |
void | FillN (Int_t, const Double_t *, const Double_t *, Int_t) |
Fill this histogram with an array x and weights w. More... | |
Int_t | FindBin (Double_t x, Double_t y, Double_t z=0) |
Returns the bin number of the bin at the given coordinate. More... | |
TList * | GetBins () |
Double_t | GetBinContent (Int_t bin) const |
Returns the content of the input bin For the overflow/underflow/sea bins: -1 | -2 | -3
---+----+----
-4 | -5 | -6
---+----+----
-7 | -8 | -9
where -5 is the "sea" bin (i.e. More... | |
Double_t | GetBinContent (Int_t, Int_t) const |
Double_t | GetBinContent (Int_t, Int_t, Int_t) const |
Bool_t | GetBinContentChanged () const |
Double_t | GetBinError (Int_t bin) const |
Returns the value of error associated to bin number bin. More... | |
Double_t | GetBinError (Int_t, Int_t) const |
Double_t | GetBinError (Int_t, Int_t, Int_t) const |
const char * | GetBinName (Int_t bin) const |
Returns the bin name. More... | |
const char * | GetBinTitle (Int_t bin) const |
Returns the bin title. More... | |
Bool_t | GetFloat () |
Double_t | GetMaximum () const |
Returns the maximum value of the histogram. More... | |
Double_t | GetMaximum (Double_t maxval) const |
Returns the maximum value of the histogram that is less than maxval. More... | |
Double_t | GetMinimum () const |
Returns the minimum value of the histogram. More... | |
Double_t | GetMinimum (Double_t minval) const |
Returns the minimum value of the histogram that is greater than minval. More... | |
Bool_t | GetNewBinAdded () const |
Int_t | GetNumberOfBins () const |
void | Honeycomb (Double_t xstart, Double_t ystart, Double_t a, Int_t k, Int_t s) |
Bins the histogram using a honeycomb structure. More... | |
Double_t | Integral (Option_t *option="") const |
Returns the integral of bin contents. More... | |
Double_t | Integral (Int_t, Int_t, const Option_t *) const |
Double_t | Integral (Int_t, Int_t, Int_t, Int_t, const Option_t *) const |
Double_t | Integral (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, const Option_t *) const |
Long64_t | Merge (TCollection *) |
TH2Poly cannot be merged. More... | |
void | Reset (Option_t *option) |
Reset this histogram: contents, errors, etc. More... | |
void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save primitive as a C++ statement(s) on output stream out. More... | |
virtual void | Scale (Double_t c1=1, Option_t *option="") |
Multiply this histogram by a constant c1. More... | |
void | SetBinContent (Int_t bin, Double_t content) |
Sets the contents of the input bin to the input content Negative values between -1 and -9 are for the overflows and the sea. More... | |
void | SetBinContent (Int_t, Int_t, Double_t) |
void | SetBinContent (Int_t, Int_t, Int_t, Double_t) |
void | SetBinContentChanged (Bool_t flag) |
void | SetFloat (Bool_t flag=true) |
When set to kTRUE, allows the histogram to expand if a bin outside the limits is added. More... | |
void | SetNewBinAdded (Bool_t flag) |
Public Member Functions inherited from TH2 | |
virtual | ~TH2 () |
Destructor. More... | |
virtual Int_t | BufferEmpty (Int_t action=0) |
Fill histogram with all entries in the buffer. More... | |
virtual void | Copy (TObject &hnew) const |
Copy. More... | |
virtual void | FillRandom (const char *fname, Int_t ntimes=5000) |
Fill histogram following distribution in function fname. More... | |
virtual void | FillRandom (TH1 *h, Int_t ntimes=5000) |
Fill histogram following distribution in histogram h. More... | |
virtual Int_t | FindFirstBinAbove (Double_t threshold=0, Int_t axis=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. More... | |
virtual Int_t | FindLastBinAbove (Double_t threshold=0, Int_t axis=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. More... | |
virtual void | FitSlicesX (TF1 *f1=0, Int_t firstybin=0, Int_t lastybin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=0) |
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. More... | |
virtual void | FitSlicesY (TF1 *f1=0, Int_t firstxbin=0, Int_t lastxbin=-1, Int_t cut=0, Option_t *option="QNR", TObjArray *arr=0) |
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. More... | |
virtual Int_t | GetBin (Int_t binx, Int_t biny, Int_t binz=0) const |
Return Global bin number corresponding to binx,y,z. More... | |
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. More... | |
virtual Double_t | GetBinErrorLow (Int_t binx, Int_t biny) |
virtual Double_t | GetBinErrorUp (Int_t binx, Int_t biny) |
virtual Double_t | GetCorrelationFactor (Int_t axis1=1, Int_t axis2=2) const |
Return correlation factor between axis1 and axis2. More... | |
virtual Double_t | GetCovariance (Int_t axis1=1, Int_t axis2=2) const |
Return covariance between axis1 and axis2. More... | |
virtual void | GetRandom2 (Double_t &x, Double_t &y) |
Return 2 random numbers along axis x and y distributed according the cellcontents of a 2-dim histogram return a NaN if the histogram has a bin with negative content. More... | |
virtual void | GetStats (Double_t *stats) const |
Fill the array stats from the contents of this histogram The array stats must be correctly dimensionned in the calling program. More... | |
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. More... | |
virtual Double_t | Integral (Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Option_t *="") const |
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. More... | |
virtual Double_t | Interpolate (Double_t x) |
illegal for a TH2 More... | |
virtual Double_t | Interpolate (Double_t x, Double_t y) |
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. More... | |
virtual Double_t | Interpolate (Double_t x, Double_t y, Double_t z) |
illegal for a TH2 More... | |
virtual Double_t | KolmogorovTest (const TH1 *h2, Option_t *option="") const |
Statistical test of compatibility in shape between THIS histogram and h2, using Kolmogorov test. More... | |
virtual TH2 * | RebinX (Int_t ngroup=2, const char *newname="") |
Rebin only the X axis see Rebin2D. More... | |
virtual TH2 * | RebinY (Int_t ngroup=2, const char *newname="") |
Rebin only the Y axis see Rebin2D. More... | |
virtual TH2 * | Rebin2D (Int_t nxgroup=2, Int_t nygroup=2, const char *newname="") |
Rebin this histogram grouping nxgroup/nygroup bins along the xaxis/yaxis together. More... | |
TProfile * | ProfileX (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. More... | |
TProfile * | ProfileY (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. More... | |
TH1D * | ProjectionX (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. More... | |
TH1D * | ProjectionY (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. More... | |
virtual void | PutStats (Double_t *stats) |
Replace current statistics with the values in array stats. More... | |
TH1D * | QuantilesX (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. More... | |
TH1D * | QuantilesY (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. More... | |
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. More... | |
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. More... | |
virtual TH1 * | ShowBackground (Int_t niter=20, Option_t *option="same") |
This function calculates the background spectrum in this histogram. More... | |
virtual Int_t | ShowPeaks (Double_t sigma=2, Option_t *option="", Double_t threshold=0.05) |
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. More... | |
virtual void | Smooth (Int_t ntimes=1, Option_t *option="") |
Smooth bin contents of this 2-d histogram using kernel algorithms similar to the ones used in the raster graphics community. More... | |
Public Member Functions inherited from TH1 | |
virtual | ~TH1 () |
Histogram default destructor. More... | |
virtual void | AddBinContent (Int_t bin) |
Increment bin content by 1. More... | |
virtual void | AddBinContent (Int_t bin, Double_t w) |
Increment bin content by a weight w. More... | |
virtual void | Browse (TBrowser *b) |
Browe the Histogram object. More... | |
virtual Bool_t | CanExtendAllAxes () const |
returns true if all axes are extendable More... | |
virtual Double_t | Chi2Test (const TH1 *h2, Option_t *option="UU", Double_t *res=0) const |
chi^{2} test for comparing weighted and unweighted histograms More... | |
virtual Double_t | Chi2TestX (const TH1 *h2, Double_t &chi2, Int_t &ndf, Int_t &igood, Option_t *option="UU", Double_t *res=0) const |
The computation routine of the Chisquare test. More... | |
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. More... | |
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. More... | |
virtual Double_t | ComputeIntegral (Bool_t onlyPositive=false) |
Compute integral (cumulative sum of bins) The result stored in fIntegral is used by the GetRandom functions. More... | |
virtual void | DirectoryAutoAdd (TDirectory *) |
Perform the automatic addition of the histogram to the given directory. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Compute distance from point px,py to a line. More... | |
virtual Bool_t | Divide (TF1 *f1, Double_t c1=1) |
Performs the operation: this = this/(c1*f1) if errors are defined (see TH1::Sumw2), errors are also recalculated. More... | |
virtual Bool_t | Divide (const TH1 *h1) |
Divide this histogram by h1. More... | |
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. More... | |
virtual void | Draw (Option_t *option="") |
Draw this histogram with options. More... | |
virtual TH1 * | DrawCopy (Option_t *option="", const char *name_postfix="_copy") const |
Copy this histogram and Draw in the current pad. More... | |
virtual TH1 * | DrawNormalized (Option_t *option="", Double_t norm=1) const |
Draw a normalized copy of this histogram. More... | |
virtual void | DrawPanel () |
Display a panel with all histogram drawing options. More... | |
virtual void | Eval (TF1 *f1, Option_t *option="") |
Evaluate function f1 at the center of bins of this histogram. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to one event. More... | |
virtual void | ExtendAxis (Double_t x, TAxis *axis) |
Histogram is resized along axis such that x is in the axis range. More... | |
virtual TH1 * | FFT (TH1 *h_output, Option_t *option) |
This function allows to do discrete Fourier transforms of TH1 and TH2. More... | |
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. More... | |
virtual TObject * | FindObject (const char *name) const |
search object named name in the list of functions More... | |
virtual TObject * | FindObject (const TObject *obj) const |
search object obj in the list of functions More... | |
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. More... | |
virtual TFitResultPtr | Fit (TF1 *f1, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0) |
Fit histogram with function f1. More... | |
virtual void | FitPanel () |
Display a panel with all histogram fit options. More... | |
TH1 * | GetAsymmetry (TH1 *h2, Double_t c2=1, Double_t dc2=0) |
Return an histogram containing the asymmetry of this histogram with h2, where the asymmetry is defined as: More... | |
Int_t | GetBufferLength () const |
Int_t | GetBufferSize () const |
const Double_t * | GetBuffer () const |
virtual Double_t * | GetIntegral () |
Return a pointer to the array of bins integral. More... | |
TH1 * | GetCumulative (Bool_t forward=kTRUE, const char *suffix="_cumulative") const |
Return a pointer to an histogram containing the cumulative 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. More... | |
TList * | GetListOfFunctions () const |
virtual Int_t | GetNdivisions (Option_t *axis="X") const |
Return the number of divisions for "axis". More... | |
virtual Color_t | GetAxisColor (Option_t *axis="X") const |
Return the number of divisions for "axis". More... | |
virtual Color_t | GetLabelColor (Option_t *axis="X") const |
Return the "axis" label color. More... | |
virtual Style_t | GetLabelFont (Option_t *axis="X") const |
Return the "axis" label font. More... | |
virtual Float_t | GetLabelOffset (Option_t *axis="X") const |
Return the "axis" label offset. More... | |
virtual Float_t | GetLabelSize (Option_t *axis="X") const |
Return the "axis" label size. More... | |
virtual Style_t | GetTitleFont (Option_t *axis="X") const |
Return the "axis" title font. More... | |
virtual Float_t | GetTitleOffset (Option_t *axis="X") const |
Return the "axis" title offset. More... | |
virtual Float_t | GetTitleSize (Option_t *axis="X") const |
Return the "axis" title size. More... | |
virtual Float_t | GetTickLength (Option_t *axis="X") const |
Return the "axis" tick length. More... | |
virtual Float_t | GetBarOffset () const |
virtual Float_t | GetBarWidth () const |
virtual Int_t | GetContour (Double_t *levels=0) |
Return contour values into array levels if pointer levels is non zero. More... | |
virtual Double_t | GetContourLevel (Int_t level) const |
Return value of contour number level use GetContour to return the array of all contour levels. More... | |
virtual Double_t | GetContourLevelPad (Int_t level) const |
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. More... | |
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 More... | |
virtual Double_t | GetBinCenter (Int_t bin) const |
return bin center for 1D historam Better to use h1.GetXaxis().GetBinCenter(bin) More... | |
virtual Double_t | GetBinErrorLow (Int_t bin) const |
Return lower error associated to bin number bin. More... | |
virtual Double_t | GetBinErrorUp (Int_t bin) const |
Return upper error associated to bin number bin. More... | |
virtual EBinErrorOpt | GetBinErrorOption () const |
virtual Double_t | GetBinLowEdge (Int_t bin) const |
return bin lower edge for 1D historam Better to use h1.GetXaxis().GetBinLowEdge(bin) More... | |
virtual Double_t | GetBinWidth (Int_t bin) const |
return bin width for 1D historam Better to use h1.GetXaxis().GetBinWidth(bin) More... | |
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 In case several bins in the specified range with diff=0 are found the first bin found is returned in binx. More... | |
virtual void | GetCenter (Double_t *center) const |
Fill array with center of bins for 1D histogram Better to use h1.GetXaxis().GetCenter(center) More... | |
TDirectory * | GetDirectory () const |
virtual Double_t | GetEntries () const |
return the current number of entries More... | |
virtual Double_t | GetEffectiveEntries () const |
number of effective entries of the histogram, neff = (Sum of weights )^2 / (Sum of weight^2 ) In case of an unweighted histogram this number is equivalent to the number of entries of the histogram. More... | |
virtual TF1 * | GetFunction (const char *name) const |
Return pointer to function with name. More... | |
virtual Int_t | GetDimension () const |
virtual Double_t | GetKurtosis (Int_t axis=1) const |
For axis =1, 2 or 3 returns kurtosis of the histogram along x, y or z axis. More... | |
virtual void | GetLowEdge (Double_t *edge) const |
Fill array with low edge of bins for 1D histogram Better to use h1.GetXaxis().GetLowEdge(edge) More... | |
virtual Int_t | GetMaximumBin () const |
Return location of bin with maximum value in the range. More... | |
virtual Int_t | GetMaximumBin (Int_t &locmax, Int_t &locmay, Int_t &locmaz) const |
Return location of bin with maximum value in the range. More... | |
virtual Double_t | GetMaximumStored () const |
virtual Int_t | GetMinimumBin () const |
Return location of bin with minimum value in the range. More... | |
virtual Int_t | GetMinimumBin (Int_t &locmix, Int_t &locmiy, Int_t &locmiz) const |
Return location of bin with minimum value in the range. More... | |
virtual Double_t | GetMinimumStored () 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. More... | |
virtual Double_t | GetMeanError (Int_t axis=1) const |
Return standard error of mean of this histogram along the X axis. More... | |
virtual Int_t | GetNbinsX () const |
virtual Int_t | GetNbinsY () const |
virtual Int_t | GetNbinsZ () const |
virtual Int_t | GetNcells () const |
virtual Double_t | GetNormFactor () const |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Redefines TObject::GetObjectInfo. More... | |
Option_t * | GetOption () const |
TVirtualHistPainter * | GetPainter (Option_t *option="") |
return pointer to painter if painter does not exist, it is created More... | |
virtual Int_t | GetQuantiles (Int_t nprobSum, Double_t *q, const Double_t *probSum=0) |
Compute Quantiles for this histogram Quantile x_q of a probability distribution Function F is defined as. More... | |
virtual Double_t | GetRandom () const |
return a random number distributed according the histogram bin contents. More... | |
virtual Double_t | GetStdDev (Int_t axis=1) const |
Returns the Standard Deviation (Sigma). More... | |
virtual Double_t | GetStdDevError (Int_t axis=1) const |
Return error of standard deviation estimation for Normal distribution. More... | |
virtual Double_t | GetSumOfWeights () const |
Return the sum of weights excluding under/overflows. More... | |
virtual TArrayD * | GetSumw2 () |
virtual const TArrayD * | GetSumw2 () const |
virtual Int_t | GetSumw2N () const |
Double_t | GetRMS (Int_t axis=1) const |
Double_t | GetRMSError (Int_t axis=1) const |
virtual Double_t | GetSkewness (Int_t axis=1) const |
For axis = 1, 2 or 3 returns skewness of the histogram along x, y or z axis. More... | |
TAxis * | GetXaxis () |
TAxis * | GetYaxis () |
TAxis * | GetZaxis () |
const TAxis * | GetXaxis () const |
const TAxis * | GetYaxis () const |
const TAxis * | GetZaxis () const |
virtual Double_t | Integral (Int_t binx1, Int_t binx2, Option_t *option="") const |
Return integral of bin contents in range [binx1,binx2] By default the integral is computed as the sum of bin contents in the range. More... | |
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 By default the integral is computed as the sum of bin contents in the range. More... | |
Bool_t | IsBinOverflow (Int_t bin) const |
Bool_t | IsBinUnderflow (Int_t bin) const |
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. More... | |
virtual Double_t | AndersonDarlingTest (const TH1 *h2, Double_t &advalue) const |
Same funciton as above but returning also the test statistic value. More... | |
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. More... | |
virtual void | LabelsInflate (Option_t *axis="X") |
Double the number of bins for axis. More... | |
virtual void | LabelsOption (Option_t *option="h", Option_t *axis="X") |
Set option(s) to draw axis with labels. More... | |
virtual Bool_t | Multiply (TF1 *h1, Double_t c1=1) |
Performs the operation: this = this*c1*f1 if errors are defined (see TH1::Sumw2), errors are also recalculated. More... | |
virtual Bool_t | Multiply (const TH1 *h1) |
Multiply this histogram by h1. More... | |
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. More... | |
virtual void | Paint (Option_t *option="") |
Control routine to paint any kind of histograms. More... | |
virtual void | Print (Option_t *option="") const |
Print some global quantities for this histogram. More... | |
virtual TH1 * | Rebin (Int_t ngroup=2, const char *newname="", const Double_t *xbins=0) |
Rebin this histogram. More... | |
virtual void | Rebuild (Option_t *option="") |
Using the current bin info, recompute the arrays for contents and errors. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove object from the list of functions. More... | |
virtual void | ResetStats () |
Reset the statistics including the number of entries and replace with values calculates 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. More... | |
virtual void | SetAxisColor (Color_t color=1, Option_t *axis="X") |
Set color to draw the axis line and tick marks. More... | |
virtual void | SetAxisRange (Double_t xmin, Double_t xmax, Option_t *axis="X") |
Set the "axis" range. More... | |
virtual void | SetBarOffset (Float_t offset=0.25) |
virtual void | SetBarWidth (Float_t width=0.5) |
virtual void | SetBinError (Int_t bin, Double_t error) |
see convention for numbering bins in TH1::GetBin More... | |
virtual void | SetBinError (Int_t binx, Int_t biny, Double_t error) |
see convention for numbering bins in TH1::GetBin More... | |
virtual void | SetBinError (Int_t binx, Int_t biny, Int_t binz, Double_t error) |
see convention for numbering bins in TH1::GetBin More... | |
virtual void | SetBins (Int_t nx, Double_t xmin, Double_t xmax) |
Redefine x axis parameters. More... | |
virtual void | SetBins (Int_t nx, const Double_t *xBins) |
Redefine x axis parameters with variable bin sizes. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual void | SetBinsLength (Int_t=-1) |
virtual void | SetBinErrorOption (EBinErrorOpt type) |
virtual void | SetBuffer (Int_t buffersize, Option_t *option="") |
set the maximum number of entries to be kept in the buffer More... | |
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 More... | |
virtual void | SetContent (const Double_t *content) |
Replace bin contents by the contents of array content. More... | |
virtual void | SetContour (Int_t nlevels, const Double_t *levels=0) |
Set the number and values of contour levels. More... | |
virtual void | SetContourLevel (Int_t level, Double_t value) |
Set value for one contour level. More... | |
virtual void | SetDirectory (TDirectory *dir) |
By default when an histogram is created, it is added to the list of histogram objects in the current directory in memory. More... | |
virtual void | SetEntries (Double_t n) |
virtual void | SetError (const Double_t *error) |
Replace bin errors by values in array error. More... | |
virtual void | SetLabelColor (Color_t color=1, Option_t *axis="X") |
Set axis labels color. More... | |
virtual void | SetLabelFont (Style_t font=62, Option_t *axis="X") |
Set font number used to draw axis labels. More... | |
virtual void | SetLabelOffset (Float_t offset=0.005, Option_t *axis="X") |
Set offset between axis and axis' labels. More... | |
virtual void | SetLabelSize (Float_t size=0.02, Option_t *axis="X") |
Set size of axis' labels. More... | |
virtual void | SetMaximum (Double_t maximum=-1111) |
virtual void | SetMinimum (Double_t minimum=-1111) |
virtual void | SetName (const char *name) |
Change the name of this histogram. More... | |
virtual void | SetNameTitle (const char *name, const char *title) |
Change the name and title of this histogram. More... | |
virtual void | SetNdivisions (Int_t n=510, Option_t *axis="X") |
Set the number of divisions to draw an axis. More... | |
virtual void | SetNormFactor (Double_t factor=1) |
virtual void | SetStats (Bool_t stats=kTRUE) |
Set statistics option on/off. More... | |
virtual void | SetOption (Option_t *option=" ") |
virtual void | SetTickLength (Float_t length=0.02, Option_t *axis="X") |
Set the axis' tick marks length. More... | |
virtual void | SetTitleFont (Style_t font=62, Option_t *axis="X") |
The the axis' title font. More... | |
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. More... | |
virtual void | SetTitleSize (Float_t size=0.02, Option_t *axis="X") |
The the axis' title size. More... | |
virtual void | SetTitle (const char *title) |
Change (i.e. More... | |
virtual void | SetXTitle (const char *title) |
virtual void | SetYTitle (const char *title) |
virtual void | SetZTitle (const char *title) |
virtual void | Sumw2 (Bool_t flag=kTRUE) |
Create structure to store sum of squares of weights. More... | |
void | UseCurrentStyle () |
Copy current attributes from/to current style. More... | |
virtual Double_t | GetCellContent (Int_t binx, Int_t biny) const |
virtual Double_t | GetCellError (Int_t binx, Int_t biny) const |
virtual void | RebinAxis (Double_t x, TAxis *axis) |
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 Double_t | GetBinErrorSqUnchecked (Int_t bin) const |
Public Member Functions inherited from TNamed | |
TNamed () | |
TNamed (const char *name, const char *title) | |
TNamed (const TString &name, const TString &title) | |
TNamed (const TNamed &named) | |
TNamed & | operator= (const TNamed &rhs) |
TNamed assignment operator. More... | |
virtual | ~TNamed () |
virtual void | Clear (Option_t *option="") |
Set name and title to empty strings (""). More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare two TNamed objects. More... | |
virtual void | FillBuffer (char *&buffer) |
Encode TNamed into output buffer. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual Bool_t | IsSortable () const |
virtual void | ls (Option_t *option="") const |
List TNamed name and title. More... | |
virtual Int_t | Sizeof () const |
Return size of the TNamed part of the TObject. More... | |
Public Member Functions inherited from TObject | |
TObject () | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current pad. More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
Bool_t | IsOnHeap () const |
Bool_t | IsZombie () const |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
void * | operator new (size_t sz) |
void * | operator new[] (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz, void *vp) |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
void | SetBit (UInt_t f) |
void | ResetBit (UInt_t f) |
Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
void | InvertBit (UInt_t f) |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
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). More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
Public Member Functions inherited from TAttLine | |
TAttLine () | |
AttLine default constructor. More... | |
TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth) | |
AttLine normal constructor. More... | |
virtual | ~TAttLine () |
AttLine destructor. More... | |
void | Copy (TAttLine &attline) const |
Copy this line attributes to a new TAttLine. More... | |
Int_t | DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2) |
Compute distance from point px,py to a line. More... | |
virtual Color_t | GetLineColor () const |
virtual Style_t | GetLineStyle () const |
virtual Width_t | GetLineWidth () const |
virtual void | Modify () |
Change current line attributes if necessary. More... | |
virtual void | ResetAttLine (Option_t *option="") |
Reset this line attributes to default values. More... | |
virtual void | SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1) |
Save line attributes as C++ statement(s) on output stream out. More... | |
virtual void | SetLineAttributes () |
Invoke the DialogCanvas Line attributes. More... | |
virtual void | SetLineColor (Color_t lcolor) |
virtual void | SetLineColorAlpha (Color_t lcolor, Float_t lalpha) |
Set a transparent line color. More... | |
virtual void | SetLineStyle (Style_t lstyle) |
virtual void | SetLineWidth (Width_t lwidth) |
ClassDef (TAttLine, 2) | |
Public Member Functions inherited from TAttFill | |
TAttFill () | |
TAttFill (Color_t fcolor, Style_t fstyle) | |
AttFill normal constructor. More... | |
virtual | ~TAttFill () |
AttFill destructor. More... | |
void | Copy (TAttFill &attfill) const |
Copy this fill attributes to a new TAttFill. More... | |
virtual Color_t | GetFillColor () const |
virtual Style_t | GetFillStyle () const |
virtual Bool_t | IsTransparent () const |
virtual void | Modify () |
Change current fill area attributes if necessary. More... | |
virtual void | ResetAttFill (Option_t *option="") |
Reset this fill attributes to default values. More... | |
virtual void | SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001) |
Save fill attributes as C++ statement(s) on output stream out. More... | |
virtual void | SetFillAttributes () |
Invoke the DialogCanvas Fill attributes. More... | |
virtual void | SetFillColor (Color_t fcolor) |
virtual void | SetFillColorAlpha (Color_t fcolor, Float_t falpha) |
Set a transparent fill color. More... | |
virtual void | SetFillStyle (Style_t fstyle) |
Public Member Functions inherited from TAttMarker | |
TAttMarker () | |
TAttMarker (Color_t color, Style_t style, Size_t msize) | |
TAttMarker normal constructor. More... | |
virtual | ~TAttMarker () |
TAttMarker destructor. More... | |
void | Copy (TAttMarker &attmarker) const |
Copy this marker attributes to a new TAttMarker. More... | |
virtual Color_t | GetMarkerColor () const |
virtual Style_t | GetMarkerStyle () const |
virtual Size_t | GetMarkerSize () const |
virtual void | Modify () |
Change current marker attributes if necessary. More... | |
virtual void | ResetAttMarker (Option_t *toption="") |
Reset this marker attributes to the default values. More... | |
virtual void | SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1) |
Save line attributes as C++ statement(s) on output stream out. More... | |
virtual void | SetMarkerAttributes () |
Invoke the DialogCanvas Marker attributes. More... | |
virtual void | SetMarkerColor (Color_t mcolor=1) |
virtual void | SetMarkerColorAlpha (Color_t mcolor, Float_t malpha) |
Set a transparent marker color. More... | |
virtual void | SetMarkerStyle (Style_t mstyle=1) |
virtual void | SetMarkerSize (Size_t msize=1) |
ClassDef (TAttMarker, 2) | |
Protected Member Functions | |
void | AddBinToPartition (TH2PolyBin *bin) |
For the 3D Painter. More... | |
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. More... | |
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) More... | |
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) More... | |
virtual Double_t | RetrieveBinContent (Int_t bin) const |
virtual void | UpdateBinContent (Int_t bin, Double_t content) |
raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin More... | |
Protected Member Functions inherited from TH2 | |
TH2 () | |
TH2 (const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup) | |
See comments in the TH1 base class constructors. More... | |
TH2 (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Int_t nbinsy, Double_t ylow, Double_t yup) | |
See comments in the TH1 base class constructors. More... | |
TH2 (const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, const Double_t *ybins) | |
See comments in the TH1 base class constructors. More... | |
TH2 (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Int_t nbinsy, const Double_t *ybins) | |
See comments in the TH1 base class constructors. More... | |
TH2 (const char *name, const char *title, Int_t nbinsx, const Float_t *xbins, Int_t nbinsy, const Float_t *ybins) | |
See comments in the TH1 base class constructors. More... | |
virtual Int_t | BufferFill (Double_t x, Double_t y, Double_t w) |
accumulate arguments in buffer. More... | |
virtual TH1D * | DoProjection (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. More... | |
virtual TProfile * | DoProfile (bool onX, const char *name, Int_t firstbin, Int_t lastbin, Option_t *option) const |
virtual TH1D * | DoQuantiles (bool onX, const char *name, Double_t prob) const |
Implementation of quantiles for x or y. More... | |
virtual void | DoFitSlices (bool onX, TF1 *f1, Int_t firstbin, Int_t lastbin, Int_t cut, Option_t *option, TObjArray *arr) |
Int_t | BufferFill (Double_t, Double_t) |
accumulate arguments in buffer. More... | |
Protected Member Functions inherited from TH1 | |
TH1 () | |
TH1 (const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup) | |
Normal constructor for fix bin size histograms. More... | |
TH1 (const char *name, const char *title, Int_t nbinsx, const Float_t *xbins) | |
Normal constructor for variable bin size histograms. More... | |
TH1 (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins) | |
Normal constructor for variable bin size histograms. More... | |
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). More... | |
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. More... | |
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) More... | |
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 More... | |
Protected Member Functions inherited from TObject | |
void | MakeZombie () |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
Additional Inherited Members | |
Public Types inherited from TH1 | |
enum | EBinErrorOpt { kNormal = 0, kPoisson = 1, kPoisson2 = 2 } |
enum | { kNoAxis = 0, kXaxis = BIT(0), kYaxis = BIT(1), kZaxis = BIT(2), kAllAxes = kXaxis | kYaxis | kZaxis } |
enum | { kNoStats = BIT(9), kUserContour = BIT(10), kLogX = BIT(15), kIsZoomed = BIT(16), kNoTitle = BIT(17), kIsAverage = BIT(18), kIsNotW = BIT(19) } |
enum | { kNstat = 13 } |
Public Types inherited from TObject | |
enum | EStatusBits { kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4), kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13) } |
enum | { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) } |
Static Public Member Functions inherited from TH1 | |
static Int_t | FitOptionsMake (Option_t *option, Foption_t &Foption) |
flag to call TH1::Sumw2 automatically at histogram creation time More... | |
static void | AddDirectory (Bool_t add=kTRUE) |
Sets the flag controlling the automatic add of histograms in memory. More... | |
static Bool_t | AddDirectoryStatus () |
static function: cannot be inlined on Windows/NT More... | |
static Int_t | GetDefaultBufferSize () |
static function return the default buffer size for automatic histograms the parameter fgBufferSize may be changed via SetDefaultBufferSize More... | |
static Bool_t | GetDefaultSumw2 () |
return kTRUE if TH1::Sumw2 must be called when creating new histograms. More... | |
static void | SetDefaultBufferSize (Int_t buffersize=1000) |
static function to set the default buffer size for automatic histograms. More... | |
static void | SetDefaultSumw2 (Bool_t sumw2=kTRUE) |
static function. More... | |
static void | SmoothArray (Int_t NN, Double_t *XX, Int_t ntimes=1) |
smooth array xx, translation of Hbook routine hsmoof.F based on algorithm 353QH twice presented by J. More... | |
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). More... | |
static TH1 * | TransformHisto (TVirtualFFT *fft, TH1 *h_output, Option_t *option) |
For a given transform (first parameter), fills the histogram (second parameter) with the transform 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. More... | |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
Static Protected Member Functions inherited from TH1 | |
static Bool_t | RecomputeAxisLimits (TAxis &destAxis, const TAxis &anAxis) |
Finds new limits for the axis for the Merge function. More... | |
static Bool_t | SameLimitsAndNBins (const TAxis &axis1, const TAxis &axis2) |
Same limits and bins. More... | |
static bool | CheckAxisLimits (const TAxis *a1, const TAxis *a2) |
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. More... | |
static bool | CheckBinLimits (const TAxis *a1, const TAxis *a2) |
static bool | CheckBinLabels (const TAxis *a1, const TAxis *a2) |
check that axis have same labels More... | |
static bool | CheckEqualAxes (const TAxis *a1, const TAxis *a2) |
Check that the axis are the same. More... | |
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 the limits are defined by first bin and last bin N.B. More... | |
static bool | CheckConsistency (const TH1 *h1, const TH1 *h2) |
Check histogram compatibility. More... | |
Static Protected Attributes inherited from TH1 | |
static Int_t | fgBufferSize = 1000 |
static Bool_t | fgAddDirectory = kTRUE |
default buffer size for automatic histograms More... | |
static Bool_t | fgStatOverflows = kFALSE |
flag to add histograms to the directory More... | |
static Bool_t | fgDefaultSumw2 = kFALSE |
flag to use under/overflows in statistics More... | |
#include <TH2Poly.h>
TH2Poly::TH2Poly | ( | ) |
TH2Poly::TH2Poly | ( | const char * | name, |
const char * | title, | ||
Double_t | xlow, | ||
Double_t | xup, | ||
Double_t | ylow, | ||
Double_t | yup | ||
) |
Constructor with specified name and boundaries, but no partition cell number.
Definition at line 162 of file TH2Poly.cxx.
TH2Poly::TH2Poly | ( | const char * | name, |
const char * | title, | ||
Int_t | nX, | ||
Double_t | xlow, | ||
Double_t | xup, | ||
Int_t | nY, | ||
Double_t | ylow, | ||
Double_t | yup | ||
) |
Constructor with specified name and boundaries and partition cell number.
Definition at line 174 of file TH2Poly.cxx.
|
virtual |
Destructor.
Definition at line 187 of file TH2Poly.cxx.
Performs the operation: this = this + c1*h1.
Reimplemented from TH1.
Definition at line 276 of file TH2Poly.cxx.
Replace contents of this histogram by the addition of h1 and h2.
Reimplemented from TH1.
Definition at line 334 of file TH2Poly.cxx.
Performs the operation: this = this + c1*f1.
Reimplemented from TH1.
Definition at line 325 of file TH2Poly.cxx.
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 202 of file TH2Poly.cxx.
Referenced by AddBin(), Honeycomb(), and testkdTreeBinning().
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 253 of file TH2Poly.cxx.
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 264 of file TH2Poly.cxx.
|
protected |
For the 3D Painter.
Adds the input bin into the partition cell matrix.
This method is called in AddBin() and ChangePartition().
Definition at line 344 of file TH2Poly.cxx.
Referenced by AddBin(), and ChangePartition().
Changes the number of partition cells in the histogram.
Deletes the old partition and constructs a new one.
Definition at line 416 of file TH2Poly.cxx.
Referenced by AddBin().
void TH2Poly::ClearBinContents | ( | ) |
Clears the contents of all bins in the histogram.
Definition at line 467 of file TH2Poly.cxx.
|
virtual |
Make a complete copy of the underlying object.
If 'newname' is set, the copy's name will be set to that name.
Reimplemented from TH1.
Definition at line 455 of file TH2Poly.cxx.
Increment the bin containing (x,y) by 1.
Uses the partitioning algorithm.
Reimplemented from TH2.
Definition at line 564 of file TH2Poly.cxx.
Referenced by FillN().
Increment the bin containing (x,y) by w.
Uses the partitioning algorithm.
Reimplemented from TH2.
Definition at line 573 of file TH2Poly.cxx.
Increment the bin named "name" by w.
Reimplemented from TH2.
Definition at line 636 of file TH2Poly.cxx.
Increment cell defined by x,namey by a weight w.
if x or/and y is less than the low-edge of the corresponding axis first bin, the Underflow cell is incremented. if x or/and y is greater than the upper edge of corresponding axis last bin, the Overflow cell is incremented.
If the weight is not equal to 1, the storage of the sum of squares of weights is automatically triggered and the sum of the squares of weights is incremented by w^2 in the bin corresponding to x,y.
The function returns the corresponding global bin number which has its content incremented by w
Reimplemented from TH2.
Increment cell defined by namex,y by a weight w.
if x or/and y is less than the low-edge of the corresponding axis first bin, the Underflow cell is incremented. if x or/and y is greater than the upper edge of corresponding axis last bin, the Overflow cell is incremented.
If the weight is not equal to 1, the storage of the sum of squares of weights is automatically triggered and the sum of the squares of weights is incremented by w^2 in the bin corresponding to namex,y
The function returns the corresponding global bin number which has its content incremented by w
Reimplemented from TH2.
Increment cell defined by namex,namey by a weight w.
if x or/and y is less than the low-edge of the corresponding axis first bin, the Underflow cell is incremented. if x or/and y is greater than the upper edge of corresponding axis last bin, the Overflow cell is incremented.
If the weight is not equal to 1, the storage of the sum of squares of weights is automatically triggered and the sum of the squares of weights is incremented by w^2 in the bin corresponding to namex,namey
The function returns the corresponding global bin number which has its content incremented by w
Reimplemented from TH2.
|
virtual |
Fills a 2-D histogram with an array of values and weights.
[in] | ntimes | number of entries in arrays x and w (array size must be ntimes*stride) |
[in] | x | array of x values to be histogrammed |
[in] | y | array of y values to be histogrammed |
[in] | w | array of weights |
[in] | stride | step size through arrays x, y and w |
Reimplemented from TH2.
Definition at line 667 of file TH2Poly.cxx.
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:
where -5 means is the "sea" bin (i.e. unbinned areas)
Reimplemented from TH1.
Definition at line 521 of file TH2Poly.cxx.
Referenced by THistPainter::DistancetoPrimitive(), and THistPainter::GetObjectInfo().
Returns the content of the input bin For the overflow/underflow/sea bins:
where -5 is the "sea" bin (i.e.
unbinned areas)
Reimplemented from TH2.
Definition at line 717 of file TH2Poly.cxx.
Referenced by GetBinError(), THistPainter::GetObjectInfo(), TGLH2PolyPainter::GetPlotInfo(), RetrieveBinContent(), SavePrimitive(), and Scale().
|
inline |
Definition at line 101 of file TH2Poly.h.
Referenced by TGLH2PolyPainter::InitGeometry().
Returns the value of error associated to bin number bin.
If the sum of squares of weights has been defined (via Sumw2), this function returns the sqrt(sum of w2). otherwise it returns the sqrt(contents) for this bin.
Reimplemented from TH1.
Definition at line 730 of file TH2Poly.cxx.
Referenced by Add(), and SavePrimitive().
const char * TH2Poly::GetBinName | ( | Int_t | bin | ) | const |
Returns the bin name.
Definition at line 746 of file TH2Poly.cxx.
|
inline |
Definition at line 97 of file TH2Poly.h.
Referenced by Add(), TGLH2PolyPainter::CacheGeometry(), and TGLH2PolyPainter::UpdateGeometry().
const char * TH2Poly::GetBinTitle | ( | Int_t | bin | ) | const |
Returns the bin title.
Definition at line 756 of file TH2Poly.cxx.
Referenced by THistPainter::GetObjectInfo(), and TGLH2PolyPainter::GetPlotInfo().
Double_t TH2Poly::GetMaximum | ( | ) | const |
Returns the maximum value of the histogram.
Definition at line 766 of file TH2Poly.cxx.
Returns the maximum value of the histogram that is less than maxval.
Reimplemented from TH1.
Definition at line 790 of file TH2Poly.cxx.
Double_t TH2Poly::GetMinimum | ( | ) | const |
Returns the minimum value of the histogram.
Definition at line 814 of file TH2Poly.cxx.
Returns the minimum value of the histogram that is greater than minval.
Reimplemented from TH1.
Definition at line 838 of file TH2Poly.cxx.
|
inline |
Definition at line 112 of file TH2Poly.h.
Referenced by TGLH2PolyPainter::InitGeometry().
|
inline |
Bins the histogram using a honeycomb structure.
Definition at line 862 of file TH2Poly.cxx.
|
protected |
Initializes the TH2Poly object. This method is called by the constructor.
Definition at line 910 of file TH2Poly.cxx.
Referenced by TH2Poly().
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 681 of file TH2Poly.cxx.
|
protected |
Returns kTRUE if the input bin is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt)
Definition at line 960 of file TH2Poly.cxx.
Referenced by AddBinToPartition().
|
protected |
Returns kTRUE if the input polygon (bn, x, y) is intersecting with the input rectangle (xclipl, xclipr, yclipb, yclipt)
Definition at line 1001 of file TH2Poly.cxx.
Referenced by IsIntersecting().
|
virtual |
Reset this histogram: contents, errors, etc.
Reimplemented from TH2.
Definition at line 491 of file TH2Poly.cxx.
Save primitive as a C++ statement(s) on output stream out.
Reimplemented from TH1.
Definition at line 1123 of file TH2Poly.cxx.
Multiply this histogram by a constant c1.
Reimplemented from TH1.
Definition at line 1183 of file TH2Poly.cxx.
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 1194 of file TH2Poly.cxx.
Referenced by Scale(), testkdTreeBinning(), and UpdateBinContent().
Definition at line 126 of file TH2Poly.h.
Referenced by Fill(), TGLH2PolyPainter::InitGeometry(), Initialize(), and SetBinContent().
When set to kTRUE, allows the histogram to expand if a bin outside the limits is added.
Definition at line 1208 of file TH2Poly.cxx.
Referenced by TH2Poly().
Definition at line 128 of file TH2Poly.h.
Referenced by AddBin(), TGLH2PolyPainter::InitGeometry(), and Initialize().
raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin
Reimplemented from TH1.
|
protected |
For the 3D Painter.
Definition at line 142 of file TH2Poly.h.
Referenced by GetBinContentChanged(), and SetBinContentChanged().
|
protected |
Definition at line 131 of file TH2Poly.h.
Referenced by Add(), AddBin(), ChangePartition(), ClearBinContents(), Fill(), GetBinContent(), GetBinName(), GetBins(), GetBinTitle(), GetMaximum(), GetMinimum(), Initialize(), Integral(), Reset(), SavePrimitive(), SetBinContent(), and ~TH2Poly().
|
protected |
Definition at line 136 of file TH2Poly.h.
Referenced by AddBinToPartition(), ChangePartition(), Fill(), FindBin(), Initialize(), and ~TH2Poly().
|
protected |
Definition at line 133 of file TH2Poly.h.
Referenced by AddBin(), AddBinToPartition(), ChangePartition(), Fill(), FindBin(), Initialize(), and SavePrimitive().
|
protected |
Definition at line 134 of file TH2Poly.h.
Referenced by AddBin(), AddBinToPartition(), ChangePartition(), Fill(), FindBin(), Initialize(), and SavePrimitive().
|
protected |
Definition at line 139 of file TH2Poly.h.
Referenced by AddBinToPartition(), ChangePartition(), Initialize(), and ~TH2Poly().
|
protected |
Definition at line 140 of file TH2Poly.h.
Referenced by AddBin(), GetFloat(), and SetFloat().
|
protected |
Definition at line 138 of file TH2Poly.h.
Referenced by AddBinToPartition(), ChangePartition(), Fill(), FindBin(), Initialize(), and ~TH2Poly().
|
protected |
Definition at line 135 of file TH2Poly.h.
Referenced by AddBinToPartition(), ChangePartition(), and Initialize().
|
protected |
Definition at line 141 of file TH2Poly.h.
Referenced by GetNewBinAdded(), and SetNewBinAdded().
|
protected |
Definition at line 132 of file TH2Poly.h.
Referenced by Fill(), GetBinContent(), Initialize(), and SetBinContent().
|
protected |
Definition at line 137 of file TH2Poly.h.
Referenced by AddBinToPartition(), ChangePartition(), Fill(), FindBin(), and Initialize().
|
protected |
Definition at line 137 of file TH2Poly.h.
Referenced by AddBinToPartition(), ChangePartition(), Fill(), FindBin(), and Initialize().