AliPhysics  2b88e80 (2b88e80)

Fit invariant mass distributions. More...

#include <TString.h>
#include <TH2F.h>
#include <TH1F.h>
#include <TH3F.h>
#include <TH1D.h>
#include <TF1.h>
#include <TMath.h>
#include <TCanvas.h>
#include <TStyle.h>
#include <TPad.h>
#include <TFile.h>
#include <TLegend.h>
#include <TObject.h>
#include <TDirectoryFile.h>
#include <TGraphErrors.h>
#include <TList.h>
#include <TArrayD.h>
#include <TGaxis.h>
Include dependency graph for InvMassFit.C:

Go to the source code of this file.

Functions

Bool_t GetFileAndEvents (TString dirName, TString listName)
 
Double_t pi0massP3 (Double_t *x, Double_t *par)
 
Double_t pi0massP2 (Double_t *x, Double_t *par)
 
Double_t pi0massP1 (Double_t *x, Double_t *par)
 
Double_t pi0massP0 (Double_t *x, Double_t *par)
 
Double_t truncatedPolEta (Double_t *x, Double_t *par)
 
Double_t truncatedPolPi0 (Double_t *x, Double_t *par)
 
Double_t CrystalBall (Double_t *x, Double_t *par)
 
void SetFitFun ()
 
void Efficiency (Int_t nPt, TArrayD xPt, TArrayD exPt, TArrayD mesonPt, TArrayD mesonPtBC, TString hname)
 Efficiency calculation called in ProjectAndFit() More...
 
void ProjectAndFit (const Int_t nPt, TString comment, TString leg, TString hname, TArrayD xPtLimits, TArrayD xPt, TArrayD exPt, TH2F *hRe, TH2F *hMi)
 
void PlotGraphs (TString opt, Int_t first, Int_t last)
 
void PrimarySpectra (Int_t nPt, TArrayD xPtLimits, TArrayD xPt, TArrayD exPt)
 
void InvMassFit (TString prodname="LHC18c3_NystromOn", TString filename="AnalysisResults", TString histoDir="Pi0IM_GammaTrackCorr_EMCAL", TString histoList="default", TString calorimeter="EMCAL", TString particle="Pi0", Bool_t mixed=1, Bool_t truncmix=1, Int_t pol=1, Int_t ncomb=1, Bool_t drawAllCombi=0, Float_t nPairMin=20, TString plotFormat="eps")
 

Variables

Bool_t kMix = kFALSE
 
Int_t kPolN = 1
 use mixed event to constrain combinatorial background More...
 
Bool_t kSumw2 = kTRUE
 polinomyal type for residual background under the peak More...
 
Float_t kNPairCut = 20
 Apply Root method Sumw2() More...
 
TString kHistoStartName = "AnaPi0_"
 Minimum number of cluster pairs in pi0 or eta window. More...
 
TString kProdName = "LHC18c3_NystromOn"
 Common starting name in histograms. More...
 
TString kFileName = "AnalysisResults"
 Input production directory name where input file is located. More...
 
TString kPlotFormat = "eps"
 Name of file with input histograms. More...
 
TString kCalorimeter = "EMCAL"
 Automatic plots format. More...
 
TString kParticle = "Pi0"
 Calorimeter, EMCAL, DCAL (PHOS) More...
 
Bool_t kTrunMixFunc = kTRUE
 Particle searched: "Pi0", "Eta". More...
 
Int_t nEvt = 0
 Use a truncated function to get the mixed event scale. More...
 
TFile * fil = 0
 
TFile * fout = 0
 
TListlis = 0
 
TF1 * fitfun = 0
 
TDirectoryFile * direc =0
 
TF1 * tPolPi0 = 0
 
TF1 * tPolEta = 0
 
Int_t modColorIndex [] ={1 , 2, 2, 3, 3, 4, 4, 7, 7, 6, 6, 2, 3, 4, 7, 6, 2, 2, 3, 3, 4, 4, 6, 6}
 
Int_t modStyleIndex [] ={20,24,25,24,25,24,25,24,25,24,25,21,21,21,21,21,22,26,22,26,22,26,22,26}
 

Detailed Description

Fit invariant mass distributions.

Macro using as input the 2D histograms mass vs pT of AliAnaPi0 For a given set of pT bins invariant mass plots are fitted and mass vs pT and width vs pT and neutral meson spectra plots are obtained. Also pure MC histograms checking the origin of the clusters and generated spectra is used to plot efficiencies and acceptance

Based on old 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 InvMassFit.C.

Function Documentation

Double_t CrystalBall ( Double_t x,
Double_t par 
)

Crystal ball function

Definition at line 184 of file InvMassFit.C.

Referenced by SetFitFun().

void Efficiency ( Int_t  nPt,
TArrayD  xPt,
TArrayD  exPt,
TArrayD  mesonPt,
TArrayD  mesonPtBC,
TString  hname 
)

Efficiency calculation called in ProjectAndFit()

Definition at line 286 of file InvMassFit.C.

Referenced by ProjectAndFit().

Bool_t GetFileAndEvents ( TString  dirName,
TString  listName 
)

Open the file and the list and the number of analyzed events

Definition at line 72 of file InvMassFit.C.

Referenced by InvMassFit().

void InvMassFit ( TString  prodname = "LHC18c3_NystromOn",
TString  filename = "AnalysisResults",
TString  histoDir = "Pi0IM_GammaTrackCorr_EMCAL",
TString  histoList = "default",
TString  calorimeter = "EMCAL",
TString  particle = "Pi0",
Bool_t  mixed = 1,
Bool_t  truncmix = 1,
Int_t  pol = 1,
Int_t  ncomb = 1,
Bool_t  drawAllCombi = 0,
Float_t  nPairMin = 20,
TString  plotFormat = "eps" 
)

Main method

Parameters
prodname: name of directory with histogram file
filename: histogram file name
histoDir: TDirectoryFile folder name
histoList: TList folder name
calorimeter"EMCAL","DCAL"
particle: "Pi0","Eta", define fitting and plotting ranges for particle
mixed: bool, use mixed event to constrain combinatorial background
truncmix: bool, 1: use truncated function to constrain backgroun; 0: use factor from fixed bin
pol: int, polinomyal type for residual background under the peak
ncomb: total number of SM combinations (Single SM, same side 2 SM, same sector 2 SM)
drawAllCombiPlot also many SM combinations
nPairMin: minimum number of entries un the pi0 or eta peak integral to do the fits and plotting. Careful in MC scaled productions.
plotFormat: define the type of figures: eps, pdf, etc.

Definition at line 1339 of file InvMassFit.C.

Referenced by PrimarySpectra().

Double_t pi0massP0 ( Double_t x,
Double_t par 
)

Gaussian plus constant function

Definition at line 144 of file InvMassFit.C.

Referenced by SetFitFun().

Double_t pi0massP1 ( Double_t x,
Double_t par 
)

Gaussian plus polinomial order 1 function

Definition at line 132 of file InvMassFit.C.

Referenced by SetFitFun().

Double_t pi0massP2 ( Double_t x,
Double_t par 
)

Gaussian plus polinomial order 2 function

Definition at line 120 of file InvMassFit.C.

Referenced by SetFitFun().

Double_t pi0massP3 ( Double_t x,
Double_t par 
)

Gaussian plus polinomial order 3 function

Definition at line 108 of file InvMassFit.C.

Referenced by SetFitFun().

void PlotGraphs ( TString  opt,
Int_t  first,
Int_t  last 
)

Plot combinations of graphs with fit results SM/Sector/Side/SM group by SM/Sector/Side/SM group comparisons

Definition at line 1043 of file InvMassFit.C.

Referenced by InvMassFit().

void PrimarySpectra ( Int_t  nPt,
TArrayD  xPtLimits,
TArrayD  xPt,
TArrayD  exPt 
)

Get primary generated spectra and detector acceptance Plot them

Definition at line 1184 of file InvMassFit.C.

Referenced by InvMassFit().

void ProjectAndFit ( const Int_t  nPt,
TString  comment,
TString  leg,
TString  hname,
TArrayD  xPtLimits,
TArrayD  xPt,
TArrayD  exPt,
TH2F hRe,
TH2F hMi 
)

Do energy projections, fits and plotting of invariant mass distributions.

Definition at line 433 of file InvMassFit.C.

Referenced by Efficiency(), and InvMassFit().

void SetFitFun ( )

Initialize the fitting function

Definition at line 207 of file InvMassFit.C.

Referenced by InvMassFit().

Double_t truncatedPolEta ( Double_t x,
Double_t par 
)

Truncated function in eta region

Definition at line 156 of file InvMassFit.C.

Referenced by SetFitFun().

Double_t truncatedPolPi0 ( Double_t x,
Double_t par 
)

Truncated function in pi0 region

Definition at line 170 of file InvMassFit.C.

Referenced by SetFitFun().

Variable Documentation

TDirectoryFile* direc =0

Definition at line 59 of file InvMassFit.C.

Referenced by GetFileAndEvents(), and InvMassFit().

TF1* fitfun = 0

Definition at line 58 of file InvMassFit.C.

Referenced by Pi0CalibInvMassAnalysis3(), ProjectAndFit(), and SetFitFun().

TFile* fout = 0

Definition at line 56 of file InvMassFit.C.

Referenced by Efficiency(), InvMassFit(), PlotGraphs(), and ProjectAndFit().

TString kCalorimeter = "EMCAL"

Automatic plots format.

Definition at line 49 of file InvMassFit.C.

TString kFileName = "AnalysisResults"

Input production directory name where input file is located.

Definition at line 47 of file InvMassFit.C.

TString kHistoStartName = "AnaPi0_"

Minimum number of cluster pairs in pi0 or eta window.

Definition at line 45 of file InvMassFit.C.

Bool_t kMix = kFALSE

Definition at line 41 of file InvMassFit.C.

Referenced by Efficiency(), InvMassFit(), PlotGraphs(), and ProjectAndFit().

Float_t kNPairCut = 20

Apply Root method Sumw2()

Definition at line 44 of file InvMassFit.C.

Referenced by InvMassFit(), ProjectAndFit(), and SetFitFun().

TString kParticle = "Pi0"

Calorimeter, EMCAL, DCAL (PHOS)

Definition at line 50 of file InvMassFit.C.

TString kPlotFormat = "eps"

Name of file with input histograms.

Definition at line 48 of file InvMassFit.C.

Int_t kPolN = 1

use mixed event to constrain combinatorial background

Definition at line 42 of file InvMassFit.C.

Referenced by InvMassFit(), ProjectAndFit(), and SetFitFun().

TString kProdName = "LHC18c3_NystromOn"

Common starting name in histograms.

Definition at line 46 of file InvMassFit.C.

Bool_t kSumw2 = kTRUE

polinomyal type for residual background under the peak

Definition at line 43 of file InvMassFit.C.

Referenced by ProjectAndFit().

Bool_t kTrunMixFunc = kTRUE

Particle searched: "Pi0", "Eta".

Definition at line 51 of file InvMassFit.C.

Referenced by InvMassFit(), and ProjectAndFit().

TList* lis = 0

Definition at line 57 of file InvMassFit.C.

Int_t modColorIndex[] ={1 , 2, 2, 3, 3, 4, 4, 7, 7, 6, 6, 2, 3, 4, 7, 6, 2, 2, 3, 3, 4, 4, 6, 6}

Definition at line 65 of file InvMassFit.C.

Referenced by PlotGraphs().

Int_t modStyleIndex[] ={20,24,25,24,25,24,25,24,25,24,25,21,21,21,21,21,22,26,22,26,22,26,22,26}

Definition at line 66 of file InvMassFit.C.

Referenced by PlotGraphs().

Int_t nEvt = 0

Use a truncated function to get the mixed event scale.

Definition at line 54 of file InvMassFit.C.

Referenced by GetFileAndEvents(), PrimarySpectra(), and ProjectAndFit().

TF1* tPolEta = 0

Definition at line 62 of file InvMassFit.C.

Referenced by ProjectAndFit(), and SetFitFun().

TF1* tPolPi0 = 0

Definition at line 61 of file InvMassFit.C.

Referenced by ProjectAndFit(), and SetFitFun().