class PTools

_HADES_CLASS_DESCRIPTION


 Peter's Tools

            Author: Peter W. Zumbruch
           Contact: P.Zumbruch@gsi.de
           Created: Mar 21, 2002

 File: $RCSfile: ptools.cc,v $
 Version: $Revision: 1.79 $
 Modified by $Author: halo $ on $Date: 2009-07-23 14:50:51 $

Function Members (Methods)

public:
PTools()
PTools(const PTools&)
~PTools()
static Bool_tareArraysCompatible(const TArray* array1, const TArray* array2)
static Bool_tareHistogramsCompatible(TH1* h1, TH1* h2)
static Int_tcheckHistogramCompatibility(TH1* h1, TH1* h2)
static TClass*Class()
static voidcleanHistogram(TH1* hist, Double_t min, Double_t max, Int_t errorMode = 0)
static voidcleanHistogramPtyOnP(TH2* hist, Double_t mass, Double_t min, Double_t max, Double_t replaceBy = 0)
static TNamed*Clone(TNamed* name, TString newname = "", TString title = "")
static Bool_tcompareHistogramLimits(TH1* hist1, TH1* hist2, Bool_t exit_on_failure)
static TH1*copyBinSubsetOfHist(TH1* hist, Int_t xbinmin = -1, Int_t xbinmax = -1, Int_t ybinmin = -1, Int_t ybinmax = -1, Int_t zbinmin = -1, Int_t zbinmax = -1)
static TH1*copySubsetOfHist(TH1* hist, Double_t xmin = copySubsetOfHistDefaultValue, Double_t xmax = copySubsetOfHistDefaultValue, Double_t ymin = copySubsetOfHistDefaultValue, Double_t ymax = copySubsetOfHistDefaultValue, Double_t zmin = copySubsetOfHistDefaultValue, Double_t zmax = copySubsetOfHistDefaultValue)
static TH1DcopyToTH1D(TH1* hist)
static TH2DcopyToTH2D(TH2* hist)
static TH3DcopyToTH3D(TH3* hist)
static TH1*copyToUnitBinsPlusLabels(TH1* hist, Double_t binningX = 1., Double_t binningY = 1., Double_t binningZ = 1.)
static TH1D*createTH1D(TH1* hist)
static TH2D*createTH2D(TH2* hist)
static TH3D*createTH3D(TH3* hist)
static voidcutEnd(Char_t*, const Char_t*)
static voidcutHistogram(TH2* hist, TCutG* cut, Bool_t complement = kFALSE)
static voidcutHistogram(TH2* hist, TObjArray* cutarray, Bool_t complement = kFALSE)
static TCanvas*draw32Canvas(const Char_t*, const Char_t*, TH1F**)
static TCanvas*draw32CanvasTH2(const Char_t*, const Char_t*, TH2F**, const Char_t* option = 0)
static TCanvas*drawCanvas(const Char_t*, const Char_t*, TH1**, Int_t, Int_t)
static TLatex*drawLatex(TString text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatex(const Char_t* text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatexNDC(TString text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatexNDC(const Char_t* text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatexPadCoords(TString text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatexPadCoords(const Char_t* text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatexWC(TString text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLatex*drawLatexWC(const Char_t* text, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static voidevalStopwatch(TStopwatch* timer, Int_t nevts)
static TGraphErrors*fillGraphErr(TH1* hist, TString name = "", TString position = "center", Bool_t xerrors = kFALSE)
static Int_tfindBeginOfDistribution(TH1* hist, Int_t max, Double_t threshold, Bool_t compact = kFALSE)
static Int_tfindEndOfDistribution(TH1* hist, Int_t min, Double_t threshold, Bool_t compact = kFALSE)
static TH1D*getBinContentDistribution(TH1* hist, Int_t binning = -1, Bool_t excludeUnderAndOverFlowBins = kFALSE)
static Int_tgetColorJM(Int_t i)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t* title)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads, const Char_t* title)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t* title)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, TPaveText* info)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, const Char_t* info)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, TString info)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t* title, const Char_t* filename)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, TPaveText* info)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, const Char_t* info)
static TPad*getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, TString info)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t* title, const Char_t* filename, Int_t nentries)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t* title, const Char_t* filename, Int_t nentries, TPaveText* info)
static TPad*getDividedSubPad(Int_t xsize, Int_t ysize, Int_t xpads, Int_t ypads, const Char_t* title, const Char_t* filename, Int_t nentries, const Char_t* info)
static TPad*getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t* title, const Char_t* filename, Int_t nentries, TString info)
static TH1*getErrorsOfHistogram(TH1* hist, Bool_t relativeError = kFALSE)
static voidgetHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax)
static voidgetHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax, Int_t& nbinsy, Axis_t& ymin, Axis_t& ymax)
static voidgetHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax, Int_t& nbinsy, Axis_t& ymin, Axis_t& ymax, Int_t& nbinsz, Axis_t& zmin, Axis_t& zmax)
static TPaveStats*getHistStats(TH1* hist, Bool_t quiet = kFALSE)
static TPaveStats*getHistStats(TPad* pad, TString name, Bool_t quiet = kFALSE, Bool_t noUpdate = kFALSE)
static TPaveStats*getHistStatsPosNDC(TH1* hist, Double_t& x1, Double_t& x2, Double_t& y1, Double_t& y2)
static TPaveStats*getHistStatsPosNDC(TPad* pad, TString name, Double_t& x1, Double_t& x2, Double_t& y1, Double_t& y2)
static TPaveStats*getHistStatsXPosNDC(TH1* hist, Double_t& x1, Double_t& x2)
static TPaveStats*getHistStatsXPosNDC(TPad* pad, TString name, Double_t& x1, Double_t& x2)
static TPaveStats*getHistStatsYPosNDC(TH1* hist, Double_t& y1, Double_t& y2)
static TPaveStats*getHistStatsYPosNDC(TPad* pad, TString name, Double_t& y1, Double_t& y2)
static Int_tgetLinearIndex(Int_t* x, UInt_t* xmax, UInt_t dim)
static Int_tgetLinearIndex(Int_t x1, UInt_t x1max, Int_t x2, UInt_t x2max = 0, Int_t x3 = -1, UInt_t x3max = 0, Int_t x4 = -1, UInt_t x4max = 0, Int_t x5 = -1, UInt_t x5max = 0)
static Int_tgetMarkerJM(Int_t i)
static Double_tgetMeanErrorRange(TH1* hist, Int_t minX, Int_t maxX, TString s = "center")
static Double_tgetMeanErrorRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString s = "center")
static Double_tgetMeanRange(TH1* hist, Int_t minX, Int_t maxX, TString s = "center")
static Double_tgetMeanRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString s = "center")
static Int_tgetNFilledBins(TH1* hist, Double_t min = -1, Double_t max = -1)
static TH1*getOneOverHist(TH1* hist)
static TH1D*getTH1D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, TString xtitle, TString ytitle)
static TH1D*getTH1D(const Char_t* name, const Char_t* title, Int_t xbin, Double_t xmin, Double_t xmax, const Char_t* xtitle, const Char_t* ytitle)
static TH1F*getTH1F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, TString xtitle, TString ytitle)
static TH1F*getTH1F(const Char_t* name, const Char_t* title, Int_t xbin, Double_t xmin, Double_t xmax, const Char_t* xtitle, const Char_t* ytitle)
static TH2D*getTH2D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, TString xtitle, TString ytitle, TString ztitle = "")
static TH2D*getTH2D(const Char_t* name, const Char_t* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, const Char_t* xtitle, const Char_t* ytitle, const Char_t* ztitle = "")
static TH2F*getTH2F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, TString xtitle, TString ytitle, TString ztitle = "")
static TH2F*getTH2F(const Char_t* name, const Char_t* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, const Char_t* xtitle, const Char_t* ytitle, const Char_t* ztitle = "")
static TH3D*getTH3D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, TString xtitle, TString ytitle, TString ztitle)
static TH3D*getTH3D(const Char_t* name, const Char_t* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, const Char_t* xtitle, const Char_t* ytitle, const Char_t* ztitle)
static TH3F*getTH3F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, TString xtitle, TString ytitle, TString ztitle)
static TH3F*getTH3F(const Char_t* name, const Char_t* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, const Char_t* xtitle, const Char_t* ytitle, const Char_t* ztitle)
static voidimportAxisAttributes(TAxis* in, TAxis* out, Bool_t labels)
static voidimportAxisLabels(TAxis* in, TAxis* out)
virtual TClass*IsA() const
static Bool_tloadMacro(const Char_t* macro)
static Bool_tloadMacro(TString macro)
static voidmdb(Int_t b = -1)
static TDirectory*Mkdir(TDirectory* dirOld, const Char_t* newDirName, Int_t i = -99, Int_t precision = 1)
static TDirectory*Mkdir(TDirectory* dirOld, const TString newDirName, Int_t i = -99, Int_t precision = 1)
static Char_t*myexec(const Char_t*)
static TStringmyexec(TString)
PTools&operator=(const PTools&)
static voidplotCounts(TH1* hist, Int_t color = 1, TString format = "")
static TLegend*plotLegend(TString pos = "right_top", TString Title = "No Title", Float_t scaleX = 0.9, Float_t scaleY = 0.9, Float_t offsetX = 0.0, Float_t offsetY = 0.0, TString Comment = "", Int_t commencolor = 1)
static voidplotPolarAxis(TH2* hist, Int_t divisions = 18, Float_t direction = 90)
static voidplotPolarAxis(Double_t min = 0.0, Double_t max = 180, Int_t divisions = 10, Float_t direction = 90)
static voidplotPolarGrid(Int_t divisions = 18)
static voidplotPolarSectorGridHADES()
static TLatex*plotTopLegend(const Char_t* label, Float_t x = -1, Float_t y = -1, Float_t size = 0.05, Int_t color = 1)
static voidpostfixToName(TNamed* name, TString postfix)
static voidpostfixToNameTitle(TNamed* name, TString postfix)
static voidpostfixToTitle(TNamed* name, TString postfix)
static voidprefixToName(TNamed* name, TString prefix)
static voidprefixToNameTitle(TNamed* name, TString prefix)
static voidprefixToTitle(TNamed* name, TString prefix)
static voidprintHistogramLimits(TH1* hist)
static voidprintHistogramLimits(TH2* hist)
static voidprintHistogramLimits(TH3* hist)
static TH2D*reBinHistX(TH2* hist, Int_t factor = 1)
static TH1*reverseXAxis(TH1* hist)
static TH2*reverseYAxis(TH2* hist)
static TH3*reverseZAxis(TH3* hist)
static voidsaveGifToPdf(TCanvas* canvas, TString path = ".", TString filename = "", Bool_t separate = kFALSE, Int_t selection = -1)
static voidsaveGifToPdf(TPad* pad, TString path = ".", TString filename = "", Bool_t separate = kFALSE, Int_t selection = -1)
static voidsaveToPdf(TCanvas* canvas, TString path = ".", TString filename = "", Bool_t separate = kFALSE, Int_t selection = -1)
static voidsaveToPdf(TPad* pad, TString path = ".", TString filename = "", Bool_t separate = kFALSE, Int_t selection = -1)
static voidsaveToPng(TCanvas* canvas, TString path = ".", TString filename = "", Bool_t separate = kFALSE, Int_t selection = -1)
static voidsaveToPng(TPad* pad, TString path = ".", TString filename = "", Bool_t separate = kFALSE, Int_t selection = -1)
static voidscaleHistErrors(TH1* hist, Double_t scaleFactor)
static voidsetErrorsOfHistogram(TH1* hist, TH1* err)
static voidsetGraph(TGraph* graph, Int_t mycolorindex = -99, Int_t markerstyle = 20, Int_t markercolor = 1, Float_t markersize = 1., Int_t linecolor = 1)
static voidsetHist(TH1* hist, Int_t mycolorindex = -99, Int_t markerstyle = 20, Int_t markercolor = 1, Float_t markersize = 1., Int_t linecolor = 1)
static voidsetHistErrors(TH1* h, TH1* h2)
static TPaveStats*setHistStatsPosNDC(TH1* hist, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
static TPaveStats*setHistStatsPosNDC(TPad* pad, TString name, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
static TPaveStats*setHistStatsTextColor(TH1* hist, Int_t color)
static TPaveStats*setHistStatsTextColor(TPad* pad, TString name, Int_t color)
static TPaveStats*setHistStatsXPosNDC(TH1* hist, Double_t x1, Double_t x2)
static TPaveStats*setHistStatsXPosNDC(TPad* pad, TString name, Double_t x1, Double_t x2)
static TPaveStats*setHistStatsYPosNDC(TH1* hist, Double_t y1, Double_t y2)
static TPaveStats*setHistStatsYPosNDC(TPad* pad, TString name, Double_t y1, Double_t y2)
static voidsetLatexArts(TLatex* tex, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0., Bool_t ndc = kFALSE)
static voidsetLatexArtsNDC(TLatex* tex, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
static TLegendEntry*setLegendEntry(TLegend* legend, TObject* object, TString label, Int_t col, TString opt)
static voidsetTitleArts(THStack* histogrammStack, const Char_t* xtitle, const Char_t* ytitle, Int_t type = 42)
static voidsetTitleArts(THStack* histogrammStack, const TString xtitle, const TString ytitle, Int_t type = 42)
static voidsetTitleArts(TH1* histogramm, const Char_t* xtitle, const Char_t* ytitle, Int_t color = 4, Int_t type = 42)
static voidsetTitleArts(TH1* histogramm, const TString xtitle, const TString ytitle, Int_t color = 4, Int_t type = 42)
static voidsetTitleArts(TH1* histogramm, const Char_t* xtitle, const Char_t* ytitle, TString color, Int_t type = 42)
static voidsetTitleArts(TH1* histogramm, const TString xtitle, const TString ytitle, TString color, Int_t type = 42)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
static voidsqrt(TH1* hist)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static voidsubstractFromHist(TH1* hist, Double_t val, Bool_t inverse = kFALSE)
static voidsuffixToName(TNamed* name, TString suffix)
static voidsuffixToNameTitle(TNamed* name, TString suffix)
static voidsuffixToTitle(TNamed* name, TString suffix)
protected:
static TH1*copyToTHxD(TH1* hist)
static voidprintHeader(const Char_t* titlehead = 0, const Char_t* mytextfilename = 0, const Int_t nentries = 0, TPad* pad = 0)

Data Members

public:
static const Double_tcopySubsetOfHistDefaultValue

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TPad* getDividedSubPad(TCanvas *canv, Int_t xpads, Int_t ypads)
 divides given canvas mycanvas into xpad times ypads pads
 returns pointer to pad of divided TPad
TPad* getDividedSubPad(TCanvas *canv, Int_t xpads, Int_t ypads, const Char_t * title)
 divides given canvas mycanvas into xpad times ypads pads
 adds a header with title
 returns pointer to pad of divided TPad
TPad* getDividedSubPad(TCanvas *canv, Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename)
 divides given canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 returns pointer to pad of divided TPad
TPad* getDividedSubPad(TCanvas *canv, Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries)
 divides given canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 returns pointer to pad of divided TPad
TPad* getDividedSubPad(TCanvas *canv, Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries, const Char_t * info)
 divides given canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
TPad* getDividedSubPad(TCanvas *canv, Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries, const TString info)
 divides given canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t * title)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 adds a header with title
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t * title, const Char_t * filename)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 adds a header with title
 containing filename and
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t * title, const Char_t * filename, Int_t nentries)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t * title, const Char_t * filename, Int_t nentries, const Char_t * info)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t * title, const Char_t * filename, Int_t nentries, const TString info)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t * title, const Char_t * filename, Int_t nentries, TPaveText *info)
 divides new canvas mycanvas of size xsizy * ysize
 into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t * title)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries, const Char_t * info)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries, const TString info)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(Int_t xpads, Int_t ypads, const Char_t * title, const Char_t * filename, Int_t nentries, TPaveText *info)
 divides new canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
 memory leak! only for CINT use
TPad* getDividedSubPad(TCanvas *mycanvas, Int_t xpads, Int_t ypads, const Char_t *titlehead, const Char_t *mytextfilename, Int_t nentries, TPaveText *info)
 divides given canvas mycanvas into xpad times ypads pads
 adds a header with title
 containing filename and
 number of entries
 creates an info box at the right of the canvas
 returns pointer to pad of divided TPad
void printHeader(const Char_t* titlehead = 0, const Char_t* mytextfilename = 0, const Int_t nentries = 0, TPad* pad = 0)
 prints header of canvas containing in the parent pad
 header contains filename and number of entries
void evalStopwatch(TStopwatch* timer, Int_t nevts)
 evaluates Stopwatch for given number of events
 also plots the machine where it was running on
void setTitleArts( TH1* histogramm, const Char_t *xtitle, const Char_t *ytitle, TString color, Int_t type)
 sets titles of x axis, y axis, fill color and font type for histogramm
 with colors "black","red","bright green","bright blue","yellow","hot pink","aqua","green","blue","default"
void setTitleArts( TH1* histogramm, const TString xtitle, const TString ytitle, TString color, Int_t type)
 sets titles of x axis, y axis, fill color and font type for histogramm
 with colors "black","red","bright green","bright blue","yellow","hot pink","aqua","green","blue","default"
void setTitleArts( TH1* histogramm, const TString xtitle, const TString ytitle, Int_t fillColor, Int_t titleFont)
 sets titles of x axis, y axis, fill color and font type for histogramm
void setTitleArts( TH1* histogramm, const Char_t *xtitle, const Char_t * ytitle, Int_t fillColor, Int_t titleFont)
 sets titles of x axis, y axis, fill color and font type for histogramm
 with colors "black","red","bright green","bright blue","yellow","hot pink","aqua","green","blue","default"
void setTitleArts( THStack* histogrammStack, const TString xtitle, const TString ytitle, Int_t titleFont)
 sets titles of x axis, y axis, font type for histogramm for histogramm stack
void setTitleArts( THStack* histogrammStack, const Char_t *xtitle, const Char_t * ytitle, Int_t titleFont)
 sets titles of x axis, y axis, font type for histogramm for histogramm stack
TCanvas* drawCanvas(const Char_t* , const Char_t* , TH1** , Int_t , Int_t )
 draws default canvas divided xsize times ysize and fills it with the contents of histarray[i] at pad(i) using plot option
 only useful for 6 pads!!
TCanvas* draw32Canvas(const Char_t* , const Char_t* , TH1F** )
 draws default canvas divided 3 times 2 and fills it with the contents of histarray[i] at pad(i) using plot option
TCanvas* draw32CanvasTH2(const Char_t* , const Char_t* , TH2F** , const Char_t* option = 0)
 draws default canvas divided 3 times 2 and fills it with the contents of histarray[i] at pad(i) using plot option "option"
void cutEnd(Char_t* , const Char_t* )
 cuts from infi end from the end
Char_t * myexec(const Char_t * in)
 executes command in
 and returns Char_t pointer to result string
 user have to delete return string
TString myexec(TString in)
 executes command in
 and returns Char_t pointer to result string
 user have to delete return string
void mdb(Int_t b = -1)
 small minidebug message, with increasing static counter
 prints out called if called different from -1
 useful example
 PTools::mdb(\__LINE__)
TDirectory * Mkdir(TDirectory *dirOld, const Char_t *newDirName, Int_t index, Int_t precision)
 Function to create subdirectories
 of dirOld with name newDirName
 if index differs from -99 then index is attached to the name with the precision of precision
 changes to the new created directory
 returns the pointer to the new directory
Thanks to J.Kempter (J.Markert)
TDirectory * Mkdir(TDirectory *dirOld, const TString newDirName, Int_t index, Int_t precision)
 see:   PTools::Mkdir(TDirectory *dirOld, const Char_t *newDirName, Int_t index, Int_t precision
void getHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax, Int_t& nbinsy, Axis_t& ymin, Axis_t& ymax, Int_t& nbinsz, Axis_t& zmin, Axis_t& zmax)
 returns the limits of hist
void getHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax, Int_t& nbinsy, Axis_t& ymin, Axis_t& ymax)
 returns the limits of hist
void getHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax)
 returns the limits of hist
void printHistogramLimits(TH1* hist)
 prints the limits of hist
void printHistogramLimits(TH2* hist)
 prints the limits of hist
void printHistogramLimits(TH3* hist)
 prints the limits of hist
Bool_t compareHistogramLimits(TH1* hist1, TH1* hist2, Bool_t exit_on_failure)
 compares limits of hist1 with limits hist2 (nbins, min, max)
 if exitIfNotEqual is set exit.
Int_t getNFilledBins(TH1* hist, Double_t min = -1, Double_t max = -1)
 get number of filled bins where the
 bin contents are within the limits of min and max
void cleanHistogram(TH1* hist, Double_t min, Double_t max, Int_t errorMode = 0)
 cleans histograms
 bin contents out of the limits of min and max
 are set to 0
 errors are set to 0

 if errorMode is not equal [default=0]
 then instead of the binContent
 the min-max condition is applied on the errors

 errorMode = 0: bin contents
 errorMode > 0: absolute Values are compared
 errorMode < 0: relative Errors are considere
 (for this purpose the function getErrorsOfHistogram() is used, see there for definitions of exceptions)
void prefixToName(TNamed* name, TString prefix)
void prefixToTitle(TNamed* name, TString prefix)
void prefixToNameTitle(TNamed* name, TString prefix)
void postfixToName(TNamed* name, TString postfix)
 attaches to the name of TNamed name "_postfix"
 and      " - postfix" to its title
void postfixToTitle(TNamed* name, TString postfix)
 attaches to TNamed name " - postfix" to its title
void postfixToNameTitle(TNamed* name, TString postfix)
 attaches to the name of TNamed name "_postfix"
 and      " - postfix" to its title
void cutHistogram(TH2* hist, TCutG *cut, Bool_t complement)
 cuts 2-dim histogram hist by using the graphical cut
 complement inverts the selection
void cutHistogram(TH2* hist, TObjArray *cutarray, Bool_t complement)
 cuts 2-dim histogram hist by using logical or of the graphical cuts in the cutarray
 complement inverts the selection
void plotCounts(TH1* hist, Int_t color = 1, TString format = "")
 plots above each bin of hist
 the bin content
 in color
 format can specify via e.g. %2.4f special output formats
 but only fixed to floating precisions, so if you want to display just integers e.g. choose %4.0f
TH1F* getTH1F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, TString xtitle, TString ytitle)
 one command for initializing a TH1F histogramm
 object has to be deleted by user
TH2F* getTH2F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, TString xtitle, TString ytitle, TString ztitle)
 one command for initializing a TH2F histogramm
 object has to be deleted by user
TH3F* getTH3F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, TString xtitle, TString ytitle, TString ztitle)
 one command for initializing a TH3F histogramm
 object has to be deleted by user
TH1D* getTH1D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, TString xtitle, TString ytitle)
 one command for initializing a TH1D histogramm
 object has to be deleted by user
TH2D* getTH2D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, TString xtitle, TString ytitle, TString ztitle)
 one command for initializing a TH2D histogramm
 object has to be deleted by user
TH3D* getTH3D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, TString xtitle, TString ytitle, TString ztitle)
 one command for initializing a TH3D histogramm
 object has to be deleted by user
TH1* reverseXAxis(TH1* hist)
 reverses the X-Axis of the histogramm
 creates a new histogramm
TH2* reverseYAxis(TH2* hist)
 reverses the Y-Axis of the histogramm
 creates a new histogramm
TH3* reverseZAxis(TH3* hist)
 reverses the Z-Axis of the histogramm
 creates a new histogramm
void plotPolarAxis(Double_t min = 0.0, Double_t max = 180, Int_t divisions = 10, Float_t direction = 90)
 plots polar axis
 starting from min
 ending at max
 pointing in direction (angle [rad])
 with n divisions
void plotPolarAxis(TH2* hist, Int_t divisions = 18, Float_t direction = 90)
 plots polar axis using the limits of hist
 see plotPolarAxis
void plotPolarGrid(Int_t divisions = 18)
 plots in polar coordiates
 a circular grid
 with the hades naming of phi angles

void plotPolarSectorGridHADES()
 plots in polar coordiates
 a line axis grid
 with the hades naming of phi angles
void saveToPdf(TCanvas* canvas,TString path,TString filename,Bool_t separate, Int_t selection)
 saves canvas to pdf
 to path
 using filename
 if separate is used
 each sub pad is printed to its own file
 (requieres external function ps2pdf)
 Thanks to Jochen Markert, GSI
 selection selects one specific subpad number if selection > 0
 produced now output in compatiblity mode 1.4 (Acrobat 5 and higher)
void saveToPdf(TPad* pad,TString path,TString filename,Bool_t separate, Int_t selection)
 saves pad to pdf
 to path
 using filename
 if separate is used
 each sub pad is printed to its own file
 (requieres external function ps2pdf)
 Thanks to Jochen Markert, GSI
 selection selects one specific subpad number if selection > 0
 produced now output in compatiblity mode 1.4 (Acrobat 5 and higher)
void saveToPng(TCanvas* canvas,TString path,TString filename,Bool_t separate, Int_t selection)
 saves canvas to png
 to path
 using filename
 if separate is used
 each sub pad is printed to its own file
 (requieres external function convert)
 Thanks to Jochen Markert, GSI
 selection selects one specific subpad number if selection > 0
void saveToPng(TPad* pad,TString path,TString filename,Bool_t separate, Int_t selection)
 saves pad to png
 to path
 using filename
 if separate is used
 each sub pad is printed to its own file
 (requieres external function convert)
 Thanks to Jochen Markert, GSI
 selection selects one specific subpad number if selection > 0
void saveGifToPdf(TCanvas* canvas,TString path,TString filename,Bool_t separate, Int_t selection)
 saves canvas to gif
 to path
 using filename
 if separate is used
 each sub pad is printed to its own file
 (requieres external function convert)
 Thanks to Jochen Markert, GSI
 selection selects one specific subpad number if selection > 0
void saveGifToPdf(TPad* pad,TString path,TString filename,Bool_t separate, Int_t selection)
 saves pad to gif
 to path
 using filename
 if separate is used
 each sub pad is printed to its own file
 (requieres external function convert)
 Thanks to Jochen Markert, GSI
 selection selects one specific subpad number if selection > 0
Int_t getColorJM(Int_t i)
 Thanks to Jochen Markert, GSI
Int_t getMarkerJM(Int_t i)
 Thanks to Jochen Markert, GSI
void setGraph(TGraph* graph, Int_t mycolorindex = -99, Int_t markerstyle = 20, Int_t markercolor = 1, Float_t markersize = 1., Int_t linecolor = 1)
 Thanks to Jochen Markert, GSI
void setHist(TH1* hist, Int_t mycolorindex = -99, Int_t markerstyle = 20, Int_t markercolor = 1, Float_t markersize = 1., Int_t linecolor = 1)
 Thanks to Jochen Markert, GSI
TLegend* plotLegend(TString pos = "right_top", TString Title = "No Title", Float_t scaleX = 0.9, Float_t scaleY = 0.9, Float_t offsetX = 0.0, Float_t offsetY = 0.0, TString Comment = "", Int_t commencolor = 1)
 Thanks to Jochen Markert, GSI
TLegendEntry* setLegendEntry(TLegend* legend, TObject* object, TString label, Int_t col, TString opt)
 add entry for object with label and color and option to legend

 Thanks to Jochen Markert, GSI
TLatex* plotTopLegend(const Char_t* label, Float_t x = -1, Float_t y = -1, Float_t size = 0.05, Int_t color = 1)
 Thanks to Jochen Markert, GSI
 coordinates in NDC!
Double_t getMeanErrorRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString s = "center")
 calculates the error of arithmetic mean of a TH1
 in a range between minX and maxX
 position: determines the value of the bin taken
           "center" : bin center value [default]
           "up"     : bin upper edge
           "low"    : bin lower edge value
Double_t getMeanErrorRange(TH1* hist, Int_t minX, Int_t maxX, TString s = "center")
 calculates the error of arithmetic mean of a TH1
 in a range between bin minX and bin maxX
 position: determines the value of the bin taken
           "center" : bin center value [default]
           "up"     : bin upper edge
           "low"    : bin lower edge value
Double_t getMeanRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString s = "center")
 calculates the arithmetic mean of a TH1
 in a range between minX and maxX
 position: determines the value of the bin taken
           "center" : bin center value [default]
           "up"     : bin upper edge
           "low"    : bin lower edge value
Double_t getMeanRange(TH1* hist, Int_t minX, Int_t maxX, TString s = "center")
 calculates the arithmetic mean of a TH1
 in a range between bin minX and bin maxX
 position: determines the value of the bin taken
           "center" : bin center value [default]
           "up"     : bin upper edge
           "low"    : bin lower edge value
void sqrt(TH1* hist)
 calculates the sqrt of each histogram bin
TNamed* Clone(TNamed* name, TString newname = "", TString title = "")
 Clones named object name and sets the name no newname and its title to title
 if newname and or title are empty
 title and name are extended by "_clone"
TH1* copyToTHxD(TH1* hist)
 copies any THx histogramm to THxD histograms
 you have to cast to the corresponding type
 attaches to name "_THxD"
TH1D copyToTH1D(TH1* hist)
 copy any TH1 histogramm to TH1D histogramm
TH2D copyToTH2D(TH2* hist)
 copy any TH2 histogramm to TH2D histogramm
TH3D copyToTH3D(TH3* hist)
 copy any TH3 histogramm to TH3D histogramm
TH1D* createTH1D(TH1* hist)
 copy any TH1 histogramm to TH1D histogramm
 returned histogram has to be deleted by user
TH2D* createTH2D(TH2* hist)
 copy any TH2 histogramm to TH2D histogramm
 returned histogram has to be deleted by user
TH3D* createTH3D(TH3* hist)
 copy any TH3 histogramm to TH3D histogramm
 returned histogram has to be deleted by user
void importAxisAttributes(TAxis* in, TAxis* out, Bool_t labels)
 Copy TAxis attributes
void importAxisLabels(TAxis* in, TAxis* out)
 copies bin labels from one axis to the other
 if bin numbers differ overlap is taken
Int_t checkHistogramCompatibility(TH1* h1, TH1* h2)
 checks whether h1 and h1

   * have the same type       +(0000001)
   * have the same dimension  +(0000100)
   * have the same binning    +(0010000)
   * have the same limits     +(1000000)

 returns the sum of conditions not matched
 i.e. not same type && not same binning =>  1000001;
 returns 0, if all conditions match
 returns -1, if h1 or h2 is a NULL pointer
Bool_t areHistogramsCompatible(TH1* h1, TH1* h2)
 checks whether h1 and h1

   * have the same binning
   * have the same dimension
   * have the same limits

   NOTE: it allows differences in the types (ClassNames)
   if you want to check for this use checkHistogramCompatibility directly

 returns kTRUE if they are compatible to these checks
 returns kFALSE if not
 returns also kFALSE, if h1 or h2 is a NULL pointer
Bool_t areArraysCompatible(const TArray* array1, const TArray* array2)
 compares two TArrays
 in size, type and values

 if identical kTRUE is returned
 else kFALSE
 returns also kFALSE, if array1 or array2 is a NULL pointer

 supported types are TArrayC, TArrayD, TArrayF, TArrayI, TArrayL, TArrayS

TGraphErrors* fillGraphErr(TH1* hist, TString name = "", TString position = "center", Bool_t xerrors = kFALSE)
 fills an TH1 histogramm hist to a TGraphError
 depending on position
 the x value is chosen
 "center" or "middle": in the middle of the bin
 "low" or "left"     : at the lower edge of the bin
 "up" or "right"     : at the upper edge of the bin

 if name is set, name is assigned as the objects name, otherwise "_graph" is put to the name of hist

 if xerrors is set xerrors are taken as 50% of the bin width

 returns pointer to TGraphError
 if hist does not exists,
   NULL pointer ist returned
 if invalid position is chosen (case insensitive)
   NULL pointer ist returned
TPaveStats* getHistStats(TH1* hist, Bool_t quiet = kFALSE)
 returns for a given (plotted) histogramm the pointer to the statistics TPaveStat
TPaveStats* getHistStats(TPad* pad, TString name, Bool_t quiet = kFALSE, Bool_t noUpdate = kFALSE)
 returns for a given TCanvas/TPad pointer to the statistics TPaveStat of a
 histogram with name "name"
 before calling getHistStats(hist) a pad->Update() is executed

TPaveStats* setHistStatsYPosNDC(TH1* hist, Double_t y1, Double_t y2)
 sets y1 and y2 position in NDC coordinates of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsYPosNDC(TPad* pad, TString name, Double_t y1, Double_t y2)
 sets y1 and y2 position in NDC coordinates of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsXPosNDC(TH1* hist, Double_t x1, Double_t x2)
 sets x1 and x2 position in NDC coordinates of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsXPosNDC(TPad* pad, TString name, Double_t x1, Double_t x2)
 sets x1 and x2 position in NDC coordinates of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsPosNDC(TH1* hist, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
 sets x1,y1 and x2,y2 position in NDC coordinates of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsPosNDC(TPad* pad, TString name, Double_t x1, Double_t x2, Double_t y1, Double_t y2)
 sets x1,y1 and x2,y2 position in NDC coordinates of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
TPaveStats* getHistStatsYPosNDC(TH1* hist, Double_t& y1, Double_t& y2)
 gets y1 and y2 position in NDC coordinates of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* getHistStatsYPosNDC(TPad* pad, TString name, Double_t& y1, Double_t& y2)
 gets y1 and y2 position in NDC coordinates of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
TPaveStats* getHistStatsXPosNDC(TH1* hist, Double_t& x1, Double_t& x2)
 gets x1 and x2 position in NDC coordinates of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* getHistStatsXPosNDC(TPad* pad, TString name, Double_t& x1, Double_t& x2)
 gets x1 and x2 position in NDC coordinates of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
TPaveStats* getHistStatsPosNDC(TH1* hist, Double_t& x1, Double_t& x2, Double_t& y1, Double_t& y2)
 gets x1,y1 and x2,y2 position in NDC coordinates of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* getHistStatsPosNDC(TPad* pad, TString name, Double_t& x1, Double_t& x2, Double_t& y1, Double_t& y2)
 gets x1,y1 and x2,y2 position in NDC coordinates of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsTextColor(TH1* hist, Int_t color)
 sets text color of stats box of histogramm
 returns pointer to stats' TPaveStats
TPaveStats* setHistStatsTextColor(TPad* pad, TString name, Int_t color)
 sets text color of stats box of histogramm
 with name "name" in pad
 returns pointer to stats' TPaveStats
void setLatexArts(TLatex* tex, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0., Bool_t ndc = kFALSE)
 sets attributes of TLatex object tex:
 x,y positions (choose setLatexArtsNDC for NDC coords)
 color
 size
 alignment
 font
 angle
 ndc: use ndc coordinates

 see TAttText for detailed information
void setLatexArtsNDC(TLatex* tex, Double_t x, Double_t y, Int_t color = 1, Float_t size = 0.1, Int_t align = 11, Int_t font = 62, Float_t angle = 0.)
 sets attributes of TLatex object tex:
 x,y positions in NDC coords
 color
 size
 alignment
 font
 angle
 see TAttText for detailed information
Bool_t loadMacro(const Char_t *macro)
 loads Macro only if macro has not yet been loaded before
 returns true if macro is loaded
 returns true if no action is necessary
Bool_t loadMacro(TString macro)
 loads Macro only if macro has not yet been loaded before
 returns true if macro is loaded
 returns true if no action is necessary
Int_t getLinearIndex(Int_t x1, UInt_t x1max, Int_t x2, UInt_t x2max = 0, Int_t x3 = -1, UInt_t x3max = 0, Int_t x4 = -1, UInt_t x4max = 0, Int_t x5 = -1, UInt_t x5max = 0)
 Translates i.e. array coordinate 0,2,3 of array[3][8][1]
 in a linear unique coordinate starting from 0

 coordinates starting from 0 !!!

 if x(i) is < 0 then only the x(i-1) coords are taken into account
 if indizes are out of bounds -1 is returned
Int_t getLinearIndex(Int_t* x, UInt_t* xmax, UInt_t dim)
 Translates i.e. array coordinate 0,2,3 of array[3][8][1]
 in a linear unique coordinate starting from 0

 coordinates starting from 0 !!!

 if x(i) is < 0 then only the x(i-1) coords are taken into account
 x is contains the coordinates and has dimension dim
 xmax are the sizes and is of dimension dim
 if indizes are out of bounds -1 is returned
TLatex * drawLatexWC(TString text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y not in NDC but it WC
 using setLatexArtsNDC
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatexWC(const Char_t* text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y not in NDC but it WC
 using setLatexArtsNDC
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatexNDC(const Char_t* text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y in NDC
 using setLatexArtsNDC
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatexNDC(TString text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y in NDC
 using setLatexArtsNDC
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatex(TString text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y in NDC
 using setLatexArtsNDC
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatex(const Char_t* text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y in NDC
 using setLatexArtsNDC
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatexPadCoords(TString text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y in NDC
 using setLatexArts
 returns pointer to new created TLatex object (user must care of removal)
TLatex * drawLatexPadCoords(const Char_t* text, Double_t x, Double_t y, Int_t color, Float_t size, Int_t align, Int_t font, Float_t angle)
 Draws text as TLatex in current pad
 at pos x,y in NDC
 using setLatexArts
 returns pointer to new created TLatex object (user must care of removal)
TH1* getErrorsOfHistogram(TH1* hist, Bool_t relativeError = kFALSE)
 creates histogram
 which contains the errors of hist
 if an error occurs NULL is returned
 the name and title of the new histogramm will expanded by "_Error" or "_relError"
 relativeError is kTRUE then |relativeError| is calculated
   (if hist does not contain in a bin the relative error is set to -1)
 otherwise the absolute error is given
void setErrorsOfHistogram(TH1* hist, TH1* err)
 sets the errors of histogram hist with the bin contents of hist err
 provided the histograms are compatible

 if hist or err are NULL pointer, or the histograms are not compatible,
 an error message is issued, but nothing happens
TH1* copyToUnitBinsPlusLabels(TH1* hist, Double_t binningX = 1., Double_t binningY = 1., Double_t binningZ = 1.)
 copies any THx histogramm to THxD histograms
 you have to cast to the corresponding type
 attaches to name "_THxD"
 the histogramm has as many bins as the original but a binning of binningXYZ [default =1]
void substractFromHist(TH1* hist, Double_t val, Bool_t inverse = kFALSE)
 substracts from each bin of histogram the value val newbin = bin - val
 if inverse = kTRUE: newbin = val - bin
TH1D * getBinContentDistribution(TH1* hist, Int_t binning = -1, Bool_t excludeUnderAndOverFlowBins = kFALSE)
 returns a pointer to a histogram containing the distribution of the bin contents
 by default in 1000 bins

 The histogram range is determined by searching for the minimum and maximum bin content
 and then setting the output histograms minimum to the found minimum,
 the maximum to maximum+(maximum - minimum)/binning, i.e. maximum+binWidth
 this one bin more is accounted for by having not binning, but binning + 1 bins.

 if hist is NULL ... NULL is returned

 Also the underflow and overflow bins are by default taken into account
 -- those can be excluded by setting excludeUnderAndOverFlowBins to kTRUE
TH1 * getOneOverHist(TH1* hist)
 returns a pointer to a histogram containing for each bin the value 1/value
 if value = 0, the ratio is set to 0

 the name is "OneOverHist" and the title "1/hist"
 if hist is NULL ... NULL is returned
void setHistErrors(TH1* h, TH1* h2)
 sets bincontent of hist h2 as errors of h
 lent from jochen
TH2D * reBinHistX(TH2* hist, Int_t factor = 1)
 returns a pointer to a histogram containing for each bin the value 1/value
 if value = 0, the ratio is set to 0

 the name is "OneOverHist" and the title "1/hist"
 if hist is NULL ... NULL is returned
void cleanHistogramPtyOnP(TH2* hist, Double_t mass, Double_t min, Double_t max, Double_t replaceBy = 0)
 cleans histograms
 bin contents out of the limits for p min and max
 are set to replaceBy
 errors are set to error 0
 mass of particle needed
Int_t findEndOfDistribution(TH1* hist, Int_t min, Double_t threshold, Bool_t compact = kFALSE)
 returns bin number where distribution ends
 i.e where no data is beyond threshold
 starting from left to right at bin number min
 returns -1 if hist is NULL
 if compact is set no bin larger min is accepted to be below threshold
 otherwise wholes of 1 bins are allowed
Int_t findBeginOfDistribution(TH1* hist, Int_t max, Double_t threshold, Bool_t compact = kFALSE)
 returns bin number where distribution begins
 i.e where no data is beyond threshold
 starting from right to left at bin number max
 returns -1 if hist is NULL
 if compact is set no bin smaller than max is accepted to be below threshold
 otherwise wholes of 1 bins are allowed
void scaleHistErrors(TH1* hist, Double_t scaleFactor)
 scales Errors of hist by scaleFactor
TH1* copyBinSubsetOfHist(TH1* hist, Int_t xbinmin = -1, Int_t xbinmax = -1, Int_t ybinmin = -1, Int_t ybinmax = -1, Int_t zbinmin = -1, Int_t zbinmax = -1)
 copies subsection of any THx histogramm hist to THxD histograms
 you have to speciy via xbinmin [default:-1], xbinmax [default:-1],
                        ybinmin [default:-1], ybinmax [default:-1],
                        zbinmin [default:-1], zbinmax [default:-1]
 the bin range you want to select
 (NOTE: To choose the coordinates you have to use ((TAxis*)hist->GetXaxis())->FindBin(value); )
 (NOTE: you have to cast to the corresponding type of histogram)

 attaches to name "_subset_X_xminbin-xmaxbin"
                  "_subset_X_xminbin-xmaxbin_Y_yminbin-ymaxbin"
                  "_subset_X_xminbin-xmaxbin_Y_yminbin-ymaxbin_Z_zminbin-zmaxbin

 if hist is NULL, NULL is returned
 in case dimension doesn't match with bin minima and maxima dimensions
 the choice is ignored.
 if xbinmin, xbinmax, ybinmin, yzbinmax, zbinmin, yxbinmax are negativ the full range is taken
 if minima > maxima NULL is returned

 The entries are copied from the original histogram, because they cannot calculated
TH1* copySubsetOfHist(TH1* hist, Double_t xmin = copySubsetOfHistDefaultValue, Double_t xmax = copySubsetOfHistDefaultValue, Double_t ymin = copySubsetOfHistDefaultValue, Double_t ymax = copySubsetOfHistDefaultValue, Double_t zmin = copySubsetOfHistDefaultValue, Double_t zmax = copySubsetOfHistDefaultValue)
 copies subsection of any THx histogramm hist to THxD histograms
 you have to speciy via xmin [default: PTools::copySubsetOfHistDefaultValue],
                        xmax [default: PTools::copySubsetOfHistDefaultValue],
                        ymin [default: PTools::copySubsetOfHistDefaultValue],
                        ymax [default: PTools::copySubsetOfHistDefaultValue],
                        zmin [default: PTools::copySubsetOfHistDefaultValue],
                        zmax [default: PTools::copySubsetOfHistDefaultValue]
 the range you want to select
 via ((TAxis*)hist->GetXaxis())->FindBin(value); the corresponding bin range is calculated

 Following copyBinSubsetOfHist is called and afterwards the name and title of the histogram are just adopted

          to name "_subset_X_xmin-xmax"
                  "_subset_X_xmin-xmax_Y_ymin-ymax"
                  "_subset_X_xmin-xmax_Y_ymin-ymax_Z_zmin-zmax

 if hist is NULL, NULL is returned
 in case dimension doesn't match with bin minima and maxima dimensions
 the choice is ignored.
 if xbinmin, xbinmax, ybinmin, yzbinmax, zbinmin, yxbinmax are PTools::copySubsetOfHistDefaultValue
 the full range is taken
 if minima > maxima NULL is returned

 The entries are copied from the original histogram, because they cannot calculated

 (NOTE: you have to cast to the corresponding type of histogram)
void suffixToName(TNamed* name, TString suffix)
  static void             postfixToNameTitle(TNamed *name, Char_t * postfix);
{postfixToName(name, suffix); }
void suffixToTitle(TNamed* name, TString suffix)
  static void             suffixToTitle(TNamed *name, Char_t * suffix){postfixToTitle(name,  suffix);};
{postfixToTitle(name, suffix);}
void suffixToNameTitle(TNamed* name, TString suffix)
  static void             suffixToNameTitle(TNamed *name, Char_t * suffix){postfixToNameTitle(name,  suffix);};
{postfixToNameTitle(name, suffix);}
TH1F* getTH1F( TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, TString xtitle, TString ytitle)
TH2F* getTH2F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, TString xtitle, TString ytitle, TString ztitle="")
TH3F* getTH3F(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, TString xtitle, TString ytitle, TString ztitle)
TH1D* getTH1D( TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, TString xtitle, TString ytitle)
TH2D* getTH2D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, TString xtitle, TString ytitle, TString ztitle="")
TH3D* getTH3D(TString name, TString title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, Int_t zbin, Double_t zmin, Double_t zmax, TString xtitle, TString ytitle, TString ztitle)

Last change: Sat May 22 13:18:03 2010
Last generated: 2010-05-22 13:18

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.