AliPhysics  a8afd6c (a8afd6c)

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 <TROOT.h>
#include "PlotUtils.C"
Include dependency graph for InvMassFit.C:

Go to the source code of this file.

Functions

Bool_t GetFileAndEvents (TString dirName, TString listName)
 
void SetFitFun ()
 
void Efficiency (Int_t nPt, TArrayD xPt, TArrayD exPt, TArrayD mesonPt, TArrayD emesonPt, TArrayD mesonPtBC, TArrayD emesonPtBC, 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 histoStart="", TString calorimeter="EMCAL", TString particle="Pi0", Float_t nPairMin=20, Bool_t sumw2=kTRUE, Int_t rebin=1, Int_t firstTRD=0, Bool_t mixed=kTRUE, Bool_t truncmix=kFALSE, Int_t pol=1, Bool_t drawAll=kTRUE, Bool_t drawMCAll=kFALSE, Bool_t drawPerSM=kTRUE, Bool_t drawPerSMGr=kFALSE, Bool_t drawPerSector=kFALSE, Bool_t drawPerSide=kFALSE, 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(), off for pT hard prod where already done before. More...
 
Float_t kFirstTRDSM = -1
 Minimum number of cluster pairs in pi0 or eta window. More...
 
TString kHistoStartName = "AnaPi0"
 First Calo SM covered by a TRD SM, 6 in 2011 and 4 in 2012-13. More...
 
TString kHistoList = "default"
 Common starting name in histograms. More...
 
TString kProdName = "LHC18c3_NystromOn"
 TList name, usually each list is a different trigger. 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...
 
Float_t kChi2NDFMax = 1000
 Use a truncated function to get the mixed event scale. More...
 
Int_t kRebin = 1
 Maximum value of chi2/ndf to define a fit as good (set lower than 1e6) More...
 
Double_t nEvt = 0
 Rebin invariant mass histograms default binning with this value. 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 , 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 [] ={24,25,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

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

Efficiency calculation called in ProjectAndFit()

Definition at line 195 of file InvMassFit.C.

Referenced by ProjectAndFit(), and SetFitFun().

Bool_t GetFileAndEvents ( TString  dirName,
TString  listName 
)

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

Definition at line 77 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  histoStart = "",
TString  calorimeter = "EMCAL",
TString  particle = "Pi0",
Float_t  nPairMin = 20,
Bool_t  sumw2 = kTRUE,
Int_t  rebin = 1,
Int_t  firstTRD = 0,
Bool_t  mixed = kTRUE,
Bool_t  truncmix = kFALSE,
Int_t  pol = 1,
Bool_t  drawAll = kTRUE,
Bool_t  drawMCAll = kFALSE,
Bool_t  drawPerSM = kTRUE,
Bool_t  drawPerSMGr = kFALSE,
Bool_t  drawPerSector = kFALSE,
Bool_t  drawPerSide = kFALSE,
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
histoStart: begining of histograms name
calorimeter"EMCAL","DCAL"
particle: "Pi0","Eta", define fitting and plotting ranges for particle
nPairMin: minimum number of entries un the pi0 or eta peak integral to do the fits and plotting. Careful in MC scaled productions.
sumw2: bool, apply the histograms Sumw2 method to get proper errors when not done before
rebin: int, rebin default Inv Mass histograms binning with this value
firstTRD: int, First EMCal SM covered by a TRD SM, in 2011 and 4 in 2012-13
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
drawAll: bool, activate plot per pair in any SM
drawMCAll: bool, activate plot per pair in any SM and MC
drawPerSM: bool, activate plot per pair in same SM
drawPerSMGrbool, activate plot per pair in same SM adding SM: 3 groups [3,7], [1,2], [0,4,5,6,8,9], needs drawPerSM=kTRUE
drawPerSectorbool, activate plot per pair in different continuous SM sectors
drawPerSidebool, activate plot per pair in different continuous SM sides
plotFormat: define the type of figures: eps, pdf, etc.

Definition at line 2095 of file InvMassFit.C.

Referenced by PrimarySpectra().

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 1056 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 1851 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 379 of file InvMassFit.C.

Referenced by Efficiency(), and InvMassFit().

void SetFitFun ( )

Initialize the fitting function The function definitions are in PlotUtils.C

Definition at line 115 of file InvMassFit.C.

Referenced by InvMassFit().

Variable Documentation

TDirectoryFile* direc =0

Definition at line 65 of file InvMassFit.C.

Referenced by GetFileAndEvents(), and InvMassFit().

TF1* fitfun = 0

Definition at line 64 of file InvMassFit.C.

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

TFile* fout = 0

Definition at line 62 of file InvMassFit.C.

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

TString kCalorimeter = "EMCAL"

Automatic plots format.

Definition at line 53 of file InvMassFit.C.

Float_t kChi2NDFMax = 1000

Use a truncated function to get the mixed event scale.

Definition at line 56 of file InvMassFit.C.

Referenced by ProjectAndFit().

TString kFileName = "AnalysisResults"

Input production directory name where input file is located.

Definition at line 51 of file InvMassFit.C.

Float_t kFirstTRDSM = -1

Minimum number of cluster pairs in pi0 or eta window.

Definition at line 47 of file InvMassFit.C.

Referenced by InvMassFit(), and PlotGraphs().

TString kHistoList = "default"

Common starting name in histograms.

Definition at line 49 of file InvMassFit.C.

TString kHistoStartName = "AnaPi0"

First Calo SM covered by a TRD SM, 6 in 2011 and 4 in 2012-13.

Definition at line 48 of file InvMassFit.C.

Bool_t kMix = kFALSE

Definition at line 43 of file InvMassFit.C.

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

Float_t kNPairCut = 20

Apply Root method Sumw2(), off for pT hard prod where already done before.

Definition at line 46 of file InvMassFit.C.

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

TString kParticle = "Pi0"

Calorimeter, EMCAL, DCAL (PHOS)

Definition at line 54 of file InvMassFit.C.

TString kPlotFormat = "eps"

Name of file with input histograms.

Definition at line 52 of file InvMassFit.C.

Int_t kPolN = 1

use mixed event to constrain combinatorial background

Definition at line 44 of file InvMassFit.C.

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

TString kProdName = "LHC18c3_NystromOn"

TList name, usually each list is a different trigger.

Definition at line 50 of file InvMassFit.C.

Int_t kRebin = 1

Maximum value of chi2/ndf to define a fit as good (set lower than 1e6)

Definition at line 57 of file InvMassFit.C.

Referenced by InvMassFit(), and ProjectAndFit().

Bool_t kSumw2 = kTRUE

polinomyal type for residual background under the peak

Definition at line 45 of file InvMassFit.C.

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

Bool_t kTrunMixFunc = kTRUE

Particle searched: "Pi0", "Eta".

Definition at line 55 of file InvMassFit.C.

Referenced by InvMassFit(), and ProjectAndFit().

TList* lis = 0

Definition at line 63 of file InvMassFit.C.

Int_t modColorIndex[] ={1 , 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 70 of file InvMassFit.C.

Referenced by PlotGraphs().

Int_t modStyleIndex[] ={24,25,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 71 of file InvMassFit.C.

Referenced by PlotGraphs().

Double_t nEvt = 0

Rebin invariant mass histograms default binning with this value.

Definition at line 60 of file InvMassFit.C.

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

TF1* tPolEta = 0

Definition at line 68 of file InvMassFit.C.

Referenced by ProjectAndFit(), and SetFitFun().

TF1* tPolPi0 = 0

Definition at line 67 of file InvMassFit.C.

Referenced by ProjectAndFit(), and SetFitFun().