TH1
class description - source file - inheritance tree
private:
Int_t AxisChoice(Option_t* axis)
void Build()
Int_t FitOptionsMake(Option_t* option)
void PaintArrows()
void PaintBoxes()
void PaintColorLevels()
void PaintContour()
Int_t PaintContourLine(Float_t elev1, Int_t icont1, Float_t x1, Float_t y1, Float_t elev2, Int_t icont2, Float_t x2, Float_t y2, Float_t* xarr, Float_t* yarr, Int_t* itarr)
void PaintErrors()
void PaintFrame()
void PaintFunction()
void PaintH3(Option_t* option)
void PaintH3Box(Option_t* option)
void PaintHist()
void PaintLego()
void PaintLegoAxis(TGaxis* axis, Float_t ang)
void PaintScatterPlot()
void PaintSurface()
void PaintTable()
void PaintTitle()
void RecalculateRange()
Int_t TableInit()
protected:
virtual void Copy(TObject& hnew)
public:
TH1 TH1()
TH1 TH1(Text_t* name, Text_t* title, Int_t nbinsx, Axis_t xlow, Axis_t xup)
TH1 TH1(Text_t* name, Text_t* title, Int_t nbinsx, Axis_t* xbins)
TH1 TH1(TH1&)
virtual void ~TH1()
virtual void Add(TH1* h1, Float_t c1 = 1)
virtual void Add(TH1* h1, TH1* h2, Float_t c1 = 1, Float_t c2 = 1)
virtual void AddBinContent(Int_t bin)
virtual void AddBinContent(Int_t bin, Stat_t w)
virtual void Browse(TBrowser* b)
TClass* Class()
virtual Double_t ComputeIntegral()
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void Divide(TH1* h1)
virtual void Divide(TH1* h1, TH1* h2, Float_t c1 = 1, Float_t c2 = 1, Option_t* option)
virtual void Draw(Option_t* option)
virtual TH1* DrawCopy(Option_t* option)
virtual void DrawPanel()
virtual void Eval(TF1* f1, Option_t* option)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual Int_t Fill(Axis_t x)
virtual Int_t Fill(Axis_t x, Stat_t w)
virtual Int_t Fill(Axis_t x, Axis_t y, Stat_t w)
virtual Int_t Fill(Axis_t x, Axis_t y, Axis_t z, Stat_t w)
virtual Int_t Fill12(Axis_t x, Axis_t y)
virtual void FillN(Int_t ntimes, Axis_t* x, Double_t* w, Int_t stride = 1)
virtual void FillN(Int_t ntimes, Axis_t* x, Axis_t* y, Double_t* w, Int_t stride = 1)
void FillRandom(char* fname, Int_t ntimes = 5000)
void FillRandom(TH1* h, Int_t ntimes = 5000)
virtual void Fit(Text_t* formula, Option_t* option, Option_t* goption, Float_t xmin = 0, Float_t xmax = 0)
virtual void FitPanel()
virtual void FitSlicesX(TF1* f1 = 0, Int_t binmin = 1, Int_t binmax = 0, Int_t cut = 0, Option_t* option = QNR)
virtual void FitSlicesY(TF1* f1 = 0, Int_t binmin = 1, Int_t binmax = 0, Int_t cut = 0, Option_t* option = QNR)
virtual void FitSlicesZ(TF1* f1 = 0, Int_t binminx = 1, Int_t binmaxx = 0, Int_t binminy = 1, Int_t binmaxy = 0, Int_t cut = 0, Option_t* option = QNR)
virtual Color_t GetAxisColor(Option_t* axis = X)
virtual Float_t GetBarOffset()
virtual Float_t GetBarWidth()
virtual Int_t GetBin(Int_t binx, Int_t biny = 0, Int_t binz = 0)
virtual Axis_t GetBinCenter(Int_t bin)
virtual Stat_t GetBinContent(Int_t bin)
virtual Stat_t GetBinError(Int_t bin)
virtual Axis_t GetBinLowEdge(Int_t bin)
virtual Axis_t GetBinWidth(Int_t bin)
virtual Stat_t GetCellContent(Int_t binx, Int_t biny)
virtual Stat_t GetCellError(Int_t binx, Int_t biny)
virtual void GetCenter(Axis_t* center)
virtual Int_t GetContour(Float_t* levels = 0)
virtual Float_t GetContourLevel(Int_t level)
virtual Int_t GetDimension()
TDirectory* GetDirectory()
virtual Stat_t GetEntries()
virtual TF1* GetFunction(Text_t* name)
virtual Double_t* GetIntegral()
virtual Color_t GetLabelColor(Option_t* axis = X)
virtual Style_t GetLabelFont(Option_t* axis = X)
virtual Float_t GetLabelOffset(Option_t* axis = X)
virtual Float_t GetLabelSize(Option_t* axis = X)
TList* GetListOfFunctions()
virtual void GetLowEdge(Axis_t* edge)
virtual Float_t GetMaximum()
virtual Stat_t GetMean(Int_t axis = 1)
virtual Float_t GetMinimum()
virtual Int_t GetNbinsX()
virtual Int_t GetNbinsY()
virtual Int_t GetNbinsZ()
virtual Int_t GetNdivisions(Option_t* axis = X)
virtual Text_t* GetObjectInfo(Int_t px, Int_t py)
virtual Option_t* GetOption()
virtual Axis_t GetRandom()
virtual void GetRandom2(Axis_t& x, Axis_t& y)
virtual void GetRandom3(Axis_t& x, Axis_t& y, Axis_t& z)
virtual Stat_t GetRMS(Int_t axis = 1)
virtual void GetStats(Stat_t* stats)
virtual Stat_t GetSumOfWeights()
virtual Int_t GetSumw2N()
virtual Float_t GetTickLength(Option_t* axis = X)
virtual Float_t GetTitleOffset(Option_t* axis = X)
virtual TAxis* GetXaxis()
virtual TAxis* GetYaxis()
virtual TAxis* GetZaxis()
virtual Stat_t Integral()
virtual Stat_t Integral(Int_t binx1, Int_t binx2)
virtual Stat_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2)
virtual Stat_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2)
virtual TClass* IsA()
virtual Int_t MakeChopt(Option_t* option)
virtual void Multiply(TH1* h1)
virtual void Multiply(TH1* h1, TH1* h2, Float_t c1 = 1, Float_t c2 = 1, Option_t* option)
virtual void Paint(Option_t* option)
virtual void PaintAxis()
virtual Int_t PaintInit()
virtual void PaintPalette()
virtual void PaintStat(Int_t dostat, TF1* fit)
virtual void PaintStat2(Int_t dostat, TF1* fit)
virtual void Print(Option_t* option)
TProfile* ProfileX(char* name = _pfx, Int_t firstybin = 0, Int_t lastybin = 9999, Option_t* option)
TProfile* ProfileY(char* name = _pfy, Int_t firstxbin = 0, Int_t lastxbin = 9999, Option_t* option)
TH1D* ProjectionX(char* name = _px, Int_t firstybin = 0, Int_t lastybin = 9999, Option_t* option)
TH1D* ProjectionY(char* name = _py, Int_t firstxbin = 0, Int_t lastxbin = 9999, Option_t* option)
TH1D* ProjectionZ(char* name = _pz, Int_t firstxbin = 0, Int_t lastxbin = 9999, Int_t firstybin = 0, Int_t lastybin = 9999, Option_t* option)
TH1* Rebin(Int_t ngroup = 2, char* newname)
virtual void Reset(Option_t* option)
virtual void SavePrimitive(ofstream& out, Option_t* option)
virtual void Scale(Float_t c1 = 1)
virtual void SetAxisColor(Color_t color = 1, Option_t* axis = X)
virtual void SetAxisRange(Float_t xmin, Float_t xmax, Option_t* axis = X)
virtual void SetBarOffset(Float_t offset = 0.25)
virtual void SetBarWidth(Float_t width = 0.5)
virtual void SetBinContent(Int_t bin, Stat_t content)
virtual void SetBinError(Int_t bin, Stat_t error)
virtual void SetBins(Int_t nx, Float_t xmin, Float_t xmax)
virtual void SetBins(Int_t nx, Float_t xmin, Float_t xmax, Int_t ny, Float_t ymin, Float_t ymax)
virtual void SetBins(Int_t nx, Float_t xmin, Float_t xmax, Int_t ny, Float_t ymin, Float_t ymax, Int_t nz, Float_t zmin, Float_t zmax)
virtual void SetBinsLength(Int_t)
virtual void SetCellContent(Int_t binx, Int_t biny, Stat_t content)
virtual void SetCellError(Int_t binx, Int_t biny, Stat_t content)
virtual void SetContent(Stat_t* content)
virtual void SetContour(Int_t nlevels, Float_t* levels = 0)
virtual void SetContourLevel(Int_t level, Float_t value)
virtual void SetDirectory(TDirectory* dir)
virtual void SetEntries(Stat_t n)
virtual void SetError(Stat_t* error)
virtual void SetLabelColor(Color_t color = 1, Option_t* axis = X)
virtual void SetLabelFont(Style_t font = 62, Option_t* axis = X)
virtual void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = X)
virtual void SetLabelSize(Float_t size = 0.02, Option_t* axis = X)
virtual void SetMaximum(Float_t maximum = -1111)
virtual void SetMinimum(Float_t minimum = -1111)
virtual void SetName(Text_t* name)
virtual void SetNdivisions(Int_t n = 510, Option_t* axis = X)
virtual void SetNormFactor(Float_t factor = 1)
virtual void SetOption(Option_t* option = )
virtual void SetStats(Bool_t stats = kTRUE)
virtual void SetTickLength(Float_t length = 0.02, Option_t* axis = X)
virtual void SetTitleOffset(Float_t offset = 1, Option_t* axis = X)
virtual void SetXTitle(Text_t* title)
virtual void SetYTitle(Text_t* title)
virtual void SetZTitle(Text_t* title)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
virtual void Sumw2()
virtual void UseCurrentStyle()
protected:
Int_t fNcells number of bins(1D), cells (2D) +U/Overflows
TAxis fXaxis X axis descriptor
TAxis fYaxis Y axis descriptor
TAxis fZaxis Z axis descriptor
Short_t fBarOffset (1000*offset) for bar charts or legos
Short_t fBarWidth (1000*width) for bar charts or legos
Stat_t fEntries Number of entries
Stat_t fTsumw Total Sum of weights
Stat_t fTsumw2 Total Sum of squares of weights
Stat_t fTsumwx Total Sum of weight*X
Stat_t fTsumwx2 Total Sum of weight*X*X
Float_t fMaximum Maximum value for plotting
Float_t fMinimum Minimum value for plotting
Float_t fNormFactor Normalization factor
TArrayF fContour Array to display contour levels
TArrayD fSumw2 Array of sum of squares of weights
TString fOption histogram options
TList* fFunctions Pointer to list of functions (fits and user)
TDirectory* fDirectory Pointer to directory holding this histogram
Int_t fDimension Histogram dimension (1, 2 or 3 dim)
Double_t* fIntegral Integral of bins used by GetRandom
See also
-
TH1C, TH1D, TH1F, TH1S
*-*-*-*-*-*-*-*-*-*-*The H I S T O G R A M Classes*-*-*-*-*-*-*-*-*-*-*-*
*-* ===============================
*-*
*-* ROOT supports the following histogram types:
*-*
*-* 1-D histograms:
*-* TH1C : histograms with one byte per channel. Maximum bin content = 255
*-* TH1S : histograms with one short per channel. Maximum bin content = 65535
*-* TH1F : histograms with one float per channel. Maximum precision 7 digits
*-* TH1D : histograms with one double per channel. Maximum precision 14 digits
*-*
*-* 2-D histograms:
*-* TH2C : histograms with one byte per channel. Maximum bin content = 255
*-* TH2S : histograms with one short per channel. Maximum bin content = 65535
*-* TH2F : histograms with one float per channel. Maximum precision 7 digits
*-* TH2D : histograms with one double per channel. Maximum precision 14 digits
*-*
*-* 3-D histograms:
*-* TH3C : histograms with one byte per channel. Maximum bin content = 255
*-* TH3S : histograms with one short per channel. Maximum bin content = 65535
*-* TH3F : histograms with one float per channel. Maximum precision 7 digits
*-* TH3D : histograms with one double per channel. Maximum precision 14 digits
*-*
*-* Profile histograms: See class TProfile
*-*
*-*- All histogram classes are derived from the base class TH1
*-* The TH*C classes also inherit from the array class TArrayC.
*-* The TH*S classes also inherit from the array class TArrayS.
*-* The TH*F classes also inherit from the array class TArrayF.
*-* The TH*D classes also inherit from the array class TArrayD.
*-*
*-* 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
*-*
/*
*/
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
TH1(): TNamed(), TAttLine(), TAttFill(), TAttMarker()
*-*-*-*-*-*-*-*-*-*-*Histogram default constructor*-*-*-*-*-*-*-*-*-*-*-*-*
*-* =============================
~TH1()
*-*-*-*-*-*-*-*-*-*-*Histogram default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-* ============================
TH1(const Text_t *name,const Text_t *title,Int_t nbins,Axis_t xlow,Axis_t xup)
:TNamed(name,title), TAttLine(), TAttFill(), TAttMarker()
*-*-*-*-*-*-*-*-*Normal constructor for fix bin size histograms*-*-*-*-*-*-*
*-* ==============================================
Creates the main histogram structure:
name : name of histogram (avoid blanks)
title : histogram title
nbins : number of bins
xlow : low edge of first bin
xup : upper edge of last bin (not included in last bin)
When an histogram is created, it is automatically added to the list
of special objects in the current directory.
To find the pointer to this histogram in the current directory
by its name, do:
TH1F *h1 = (TH1F*)gDirectory->FindObject(name);
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
TH1(const Text_t *name,const Text_t *title,Int_t nbins,Axis_t *xbins)
:TNamed(name,title), TAttLine(), TAttFill(), TAttMarker()
*-*-*-*-*-*-*Normal constructor for variable bin size histograms*-*-*-*-*-*-*
*-* ===================================================
Creates the main histogram structure:
name : name of histogram (avoid blanks)
title : histogram title
nbins : number of bins
xbins : array of low-edges for each bin
This is an array of size nbins+1
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void Browse(TBrowser *)
void Build()
*-*-*-*-*-*-*-*-*-*Creates histogram basic data structure*-*-*-*-*-*-*-*-*-*
*-* ======================================
void Add(TH1 *h1, Float_t c1)
Performs the operation: this = this + c1*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.
void Add(TH1 *h1, TH1 *h2, Float_t c1, Float_t c2)
*-*-*-*-*Replace contents of this histogram by the addition of h1 and 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.
void AddBinContent(Int_t)
*-*-*-*-*-*-*-*-*-*Increment bin content by 1*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-* ==========================
void AddBinContent(Int_t, Stat_t)
*-*-*-*-*-*-*-*-*-*Increment bin content by a weight w*-*-*-*-*-*-*-*-*-*-*
*-* ===================================
Double_t ComputeIntegral()
Compute integral (cumulative sum of bins)
The result stored in fIntegral is used by the GetRandom functions.
This function is automatically called by GetRandom when the fIntegral
array does not exist or when the number of entries in the histogram
has changed since the previous call to GetRandom.
The resulting integral is normalized to 1
void Copy(TObject &obj)
*-*-*-*-*-*-*Copy this histogram structure to newth1*-*-*-*-*-*-*-*-*-*-*-*
*-* =======================================
Int_t DistancetoPrimitive(Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*-*Compute distance from point px,py to a line*-*-*-*-*-*
*-* ===========================================
*-* Compute the closest distance of approach from point px,py to elements
*-* of an histogram.
*-* The distance is computed in pixels units.
*-*
*-* Algorithm:
*-* Currently, this simple model computes the distance from the mouse
*-* to the histogram contour only.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void Divide(TH1 *h1)
*-*-*-*-*-*-*-*-*-*-*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.
void Divide(TH1 *h1, TH1 *h2, Float_t c1, Float_t c2, Option_t *option)
*-*-*-*-*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.
void Draw(Option_t *option)
*-*-*-*-*-*-*-*-*-*-*Draw this histogram with options*-*-*-*-*-*-*-*-*-*-*-*
*-* ================================
*-*
*-* This histogram is added in the list of objects to be drawn in the
*-* current pad.
*-* It is important to note that only a reference to this histogram is added.
*-* This means that if the histogram contents change between pad redraws,
*-* the current histogram contents will be shown.
*-* Use function DrawCopy to force a copy of the histogram at the time
*-* of the Draw operation in the Pad list.
*-*
*-* The following options are supported on all types:
*-* "SAME" : Superimpose on previous picture in the same pad
*-* "CYL" : Use Cylindrical coordinates
*-* "POL" : Use Polar coordinates
*-* "SPH" : Use Spherical coordinates
*-* "PSR" : Use PseudoRapidity/Phi coordinates
*-* "LEGO" : Draw a lego plot with hidden line removal
*-* "LEGO1" : Draw a lego plot with hidden surface removal
*-* "LEGO2" : Draw a lego plot using colors to show the cell contents
*-* "SURF" : Draw a surface plot with hidden line removal
*-* "SURF1" : Draw a surface plot with hidden surface removal
*-* "SURF2" : Draw a surface plot using colors to show the cell contents
*-* "SURF3" : same as SURF with in addition a contour view drawn on the top
*-* "SURF4" : Draw a surface using Gouraud shading
*-*
*-* The following options are supported for 1-D types:
*-* "AH" : Draw histogram, but not the axis labels and tick marks
*-* "B" : Bar chart option
*-* "C" : Draw a smooth Curve througth the histogram bins
*-* "E" : Draw error bars
*-* "E0" : Draw error bars including bins with o contents
*-* "E1" : Draw error bars with perpendicular lines at the edges
*-* "E2" : Draw error bars with rectangles
*-* "E3" : Draw a fill area througth the end points of the vertical error bars
*-* "E4" : Draw a smoothed filled area through the end points of the error bars
*-* "L" : Draw a line througth the bin contents
*-* "P" : Draw current marker at each bin
*-* "*H" : Draw histogram with a * at each bin
*-*
*-*
*-* The following options are supported for 2-D types:
*-* "ARR" : arrow mode. Shows gradient between adjacent cells
*-* "BOX" : a box is drawn for each cell with surface proportional to contents
*-* "COL" : a box is drawn for each cell with a color scale varying with contents
*-* "COLZ" : same as "COL". In addition the color mapping is also drawn
*-* "CONT" : Draw a contour plot (same as CONT3)
*-* "CONT0" : Draw a contour plot using colors to distinguish contours
*-* "CONT1" : Draw a contour plot using line styles to distinguish contours
*-* "CONT2" : Draw a contour plot using the same line style for all contours
*-* "CONT3" : Draw a contour plot using fill area colors
*-* "FB" : With LEGO or SURFACE, suppress the Front-Box
*-* "BB" : With LEGO or SURFACE, suppress the Back-Box
*-* "SCAT" : Draw a scatter-plot (default)
*-*
*-* Note that most options above can be concatenated, example:
*-* h-Draw("e1same");
*-* Options are case insensitive
*-*
*-* Whe using the options "BOX", "COL" or "COLZ", the color palette used
*-* is the one defined in the current style (see TStyle::SetPalette)
*-*
*-* When using the "CONT" or "SURF" or "LEGO" options, the number
*-* of contour levels can be changed via TH1::SetContour.
*-* (default is 20 equidistant levels)
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
TH1* DrawCopy(Option_t *)
*-*-*-*-*-*-*Copy this histogram and Draw in the current pad*-*-*-*-*-*-*-*
*-* ===============================================
*-*
*-* Once the histogram is drawn into the pad, any further modification
*-* using graphics input will be made on the copy of the histogram,
*-* and not to the original object.
*-*
*-* See Draw for the list of options
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void DrawPanel()
*-*-*-*-*-*-*Display a panel with all histogram drawing options*-*-*-*-*-*
*-* ==================================================
*-*
*-* See class TDrawPanelHist for example
void Eval(TF1 *f1, Option_t *option)
*-*-*-*-*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 an integer value, distributed according to the Poisson
*-* distribution, with f1 as the mean.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
*-*-*-*-*-*-*-*-*-*-*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.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Int_t Fill(Axis_t x)
*-*-*-*-*-*-*-*-*-*Increment bin with abscissa X by 1*-*-*-*-*-*-*-*-*-*-*
*-* ==================================
*-*
*-* if x is less than the low-edge of the first bin, the Underflow bin is incremented
*-* if x is greater than the upper edge of last bin, the Overflow bin is incremented
*-*
*-* If the storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by 1 in the bin corresponding to x.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Int_t Fill(Axis_t x, Stat_t w)
*-*-*-*-*-*-*-*Increment bin with abscissa X with a weight w*-*-*-*-*-*-*-*
*-* =============================================
*-*
*-* if x is less than the low-edge of the first bin, the Underflow bin is incremented
*-* if x is greater than the upper edge of last bin, the Overflow bin is incremented
*-*
*-* If the storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by w^2 in the bin corresponding to x.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void FillN(Int_t ntimes, Axis_t *x, Double_t *w, Int_t stride)
*-*-*-*-*-*-*-*Fill this histogram with an array x and weights w*-*-*-*-*
*-* =================================================
*-*
*-* ntimes: number of entries in arrays x and w (array size must be ntimes*stride)
*-* x: array of values to be histogrammed
*-* w: array of weighs
*-* stride: step size through arrays x and w
*-*
*-* If the storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by w[i]^2 in the bin corresponding to x[i].
*-* if w is NULL each entry is assumed a weight=1
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Int_t Fill12(Axis_t x,Axis_t y)
*-*-*-*-*-*-*-*-*-*-*Increment cell defined by x,y by 1*-*-*-*-*-*-*-*-*-*
*-* ==================================
*-*
*-* 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 storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by 1in the cell corresponding to x,y.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Int_t Fill(Axis_t x, Axis_t y, Stat_t w)
*-*-*-*-*-*-*-*-*-*-*Increment cell defined by x,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 storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by w^2 in the cell corresponding to x,y.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Int_t Fill(Axis_t x, Axis_t y, Axis_t z, Stat_t w)
*-*-*-*-*-*-*-*-*-*-*Increment cell defined by x,y,z by a weight w*-*-*-*-*
*-* =============================================
*-*
*-* If the storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by w^2 in the cell corresponding to x,y,z.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void FillN(Int_t ntimes, Axis_t *x, Axis_t *y, Double_t *w, Int_t stride)
*-*-*-*-*-*-*Fill a 2-D histogram with an array of values and weights*-*-*-*
*-* ========================================================
*-*
*-* ntimes: number of entries in arrays x and w (array size must be ntimes*stride)
*-* x: array of x values to be histogrammed
*-* y: array of y values to be histogrammed
*-* w: array of weights
*-* stride: step size through arrays x, y and w
*-*
*-* If the storage of the sum of squares of weights has been triggered,
*-* via the function Sumw2, then the sum of the squares of weights is incremented
*-* by w[i]^2 in the cell corresponding to x[i],y[i].
*-* if w is NULL each entry is assumed a weight=1
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void FillRandom(char *fname, Int_t ntimes)
*-*-*-*-*-*-*Fill histogram following distribution in function fname*-*-*-*
*-* =======================================================
*-*
*-* The distribution contained in the function fname (TF1) 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
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*
void FillRandom(TH1 *h, Int_t ntimes)
*-*-*-*-*-*-*Fill histogram following distribution in histogram h*-*-*-*
*-* ====================================================
*-*
*-* The distribution contained in the histogram h (TH1) 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
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*
void Fit(const Text_t *fname ,Option_t *option ,Option_t *goption, Float_t xxmin, Float_t xxmax)
*-*-*-*-*-*-*-*-*-*-*Fit histogram with function fname*-*-*-*-*-*-*-*-*-*-*
*-* =================================
*-*
*-* fname is the name of an already predefined function created by TF1 or TF2
*-* Predefined functions such as Gaus, Expo and Poln are automatically
*-* created by ROOT.
*-*
*-* The list of fit options is given in parameter option.
*-* option = "W" Set all errors to 1
*-* = "I" Use integral of function in bin instead of value at bin center
*-* = "L" Use Loglikelihood method (default is chisquare method)
*-* = "Q" Quiet mode (minimum printing)
*-* = "V" Verbose mode (default is between Q and V)
*-* = "E" Perform better Errors estimation using Minos technique
*-* = "R" Use the Range specified in the function range
*-* = "N" Do not store the graphics function, do not draw
*-* = "0" Do not plot the result of the fit. By default the fitted function
*-* is drawn unless the option"N" above is specified.
*-* = "+" Add this new fitted function to the list of fitted functions
*-* (by default, any previous function is deleted)
*-*
*-* When the fit is drawn (by default), the parameter goption may be used
*-* to specify a list of graphics options. See TH1::Draw for a complete
*-* list of these options.
*-*
*-* In order to use the Range option, one must first create a function
*-* with the expression to be fitted. 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");
*-*
*-* 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,0.1,-8,100);
*-* func->SetParLimits(4,-10,-4);
*-* func->SetParLimits(5, 1,1);
*-* With this setup, parameters 0->3 can vary freely
*-* Parameter 4 has boundaries [-10,-4] with initial value -8
*-* Parameter 5 is fixed to 100.
*-*
*-* Note that option "I" gives better results but is slower.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void FitPanel()
*-*-*-*-*-*-*Display a panel with all histogram fit options*-*-*-*-*-*
*-* ==============================================
*-*
*-* See class TFitPanel for example
void FitSlicesX(TF1 *f1, Int_t binmin, Int_t binmax, Int_t cut, Option_t *option)
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 binmin and binmax are considered.
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
Note that the generated histograms are added to the list of objects
in the current directory. It is the user's responsability 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(RMS) 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.
void FitSlicesY(TF1 *f1, Int_t binmin, Int_t binmax, Int_t cut, Option_t *option)
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 binmin and binmax are considered.
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
Note that the generated histograms are added to the list of objects
in the current directory. It is the user's responsability 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(RMS) 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.
A complete example of this function is given in tutorial:fitslicesy.C
with the following output:
/*
*/
void FitSlicesZ(TF1 *f1, Int_t binminx, Int_t binmaxx, Int_t binminy, Int_t binmaxy, Int_t cut, Option_t *option)
Project slices along Z in case of a 3-D histogram, then fit each slice
with function f1 and make a 2-d histogram for each fit parameter
Only cells in the bin range [binminx,binmaxx] and [binminy,binmaxy] are considered.
if f1=0, a gaussian is assumed
Before invoking this function, one can set a subrange to be fitted along Z
via f1->SetRange(zmin,zmax)
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
Example: Assume a 3-d histogram h3
Root > h3->FitSlicesZ(); produces 4 TH2D histograms
with h3_0 containing parameter 0(Constant) for a Gaus fit
of each cell in X,Y projected along Z
with h3_1 containing parameter 1(Mean) for a gaus fit
with h3_2 containing parameter 2(RMS) for a gaus fit
with h3_chi2 containing the chisquare/number of degrees of freedom for a gaus fit
Root > h3->Fit(0,15,22,0,0,10);
same as above, but only for bins 15 to 22 along X
and only for cells in X,Y for which the corresponding projection
along Z has more than cut bins filled.
Text_t* GetObjectInfo(Int_t px, Int_t py)
Redefines TObject::GetObjectInfo.
Displays the histogram info (bin number, contents, integral up to bin
corresponding to cursor position px,py
Int_t MakeChopt(Option_t *choptin)
*-*-*-*-*-*-*-*-*Decode string chopt and fill Hoption structure*-*-*-*-*-*-*
*-* ==============================================
Int_t FitOptionsMake(Option_t *choptin)
*-*-*-*-*-*-*-*-*Decode string choptin and fill Foption structure*-*-*-*-*-*
*-* ================================================
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz)
*-*-*-*-*-*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.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Axis_t GetRandom()
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.
The integral is automatically recomputed if the number of entries
is not the same then when the integral was computed.
void GetRandom2(Axis_t &x, Axis_t &y)
return 2 random numbers along axis x and y distributed according
the cellcontents of a 2-dim histogram
void GetRandom3(Axis_t &x, Axis_t &y, Axis_t &z)
return 3 random numbers along axis x , y and z distributed according
the cellcontents of a 3-dim histogram
Stat_t GetBinContent(Int_t)
*-*-*-*-*-*-*Return content of global bin number bin*-*-*-*-*-*-*-*-*-*-*-*
*-* =======================================
void Multiply(TH1 *h1)
*-*-*-*-*-*-*-*-*-*-*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.
void Multiply(TH1 *h1, TH1 *h2, Float_t c1, Float_t c2, Option_t *option)
*-*-*-*-*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.
void Paint(Option_t *option)
*-*-*-*-*-*-*-*-*Control routine to paint any kind of histograms*-*-*-*-*-*-*
*-* ===============================================
This function is automatically called by TCanvas::Update.
(see TH1::Draw for the list of options)
void PaintArrows()
*-*-*-*-*-*-*-*Control function to draw a table as an arrow plot*-*-*-*-*-*
*-* =================================================
*-*
*-* For each cell (i,j) an arrow is drawn
*-* The orientation of the arrow follows the cell gradient
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintAxis()
*-*-*-*-*-*-*-*-*-*-*-*Draw axis of an histogram*-*-*-*-*-*-*-*-*-*-*-*-*
*-* =========================
Assume tx = gPad->GetTickx() and ty = gPad->GetTicky()
by default only the left Y axis and X bottom axis are drawn (tx = ty = 0)
tx = 1 ; tick marks on top side are drawn (inside)
tx = 2; tick marks and labels on top side are drawn
ty = 1; tick marks on right side are drawn (inside)
ty = 2; tick marks and labels on right side are drawn
Use TPad::SetTicks(tx,ty) to set these options
void PaintBoxes()
*-*-*-*-*-*-*-*Control function to draw a table as a box plot*-*-*-*-*-*
*-* ==============================================
*-*
*-* For each cell (i,j) a box is drawn.
*-* The size of the box is proportional to the cell content.
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintColorLevels()
*-*-*-*-*-*-*-*Control function to draw a table as a color plot*-*-*-*-*-*
*-* ================================================
*-*
*-* For each cell (i,j) a box is drawn with a color proportional
*-* to the cell content.
*-* The color table used is defined in the current style (gStyle).
*-* The color palette in TStyle can be modified via TStyle::SetPalette.
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintPalette()
*-*-*-*-*-*-*-*Paint the color palette on the right side of the pad*-*-*-*-*
*-* ====================================================
void PaintContour()
*-*-*-*-*-*-*-*Control function to draw a table as a contour plot*-*-*-*-*-*
*-* =================================================
*-* Hoption.Contour may have the following values:
*-* 1 The contour is drawn with filled colour levels.
*-* The levels are equidistant.
*-* 11 Use colour to distinguish contours.
*-* 12 Use line style to distinguish contours.
*-* 13 Line style and colour are the same for all contours.
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Int_t PaintContourLine(Float_t elev1, Int_t icont1, Float_t x1, Float_t y1,
Float_t elev2, Int_t icont2, Float_t x2, Float_t y2,
Float_t *xarr, Float_t *yarr, Int_t *itarr)
*-*-*-*-*-*-*-*Fill the matrix XARR YARR for Contour Plot*-*-*-*-*-*-*-*
*-* ==========================================
*-*
Int_t PaintInit()
*-*-*-*-*-*-*Compute histogram parameters used by the drawing routines*-*-*-*
*-* =========================================================
void PaintErrors()
*-*-*-*-*-*-*-*-*-*-*Draw histogram error bars*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-
*-*- Draws error bars for the current histogram. The current polymarker
*-*- is drawn at the centre of the errors according to CHOPT:
*-*-
*-*- ' ' Coordinates are expressed in histogram coordinates
*-*- (of the last drawn histogram). Error bars are drawn.
*-*- '1' Small lines are drawn at the end of the error bars.
*-*- '2' Error rectangles are drawn.
*-*- '3' A filled area is drawn through the end points of the vertical
*-*- error bars.
*-*- '4' A smoothed filled area is drawn through the end points of the
*-*- vertical error bars.
*-*- '0' Turn off the symbols clipping.
/*
*/
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintFrame()
*-*-*-*-*-*-*-*-*-*Calculate range and clear pad (canvas)*-*-*-*-*-*-*-*-*-*
*-* ======================================
void PaintFunction()
*-*-*-*-*-*-*-*-*-*-*Paint functions associated to an histogram*-*-*-*-*-*-*
*-* ==========================================
An associated function is created by TH1::Fit. Note that more than
on fitted function can be associated with one histogram (see TH1::Fit).
A TF1 object can be added to the list of associated functions directly
by a user without calling TH1::Fit.
To add a new function to the list of associated functions, do
h->GetListOfFunctions()->Add(f1);
To retrieve a function by name from this list, do:
TF1 *f1 = (TF1*)h->GetListOfFunctions()->FindObject(name);
or
TF1 *f1 = h->GetFunction(name);
void PaintHist()
*-*-*-*-*-*-*-*-*-*Control routine to draw an histogram*-*-*-*-*-*-*-*-*-*-*
*-* ====================================
void PaintH3(Option_t *option)
*-*-*-*-*-*-*-*-*-*Control function to draw a 3-D histogram*-*-*-*-*-*-*-*-*
*-* ========================================
void PaintH3Box(Option_t *option)
*-*-*-*-*-*-*-*-*-*Draw a 3-D histogram with boxes*-*-*-*-*-*-*-*-*
*-* ===============================
Each 3-d cell is represented by a box of size proportional to the cell content
The cell color is the histogram marker color
void PaintLego()
*-*-*-*-*-*-*-*Control function to draw a table as a lego plot*-*-*-*-*-*
*-* ===============================================
*-*
*-* In a lego plot, cell contents are represented as 3-d boxes.
*-* The height of the box is proportional to the cell content.
*-*
*-* A lego plot can be represented in several coordinate systems.
*-* Default system is Cartesian coordinates.
*-* Possible systems are CYL,POL,SPH,PSR.
*-*
*-* See TH1::Draw for the list of Lego options.
*-* See TLego for more examples of lego options.
See TStyle::SetPalette to change the color palette.
It is suggested to use palette 1 via the call
gStyle->SetColorPalette(1)
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintLegoAxis(TGaxis *axis, Float_t ang)
*-*-*-*-*-*-*Draw the axis for legos and surface plots*-*-*-*-*-*-*-*-*-*
*-* =========================================
*-*
void PaintScatterPlot()
*-*-*-*-*-*-*-*Control function to draw a table as a scatter plot*-*-*-*-*
*-* ==================================================
*-*
*-* For each cell (i,j) a number of points proportional to the cell
*-* content is drawn.
*-* A maximum of 500 points per cell is drawn. If the maximum is above 500
*-* contents are normalized to 500.
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintStat(Int_t dostat, TF1 *fit)
*-*-*-*-*-*-*-*-*-*-*-*Draw the statistics box*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-* =======================
The type of information printed in the histogram statistics box
can be selected via gStyle->SetOptStat(mode).
The parameter mode can be = ourmeni (default = 0001111)
n = 1; name of histogram is printed
e = 1; number of entries printed
m = 1; mean value printed
r = 1; rms printed
u = 1; number of underflows printed
o = 1; number of overflows printed
i = 1; integral of bins printed
Example: gStyle->SetOptStat(11);
print only name of histogram and number of entries.
The type of information about fit parameters printed in the histogram
statistics box can be selected via the parameter mode.
The parameter mode can be = 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 degress of freedom
p = 1; print Probability
Example: gStyle->SetOptFit(1011);
print fit probability, parameter names/values and errors.
void PaintStat2(Int_t dostat, TF1 *fit)
Draw the statistics box for 2D histogram.
The type of information printed in the histogram statistics box
can be selected via gStyle->SetOptStat(mode).
The parameter mode can be = ourmen (default = 001111)
n = 1; name of histogram is printed
e = 1; number of entries printed
m = 1; mean value printed
r = 1; rms printed
u = 1; number of underflows printed
o = 1; number of overflows printed
i = 1; integral of bins printed
Example: gStyle->SetOptStat(11);
print only name of histogram and number of entries.
void PaintSurface()
*-*-*-*-*-*-*-*Control function to draw a table as a surface plot*-*-*-*-*-*
*-* ==================================================
*-*
*-* In a surface plot, cell contents are represented as a mesh.
*-* The height of the mesh is proportional to the cell content.
*-*
*-* A surface plot can be represented in several coordinate systems.
*-* Default system is Cartesian coordinates.
*-* Possible systems are CYL,POL,SPH,PSR.
*-*
*-* See TH1::Draw for a list of Surface options
*-* The following picture is generated with option SURF1.
See TStyle::SetPalette to change the color palette.
It is suggested to use palette 1 via the call
gStyle->SetColorPalette(1)
/*
*/
*-* The following picture is generated with option SURF3.
/*
*/
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
void PaintTable()
*-*-*-*-*-*-*-*-*-*Control function to draw 2-D/3-D tables*-*-*-*-*-*-*-*
*-* =======================================
TProfile* ProfileX(const char *name, Int_t firstybin, Int_t lastybin, Option_t *option)
*-*-*-*-*Project a 2-D histogram into a profile histogram along X*-*-*-*-*-*
*-* ========================================================
The projection is made from the channels along the Y axis
ranging from firstybin to lastybin included.
TProfile* ProfileY(const char *name, Int_t firstxbin, Int_t lastxbin, Option_t *option)
*-*-*-*-*Project a 2-D histogram into a profile histogram along Y*-*-*-*-*-*
*-* ========================================================
The projection is made from the channels along the X axis
ranging from firstxbin to lastxbin included.
TH1D* ProjectionX(const char *name, Int_t firstybin, Int_t lastybin, Option_t *option)
*-*-*-*-*Project a 2-D histogram into a 1-D histogram along X*-*-*-*-*-*-*
*-* ====================================================
The projection is always of the type TH1D.
The projection is made from the channels along the Y axis
ranging from firstybin to lastybin included.
if option 'E" is specified, the errors are computed.
TH1D* ProjectionY(const char *name, Int_t firstxbin, Int_t lastxbin, Option_t *option)
*-*-*-*-*Project a 2-D histogram into a 1-D histogram along Y*-*-*-*-*-*-*
*-* ====================================================
The projection is always of the type TH1D.
The projection is made from the channels along the X axis
ranging from firstxbin to lastxbin included.
if option 'E" is specified, the errors are computed.
TH1D* ProjectionZ(const char *name, Int_t ixmin, Int_t ixmax, Int_t iymin, Int_t iymax, Option_t *option)
*-*-*-*-*Project a 3-D histogram into a 1-D histogram along Z*-*-*-*-*-*-*
*-* ====================================================
The projection is always of the type TH1D.
The projection is made from the cells along the X axis
ranging from ixmin to ixmax and iymin to iymax included.
if option 'E" is specified, the errors are computed.
code from Paola Collins & Hans Dijkstra
TH1* Rebin(Int_t ngroup, const char*newname)
*-*-*-*-*Rebin this histogram grouping ngroup bins together*-*-*-*-*-*-*-*-*
*-* ==================================================
if newname is not blank a new temporary histogram hnew is created.
else the current histogram is modified (default)
The parameter ngroup indicates how many bins 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 h1 is an existing TH1F histogram with 100 bins
h1->Rebin(); //merges two bins in one in h1: previous contents of h1 are lost
h1->Rebin(5); //merges five bins in one in h1
TH1F *hnew = h1->Rebin(5,"hnew"); // creates a new histogram hnew
//merging 5 bins of h1 in one bin
NOTE: This function is currently implemented only for 1-D histograms
void Scale(Float_t c1)
*-*-*-*-*Multiply this histogram by a constant c1*-*-*-*-*-*-*-*-*
*-* ========================================
this = c1*this
Note that both contents and errors(if any) are scaled.
This function uses the services of TH1::Add
void Streamer(TBuffer &b)
*-*-*-*-*-*-*-*-*Stream a class object*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-* =====================
Int_t TableInit()
*-*-*-*-*-*-*-*-*Initialize various options to draw tables*-*-*-*-*-*-*-*
*-* =========================================
void PaintTitle()
*-*-*-*-*-*-*-*-*-*-*-*Draw the histogram title*-*-*-*-*-*-*-*-*-*-*-*-*
*-* ========================
void Print(Option_t *option)
*-*-*-*-*-*-*Print some global quantities for this histogram*-*-*-*-*-*-*-*
*-* ===============================================
If option "all" is given, bin contents and errors are also printed.
void RecalculateRange()
*-*-*-*-*-*Recompute the histogram range following graphics operations*-*-*
*-* ===========================================================
void Reset(Option_t *)
*-*-*-*-*-*-*-*Reset this histogram: contents, errors, etc*-*-*-*-*-*-*-*
*-* ===========================================
void SavePrimitive(ofstream &out, Option_t *option)
Save primitive as a C++ statement(s) on output stream out
void UseCurrentStyle()
*-*-*-*-*-*Replace current attributes by current style*-*-*-*-*
*-* ===========================================
Stat_t GetMean(Int_t axis)
*-*-*-*-*-*-*-*Return mean value of this histogram along the X axis*-*-*-*-*
*-* ====================================================
Stat_t GetRMS(Int_t axis)
*-*-*-*-*-*-*-*Return the Root Mean Square value of this histogram*-*-*-*-*
*-* ===================================================
void GetStats(Stat_t *stats)
fill the array stats from the contents of this histogram
The array stats must be correctly dimensionned in the calling program.
stats[0] = sumw
stats[1] = sumw2
stats[2] = sumwx
stats[3] = sumwx2
stats[4] = sumwy if 2-d or 3-d
stats[5] = sumwy2
stats[6] = sumwz if 3-d
stats[7] = 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.
Stat_t GetSumOfWeights()
*-*-*-*-*-*-*-*Return the sum of weights excluding under/overflows*-*-*-*-*
*-* ===================================================
Stat_t Integral()
Return integral of bin contents (all bins)
Stat_t Integral(Int_t binx1, Int_t binx2)
Return integral of bin contents between binx1 and binx2 for a 1-D histogram
Stat_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2)
Return integral of bin contents in range [binx1,binx2],[biny1,biny2]
for a 2-D histogram
Stat_t Integral(Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2)
Return integral of bin contents in range [binx1,binx2],[biny1,biny2],[binz1,binz2]
for a 3-D histogram
void SetContent(Stat_t *content)
*-*-*-*-*-*-*-*Replace bin contents by the contents of array content*-*-*-*
*-* =====================================================
Int_t GetContour(Float_t *levels)
*-*-*-*-*-*-*-*Return contour values into array levels*-*-*-*-*-*-*-*-*-*
*-* =======================================
*-*
*-* The number of contour levels can be returned by getContourLevel
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Float_t GetContourLevel(Int_t level)
*-*-*-*-*-*-*-*Return the number of contour levels*-*-*-*-*-*-*-*-*-*-*-*-*
*-* ===================================
void SetContour(Int_t nlevels, Float_t *levels)
*-*-*-*-*-*-*-*Set the number and values of contour levels*-*-*-*-*-*-*-*-*
*-* ===========================================
By default the number of contour levels is set to 20.
if argument levels = 0 or issing, equidistant contours are computed
void SetContourLevel(Int_t level, Float_t value)
*-*-*-*-*-*-*-*-*-*-*Set value for one contour level*-*-*-*-*-*-*-*-*-*-*-*
*-* ===============================
Float_t GetMaximum()
*-*-*-*-*-*-*-*-*-*-*Return maximum value of all bins*-*-*-*-*-*-*-*-*-*-*-*
*-* ================================
Float_t GetMinimum()
*-*-*-*-*-*-*-*-*-*-*Return minimum value of all bins*-*-*-*-*-*-*-*-*-*-*-*
*-* ================================
void SetBins(Int_t nx, Float_t xmin, Float_t xmax)
*-*-*-*-*-*-*-*-*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
void SetBins(Int_t nx, Float_t xmin, Float_t xmax, Int_t ny, Float_t ymin, Float_t ymax)
*-*-*-*-*-*-*-*-*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
void SetBins(Int_t nx, Float_t xmin, Float_t xmax, Int_t ny, Float_t ymin, Float_t ymax, Int_t nz, Float_t zmin, Float_t zmax)
*-*-*-*-*-*-*-*-*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
void SetMaximum(Float_t maximum)
*-*-*-*-*-*-*-*-*Set the maximum value for the Y axis*-*-*-*-*-*-*-*-*-*-*-*
*-* ====================================
By default the maximum value is automatically set to the maximum
bin content plyus a margin of 10 per cent.
void SetMinimum(Float_t minimum)
*-*-*-*-*-*-*-*-*Set the minimum value for the Y axis*-*-*-*-*-*-*-*-*-*-*-*
*-* ====================================
By default the minimum value is automatically set to zero if all bin contents
are positive or the minimum - 10 per cent otherwise.
void SetDirectory(TDirectory *dir)
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.
void SetError(Stat_t *error)
*-*-*-*-*-*-*-*-*Replace bin errors by values in array error*-*-*-*-*-*-*-*-*
*-* ===========================================
void SetName(const Text_t *name)
*-*-*-*-*-*-*-*-*-*-*Change the name of this histogram*-*-*-*-*-*-*-*-*-*-*
*-* =================================
void SetStats(Bool_t stats)
*-*-*-*-*-*-*-*-*Set statistics option on/off
*-* ============================
By default, the statistics box is drawn.
The paint options can be selected via gStyle->SetOptStats.
This function sets/resets the kNoStats bin in the histogram object.
It has priority over the Style option.
void Sumw2()
*-*-*-*-*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
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
TF1* GetFunction(const Text_t *name)
*-*-*-*-*Return pointer to function with name*-*-*-*-*-*-*-*-*-*-*-*-*
*-* ===================================
Stat_t GetBinError(Int_t bin)
*-*-*-*-*-*-*Return 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.
*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Stat_t GetCellContent(Int_t binx, Int_t biny)
Stat_t GetCellError(Int_t binx, Int_t biny)
void SetBinError(Int_t bin, Stat_t error)
void SetCellError(Int_t binx, Int_t biny, Stat_t error)
void SetBinContent(Int_t, Stat_t)
Inline Functions
Int_t AxisChoice(Option_t* axis)
Double_t* GetIntegral()
TList* GetListOfFunctions()
Int_t GetNdivisions(Option_t* axis = X)
Color_t GetAxisColor(Option_t* axis = X)
Color_t GetLabelColor(Option_t* axis = X)
Style_t GetLabelFont(Option_t* axis = X)
Float_t GetLabelOffset(Option_t* axis = X)
Float_t GetLabelSize(Option_t* axis = X)
Float_t GetTitleOffset(Option_t* axis = X)
Float_t GetTickLength(Option_t* axis = X)
Float_t GetBarOffset()
Float_t GetBarWidth()
Axis_t GetBinCenter(Int_t bin)
Axis_t GetBinLowEdge(Int_t bin)
Axis_t GetBinWidth(Int_t bin)
void GetCenter(Axis_t* center)
TDirectory* GetDirectory()
Stat_t GetEntries()
Int_t GetDimension()
void GetLowEdge(Axis_t* edge)
Int_t GetNbinsX()
Int_t GetNbinsY()
Int_t GetNbinsZ()
Option_t* GetOption()
Int_t GetSumw2N()
TAxis* GetXaxis()
TAxis* GetYaxis()
TAxis* GetZaxis()
void SetAxisColor(Color_t color = 1, Option_t* axis = X)
void SetAxisRange(Float_t xmin, Float_t xmax, Option_t* axis = X)
void SetBarOffset(Float_t offset = 0.25)
void SetBarWidth(Float_t width = 0.5)
void SetBinsLength(Int_t)
void SetCellContent(Int_t binx, Int_t biny, Stat_t content)
void SetEntries(Stat_t n)
void SetLabelColor(Color_t color = 1, Option_t* axis = X)
void SetLabelFont(Style_t font = 62, Option_t* axis = X)
void SetLabelOffset(Float_t offset = 0.005, Option_t* axis = X)
void SetLabelSize(Float_t size = 0.02, Option_t* axis = X)
void SetNdivisions(Int_t n = 510, Option_t* axis = X)
void SetNormFactor(Float_t factor = 1)
void SetOption(Option_t* option = )
void SetTickLength(Float_t length = 0.02, Option_t* axis = X)
void SetTitleOffset(Float_t offset = 1, Option_t* axis = X)
void SetXTitle(Text_t* title)
void SetYTitle(Text_t* title)
void SetZTitle(Text_t* title)
TClass* Class()
TClass* IsA()
void ShowMembers(TMemberInspector& insp, char* parent)
TH1 TH1(TH1&)
Author: Rene Brun 26/12/94
Last update: 2.22/09 13/07/99 11.20.05 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *
ROOT page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.