PTools
class description - source file - inheritance tree (.pdf)
protected:
static TH1* copyToTHxD(TH1* hist)
static void printHeader(const Char_t* titlehead = "0", const Char_t* mytextfilename = "0", const Int_t nentries = 0, TPad* pad = 0)
public:
PTools()
PTools(const PTools&)
~PTools()
static Bool_t areArraysCompatible(const TArray* array1, const TArray* array2)
static Bool_t areHistogramsCompatible(TH1* h1, TH1* h2)
static Int_t checkHistogramCompatibility(TH1* h1, TH1* h2)
static TClass* Class()
static void cleanHistogram(TH1* hist, Double_t min, Double_t max, Int_t errorMode = 0)
static void cleanHistogramPtyOnP(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_t compareHistogramLimits(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 TH1D copyToTH1D(TH1* hist)
static TH2D copyToTH2D(TH2* hist)
static TH3D copyToTH3D(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 void cutEnd(Char_t*, Char_t*)
static void cutHistogram(TH2* hist, TCutG* cut, Bool_t complement = kFALSE)
static void cutHistogram(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* 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* 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* 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* 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 void evalStopwatch(TStopwatch* timer, Int_t nevts)
static TGraphErrors* fillGraphErr(TH1* hist, TString name, TString position = center, Bool_t xerrors = kFALSE)
static Int_t findBeginOfDistribution(TH1* hist, Int_t max, Double_t threshold, Bool_t compact = kFALSE)
static Int_t findEndOfDistribution(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_t getColorJM(Int_t i)
static TPad* getDividedSubPad(TCanvas* canv, Int_t xpads, Int_t ypads)
static TPad* getDividedSubPad(TCanvas* canv, 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, 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)
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)
static TPad* getDividedSubPad(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, 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)
static TPad* getDividedSubPad(Int_t xpads, Int_t ypads, Int_t xsize, Int_t ysize, const Char_t* title)
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(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 void getHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax)
static void getHistogramLimits(TH1* hist, Int_t& nbinsx, Axis_t& xmin, Axis_t& xmax, Int_t& nbinsy, Axis_t& ymin, Axis_t& ymax)
static 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)
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_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)
static Int_t getLinearIndex(Int_t* x, UInt_t* xmax, UInt_t dim)
static Int_t getMarkerJM(Int_t i)
static Double_t getMeanErrorRange(TH1* hist, Int_t minX, Int_t maxX, TString s = center)
static Double_t getMeanErrorRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString s = center)
static Double_t getMeanRange(TH1* hist, Int_t minX, Int_t maxX, TString s = center)
static Double_t getMeanRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString s = center)
static Int_t getNFilledBins(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* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, const char* xtitle, const char* 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* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, const char* xtitle, const char* 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* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, const char* xtitle, const char* ytitle, const char* 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* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, const char* xtitle, const char* ytitle, const char* 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* name, const char* 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* xtitle, const char* ytitle, const char* 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* name, const char* 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* xtitle, const char* ytitle, const char* ztitle)
static void importAxisAttributes(TAxis* in, TAxis* out, Bool_t labels)
static void importAxisLabels(TAxis* in, TAxis* out)
virtual TClass* IsA() const
static Bool_t loadMacro(const char* macro)
static Bool_t loadMacro(TString macro)
static void mdb(int 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* myexec(char*)
static TString myexec(TString)
PTools& operator=(const PTools&)
static void plotCounts(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 void plotPolarAxis(Double_t min = 0.0, Double_t max = 180, Int_t divisions = 10, Float_t direction = 90)
static void plotPolarAxis(TH2* hist, Int_t divisions = 18, Float_t direction = 90)
static void plotPolarGrid(Int_t divisions = 18)
static void plotPolarSectorGridHADES()
static TLatex* plotTopLegend(char* label, Float_t x = -1, Float_t y = -1, Float_t size = 0.05, Int_t color = 1)
static void postfixToName(TNamed* name, TString postfix)
static void postfixToNameTitle(TNamed* name, TString postfix)
static void postfixToTitle(TNamed* name, TString postfix)
static void prefixToName(TNamed* name, TString prefix)
static void prefixToNameTitle(TNamed* name, TString prefix)
static void prefixToTitle(TNamed* name, TString prefix)
static void printHistogramLimits(TH1* hist)
static void printHistogramLimits(TH2* hist)
static void printHistogramLimits(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 void saveGifToPdf(TCanvas* canvas, TString path = ., TString filename, Bool_t separate = kFALSE, Int_t selection = -1)
static void saveGifToPdf(TPad* pad, TString path = ., TString filename, Bool_t separate = kFALSE, Int_t selection = -1)
static void saveToPdf(TCanvas* canvas, TString path = ., TString filename, Bool_t separate = kFALSE, Int_t selection = -1)
static void saveToPdf(TPad* pad, TString path = ., TString filename, Bool_t separate = kFALSE, Int_t selection = -1)
static void saveToPng(TCanvas* canvas, TString path = ., TString filename, Bool_t separate = kFALSE, Int_t selection = -1)
static void saveToPng(TPad* pad, TString path = ., TString filename, Bool_t separate = kFALSE, Int_t selection = -1)
static void scaleHistErrors(TH1* hist, Double_t scaleFactor)
static void setErrorsOfHistogram(TH1* hist, TH1* err)
static void setGraph(TGraph* graph, Int_t mycolorindex = -99, Int_t markerstyle = 20, Int_t markercolor = 1, Float_t markersize = 1., Int_t linecolor = 1)
static void setHist(TH1* hist, Int_t mycolorindex = -99, Int_t markerstyle = 20, Int_t markercolor = 1, Float_t markersize = 1., Int_t linecolor = 1)
static void setHistErrors(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 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)
static 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.)
static TLegendEntry* setLegendEntry(TLegend* legend, TObject* object, TString label, Int_t col, TString opt)
static void setTitleArts(TH1* histogramm, const Char_t* xtitle, const Char_t* ytitle, int color = 4, int type = 42)
static void setTitleArts(TH1* histogramm, const TString xtitle, const TString ytitle, int color = 4, int type = 42)
static void setTitleArts(THStack* histogrammStack, const Char_t* xtitle, const Char_t* ytitle, int type = 42)
static void setTitleArts(THStack* histogrammStack, const TString xtitle, const TString ytitle, int type = 42)
static void setTitleArts(TH1* histogramm, const Char_t* xtitle, const Char_t* ytitle, TString color, int type = 42)
static void setTitleArts(TH1* histogramm, const TString xtitle, const TString ytitle, TString color, int type = 42)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
static void sqrt(TH1* hist)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
static void substractFromHist(TH1* hist, Double_t val, Bool_t inverse = kFALSE)
static void suffixToName(TNamed* name, TString suffix)
static void suffixToNameTitle(TNamed* name, TString suffix)
static void suffixToTitle(TNamed* name, TString suffix)
public:
static const Double_t copySubsetOfHistDefaultValue
Peter's Tools
Author: Peter W. Zumbruch
Contact: P.Zumbruch@gsi.de
Created: Mar 21, 2002
File: $RCSfile: ptools.cc,v $
Version: $Revision: 1.75 $
Modified by $Author: halo $ on $Date: 2006/08/12 13:05:25 $
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, const Char_t *mytextfilename, Int_t nentries, TPad *parentPad)
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 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 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 * name,
const Char_t * title,
TH1 **histarray,
Int_t xsize,
Int_t ysize)
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 * name, const Char_t * title, TH1F *histarray[])
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 * name, const Char_t * title, TH2F *histarray[], const Char_t * option)
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 * infi, Char_t * end)
cuts from infi end from the end
char* myexec(char * in)
executes command in
and returns char pointer to result string
user have to delete return string
TString myexec(TString in)
executes command in
and returns char pointer to result string
user have to delete return string
void mdb(int called)
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) //! Makes new Dir, changes to Dir, returns pointer to new Dir
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) //! Makes new Dir, changes to Dir, returns pointer to new Dir
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 exitIfNotEqual )
compares limits of hist1 with limits hist2 (nbins, min, max)
if exitIfNotEqual is set exit.
Int_t getNFilledBins(TH1 * hist, Double_t min, Double_t max)
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)
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, 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, Double_t max, Int_t divisions, Float_t direction)
plots polar axis
starting from min
ending at max
pointing in direction (angle [rad])
with n divisions
void plotPolarAxis(TH2* hist, Int_t divisions, Float_t direction)
plots polar axis using the limits of hist
see plotPolarAxis
void plotPolarGrid(Int_t division)
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,Int_t markerstyle,Int_t markercolor,Float_t markersize,Int_t linecolor)
Thanks to Jochen Markert, GSI
void setHist(TH1* hist,Int_t mycolorindex,Int_t markerstyle,Int_t markercolor,Float_t markersize,Int_t linecolor)
Thanks to Jochen Markert, GSI
TLegend* plotLegend(TString pos,TString Title,
Float_t scaleX,Float_t scaleY,
Float_t offsetX,Float_t offsetY,
TString Comment,
Int_t commencolor)
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(char* label,Float_t x,Float_t y,Float_t size,Int_t color)
Thanks to Jochen Markert, GSI
coordinates in NDC!
Double_t getMeanErrorRangeUser(TH1* hist, Axis_t minX, Axis_t maxX, TString pos)
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 pos)
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 pos)
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 pos)
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 includeLabels)
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, Bool_t xerrors)
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)
returns for a given (plotted) histogramm the pointer to the statistics TPaveStat
TPaveStats* getHistStats(TPad* pad, TString name, Bool_t quiet, Bool_t noUpdate)
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, Float_t size, Int_t align,
Int_t font, Float_t angle, Bool_t ndc)
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, Float_t size, Int_t align,
Int_t font, Float_t angle)
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 *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,
Int_t x3, UInt_t x3max,
Int_t x4, UInt_t x4max,
Int_t x5, UInt_t x5max)
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* 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* 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* 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* 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)
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, Double_t binningY, Double_t binningZ)
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)
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, Bool_t excludeUnderAndOverFlowBins)
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)
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)
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)
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)
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, Int_t xbinmax,
Int_t ybinmin, Int_t ybinmax,
Int_t zbinmin, Int_t zbinmax
)
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, Double_t xmax,
Double_t ymin, Double_t ymax,
Double_t zmin, Double_t zmax
)
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)
Inline Functions
void ~PTools()
void suffixToName(TNamed* name, TString suffix)
void suffixToTitle(TNamed* name, TString suffix)
void suffixToNameTitle(TNamed* name, TString suffix)
TH1F* getTH1F(const char* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, const char* xtitle, const char* ytitle)
TH2F* getTH2F(const char* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, const char* xtitle, const char* ytitle, const char* ztitle)
TH3F* getTH3F(const char* name, const char* 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* xtitle, const char* ytitle, const char* ztitle)
TH1D* getTH1D(const char* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, const char* xtitle, const char* ytitle)
TH2D* getTH2D(const char* name, const char* title, Int_t xbin, Double_t xmin, Double_t xmax, Int_t ybin, Double_t ymin, Double_t ymax, const char* xtitle, const char* ytitle, const char* ztitle)
TH3D* getTH3D(const char* name, const char* 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* xtitle, const char* ytitle, const char* ztitle)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
PTools PTools()
PTools PTools(const PTools&)
PTools& operator=(const PTools&)
Last update: Fri Jan 26 12:39:32 2007
ROOT page - Class index - Class Hierarchy - 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.