AliPhysics  c7b8e89 (c7b8e89)

Plotting utilities. More...

#include <TH1D.h>
#include <TF1.h>
#include <TMath.h>
#include <TGraphErrors.h>
Include dependency graph for PlotUtils.C:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static Double_t FunctionCrystalBall (Double_t *x, Double_t *par)
 
static Double_t FunctionGaussPol3 (Double_t *x, Double_t *par)
 
static Double_t FunctionGaussPol2 (Double_t *x, Double_t *par)
 
static Double_t FunctionGaussPol1 (Double_t *x, Double_t *par)
 
static Double_t FunctionGaussPol0 (Double_t *x, Double_t *par)
 
static Double_t FunctionTruncatedPolEta (Double_t *x, Double_t *par)
 
static Double_t FunctionTruncatedPolPi0 (Double_t *x, Double_t *par)
 
static Double_t GetFractionError (Double_t num, Double_t den, Double_t numErr, Double_t denErr)
 
static TGraphErrorsDivideGraphs (TGraphErrors *gNum, TGraphErrors *gDen)
 
static void GetRangeIntegralAndError (TH1D *h, Int_t binMin, Int_t binMax, Double_t &integral, Double_t &integralErr)
 
static void GetRangeIntegralAndError (TH1D *h, Float_t minX, Float_t maxX, Double_t &integral, Double_t &integralErr)
 
void RemovePointsOutOfRangeOrLargeErrorFromGraph (TGraphErrors *graph, Double_t min, Double_t max, Float_t errFraction=0.5, Float_t value=-1, Float_t valueErr=0)
 
static void ScaleBinBySize (TH1D *h)
 Scale histogram bins by its size. More...
 
void GetCanvasColRowNumber (Int_t npad, Int_t &ncol, Int_t &nrow, Bool_t square=kFALSE)
 

Detailed Description

Plotting utilities.

Macro that containes useful small methods that can be used in plotting macros

Author
Gustavo Conesa Balbastre Gusta.nosp@m.vo.C.nosp@m.onesa.nosp@m..Bal.nosp@m.bastr.nosp@m.e@ce.nosp@m.rn.ch, (LPSC-CNRS)

Definition in file PlotUtils.C.

Function Documentation

static TGraphErrors* DivideGraphs ( TGraphErrors gNum,
TGraphErrors gDen 
)
static

Divide 2 TGraphErrors

Returns
TGraphError result of division
Parameters
gNumTGraphError numerator
gDenTGraphError denominator

Definition at line 151 of file PlotUtils.C.

Referenced by CompareInvMassGraphsDataProd(), CompareInvMassGraphsMCvsData(), GetFractionError(), and PlotGraphs().

static Double_t FunctionCrystalBall ( Double_t x,
Double_t par 
)
static

Crystal ball function. Fitting function.

Definition at line 25 of file PlotUtils.C.

Referenced by SetFitFun().

static Double_t FunctionGaussPol0 ( Double_t x,
Double_t par 
)
static

Gaussian plus constant function. Fitting function.

Definition at line 84 of file PlotUtils.C.

Referenced by SetFitFun().

static Double_t FunctionGaussPol1 ( Double_t x,
Double_t par 
)
static

Gaussian plus polinomial order 1 function. Fitting function.

Definition at line 72 of file PlotUtils.C.

Referenced by SetFitFun().

static Double_t FunctionGaussPol2 ( Double_t x,
Double_t par 
)
static

Gaussian plus polinomial order 2 function. Fitting function.

Definition at line 60 of file PlotUtils.C.

Referenced by SetFitFun().

static Double_t FunctionGaussPol3 ( Double_t x,
Double_t par 
)
static

Gaussian plus polinomial order 3 function. Fitting function.

Definition at line 48 of file PlotUtils.C.

Referenced by SetFitFun().

static Double_t FunctionTruncatedPolEta ( Double_t x,
Double_t par 
)
static

Truncated function in eta region. Fitting function.

Definition at line 96 of file PlotUtils.C.

Referenced by SetFitFun().

static Double_t FunctionTruncatedPolPi0 ( Double_t x,
Double_t par 
)
static

Truncated function in pi0 region. Fitting function.

Definition at line 112 of file PlotUtils.C.

Referenced by SetFitFun().

void GetCanvasColRowNumber ( Int_t  npad,
Int_t ncol,
Int_t nrow,
Bool_t  square = kFALSE 
)

When more than 1 frame pad in a canvas, define the number of columns or rows, depending on the total number of frames

Parameters
npadnumber of pads
ncolnumber of assigned columns
nrownumber of assigned rows
squaretake the number of columns and rows as the square root of npad

Definition at line 304 of file PlotUtils.C.

Referenced by CalculateAndPlot(), CalculateParamChi2MCxTalkDataPerSM(), CompareTH3DataAndMCProd(), DoIt(), and GetSMNumber().

static Double_t GetFractionError ( Double_t  num,
Double_t  den,
Double_t  numErr,
Double_t  denErr 
)
static

Calculation of error of a fraction

Returns
fraction error
Parameters
numnumerator

Definition at line 132 of file PlotUtils.C.

Referenced by CalculateAndPlot(), DivideGraphs(), Efficiency(), FunctionTruncatedPolPi0(), and PrimarySpectra().

static void GetRangeIntegralAndError ( TH1D h,
Int_t  binMin,
Int_t  binMax,
Double_t integral,
Double_t integralErr 
)
static

Get a TH1D integral and its error within a bin range

Parameters
hTH1D
binMinFirst bin of integration
binMaxLast bin of integration
integralsum between first and last bin
integralErrerror of integral

Definition at line 208 of file PlotUtils.C.

Referenced by CalculateAndPlot(), DivideGraphs(), GetRangeIntegralAndError(), PrimarySpectra(), and ProjectAndFit().

static void GetRangeIntegralAndError ( TH1D h,
Float_t  minX,
Float_t  maxX,
Double_t integral,
Double_t integralErr 
)
static

Get a TH1D integral and its error within a x axis range

Parameters
hTH1D
minXx axis minimum value
maxXx axis maximum value
integralsum between first and last bin
integralErrerror of integral

Definition at line 235 of file PlotUtils.C.

void RemovePointsOutOfRangeOrLargeErrorFromGraph ( TGraphErrors graph,
Double_t  min,
Double_t  max,
Float_t  errFraction = 0.5,
Float_t  value = -1,
Float_t  valueErr = 0 
)

When plotting multiple graphs, and need to set different ranges Those points with too large error or out of the desired range are set to a default value out of the plot scale

Parameters
graphTGraphError
minx axis minimum value
maxx axis maximum value
errFractionIf error of point is larger than a fraction of the point, it is removed
valuedefault value for removed point
valueErrdefault error value for removed point

Definition at line 257 of file PlotUtils.C.

Referenced by CompareProductions(), and GetRangeIntegralAndError().

static void ScaleBinBySize ( TH1D h)
static

Scale histogram bins by its size.

Definition at line 285 of file PlotUtils.C.

Referenced by MakeDoubleRatios(), and PrimarySpectra().