1 #ifndef ALIANALYSISTASKSE_H
10 #include <TProfile2D.h>
15 #include <TClonesArray.h>
19 #include <TInterpreter.h>
21 #include "AliAnalysisTask.h"
22 #include "AliCentrality.h"
24 #include "AliESDEvent.h"
25 #include "AliESDInputHandler.h"
26 #include "AliAODEvent.h"
27 #include "AliAODHandler.h"
28 #include "AliAnalysisManager.h"
29 #include "AliAnalysisTaskSE.h"
34 #include "AliGenPythiaEventHeader.h"
35 #include "AliAODMCHeader.h"
36 #include "AliMCEvent.h"
38 #include <AliEmcalJet.h>
39 #include <AliPicoTrack.h>
40 #include "AliVEventHandler.h"
41 #include "AliVParticle.h"
42 #include "AliAODMCParticle.h"
43 #include "AliAnalysisUtils.h"
44 #include "AliRhoParameter.h"
47 #include "AliAnalysisTaskChargedJetsPA.h"
50 //TODO: Not accessing the particles when using MC
51 //TODO: FillHistogram can be done better with virtual TH1(?)
52 ClassImp(AliAnalysisTaskChargedJetsPA)
54 // ######################################################################################## DEFINE HISTOGRAMS
55 void AliAnalysisTaskChargedJetsPA::Init()
58 AliInfo("Creating histograms.");
61 TH1D* tmpHisto = AddHistogram1D<TH1D>("hNumberEvents", "Number of events (0 = before cuts, 1 = after cuts)", "", 2, 0, 2, "stage","N^{Events}/cut");
62 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
63 tmpHisto->GetXaxis()->SetBinLabel(2, "After cuts");
65 tmpHisto = AddHistogram1D<TH1D>("hEventAcceptance", "Accepted events (0 = before cuts, 1 = after pile up, 2 = after vertex)", "", 3, 0, 3, "stage","N^{Events}/cut");
66 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
67 tmpHisto->GetXaxis()->SetBinLabel(2, "After pile up");
68 tmpHisto->GetXaxis()->SetBinLabel(3, "After vertex");
70 tmpHisto = AddHistogram1D<TH1D>("hTrackAcceptance", "Accepted tracks (0 = before cuts, 1 = after eta, 2 = after pT)", "", 3, 0, 3, "stage","N^{Tracks}/cut");
71 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
72 tmpHisto->GetXaxis()->SetBinLabel(2, "After eta");
73 tmpHisto->GetXaxis()->SetBinLabel(3, "After p_{T}");
75 tmpHisto = AddHistogram1D<TH1D>("hJetAcceptance", "Accepted jets (0 = before cuts, 1 = after eta, 2 = after pT, 3 = after area)", "", 4, 0, 4, "stage","N^{Jets}/cut");
76 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
77 tmpHisto->GetXaxis()->SetBinLabel(2, "After eta");
78 tmpHisto->GetXaxis()->SetBinLabel(3, "After p_{T}");
79 tmpHisto->GetXaxis()->SetBinLabel(4, "After area");
81 // NOTE: Jet histograms
84 // ######## Jet spectra
85 AddHistogram1D<TH1D>("hRawJetPt", "Raw jets p_{T} distribution (before cuts)", "", 500, 0., 250., "p_{T} (GeV/c)", "dN^{Jets}/dp_{T}");
86 AddHistogram2D<TH2D>("hJetPt", "Jets p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
87 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTImprovedCMS", "Jets p_{T} distribution, KT background (Improved CMS) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
88 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedPP", "Jets p_{T} distribution, pp background subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
89 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedExternal", "Jets p_{T} distribution, external bgrd. subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
93 AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoKTImprovedCMS", "Mean subtracted KT (CMS w/o signal) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean");
95 if(fAnalyzeDeprecatedBackgrounds)
97 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedTR", "Jets p_{T} distribution, TR background (Cone R=0.6 around jets excluded) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
98 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTPbPb", "Jets p_{T} distribution, KT background (PbPb w/o ghosts) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
99 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTPbPbWithGhosts", "Jets p_{T} distribution, KT background (PbPb w/ ghosts) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
100 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTCMS", "Jets p_{T} distribution, KT background (CMS) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
101 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTMean", "Jets p_{T} distribution, KT background (Mean) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
102 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTTrackLike", "Jets p_{T} distribution, KT background (track-like) subtracted", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
105 // ######## Jet profiles
106 if(fAnalyzeJetProfile)
108 AddHistogram2D<TH2D>("hJetProfile10GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 10 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
109 AddHistogram2D<TH2D>("hJetProfile20GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 20 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
110 AddHistogram2D<TH2D>("hJetProfile30GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 30 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
111 AddHistogram2D<TH2D>("hJetProfile40GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 40 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
112 AddHistogram2D<TH2D>("hJetProfile50GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 50 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
113 AddHistogram2D<TH2D>("hJetProfile60GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 60 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
114 AddHistogram2D<TH2D>("hJetProfile70GeV", "Jet profile, cone p_{T}/jet p_{T} vs. jet radius, jet p_{T} > 70 GeV", "", 12, 0, 0.6,200, 0., 2., "Cone radius","dN^{Jets}/dR", "Ratio");
116 // ######## Jet stuff
117 AddHistogram2D<TH2D>("hJetConstituentPt", "Jet constituents p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
118 AddHistogram1D<TH1D>("hJetCountAll", "Number of Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}");
119 AddHistogram1D<TH1D>("hJetCountAccepted", "Number of accepted Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}");
120 AddHistogram2D<TH2D>("hJetCount", "Correlation jets/accepted jets", "", 200, 0., 200., 200, 0., 200., "N jets","N jets accepted", "d^{2}N^{Events}/dN^{Jets dN^{Jets, acc}}");
121 AddHistogram1D<TH1D>("hLeadingJetPt", "Leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
122 AddHistogram1D<TH1D>("hSecondLeadingJetPt", "Second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
123 AddHistogram1D<TH1D>("hCorrectedLeadingJetPt", "Corrected leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
124 AddHistogram1D<TH1D>("hCorrectedSecondLeadingJetPt", "Corrected second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
125 AddHistogram1D<TH1D>("hJetDeltaPhi", "Jets combinatorial #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)");
126 AddHistogram1D<TH1D>("hLeadingJetDeltaPhi", "1st and 2nd leading jet #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)");
128 // ########## Dijet stuff
129 AddHistogram1D<TH1D>("hDijetLeadingJetPt", "Dijet leading jet p_{T} distribution", "", 500, 0., 100., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
130 AddHistogram1D<TH1D>("hDijetConstituentsPt", "Dijet constituents p_{T} distribution", "", 500, 0., 100., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
131 AddHistogram2D<TH2D>("hDijetPtCorrelation", "Dijet constituents p_{T} correlation", "COLZ", 500, 5., 100., 500, 5., 100., "1st leading jet p_{T} (GeV/c)","2nd leading jet p_{T} (GeV/c)","dN^{Dijets}/d^{2}p_{T}");
134 // NOTE: Jet background histograms
135 if (fAnalyzeBackground)
137 // ########## Default background estimates
138 AddHistogram2D<TH2D>("hKTBackgroundImprovedCMS", "KT background density (Improved CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
139 AddHistogram2D<TH2D>("hKTBackgroundImprovedCMSExternal", "KT background density (Improved CMS approach from external task)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
140 AddHistogram2D<TH2D>("hDeltaPtExternalBgrd", "Background fluctuations #delta p_{T} (KT, External)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
141 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMS", "Background fluctuations #delta p_{T} (KT, Improved CMS-like)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
142 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSPartialExclusion", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, partial jet exclusion)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
143 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSPartialExclusion_Signal", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, partial jet exclusion w/ 1/N_{sig} probability)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
144 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSFullExclusion", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, full leading jet exclusion)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
145 AddHistogram2D<TH2D>("hDeltaPtNoBackground", "Background fluctuations #delta p_{T} (No background)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
146 AddHistogram2D<TH2D>("hDeltaPtNoBackgroundNoEmptyCones", "Background fluctuations #delta p_{T} (No background, no empty cones)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
148 AddHistogram1D<TProfile>("hKTMeanBackgroundImprovedCMS", "KT background mean (Improved CMS approach)", "", 100, 0, 100, "Centrality", "#rho mean");
150 AddHistogram2D<TH2D>("hDijetBackground", "Background density (dijets excluded)", "", 200, 0., 20., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
151 AddHistogram2D<TH2D>("hDijetBackgroundPerpendicular", "Background density (dijets excluded)", "", 200, 0., 20., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
152 AddHistogram2D<TH2D>("hDijetBackgroundPerpendicularDeltaPt", "Background fluctuations #delta p_{T} (dijets excluded)", "", 1201, -80.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
154 if(fAnalyzeDeprecatedBackgrounds)
156 // ########## Different background estimates
157 AddHistogram2D<TH2D>("hKTBackgroundPbPb", "KT background density (PbPb approach, no ghosts)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
158 AddHistogram2D<TH2D>("hKTBackgroundPbPbWithGhosts", "KT background density (PbPb approach w/ ghosts)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
159 AddHistogram2D<TH2D>("hKTBackgroundCMS", "KT background density (CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
160 AddHistogram2D<TH2D>("hKTBackgroundMean", "KT background density (Mean approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
161 AddHistogram2D<TH2D>("hKTBackgroundTrackLike", "KT background density (Track-like approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
163 AddHistogram2D<TH2D>("hTRBackgroundNoExcl", "TR background density (No signal excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
164 AddHistogram2D<TH2D>("hTRBackgroundCone02", "TR background density (Cones R=0.2 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
165 AddHistogram2D<TH2D>("hTRBackgroundCone04", "TR background density (Cones R=0.4 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
166 AddHistogram2D<TH2D>("hTRBackgroundCone06", "TR background density (Cones R=0.6 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
167 AddHistogram2D<TH2D>("hTRBackgroundCone08", "TR background density (Cones R=0.8 around signal jets excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
168 AddHistogram2D<TH2D>("hTRBackgroundExact", "TR background density (signal jets exactly excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
170 // ########## Delta Pt
171 AddHistogram2D<TH2D>("hDeltaPtKTPbPb", "Background fluctuations #delta p_{T} (KT, PbPb w/o ghosts)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
172 AddHistogram2D<TH2D>("hDeltaPtKTPbPbWithGhosts", "Background fluctuations #delta p_{T} (KT, PbPb w/ ghosts)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
173 AddHistogram2D<TH2D>("hDeltaPtKTCMS", "Background fluctuations #delta p_{T} (KT, CMS-like)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
174 AddHistogram2D<TH2D>("hDeltaPtKTMean", "Background fluctuations #delta p_{T} (KT, Mean)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
175 AddHistogram2D<TH2D>("hDeltaPtKTTrackLike", "Background fluctuations #delta p_{T} (KT, track-like)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
176 AddHistogram2D<TH2D>("hDeltaPtTR", "Background fluctuations #delta p_{T} (TR, cone R=0.6)", "", 1201, -40.0, 40.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
178 // ########## Profiles for background means vs. centrality
179 AddHistogram1D<TProfile>("hKTMeanBackgroundPbPb", "KT background mean (PbPb approach w/o ghosts)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
180 AddHistogram1D<TProfile>("hKTMeanBackgroundPbPbWithGhosts", "KT background mean (PbPb approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
181 AddHistogram1D<TProfile>("hKTMeanBackgroundCMS", "KT background mean (CMS approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
182 AddHistogram1D<TProfile>("hKTMeanBackgroundMean", "KT background mean (Mean approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
183 AddHistogram1D<TProfile>("hKTMeanBackgroundTPC", "KT background mean (Track-like approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
184 AddHistogram1D<TProfile>("hTRMeanBackground", "TR background mean", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
187 // NOTE: Jet constituent correlations
188 if(fAnalyzeMassCorrelation)
190 AddHistogram1D<TH1D>("hJetMassFromConstituents", "Jet mass by mass of charged constituents", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}");
191 AddHistogram1D<TH1D>("hJetMass", "Jet mass from fastjet", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}");
193 AddHistogram2D<TH2D>("hJetPtVsMass", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
194 AddHistogram2D<TH2D>("hJetPtVsJetMass", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
196 AddHistogram2D<TH2D>("hJetPtVsProtonCount", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Proton percentage", "d^{2}N}/dN^{p_{T}dPercentage");
197 AddHistogram2D<TH2D>("hJetPtVsPionCount", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Pion percentage", "d^{2}N}/dN^{p_{T}dPercentage");
198 AddHistogram2D<TH2D>("hJetPtVsKaonCount", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Kaon percentage", "d^{2}N}/dN^{p_{T}dPercentage");
199 AddHistogram2D<TH2D>("hJetPtVsElectronCount", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Electron percentage", "d^{2}N}/dN^{p_{T}dPercentage");
200 AddHistogram2D<TH2D>("hJetPtVsOthersCount", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 20, 0., 1., "p_{T}","Others percentage", "d^{2}N}/dN^{p_{T}dPercentage");
201 AddHistogram1D<TH1D>("hJetConstituentProtonCount", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
202 AddHistogram1D<TH1D>("hJetConstituentPionCount", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
203 AddHistogram1D<TH1D>("hJetConstituentKaonCount", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
204 AddHistogram1D<TH1D>("hJetConstituentElectronCount", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
205 AddHistogram1D<TH1D>("hJetConstituentOthersCount", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
207 AddHistogram2D<TH2D>("hJetPtVsMass_6_14", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
208 AddHistogram2D<TH2D>("hJetPtVsJetMass_6_14", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
209 AddHistogram2D<TH2D>("hJetPtVsProtonCount_6_14", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Proton count", "d^{2}N}/dN^{p_{T}dN");
210 AddHistogram2D<TH2D>("hJetPtVsPionCount_6_14", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Pion count", "d^{2}N}/dN^{p_{T}dN");
211 AddHistogram2D<TH2D>("hJetPtVsKaonCount_6_14", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Kaon count", "d^{2}N}/dN^{p_{T}dN");
212 AddHistogram2D<TH2D>("hJetPtVsElectronCount_6_14", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Electron count", "d^{2}N}/dN^{p_{T}dN");
213 AddHistogram2D<TH2D>("hJetPtVsOthersCount_6_14", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 8, 6., 14., "p_{T}","Others count", "d^{2}N}/dN^{p_{T}dN");
214 AddHistogram1D<TH1D>("hJetConstituentProtonCount_6_14", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
215 AddHistogram1D<TH1D>("hJetConstituentPionCount_6_14", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
216 AddHistogram1D<TH1D>("hJetConstituentKaonCount_6_14", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
217 AddHistogram1D<TH1D>("hJetConstituentElectronCount_6_14", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
218 AddHistogram1D<TH1D>("hJetConstituentOthersCount_6_14", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
220 AddHistogram2D<TH2D>("hJetPtVsMass_2_X", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
221 AddHistogram2D<TH2D>("hJetPtVsJetMass_2_X", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
222 AddHistogram2D<TH2D>("hJetPtVsProtonCount_2_X", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Proton count", "d^{2}N}/dN^{p_{T}dN");
223 AddHistogram2D<TH2D>("hJetPtVsPionCount_2_X", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Pion count", "d^{2}N}/dN^{p_{T}dN");
224 AddHistogram2D<TH2D>("hJetPtVsKaonCount_2_X", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Kaon count", "d^{2}N}/dN^{p_{T}dN");
225 AddHistogram2D<TH2D>("hJetPtVsElectronCount_2_X", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Electron count", "d^{2}N}/dN^{p_{T}dN");
226 AddHistogram2D<TH2D>("hJetPtVsOthersCount_2_X", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 68, 2., 70., "p_{T}","Others count", "d^{2}N}/dN^{p_{T}dN");
227 AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_X", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
228 AddHistogram1D<TH1D>("hJetConstituentPionCount_2_X", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
229 AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_X", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
230 AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_X", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
231 AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_X", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
233 AddHistogram2D<TH2D>("hJetPtVsMass_2_7", "Correlation jet pt/summed constituent jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
234 AddHistogram2D<TH2D>("hJetPtVsJetMass_2_7", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
235 AddHistogram2D<TH2D>("hJetPtVsProtonCount_2_7", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Proton count", "d^{2}N}/dN^{p_{T}dN");
236 AddHistogram2D<TH2D>("hJetPtVsPionCount_2_7", "Correlation jet pt/amount of pion in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Pion count", "d^{2}N}/dN^{p_{T}dN");
237 AddHistogram2D<TH2D>("hJetPtVsKaonCount_2_7", "Correlation jet pt/amount of kaon in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Kaon count", "d^{2}N}/dN^{p_{T}dN");
238 AddHistogram2D<TH2D>("hJetPtVsElectronCount_2_7", "Correlation jet pt/amount of proton in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Electron count", "d^{2}N}/dN^{p_{T}dN");
239 AddHistogram2D<TH2D>("hJetPtVsOthersCount_2_7", "Correlation jet pt/amount of other particles in jet", "", 400, 0., 100., 6, 2., 8., "p_{T}","Others count", "d^{2}N}/dN^{p_{T}dN");
240 AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_7", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
241 AddHistogram1D<TH1D>("hJetConstituentPionCount_2_7", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
242 AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_7", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
243 AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_7", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
244 AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_7", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
248 // NOTE: Track & Cluster & QA histograms
251 AddHistogram1D<TH1D>("hVertexX", "X distribution of the vertex", "", 2000, -1., 1., "#Delta x(cm)","dN^{Events}/dx");
252 AddHistogram1D<TH1D>("hVertexY", "Y distribution of the vertex", "", 2000, -1., 1., "#Delta y(cm)","dN^{Events}/dy");
253 AddHistogram2D<TH2D>("hVertexXY", "XY distribution of the vertex", "COLZ", 500, -1., 1., 500, -1., 1.,"#Delta x(cm)", "#Delta y(cm)","dN^{Events}/dxdy");
254 AddHistogram1D<TH1D>("hVertexZBeforeVertexCut", "Z distribution of the vertex (before std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz");
255 AddHistogram1D<TH1D>("hVertexZAfterVertexCut", "Z distribution of the vertex (after std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz");
256 AddHistogram1D<TH1D>("hVertexR", "R distribution of the vertex", "", 100, 0., 1., "#Delta r(cm)","dN^{Events}/dr");
257 AddHistogram1D<TH1D>("hCentralityV0M", "Centrality distribution V0M", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
258 AddHistogram1D<TH1D>("hCentralityV0A", "Centrality distribution V0A", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
259 AddHistogram1D<TH1D>("hCentralityV0C", "Centrality distribution V0C", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
260 AddHistogram1D<TH1D>("hCentralityZNA", "Centrality distribution ZNA", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
261 AddHistogram1D<TH1D>("hCentrality", Form("Centrality distribution %s", fCentralityType.Data()), "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
264 AddHistogram2D<TH2D>("hTrackCountAcc", "Number of tracks in acceptance vs. centrality", "LEGO2", 750, 0., 750., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}");
265 AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
266 AddHistogram2D<TH2D>("hTrackPtNegEta", "Tracks p_{T} distribution (negative #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
267 AddHistogram2D<TH2D>("hTrackPtPosEta", "Tracks p_{T} distribution (positive #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
268 AddHistogram1D<TH1D>("hTrackCharge", "Charge", "", 11, -5, 5, "Charge (e)","dN^{Tracks}/dq");
269 AddHistogram1D<TH1D>("hTrackPhi", "Track #phi distribution", "", 360, 0, TMath::TwoPi(), "#phi","dN^{Tracks}/d#phi");
270 AddHistogram2D<TH2D>("hTrackPhiEta", "Track angular distribution", "LEGO2", 100, 0., 2*TMath::Pi(),100, -2.5, 2.5, "#phi","#eta","dN^{Tracks}/(d#phi d#eta)");
272 AddHistogram2D<TH2D>("hTrackPhiPtCut", "Track #phi distribution for different pT cuts", "LEGO2", 360, 0, TMath::TwoPi(), 20, 0, 20, "#phi", "p_{T} lower cut", "dN^{Tracks}/d#phi dp_{T}");
273 AddHistogram2D<TH2D>("hTrackPhiTrackType", "Track #phi distribution for different track types", "LEGO2", 360, 0, TMath::TwoPi(), 3, 0, 3, "#phi", "Label", "dN^{Tracks}/d#phi");
274 AddHistogram2D<TH2D>("hTrackEta", "Track #eta distribution", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Tracks}/d#eta");
278 AddHistogram1D<TH1D>("hRawJetArea", "Jets area distribution w/o area cut", "", 200, 0., 2., "Area","dN^{Jets}/dA");
279 AddHistogram1D<TH1D>("hJetArea", "Jets area distribution", "", 200, 0., 2., "Area","dN^{Jets}/dA");
280 AddHistogram2D<TH2D>("hRawJetPhiEta", "Raw Jets angular distribution w/o #eta cut", "LEGO2", 360, 0., 2*TMath::Pi(),100, -1.0, 1.0, "#phi","#eta","dN^{Jets}/(d#phi d#eta)");
281 AddHistogram2D<TH2D>("hJetEta", "Jets #eta distribution", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
282 AddHistogram2D<TH2D>("hJetEta2GeVTracks", "Jets #eta distribution, track p_{T} > 2 GeV", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
283 AddHistogram2D<TH2D>("hJetEta4GeVTracks", "Jets #eta distribution, track p_{T} > 4 GeV", "COLZ", 180, -fTrackEtaWindow, +fTrackEtaWindow, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
284 AddHistogram2D<TH2D>("hJetPhiEta", "Jets angular distribution", "LEGO2", 360, 0., 2*TMath::Pi(),100, -1.0, 1.0, "#phi","#eta","dN^{Jets}/(d#phi d#eta)");
285 AddHistogram2D<TH2D>("hJetPtVsConstituentCount", "Jets number of constituents vs. jet p_{T}", "COLZ", 400, 0., 200., 100, 0., 100., "p_{T}","N^{Tracks}","dN^{Jets}/(dp_{T} dN^{tracks})");
289 // NOTE: Pythia histograms
292 AddHistogram1D<TH1D>("hPythiaPtHard", "Pythia p_{T} hard distribution", "", 2000, 0, 400, "p_{T} hard","dN^{Events}/dp_{T,hard}");
295 // register Histograms
296 for (Int_t i = 0; i < fHistCount; i++)
298 fOutputList->Add(fHistList->At(i));
301 PostData(1,fOutputList); // important for merging
305 //________________________________________________________________________
306 AliAnalysisTaskChargedJetsPA::AliAnalysisTaskChargedJetsPA(const char *name, const char* trackArrayName, const char* jetArrayName, const char* backgroundJetArrayName) : AliAnalysisTaskSE(name), fOutputList(0), fAnalyzeJets(1), fAnalyzeJetProfile(1), fAnalyzeQA(1), fAnalyzeBackground(1), fAnalyzeDeprecatedBackgrounds(1), fAnalyzePythia(0), fAnalyzeMassCorrelation(0), fHasTracks(0), fHasJets(0), fHasBackgroundJets(0), fIsKinematics(0), fUseDefaultVertexCut(1), fUsePileUpCut(1), fSetCentralityToOne(0), fNoExternalBackground(0), fPartialAnalysisNParts(1), fPartialAnalysisIndex(0), fJetArray(0), fTrackArray(0), fBackgroundJetArray(0), fJetArrayName(0), fTrackArrayName(0), fBackgroundJetArrayName(0), fNumPtHardBins(11), fUsePtHardBin(-1), fRhoTaskName(), fNcoll(6.88348), fRandConeRadius(0.4), fSignalJetRadius(0.4), fBackgroundJetRadius(0.4), fTRBackgroundConeRadius(0.6), fNumberRandCones(8), fNumberExcludedJets(-1), fDijetMaxAngleDeviation(10.0), fPhysicalJetRadius(0.6), fSignalJetEtaWindow(0.5), fBackgroundJetEtaWindow(0.5), fTrackEtaWindow(0.9), fMinTrackPt(0.150), fMinJetPt(0.15), fMinJetArea(0.5), fMinBackgroundJetPt(0.0), fMinDijetLeadingPt(10.0), fNumberOfCentralityBins(20), fCentralityType("V0A"), fFirstLeadingJet(0), fSecondLeadingJet(0), fNumberSignalJets(0), fCrossSection(0.0), fTrials(0.0), fRandom(0), fHelperClass(0), fInitialized(0), fTaskInstanceCounter(0), fHistList(0), fHistCount(0), fIsDEBUG(0), fEventCounter(0)
309 AliInfo("Calling constructor.");
312 // Every instance of this task gets his own number
313 static Int_t instance = 0;
314 fTaskInstanceCounter = instance;
317 fTrackArrayName = new TString(trackArrayName);
318 if (fTrackArrayName->Contains("MCParticles") || fTrackArrayName->Contains("mcparticles"))
319 fIsKinematics = kTRUE;
321 fJetArrayName = new TString(jetArrayName);
322 if (strcmp(fJetArrayName->Data(),"") == 0)
324 fAnalyzeJets = kFALSE;
325 fAnalyzeJetProfile = kFALSE;
328 fAnalyzeJets = kTRUE;
330 fBackgroundJetArrayName = new TString(backgroundJetArrayName);
331 if (strcmp(fBackgroundJetArrayName->Data(),"") == 0)
332 fAnalyzeBackground = kFALSE;
334 fAnalyzeBackground = kTRUE;
336 DefineOutput(1, TList::Class());
338 fHistList = new TList();
340 for(Int_t i=0;i<1024;i++)
341 fSignalJets[i] = NULL;
345 AliInfo("Constructor done.");
350 //________________________________________________________________________
351 inline Double_t AliAnalysisTaskChargedJetsPA::GetConePt(Double_t eta, Double_t phi, Double_t radius)
353 Double_t tmpConePt = 0.0;
355 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
357 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
358 if (IsTrackInAcceptance(tmpTrack))
359 if(IsTrackInCone(tmpTrack, eta, phi, radius))
360 tmpConePt = tmpConePt + tmpTrack->Pt();
365 //________________________________________________________________________
366 inline Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedConePt(Double_t eta, Double_t phi, Double_t radius, Double_t background)
368 Double_t tmpConePt = 0.0;
370 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
372 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
373 if (IsTrackInAcceptance(tmpTrack))
374 if(IsTrackInCone(tmpTrack, eta, phi, radius))
375 tmpConePt = tmpConePt + tmpTrack->Pt();
377 Double_t realConeArea = (2.0*fTrackEtaWindow) * TMath::TwoPi() * MCGetOverlapCircleRectancle(eta, phi, radius, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi());
378 tmpConePt -= background * realConeArea; // subtract background
384 //________________________________________________________________________
385 inline Double_t AliAnalysisTaskChargedJetsPA::GetPtHard()
388 AliInfo("Starting GetPtHard.");
390 AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
395 AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
399 for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++)
401 pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
402 if (pythiaHeader) break;
408 AliInfo("Ending GetPtHard.");
411 return pythiaHeader->GetPtHard();
413 AliWarning(Form("In task %s: GetPtHard() failed!", GetName()));
418 //________________________________________________________________________
419 inline Double_t AliAnalysisTaskChargedJetsPA::GetPythiaTrials()
422 AliInfo("Starting GetPythiaTrials.");
424 AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
429 AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
433 for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++)
435 pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
436 if (pythiaHeader) break;
442 AliInfo("Ending GetPythiaTrials.");
445 return pythiaHeader->Trials();
447 AliWarning(Form("In task %s: GetPythiaTrials() failed!", GetName()));
453 //________________________________________________________________________
454 inline Int_t AliAnalysisTaskChargedJetsPA::GetPtHardBin()
457 AliInfo("Starting GetPtHardBin.");
459 // ########## PT HARD BIN EDGES
460 const Int_t kPtHardLowerEdges[] = { 0, 5,11,21,36,57, 84,117,152,191,234};
461 const Int_t kPtHardHigherEdges[] = { 5,11,21,36,57,84,117,152,191,234,1000000};
463 Int_t tmpPtHardBin = 0;
464 Double_t tmpPtHard = GetPtHard();
466 for (tmpPtHardBin = 0; tmpPtHardBin <= fNumPtHardBins; tmpPtHardBin++)
467 if (tmpPtHard >= kPtHardLowerEdges[tmpPtHardBin] && tmpPtHard < kPtHardHigherEdges[tmpPtHardBin])
471 AliInfo("Ending GetPtHardBin.");
476 //________________________________________________________________________
477 Double_t AliAnalysisTaskChargedJetsPA::GetExternalRho()
479 // Get rho from event.
480 AliRhoParameter *rho = 0;
481 if (!fRhoTaskName.IsNull()) {
482 rho = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoTaskName.Data()));
484 AliWarning(Form("%s: Could not retrieve rho with name %s!", GetName(), fRhoTaskName.Data()));
491 return (rho->GetVal());
495 //________________________________________________________________________
496 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius)
498 // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi)
499 Double_t trackPhi = 0.0;
500 if (track->Phi() > (TMath::TwoPi() - (radius-phi)))
501 trackPhi = track->Phi() - TMath::TwoPi();
502 else if (track->Phi() < (phi+radius - TMath::TwoPi()))
503 trackPhi = track->Phi() + TMath::TwoPi();
505 trackPhi = track->Phi();
507 if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius)
513 //________________________________________________________________________
514 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex)
516 for (Int_t i = 0; i < jet->GetNumberOfTracks(); ++i)
518 Int_t jetTrack = jet->TrackAt(i);
519 if (jetTrack == trackIndex)
525 //________________________________________________________________________
526 inline Bool_t AliAnalysisTaskChargedJetsPA::IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2)
528 for (Int_t i = 0; i < jet1->GetNumberOfTracks(); ++i)
530 Int_t jet1Track = jet1->TrackAt(i);
531 for (Int_t j = 0; j < jet2->GetNumberOfTracks(); ++j)
533 Int_t jet2Track = jet2->TrackAt(j);
534 if (jet1Track == jet2Track)
541 //________________________________________________________________________
542 inline Bool_t AliAnalysisTaskChargedJetsPA::IsEventInAcceptance(AliVEvent* event)
547 FillHistogram("hEventAcceptance", 0.5); // number of events before manual cuts
549 if(fHelperClass->IsPileUpEvent(event))
552 FillHistogram("hEventAcceptance", 1.5); // number of events after pileup cuts
555 FillHistogram("hVertexZBeforeVertexCut",event->GetPrimaryVertex()->GetZ());
557 if(fUseDefaultVertexCut)
559 if(!fHelperClass->IsVertexSelected2013pA(event))
562 else // Failsafe vertex cut
564 if(TMath::Abs(event->GetPrimaryVertex()->GetZ()) > 10.0)
569 FillHistogram("hVertexZAfterVertexCut",event->GetPrimaryVertex()->GetZ());
571 FillHistogram("hEventAcceptance", 2.5); // number of events after vertex cut
576 //________________________________________________________________________
577 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInAcceptance(AliVParticle* track)
579 FillHistogram("hTrackAcceptance", 0.5);
584 // TODO: Only working for AOD MC
585 if((!track->Charge()) || (!(static_cast<AliAODMCParticle*>(track))->IsPhysicalPrimary()) )
588 if (TMath::Abs(track->Eta()) <= fTrackEtaWindow)
590 FillHistogram("hTrackAcceptance", 1.5);
591 if (track->Pt() >= fMinTrackPt)
593 FillHistogram("hTrackAcceptance", 2.5);
601 //________________________________________________________________________
602 inline Bool_t AliAnalysisTaskChargedJetsPA::IsBackgroundJetInAcceptance(AliEmcalJet *jet)
605 if (TMath::Abs(jet->Eta()) <= fBackgroundJetEtaWindow)
606 if (jet->Pt() >= fMinBackgroundJetPt)
612 //________________________________________________________________________
613 inline Bool_t AliAnalysisTaskChargedJetsPA::IsSignalJetInAcceptance(AliEmcalJet *jet)
615 FillHistogram("hJetAcceptance", 0.5);
617 if (TMath::Abs(jet->Eta()) <= fSignalJetEtaWindow)
619 FillHistogram("hJetAcceptance", 1.5);
620 if (jet->Pt() >= fMinJetPt)
622 FillHistogram("hJetAcceptance", 2.5);
623 if (jet->Area() >= fMinJetArea)
625 FillHistogram("hJetAcceptance", 3.5);
633 //________________________________________________________________________
634 inline Bool_t AliAnalysisTaskChargedJetsPA::IsDijet(AliEmcalJet *jet1, AliEmcalJet *jet2)
636 // Output from GetDeltaPhi is < pi in any case
637 if ((jet1 != 0) && (jet2 != 0))
638 if((TMath::Pi() - GetDeltaPhi(jet1->Phi(),jet2->Phi())) < fDijetMaxAngleDeviation)
639 if ((jet1->Pt() > fMinDijetLeadingPt) && (jet2->Pt() > fMinDijetLeadingPt)) //TODO: Introduce recoil jet?
645 //________________________________________________________________________
646 void AliAnalysisTaskChargedJetsPA::ExecOnce()
649 AliInfo("Starting ExecOnce.");
651 fInitialized = kTRUE;
653 // Check for track array
654 if (strcmp(fTrackArrayName->Data(), "") != 0)
656 fTrackArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrackArrayName->Data()));
660 AliWarning(Form("%s: Could not retrieve tracks %s! This is OK, if tracks are not demanded.", GetName(), fTrackArrayName->Data()));
665 TClass *cl = fTrackArray->GetClass();
666 if (!cl->GetBaseClass("AliVParticle"))
668 AliError(Form("%s: Collection %s does not contain AliVParticle objects!", GetName(), fTrackArrayName->Data()));
675 // Check for jet array
676 if (strcmp(fJetArrayName->Data(), "") != 0)
678 fJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetArrayName->Data()));
683 AliWarning(Form("%s: Could not retrieve jets %s! This is OK, if jets are not demanded.", GetName(), fJetArrayName->Data()));
688 if (!fJetArray->GetClass()->GetBaseClass("AliEmcalJet"))
690 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fJetArrayName->Data()));
697 // Check for background object
698 if (strcmp(fBackgroundJetArrayName->Data(), "") != 0)
700 fBackgroundJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fBackgroundJetArrayName->Data()));
701 fHasBackgroundJets = kTRUE;
702 if (!fBackgroundJetArray)
704 AliInfo(Form("%s: Could not retrieve background jets %s! This is OK, if background is not demanded.", GetName(), fBackgroundJetArrayName->Data()));
705 fHasBackgroundJets = kFALSE;
709 // Look, if initialization is OK
710 if (!fHasTracks && fAnalyzeBackground)
712 AliError(Form("%s: Tracks NOT successfully casted although demanded! Deactivating background analysis",GetName()));
713 fAnalyzeBackground = kFALSE;
715 if ((!fHasJets && fAnalyzeJets) || (!fHasJets && fAnalyzeBackground))
717 AliError(Form("%s: Jets NOT successfully casted although demanded! Deactivating jet- and background analysis",GetName()));
718 fAnalyzeJets = kFALSE;
719 fAnalyzeBackground = kFALSE;
721 if (!fHasBackgroundJets && fAnalyzeBackground)
723 AliError(Form("%s: Background NOT successfully casted although demanded! Deactivating background analysis",GetName()));
724 fAnalyzeBackground = kFALSE;
727 // Initialize helper class (for vertex selection & pile up correction)
728 fHelperClass = new AliAnalysisUtils();
729 fHelperClass->SetCutOnZVertexSPD(kFALSE);
734 AliInfo("ExecOnce done.");
739 //________________________________________________________________________
740 void AliAnalysisTaskChargedJetsPA::GetSignalJets()
743 fFirstLeadingJet = NULL;
744 fSecondLeadingJet = NULL;
745 fNumberSignalJets = 0;
748 for (Int_t i = 0; i < fJetArray->GetEntries(); i++)
750 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJetArray->At(i));
753 AliError(Form("%s: Could not receive jet %d", GetName(), i));
756 if (!IsSignalJetInAcceptance(jet))
759 for (Int_t j = 0; j <= tmpJets.GetEntries(); j++)
761 if (j>tmpJets.GetEntries()-1) // When passed last item add the jet at the end
767 AliEmcalJet* listJet = static_cast<AliEmcalJet*>(tmpJets.At(j));
769 if(jet->Pt() < listJet->Pt()) // Insert jet before that one in list if pt smaller
771 tmpJets.AddAt(jet, j);
777 for (Int_t i = 0; i < tmpJets.GetEntries(); i++)
779 AliEmcalJet* jet = static_cast<AliEmcalJet*>(tmpJets.At(i));
780 fSignalJets[fNumberSignalJets] = jet;
784 if (fNumberSignalJets > 0)
785 fFirstLeadingJet = static_cast<AliEmcalJet*>(tmpJets.At(0));
786 if (fNumberSignalJets > 1)
787 fSecondLeadingJet = static_cast<AliEmcalJet*>(tmpJets.At(1));
791 //________________________________________________________________________
792 Int_t AliAnalysisTaskChargedJetsPA::GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets)
794 // Writes first two leading jets into already registered array jetIDArray
798 AliError("Could not get the jet array to get leading jets from it!");
802 Float_t maxJetPts[] = {0, 0};
806 Int_t jetCount = jetArray->GetEntries();
807 Int_t jetCountAccepted = 0;
809 for (Int_t i = 0; i < jetCount; i++)
811 AliEmcalJet* jet = static_cast<AliEmcalJet*>(jetArray->At(i));
814 AliError(Form("%s: Could not receive jet %d", GetName(), i));
820 if (!IsSignalJetInAcceptance(jet)) continue;
824 if (!IsBackgroundJetInAcceptance(jet)) continue;
827 if (jet->Pt() > maxJetPts[0])
829 maxJetPts[1] = maxJetPts[0];
830 jetIDArray[1] = jetIDArray[0];
831 maxJetPts[0] = jet->Pt();
834 else if (jet->Pt() > maxJetPts[1])
836 maxJetPts[1] = jet->Pt();
841 return jetCountAccepted;
845 //________________________________________________________________________
846 Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedJetPt(AliEmcalJet* jet, Double_t background)
849 AliInfo("Getting corrected jet spectra.");
854 AliError("Jet pointer passed to GetCorrectedJetPt() not valid!");
858 Double_t correctedPt = -1.0;
860 // if the passed background is not valid, do not subtract it
864 // Subtract background
865 correctedPt = jet->Pt() - background * jet->Area();
868 AliInfo("Got corrected jet spectra.");
876 //________________________________________________________________________
877 Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability)
880 AliInfo("Getting Delta Pt.");
883 // Define an invalid delta pt
884 Double_t deltaPt = -10000.0;
887 Double_t etaMin, etaMax;
888 etaMin = -(fTrackEtaWindow-fRandConeRadius);
889 etaMax = +(fTrackEtaWindow-fRandConeRadius);
891 // Define random cone
892 Bool_t coneValid = kTRUE;
893 Double_t tmpRandConeEta = etaMin + fRandom->Rndm()*(etaMax-etaMin);
894 Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
896 // if there is a jet, check for overlap if demanded
897 if(leadingJetExclusionProbability)
899 AliEmcalJet* tmpLeading = dynamic_cast<AliEmcalJet*>(fJetArray->At(0));
900 // Get leading jet (regardless of pT)
901 for (Int_t i = 1; i<fJetArray->GetEntries(); i++)
903 AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i));
904 // if jet is in acceptance and higher, take as new leading
906 if ((TMath::Abs(tmpJet->Eta()) <= fSignalJetEtaWindow) && (tmpJet->Area() >= fMinJetArea))
907 if((!tmpLeading) || (tmpJet->Pt() > tmpLeading->Pt()))
912 Double_t excludedJetPhi = tmpLeading->Phi();
913 Double_t excludedJetEta = tmpLeading->Eta();
914 Double_t tmpDeltaPhi = GetDeltaPhi(tmpRandConePhi, excludedJetPhi);
916 // Check, if cone has overlap with jet
917 if ( tmpDeltaPhi*tmpDeltaPhi + TMath::Abs(tmpRandConeEta-excludedJetEta)*TMath::Abs(tmpRandConeEta-excludedJetEta) <= fRandConeRadius*fRandConeRadius)
919 // Define probability to exclude the RC
920 Double_t probability = leadingJetExclusionProbability;
922 // Only exclude cone with a given probability
923 if (fRandom->Rndm()<=probability)
930 // Get the cones' pt and calculate delta pt
932 deltaPt = GetConePt(tmpRandConeEta,tmpRandConePhi,fRandConeRadius) - (rho*fRandConeRadius*fRandConeRadius*TMath::Pi());
936 AliInfo("Got Delta Pt.");
940 //________________________________________________________________________
941 void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike)
944 AliInfo("Getting ALL KT background density.");
947 static Double_t tmpRhoPbPb[1024];
948 static Double_t tmpRhoPbPbWithGhosts[1024];
949 static Double_t tmpRhoMean[1024];
950 static Double_t tmpRhoCMS[1024];
951 static Double_t tmpRhoImprovedCMS[1024];
952 Double_t tmpCoveredArea = 0.0;
953 Double_t tmpSummedArea = 0.0;
954 Double_t tmpPtTrackLike = 0.0;
955 Double_t tmpAreaTrackLike = 0.0;
957 // Setting invalid values
959 rhoPbPbWithGhosts = 0.0;
961 rhoImprovedCMS = 0.0;
965 Int_t rhoPbPbJetCount = 0;
966 Int_t rhoPbPbWithGhostsJetCount = 0;
967 Int_t rhoCMSJetCount = 0;
968 Int_t rhoImprovedCMSJetCount = 0;
969 Int_t rhoMeanJetCount = 0;
972 // Find 2 leading KT jets for the original PbPb approach
973 Int_t leadingKTJets[] = {-1, -1};
974 GetLeadingJets(fBackgroundJetArray, &leadingKTJets[0], kFALSE);
976 // Exclude UP TO numberExcludeLeadingJets
977 if(numberExcludeLeadingJets==-1)
978 numberExcludeLeadingJets = fNumberSignalJets;
979 if (fNumberSignalJets < numberExcludeLeadingJets)
980 numberExcludeLeadingJets = fNumberSignalJets;
982 for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++)
984 AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i));
988 AliError(Form("%s: Could not receive jet %d", GetName(), i));
992 tmpSummedArea += backgroundJet->Area();
993 if(backgroundJet->Pt() > 0.150)
994 tmpCoveredArea += backgroundJet->Area();
996 if (!IsBackgroundJetInAcceptance(backgroundJet))
999 // Search for overlap with signal jets
1000 Bool_t isOverlapping = kFALSE;
1001 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1003 AliEmcalJet* signalJet = fSignalJets[j];
1005 if(signalJet->Pt() >= 5.0)
1006 if(IsJetOverlapping(signalJet, backgroundJet))
1008 isOverlapping = kTRUE;
1013 Double_t tmpRho = 0.0;
1014 if(backgroundJet->Area())
1015 tmpRho = backgroundJet->Pt() / backgroundJet->Area();
1017 // PbPb approach (take ghosts into account)
1018 if ((i != leadingKTJets[0]) && (i != leadingKTJets[1]))
1020 tmpRhoPbPbWithGhosts[rhoPbPbWithGhostsJetCount] = tmpRho;
1021 rhoPbPbWithGhostsJetCount++;
1024 if(backgroundJet->Pt() > 0.150)
1026 // CMS approach: don't take ghosts into acount
1027 tmpRhoCMS[rhoCMSJetCount] = tmpRho;
1030 // Improved CMS approach: like CMS but excluding signal
1033 tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho;
1034 rhoImprovedCMSJetCount++;
1037 // PbPb w/o ghosts approach (just neglect ghosts)
1038 if ((i != leadingKTJets[0]) && (i != leadingKTJets[1]))
1040 tmpRhoPbPb[rhoPbPbJetCount] = tmpRho;
1045 // (no overlap with signal jets)
1049 tmpRhoMean[rhoMeanJetCount] = tmpRho;
1052 // Track like approach approach
1053 tmpPtTrackLike += backgroundJet->Pt();
1054 tmpAreaTrackLike += backgroundJet->Area();
1059 if (tmpAreaTrackLike > 0)
1060 rhoTrackLike = tmpPtTrackLike/tmpAreaTrackLike;
1061 if (rhoPbPbJetCount > 0)
1062 rhoPbPb = TMath::Median(rhoPbPbJetCount, tmpRhoPbPb);
1063 if (rhoPbPbWithGhostsJetCount > 0)
1064 rhoPbPbWithGhosts = TMath::Median(rhoPbPbWithGhostsJetCount, tmpRhoPbPbWithGhosts);
1065 if (rhoCMSJetCount > 0)
1066 rhoCMS = TMath::Median(rhoCMSJetCount, tmpRhoCMS) * tmpCoveredArea/tmpSummedArea;
1067 if (rhoImprovedCMSJetCount > 0)
1069 rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
1071 if (rhoMeanJetCount > 0)
1072 rhoMean = TMath::Mean(rhoMeanJetCount, tmpRhoMean);
1075 AliInfo("Got ALL KT background density.");
1079 //________________________________________________________________________
1080 void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS)
1083 AliInfo("Getting KT background density.");
1086 static Double_t tmpRhoImprovedCMS[1024];
1087 Double_t tmpCoveredArea = 0.0;
1088 Double_t tmpSummedArea = 0.0;
1090 // Setting invalid values
1091 rhoImprovedCMS = 0.0;
1093 Int_t rhoImprovedCMSJetCount = 0;
1095 // Exclude UP TO numberExcludeLeadingJets
1096 if(numberExcludeLeadingJets==-1)
1097 numberExcludeLeadingJets = fNumberSignalJets;
1098 if (fNumberSignalJets < numberExcludeLeadingJets)
1099 numberExcludeLeadingJets = fNumberSignalJets;
1101 for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++)
1103 AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i));
1107 AliError(Form("%s: Could not receive jet %d", GetName(), i));
1111 // Search for overlap with signal jets
1112 Bool_t isOverlapping = kFALSE;
1113 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1115 AliEmcalJet* signalJet = fSignalJets[j];
1116 if(signalJet->Pt() >= 5.0)
1117 if(IsJetOverlapping(signalJet, backgroundJet))
1119 isOverlapping = kTRUE;
1124 tmpSummedArea += backgroundJet->Area();
1125 if(backgroundJet->Pt() > 0.150)
1126 tmpCoveredArea += backgroundJet->Area();
1128 if (!IsBackgroundJetInAcceptance(backgroundJet))
1131 Double_t tmpRho = backgroundJet->Pt() / backgroundJet->Area();
1133 if(backgroundJet->Pt() > 0.150)
1136 tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho;
1137 rhoImprovedCMSJetCount++;
1141 if (rhoImprovedCMSJetCount > 0)
1143 rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
1146 AliInfo("Got KT background density.");
1151 //________________________________________________________________________
1152 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion)
1155 AliInfo("Getting TR background density.");
1158 Double_t summedTracksPtCone04 = 0.0;
1159 Double_t summedTracksPtCone02 = 0.0;
1160 Double_t summedTracksPtCone06 = 0.0;
1161 Double_t summedTracksPtCone08 = 0.0;
1162 Double_t summedTracksPtWithinJets = 0.0;
1163 Double_t summedTracksPt = 0.0;
1165 // Setting invalid values
1166 rhoNoExclusion = 0.0;
1167 rhoConeExclusion02 = 0.0;
1168 rhoConeExclusion04 = 0.0;
1169 rhoConeExclusion06 = 0.0;
1170 rhoConeExclusion08 = 0.0;
1171 rhoExactExclusion = 0.0;
1173 // Exclude UP TO numberExcludeLeadingJets
1174 if(numberExcludeLeadingJets==-1)
1175 numberExcludeLeadingJets = fNumberSignalJets;
1176 if (fNumberSignalJets < numberExcludeLeadingJets)
1177 numberExcludeLeadingJets = fNumberSignalJets;
1179 Int_t fSignalJetCount5GeV = 0;
1180 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1182 AliEmcalJet* signalJet = fSignalJets[j];
1183 if(signalJet->Pt() < 5.0)
1185 fSignalJetCount5GeV++;
1188 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
1190 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
1191 Bool_t trackWithinJet = kFALSE; Bool_t trackWithin02Cone = kFALSE; Bool_t trackWithin04Cone = kFALSE; Bool_t trackWithin06Cone = kFALSE; Bool_t trackWithin08Cone = kFALSE;
1193 if (IsTrackInAcceptance(tmpTrack))
1195 // Check if tracks overlaps with jet
1196 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1198 AliEmcalJet* signalJet = fSignalJets[j];
1200 if(signalJet->Pt() < 5.0)
1203 // Exact jet exclusion
1204 if (IsTrackInJet(signalJet, i))
1205 trackWithinJet = kTRUE;
1208 if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.2))
1210 trackWithin02Cone = kTRUE;
1211 trackWithin04Cone = kTRUE;
1212 trackWithin06Cone = kTRUE;
1213 trackWithin08Cone = kTRUE;
1216 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.4))
1218 trackWithin04Cone = kTRUE;
1219 trackWithin06Cone = kTRUE;
1220 trackWithin08Cone = kTRUE;
1222 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.6))
1224 trackWithin06Cone = kTRUE;
1225 trackWithin08Cone = kTRUE;
1227 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.8))
1229 trackWithin08Cone = kTRUE;
1233 if(!trackWithin08Cone)
1235 summedTracksPtCone08 += tmpTrack->Pt();
1237 if(!trackWithin06Cone)
1239 summedTracksPtCone06 += tmpTrack->Pt();
1241 if(!trackWithin04Cone)
1243 summedTracksPtCone04 += tmpTrack->Pt();
1245 if(!trackWithin02Cone)
1247 summedTracksPtCone02 += tmpTrack->Pt();
1251 summedTracksPtWithinJets += tmpTrack->Pt();
1253 summedTracksPt += tmpTrack->Pt();
1258 // Calculate the correct area where the tracks were taking from
1260 Double_t tmpFullTPCArea = (2.0*fTrackEtaWindow) * TMath::TwoPi();
1261 Double_t tmpAreaCone02 = tmpFullTPCArea;
1262 Double_t tmpAreaCone04 = tmpFullTPCArea;
1263 Double_t tmpAreaCone06 = tmpFullTPCArea;
1264 Double_t tmpAreaCone08 = tmpFullTPCArea;
1265 Double_t tmpAreaWithinJets = tmpFullTPCArea;
1266 std::vector<Double_t> tmpEtas(fSignalJetCount5GeV);
1267 std::vector<Double_t> tmpPhis(fSignalJetCount5GeV);
1270 for(Int_t i=0;i<numberExcludeLeadingJets;i++)
1272 AliEmcalJet* tmpJet = fSignalJets[i];
1274 if(tmpJet->Pt() < 5.0)
1277 tmpEtas[iSignal] = tmpJet->Eta();
1278 tmpPhis[iSignal] = tmpJet->Phi();
1279 tmpAreaWithinJets -= tmpJet->Area();
1284 tmpAreaCone02 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.2, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi());
1285 tmpAreaCone04 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.4, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi());
1286 tmpAreaCone06 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.6, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi());
1287 tmpAreaCone08 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.8, -fTrackEtaWindow, +fTrackEtaWindow, 0., TMath::TwoPi());
1289 rhoConeExclusion02 = summedTracksPtCone02/tmpAreaCone02;
1290 rhoConeExclusion04 = summedTracksPtCone04/tmpAreaCone04;
1291 rhoConeExclusion06 = summedTracksPtCone06/tmpAreaCone06;
1292 rhoConeExclusion08 = summedTracksPtCone08/tmpAreaCone08;
1293 rhoExactExclusion = summedTracksPtWithinJets/tmpAreaWithinJets;
1294 rhoNoExclusion = summedTracksPt/tmpFullTPCArea;
1298 AliInfo("Got TR background density.");
1302 //________________________________________________________________________
1303 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular)
1306 AliInfo("Getting TR background density.");
1309 // Setting invalid values
1310 Double_t summedTracksPt = 0.0;
1314 Double_t tmpRadius = 0.0;
1315 if (doSearchPerpendicular)
1316 tmpRadius = 0.4*TMath::Pi(); // exclude 90 degrees around jets
1320 numberExcludeLeadingJets = 2; // dijet is excluded here in any case
1324 if (!fTrackArray || !fJetArray)
1326 AliError("Could not get the track/jet array to calculate track rho!");
1330 Int_t trackCount = fTrackArray->GetEntries();
1331 Int_t trackCountAccepted = 0;
1332 for (Int_t i = 0; i < trackCount; i++)
1334 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
1335 if (IsTrackInAcceptance(tmpTrack))
1337 if (IsTrackInCone(tmpTrack, excludeJet1->Eta(), excludeJet1->Phi(), tmpRadius))
1340 if (numberExcludeLeadingJets > 1)
1341 if (IsTrackInCone(tmpTrack, excludeJet2->Eta(), excludeJet2->Phi(), tmpRadius))
1344 // Add track pt to array
1345 summedTracksPt = summedTracksPt + tmpTrack->Pt();
1346 trackCountAccepted++;
1350 if (trackCountAccepted > 0)
1352 Double_t tmpArea = 2.0*fTrackEtaWindow*TMath::TwoPi() - 2*(tmpRadius*tmpRadius * TMath::Pi()); //TPC area - excluding jet area
1353 rhoMean = summedTracksPt/tmpArea;
1358 AliInfo("Got TR background density.");
1362 //________________________________________________________________________
1363 void AliAnalysisTaskChargedJetsPA::GetPPBackgroundDensity(Double_t& background, AliEmcalJet* jet)
1365 // This is the background that was used for the pp 7 TeV ALICE paper
1366 Double_t jetMom[3] = { jet->Px(), jet->Py(), jet->Pz() };
1367 TVector3 jet3mom1(jetMom);
1368 TVector3 jet3mom2(jetMom);
1371 jet3mom1.RotateZ(TMath::Pi());
1372 jet3mom2.RotateZ(-TMath::Pi());
1374 for (int i = 0; i < fTrackArray->GetEntries(); i++)
1376 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1378 Double_t trackMom[3] = { track->Px(), track->Py(), track->Pz() };
1379 TVector3 track3mom(trackMom);
1381 Double_t dR1 = jet3mom1.DeltaR(track3mom);
1382 Double_t dR2 = jet3mom2.DeltaR(track3mom);
1384 if (dR1 <= fSignalJetRadius || dR2 <= fSignalJetRadius)
1385 background += track3mom.Pt();
1388 background /= (2 * TMath::Pi() * fSignalJetRadius * fSignalJetRadius);
1391 //________________________________________________________________________
1392 void AliAnalysisTaskChargedJetsPA::Calculate(AliVEvent* event)
1395 AliInfo("Starting Calculate().");
1397 ////////////////////// NOTE: initialization & casting
1401 // Check, if analysis should be done in pt hard bins
1402 if(fUsePtHardBin != -1)
1403 if(GetPtHardBin() != fUsePtHardBin)
1406 // This is to take only every Nth event
1407 if((fEventCounter+fPartialAnalysisIndex) % fPartialAnalysisNParts != 0)
1410 FillHistogram("hNumberEvents",0.5);
1412 if(!IsEventInAcceptance(event))
1415 FillHistogram("hNumberEvents",1.5);
1418 AliInfo("Calculate()::Init done.");
1421 ////////////////////// NOTE: Get Centrality, (Leading)Signal jets and Background
1424 AliCentrality* tmpCentrality = NULL;
1425 tmpCentrality = event->GetCentrality();
1426 Double_t centralityPercentile = -1.0;
1427 Double_t centralityPercentileV0A = 0.0;
1428 Double_t centralityPercentileV0C = 0.0;
1429 Double_t centralityPercentileV0M = 0.0;
1430 Double_t centralityPercentileZNA = 0.0;
1431 if (tmpCentrality != NULL)
1433 centralityPercentile = tmpCentrality->GetCentralityPercentile(fCentralityType.Data());
1434 centralityPercentileV0A = tmpCentrality->GetCentralityPercentile("V0A");
1435 centralityPercentileV0C = tmpCentrality->GetCentralityPercentile("V0C");
1436 centralityPercentileV0M = tmpCentrality->GetCentralityPercentile("V0M");
1437 centralityPercentileZNA = tmpCentrality->GetCentralityPercentile("ZNA");
1440 if((centralityPercentile < 0.0) || (centralityPercentile > 100.0))
1441 AliWarning(Form("Centrality value not valid (c=%E)",centralityPercentile));
1443 if(fSetCentralityToOne)
1444 centralityPercentile = 1.0;
1447 if (fAnalyzeBackground || fAnalyzeJets)
1450 // Get background estimates
1451 Double_t backgroundKTImprovedCMS = -1.0;
1452 Double_t backgroundKTImprovedCMSExternal = -1.0;
1453 Double_t backgroundDijet = -1.0;
1454 Double_t backgroundDijetPerpendicular = -1.0;
1455 Double_t deltaPtDijetPerpendicular = -10000.0;
1456 Double_t backgroundKTPbPb = -1.0;
1457 Double_t backgroundKTPbPbWithGhosts = -1.0;
1458 Double_t backgroundKTCMS = -1.0;
1459 Double_t backgroundKTMean = -1.0;
1460 Double_t backgroundKTTrackLike = -1.0;
1461 Double_t backgroundTRNoExcl = -1.0;
1462 Double_t backgroundTRCone02 = -1.0;
1463 Double_t backgroundTRCone04 = -1.0;
1464 Double_t backgroundTRCone06 = -1.0;
1465 Double_t backgroundTRCone08 = -1.0;
1466 Double_t backgroundTRExact = -1.0;
1467 Double_t backgroundPP = -1.0;
1468 // Calculate background for different jet exclusions
1470 if (fAnalyzeBackground)
1473 if(fAnalyzeDeprecatedBackgrounds)
1474 GetKTBackgroundDensityAll (fNumberExcludedJets, backgroundKTPbPb, backgroundKTPbPbWithGhosts, backgroundKTCMS, backgroundKTImprovedCMS, backgroundKTMean, backgroundKTTrackLike);
1476 GetKTBackgroundDensity (fNumberExcludedJets, backgroundKTImprovedCMS);
1478 if(fAnalyzeDeprecatedBackgrounds)
1479 GetTRBackgroundDensity (fNumberExcludedJets, backgroundTRNoExcl, backgroundTRCone02, backgroundTRCone04, backgroundTRCone06, backgroundTRCone08, backgroundTRExact);
1481 backgroundKTImprovedCMSExternal = GetExternalRho();
1482 if(fNoExternalBackground)
1483 backgroundKTImprovedCMSExternal = 0;
1488 AliInfo("Calculate()::Centrality&SignalJets&Background-Calculation done.");
1493 FillHistogram("hVertexX",event->GetPrimaryVertex()->GetX());
1494 FillHistogram("hVertexY",event->GetPrimaryVertex()->GetY());
1495 FillHistogram("hVertexXY",event->GetPrimaryVertex()->GetX(), event->GetPrimaryVertex()->GetY());
1496 FillHistogram("hVertexR",TMath::Sqrt(event->GetPrimaryVertex()->GetX()*event->GetPrimaryVertex()->GetX() + event->GetPrimaryVertex()->GetY()*event->GetPrimaryVertex()->GetY()));
1497 FillHistogram("hCentralityV0M",centralityPercentileV0M);
1498 FillHistogram("hCentralityV0A",centralityPercentileV0A);
1499 FillHistogram("hCentralityV0C",centralityPercentileV0C);
1500 FillHistogram("hCentralityZNA",centralityPercentileZNA);
1501 FillHistogram("hCentrality",centralityPercentile);
1503 Int_t trackCountAcc = 0;
1504 Int_t nTracks = fTrackArray->GetEntries();
1505 for (Int_t i = 0; i < nTracks; i++)
1507 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1510 if (track->Pt() >= fMinTrackPt)
1511 FillHistogram("hTrackPhiEta", track->Phi(),track->Eta(), 1);
1513 if (IsTrackInAcceptance(track))
1515 FillHistogram("hTrackPt", track->Pt(), centralityPercentile);
1516 if(track->Eta() >= 0)
1517 FillHistogram("hTrackPtPosEta", track->Pt(), centralityPercentile);
1519 FillHistogram("hTrackPtNegEta", track->Pt(), centralityPercentile);
1521 FillHistogram("hTrackEta", track->Eta(), centralityPercentile);
1522 FillHistogram("hTrackPhi", track->Phi());
1524 if(static_cast<AliPicoTrack*>(track))
1525 FillHistogram("hTrackPhiTrackType", track->Phi(), (static_cast<AliPicoTrack*>(track))->GetTrackType());
1527 for(Int_t j=0;j<20;j++)
1529 FillHistogram("hTrackPhiPtCut", track->Phi(), track->Pt());
1531 FillHistogram("hTrackCharge", track->Charge());
1535 FillHistogram("hTrackCountAcc", trackCountAcc, centralityPercentile);
1539 // This is code that is run locally to get some special events
1540 TFile* fileOutput = new TFile("SpecialEvents.root", "UPDATE");
1541 if(fSecondLeadingJet&&(fSecondLeadingJet->Pt()>10.))
1543 cout << "Event found\n";
1544 TH2D* tmpEvent = new TH2D(Form("Event%lu", fEventCounter), "", 40, -0.9, 0.9, 40, 0., TMath::TwoPi());
1545 tmpEvent->GetXaxis()->SetTitle("#eta");
1546 tmpEvent->GetYaxis()->SetTitle("#phi");
1547 tmpEvent->SetOption("LEGO2");
1550 for (Int_t i = 0; i < nTracks; i++)
1552 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1554 if (IsTrackInAcceptance(track))
1556 tmpEvent->Fill(track->Eta(), track->Phi(), track->Pt());
1559 tmpEvent->Write(0, kOverwrite);
1561 fileOutput->Close();
1565 AliInfo("Calculate()::QA done.");
1568 ////////////////////// NOTE: Jet analysis and calculations
1572 for (Int_t i = 0; i<fJetArray->GetEntries(); i++)
1574 AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i));
1578 FillHistogram("hRawJetPt", tmpJet->Pt());
1579 if (tmpJet->Pt() >= 5.0)
1581 // ### RAW JET ANALYSIS
1582 if (tmpJet->Area() >= fMinJetArea)
1583 FillHistogram("hRawJetPhiEta", tmpJet->Phi(), tmpJet->Eta());
1584 if (TMath::Abs(tmpJet->Eta()) <= fSignalJetEtaWindow)
1585 FillHistogram("hRawJetArea", tmpJet->Area());
1588 if(IsSignalJetInAcceptance(tmpJet))
1590 // ### SIGNAL JET ANALYSIS
1592 FillHistogram("hJetPt", tmpJet->Pt(), centralityPercentile);
1593 FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile);
1594 FillHistogram("hJetPtBgrdSubtractedExternal", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal), centralityPercentile);
1595 FillHistogram("hJetPtSubtractedRhoKTImprovedCMS", tmpJet->Pt(), centralityPercentile, backgroundKTImprovedCMS);
1598 GetPPBackgroundDensity(backgroundPP, tmpJet);
1599 FillHistogram("hJetPtBgrdSubtractedPP", GetCorrectedJetPt(tmpJet, backgroundPP), centralityPercentile);
1601 if(fAnalyzeDeprecatedBackgrounds)
1603 FillHistogram("hJetPtBgrdSubtractedTR", GetCorrectedJetPt(tmpJet, backgroundTRCone06), centralityPercentile);
1604 FillHistogram("hJetPtBgrdSubtractedKTPbPb", GetCorrectedJetPt(tmpJet, backgroundKTPbPb), centralityPercentile);
1605 FillHistogram("hJetPtBgrdSubtractedKTPbPbWithGhosts", GetCorrectedJetPt(tmpJet, backgroundKTPbPbWithGhosts), centralityPercentile);
1606 FillHistogram("hJetPtBgrdSubtractedKTCMS", GetCorrectedJetPt(tmpJet, backgroundKTCMS), centralityPercentile);
1607 FillHistogram("hJetPtBgrdSubtractedKTMean", GetCorrectedJetPt(tmpJet, backgroundKTMean), centralityPercentile);
1608 FillHistogram("hJetPtBgrdSubtractedKTTrackLike", GetCorrectedJetPt(tmpJet, backgroundKTTrackLike), centralityPercentile);
1611 // Jet profile analysis
1612 if(TMath::Abs(tmpJet->Eta()) <= 0.3)
1614 if(tmpJet->Pt()>=70.0)
1616 FillHistogram("hJetProfile70GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1617 FillHistogram("hJetProfile70GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1618 FillHistogram("hJetProfile70GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1619 FillHistogram("hJetProfile70GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1620 FillHistogram("hJetProfile70GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1621 FillHistogram("hJetProfile70GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1622 FillHistogram("hJetProfile70GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1623 FillHistogram("hJetProfile70GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1624 FillHistogram("hJetProfile70GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1625 FillHistogram("hJetProfile70GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1626 FillHistogram("hJetProfile70GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1627 FillHistogram("hJetProfile70GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1629 else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=60.0)
1631 FillHistogram("hJetProfile60GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1632 FillHistogram("hJetProfile60GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1633 FillHistogram("hJetProfile60GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1634 FillHistogram("hJetProfile60GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1635 FillHistogram("hJetProfile60GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1636 FillHistogram("hJetProfile60GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1637 FillHistogram("hJetProfile60GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1638 FillHistogram("hJetProfile60GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1639 FillHistogram("hJetProfile60GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1640 FillHistogram("hJetProfile60GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1641 FillHistogram("hJetProfile60GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1642 FillHistogram("hJetProfile60GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1644 else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=50.0)
1646 FillHistogram("hJetProfile50GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1647 FillHistogram("hJetProfile50GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1648 FillHistogram("hJetProfile50GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1649 FillHistogram("hJetProfile50GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1650 FillHistogram("hJetProfile50GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1651 FillHistogram("hJetProfile50GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1652 FillHistogram("hJetProfile50GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1653 FillHistogram("hJetProfile50GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1654 FillHistogram("hJetProfile50GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1655 FillHistogram("hJetProfile50GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1656 FillHistogram("hJetProfile50GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1657 FillHistogram("hJetProfile50GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1659 else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=40.0)
1661 FillHistogram("hJetProfile40GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1662 FillHistogram("hJetProfile40GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1663 FillHistogram("hJetProfile40GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1664 FillHistogram("hJetProfile40GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1665 FillHistogram("hJetProfile40GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1666 FillHistogram("hJetProfile40GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1667 FillHistogram("hJetProfile40GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1668 FillHistogram("hJetProfile40GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1669 FillHistogram("hJetProfile40GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1670 FillHistogram("hJetProfile40GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1671 FillHistogram("hJetProfile40GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1672 FillHistogram("hJetProfile40GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1674 else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=30.0)
1676 FillHistogram("hJetProfile30GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1677 FillHistogram("hJetProfile30GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1678 FillHistogram("hJetProfile30GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1679 FillHistogram("hJetProfile30GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1680 FillHistogram("hJetProfile30GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1681 FillHistogram("hJetProfile30GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1682 FillHistogram("hJetProfile30GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1683 FillHistogram("hJetProfile30GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1684 FillHistogram("hJetProfile30GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1685 FillHistogram("hJetProfile30GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1686 FillHistogram("hJetProfile30GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1687 FillHistogram("hJetProfile30GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1689 else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=20.0)
1691 FillHistogram("hJetProfile20GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1692 FillHistogram("hJetProfile20GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1693 FillHistogram("hJetProfile20GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1694 FillHistogram("hJetProfile20GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1695 FillHistogram("hJetProfile20GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1696 FillHistogram("hJetProfile20GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1697 FillHistogram("hJetProfile20GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1698 FillHistogram("hJetProfile20GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1699 FillHistogram("hJetProfile20GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1700 FillHistogram("hJetProfile20GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1701 FillHistogram("hJetProfile20GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1702 FillHistogram("hJetProfile20GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1704 else if(GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal)>=10.0)
1706 FillHistogram("hJetProfile10GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1707 FillHistogram("hJetProfile10GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1708 FillHistogram("hJetProfile10GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1709 FillHistogram("hJetProfile10GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1710 FillHistogram("hJetProfile10GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1711 FillHistogram("hJetProfile10GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1712 FillHistogram("hJetProfile10GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1713 FillHistogram("hJetProfile10GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1714 FillHistogram("hJetProfile10GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1715 FillHistogram("hJetProfile10GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1716 FillHistogram("hJetProfile10GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1717 FillHistogram("hJetProfile10GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundKTImprovedCMSExternal))/GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1720 FillHistogram("hJetPtVsConstituentCount", tmpJet->Pt(),tmpJet->GetNumberOfTracks());
1722 if((fAnalyzeQA) && (tmpJet->Pt() >= 5.0))
1724 Double_t lowestTrackPt = 1e99;
1725 Double_t highestTrackPt = 0.0;
1726 for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++)
1728 FillHistogram("hJetConstituentPt", tmpJet->TrackAt(j, fTrackArray)->Pt(), centralityPercentile);
1729 // Find the lowest pT of a track in the jet
1730 if (tmpJet->TrackAt(j, fTrackArray)->Pt() < lowestTrackPt)
1731 lowestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt();
1732 if (tmpJet->TrackAt(j, fTrackArray)->Pt() > highestTrackPt)
1733 highestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt();
1735 FillHistogram("hJetArea", tmpJet->Area());
1736 // Signal jet vs. signal jet - "Combinatorial"
1737 for (Int_t j = i+1; j<fNumberSignalJets; j++)
1738 FillHistogram("hJetDeltaPhi", GetDeltaPhi(tmpJet->Phi(), fSignalJets[j]->Phi()));
1740 FillHistogram("hJetPhiEta", tmpJet->Phi(),tmpJet->Eta());
1741 FillHistogram("hJetEta", tmpJet->Eta(), centralityPercentile);
1743 if(lowestTrackPt>=2.0)
1744 FillHistogram("hJetEta2GeVTracks", tmpJet->Eta(), centralityPercentile);
1745 if(lowestTrackPt>=4.0)
1746 FillHistogram("hJetEta4GeVTracks", tmpJet->Eta(), centralityPercentile);
1750 // Jet constituent mass analyses (for PYTHIA)
1751 if (fAnalyzeMassCorrelation)
1753 Double_t jetMass = 0.0;
1754 Int_t constituentCount = tmpJet->GetNumberOfTracks();
1755 Int_t electronCount = 0;
1756 Int_t pionCount = 0;
1757 Int_t protonCount = 0;
1758 Int_t kaonCount = 0;
1759 Int_t othersCount = 0;
1761 for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++)
1763 AliVParticle* tmpParticle = tmpJet->TrackAt(j, fTrackArray);
1765 jetMass += tmpParticle->M();
1766 if(TMath::Abs(tmpParticle->PdgCode()) == 11) // electron, positron
1768 else if(TMath::Abs(tmpParticle->PdgCode()) == 211) // p-, p+
1770 else if(TMath::Abs(tmpParticle->PdgCode()) == 2212) // p, pbar
1772 else if(TMath::Abs(tmpParticle->PdgCode()) == 321) // kaon+,kaon-
1778 FillHistogram("hJetMassFromConstituents", jetMass);
1779 FillHistogram("hJetMass", tmpJet->M());
1781 FillHistogram("hJetPtVsMass", tmpJet->Pt(), jetMass);
1782 FillHistogram("hJetPtVsJetMass", tmpJet->Pt(), tmpJet->M());
1784 FillHistogram("hJetPtVsProtonCount", tmpJet->Pt(), protonCount/(static_cast<Double_t>(constituentCount)));
1785 FillHistogram("hJetPtVsPionCount", tmpJet->Pt(), pionCount/(static_cast<Double_t>(constituentCount)));
1786 FillHistogram("hJetPtVsKaonCount", tmpJet->Pt(), kaonCount/(static_cast<Double_t>(constituentCount)));
1787 FillHistogram("hJetPtVsElectronCount", tmpJet->Pt(), electronCount/(static_cast<Double_t>(constituentCount)));
1788 FillHistogram("hJetPtVsOthersCount", tmpJet->Pt(), othersCount/(static_cast<Double_t>(constituentCount)));
1789 FillHistogram("hJetConstituentProtonCount", protonCount);
1790 FillHistogram("hJetConstituentPionCount", pionCount);
1791 FillHistogram("hJetConstituentKaonCount", kaonCount);
1792 FillHistogram("hJetConstituentElectronCount", electronCount);
1793 FillHistogram("hJetConstituentOthersCount", othersCount);
1795 // Results for the "normal" jet (avoiding single particle jets)
1796 if((constituentCount>=6) && (constituentCount<=14))
1798 FillHistogram("hJetPtVsMass_6_14", tmpJet->Pt(), jetMass);
1799 FillHistogram("hJetPtVsJetMass_6_14", tmpJet->Pt(), tmpJet->M());
1801 FillHistogram("hJetPtVsProtonCount_6_14", tmpJet->Pt(), protonCount);
1802 FillHistogram("hJetPtVsPionCount_6_14", tmpJet->Pt(), pionCount);
1803 FillHistogram("hJetPtVsKaonCount_6_14", tmpJet->Pt(), kaonCount);
1804 FillHistogram("hJetPtVsElectronCount_6_14", tmpJet->Pt(), electronCount);
1805 FillHistogram("hJetPtVsOthersCount_6_14", tmpJet->Pt(), othersCount);
1806 FillHistogram("hJetConstituentProtonCount_6_14", protonCount);
1807 FillHistogram("hJetConstituentPionCount_6_14", pionCount);
1808 FillHistogram("hJetConstituentKaonCount_6_14", kaonCount);
1809 FillHistogram("hJetConstituentElectronCount_6_14", electronCount);
1810 FillHistogram("hJetConstituentOthersCount_6_14", othersCount);
1812 if((constituentCount>=2))
1814 FillHistogram("hJetPtVsMass_2_X", tmpJet->Pt(), jetMass);
1815 FillHistogram("hJetPtVsJetMass_2_X", tmpJet->Pt(), tmpJet->M());
1817 FillHistogram("hJetPtVsProtonCount_2_X", tmpJet->Pt(), protonCount);
1818 FillHistogram("hJetPtVsPionCount_2_X", tmpJet->Pt(), pionCount);
1819 FillHistogram("hJetPtVsKaonCount_2_X", tmpJet->Pt(), kaonCount);
1820 FillHistogram("hJetPtVsElectronCount_2_X", tmpJet->Pt(), electronCount);
1821 FillHistogram("hJetPtVsOthersCount_2_X", tmpJet->Pt(), othersCount);
1822 FillHistogram("hJetConstituentProtonCount_2_X", protonCount);
1823 FillHistogram("hJetConstituentPionCount_2_X", pionCount);
1824 FillHistogram("hJetConstituentKaonCount_2_X", kaonCount);
1825 FillHistogram("hJetConstituentElectronCount_2_X", electronCount);
1826 FillHistogram("hJetConstituentOthersCount_2_X", othersCount);
1828 if((constituentCount>=2) && (constituentCount<=7))
1830 FillHistogram("hJetPtVsMass_2_7", tmpJet->Pt(), jetMass);
1831 FillHistogram("hJetPtVsJetMass_2_7", tmpJet->Pt(), tmpJet->M());
1833 FillHistogram("hJetPtVsProtonCount_2_7", tmpJet->Pt(), protonCount);
1834 FillHistogram("hJetPtVsPionCount_2_7", tmpJet->Pt(), pionCount);
1835 FillHistogram("hJetPtVsKaonCount_2_7", tmpJet->Pt(), kaonCount);
1836 FillHistogram("hJetPtVsElectronCount_2_7", tmpJet->Pt(), electronCount);
1837 FillHistogram("hJetPtVsOthersCount_2_7", tmpJet->Pt(), othersCount);
1838 FillHistogram("hJetConstituentProtonCount_2_7", protonCount);
1839 FillHistogram("hJetConstituentPionCount_2_7", pionCount);
1840 FillHistogram("hJetConstituentKaonCount_2_7", kaonCount);
1841 FillHistogram("hJetConstituentElectronCount_2_7", electronCount);
1842 FillHistogram("hJetConstituentOthersCount_2_7", othersCount);
1849 if(fNumberSignalJets >= 2)
1851 FillHistogram("hLeadingJetDeltaPhi", GetDeltaPhi(fFirstLeadingJet->Phi(), fSecondLeadingJet->Phi()));
1853 if (IsDijet(fFirstLeadingJet, fSecondLeadingJet))
1855 FillHistogram("hDijetConstituentsPt", fFirstLeadingJet->Pt());
1856 FillHistogram("hDijetConstituentsPt", fSecondLeadingJet->Pt());
1858 FillHistogram("hDijetLeadingJetPt", fFirstLeadingJet->Pt());
1859 FillHistogram("hDijetPtCorrelation", fFirstLeadingJet->Pt(), fSecondLeadingJet->Pt());
1860 Double_t dummyArea = 0;
1861 GetTRBackgroundDensity (2, backgroundDijet, dummyArea, fFirstLeadingJet, fSecondLeadingJet, kFALSE);
1862 GetTRBackgroundDensity (2, backgroundDijetPerpendicular, dummyArea, fFirstLeadingJet, fSecondLeadingJet, kTRUE);
1863 deltaPtDijetPerpendicular = GetDeltaPt(backgroundDijetPerpendicular);
1867 // ### SOME JET PLOTS
1868 FillHistogram("hJetCountAll", fJetArray->GetEntries());
1869 FillHistogram("hJetCountAccepted", fNumberSignalJets);
1870 FillHistogram("hJetCount", fJetArray->GetEntries(), fNumberSignalJets);
1871 if (fFirstLeadingJet)
1873 FillHistogram("hLeadingJetPt", fFirstLeadingJet->Pt());
1874 FillHistogram("hCorrectedLeadingJetPt", GetCorrectedJetPt(fFirstLeadingJet,backgroundKTImprovedCMS));
1876 if (fSecondLeadingJet)
1878 FillHistogram("hSecondLeadingJetPt", fSecondLeadingJet->Pt());
1879 FillHistogram("hCorrectedSecondLeadingJetPt", GetCorrectedJetPt(fSecondLeadingJet,backgroundKTImprovedCMS));
1881 } //endif AnalyzeJets
1884 AliInfo("Calculate()::Jets done.");
1886 ////////////////////// NOTE: Background analysis
1888 if (fAnalyzeBackground)
1890 // Calculate background in centrality classes
1891 FillHistogram("hKTBackgroundImprovedCMS", backgroundKTImprovedCMS, centralityPercentile);
1893 FillHistogram("hKTBackgroundImprovedCMSExternal", backgroundKTImprovedCMSExternal, centralityPercentile);
1895 FillHistogram("hKTMeanBackgroundImprovedCMS", centralityPercentile, backgroundKTImprovedCMS);
1897 // In case of dijets -> look at the background
1898 if (backgroundDijet >= 0)
1899 FillHistogram("hDijetBackground", backgroundDijet, centralityPercentile);
1900 if (backgroundDijetPerpendicular >= 0)
1901 FillHistogram("hDijetBackgroundPerpendicular", backgroundDijetPerpendicular, centralityPercentile);
1902 if (deltaPtDijetPerpendicular > -10000.)
1903 FillHistogram("hDijetBackgroundPerpendicularDeltaPt", deltaPtDijetPerpendicular, centralityPercentile);
1906 if(fAnalyzeDeprecatedBackgrounds)
1908 FillHistogram("hKTBackgroundPbPb", backgroundKTPbPb, centralityPercentile);
1909 FillHistogram("hKTBackgroundPbPbWithGhosts", backgroundKTPbPbWithGhosts, centralityPercentile);
1910 FillHistogram("hKTBackgroundCMS", backgroundKTCMS, centralityPercentile);
1911 FillHistogram("hKTBackgroundMean", backgroundKTMean, centralityPercentile);
1912 FillHistogram("hKTBackgroundTrackLike", backgroundKTTrackLike, centralityPercentile);
1914 FillHistogram("hTRBackgroundNoExcl", backgroundTRNoExcl, centralityPercentile);
1915 FillHistogram("hTRBackgroundCone02", backgroundTRCone02, centralityPercentile);
1916 FillHistogram("hTRBackgroundCone04", backgroundTRCone04, centralityPercentile);
1917 FillHistogram("hTRBackgroundCone06", backgroundTRCone06, centralityPercentile);
1918 FillHistogram("hTRBackgroundCone08", backgroundTRCone08, centralityPercentile);
1919 FillHistogram("hTRBackgroundExact", backgroundTRExact, centralityPercentile);
1921 // Calculate background profiles in terms of centrality
1922 FillHistogram("hKTMeanBackgroundPbPb", centralityPercentile, backgroundKTPbPb);
1923 FillHistogram("hKTMeanBackgroundPbPbWithGhosts", centralityPercentile, backgroundKTPbPbWithGhosts);
1924 FillHistogram("hKTMeanBackgroundCMS", centralityPercentile, backgroundKTCMS);
1925 FillHistogram("hKTMeanBackgroundMean", centralityPercentile, backgroundKTMean);
1926 FillHistogram("hKTMeanBackgroundTPC", centralityPercentile, backgroundKTTrackLike);
1927 FillHistogram("hTRMeanBackground", centralityPercentile, backgroundTRCone06);
1931 // Calculate the delta pt
1932 Double_t tmpDeltaPtNoBackground = GetDeltaPt(0.0);
1933 Double_t tmpDeltaPtKTImprovedCMS = GetDeltaPt(backgroundKTImprovedCMS);
1934 Double_t tmpDeltaPtExternalBgrd = GetDeltaPt(backgroundKTImprovedCMSExternal);
1937 Double_t tmpDeltaPtKTImprovedCMSPartialExclusion = 0.0;
1939 tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNcoll);
1941 tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1943 Double_t tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = 0.0;
1944 if(fNumberSignalJets)
1945 tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNumberSignalJets);
1947 tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1949 Double_t tmpDeltaPtKTImprovedCMSFullExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1951 Double_t tmpDeltaPtKTPbPb = 0;
1952 Double_t tmpDeltaPtKTPbPbWithGhosts = 0;
1953 Double_t tmpDeltaPtKTCMS = 0;
1954 Double_t tmpDeltaPtKTMean = 0;
1955 Double_t tmpDeltaPtKTTrackLike = 0;
1956 Double_t tmpDeltaPtTR = 0;
1958 if(fAnalyzeDeprecatedBackgrounds)
1960 tmpDeltaPtKTPbPb = GetDeltaPt(backgroundKTPbPb);
1961 tmpDeltaPtKTPbPbWithGhosts = GetDeltaPt(backgroundKTPbPbWithGhosts);
1962 tmpDeltaPtKTCMS = GetDeltaPt(backgroundKTCMS);
1963 tmpDeltaPtKTMean = GetDeltaPt(backgroundKTMean);
1964 tmpDeltaPtKTTrackLike = GetDeltaPt(backgroundKTTrackLike);
1965 tmpDeltaPtTR = GetDeltaPt(backgroundTRCone06);
1968 // If valid, fill the delta pt histograms
1970 if(tmpDeltaPtExternalBgrd > -10000.0)
1971 FillHistogram("hDeltaPtExternalBgrd", tmpDeltaPtExternalBgrd, centralityPercentile);
1972 if(tmpDeltaPtKTImprovedCMS > -10000.0)
1973 FillHistogram("hDeltaPtKTImprovedCMS", tmpDeltaPtKTImprovedCMS, centralityPercentile);
1974 if(tmpDeltaPtKTImprovedCMSPartialExclusion > -10000.0)
1975 FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion", tmpDeltaPtKTImprovedCMSPartialExclusion, centralityPercentile);
1976 if(tmpDeltaPtKTImprovedCMSPartialExclusion_Signal > -10000.0)
1977 FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion_Signal", tmpDeltaPtKTImprovedCMSPartialExclusion_Signal, centralityPercentile);
1978 if(tmpDeltaPtKTImprovedCMSFullExclusion > -10000.0)
1979 FillHistogram("hDeltaPtKTImprovedCMSFullExclusion", tmpDeltaPtKTImprovedCMSFullExclusion, centralityPercentile);
1981 if(tmpDeltaPtNoBackground > 0.000001)
1982 FillHistogram("hDeltaPtNoBackgroundNoEmptyCones", tmpDeltaPtNoBackground, centralityPercentile);
1983 else if(tmpDeltaPtNoBackground > -10000.0)
1984 FillHistogram("hDeltaPtNoBackground", tmpDeltaPtNoBackground, centralityPercentile);
1987 if(fAnalyzeDeprecatedBackgrounds)
1989 if(tmpDeltaPtKTPbPb > -10000.0)
1990 FillHistogram("hDeltaPtKTPbPb", tmpDeltaPtKTPbPb, centralityPercentile);
1991 if(tmpDeltaPtKTPbPbWithGhosts > -10000.0)
1992 FillHistogram("hDeltaPtKTPbPbWithGhosts", tmpDeltaPtKTPbPbWithGhosts, centralityPercentile);
1993 if(tmpDeltaPtKTCMS > -10000.0)
1994 FillHistogram("hDeltaPtKTCMS", tmpDeltaPtKTCMS, centralityPercentile);
1995 if(tmpDeltaPtKTMean > -10000.0)
1996 FillHistogram("hDeltaPtKTMean", tmpDeltaPtKTMean, centralityPercentile);
1997 if(tmpDeltaPtKTTrackLike > -10000.0)
1998 FillHistogram("hDeltaPtKTTrackLike", tmpDeltaPtKTTrackLike, centralityPercentile);
2000 if(tmpDeltaPtTR > -10000.0)
2001 FillHistogram("hDeltaPtTR", tmpDeltaPtTR, centralityPercentile);
2006 AliInfo("Calculate()::Background done.");
2009 ////////////////////// NOTE: Pythia histograms
2012 FillHistogram("hPythiaPtHard", GetPtHard());
2013 FillHistogram("hPythiaNTrials", GetPtHardBin()+0.1, GetPythiaTrials());
2014 FillHistogram("hPythiaXSection", GetPtHardBin()+0.1, fCrossSection);
2017 AliInfo("Calculate()::Pythia done.");
2021 AliInfo("Calculate() done.");
2025 //________________________________________________________________________
2026 Bool_t AliAnalysisTaskChargedJetsPA::UserNotify()
2028 // Implemented Notify() to read the cross sections
2029 // and number of trials from pyxsec.root
2032 AliInfo("UserNotify started.");
2037 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
2038 TFile *currFile = tree->GetCurrentFile();
2040 TString file(currFile->GetName());
2042 if(file.Contains("root_archive.zip#")){
2043 Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
2044 Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
2045 file.Replace(pos+1,20,"");
2048 // not an archive take the basename....
2049 file.ReplaceAll(gSystem->BaseName(file.Data()),"");
2052 TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")); // problem that we cannot really test the existance of a file in a archive so we have to lvie with open error message from root
2054 // next trial fetch the histgram file
2055 fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
2057 // not a severe condition but inciate that we have no information
2061 // find the tlist we want to be independtent of the name so use the Tkey
2062 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
2067 TList *list = dynamic_cast<TList*>(key->ReadObj());
2072 fCrossSection = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
2073 fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
2076 } // no tree pyxsec.root
2078 TTree *xtree = (TTree*)fxsec->Get("Xsection");
2084 Double_t xsection = 0;
2085 xtree->SetBranchAddress("xsection",&xsection);
2086 xtree->SetBranchAddress("ntrials",&ntrials);
2089 fCrossSection = xsection;
2094 AliInfo("UserNotify ended.");
2100 //________________________________________________________________________
2101 inline Double_t AliAnalysisTaskChargedJetsPA::EtaToTheta(Double_t arg)
2102 {return 2.*atan(exp(-arg));}
2103 //________________________________________________________________________
2104 inline Double_t AliAnalysisTaskChargedJetsPA::ThetaToEta(Double_t arg)
2106 if ((arg > TMath::Pi()) || (arg < 0.0))
2108 AliError(Form("ThetaToEta got wrong input! (%f)", arg));
2111 return -log(tan(arg/2.));
2113 //________________________________________________________________________
2114 inline Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPhi(Double_t phi1, Double_t phi2)
2115 {return min(TMath::Abs(phi1-phi2),TMath::TwoPi() - TMath::Abs(phi1-phi2));}
2117 //________________________________________________________________________
2118 Double_t AliAnalysisTaskChargedJetsPA::MCGetOverlapCircleRectancle(Double_t cPosX, Double_t cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax)
2120 const Int_t kTests = 1000;
2122 TRandom3 randomGen(0);
2124 // Loop over kTests-many tests
2125 for (Int_t i=0; i<kTests; i++)
2127 //Choose random position in rectangle for the tester
2128 Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax);
2129 Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax);
2131 //Check, if tester is in circle. If yes, increment circle counter.
2132 Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX)*(tmpTestX - cPosX) + (tmpTestY - cPosY)*(tmpTestY - cPosY) );
2133 if(tmpDistance < cRadius)
2138 return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests));
2141 //________________________________________________________________________
2142 Double_t AliAnalysisTaskChargedJetsPA::MCGetOverlapMultipleCirclesRectancle(Int_t numCircles, std::vector<Double_t> cPosX, std::vector<Double_t> cPosY, Double_t cRadius, Double_t rPosXmin, Double_t rPosXmax, Double_t rPosYmin, Double_t rPosYmax)
2145 const Int_t kTests = 1000;
2147 TRandom3 randomGen(0);
2149 // Loop over kTests-many tests
2150 for (Int_t i=0; i<kTests; i++)
2152 //Choose random position in rectangle for the tester
2153 Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax);
2154 Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax);
2156 //Check, if tester is in one of the circles. If yes, increment circle counter.
2157 for(Int_t j=0; j<numCircles; j++)
2159 Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX[j])*(tmpTestX - cPosX[j]) + (tmpTestY - cPosY[j])*(tmpTestY - cPosY[j]) );
2160 if(tmpDistance < cRadius)
2169 return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests));
2173 //________________________________________________________________________
2174 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x)
2176 TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key)));
2179 AliError(Form("Cannot find histogram <%s> ",key)) ;
2186 //________________________________________________________________________
2187 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y)
2189 TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key)));
2192 AliError(Form("Cannot find histogram <%s> ",key));
2196 if (tmpHist->IsA()->GetBaseClass("TH1"))
2197 static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
2198 else if (tmpHist->IsA()->GetBaseClass("TH2"))
2199 static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
2202 //________________________________________________________________________
2203 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y, Double_t add)
2205 TH2* tmpHist = static_cast<TH2*>(fOutputList->FindObject(GetHistoName(key)));
2208 AliError(Form("Cannot find histogram <%s> ",key));
2212 tmpHist->Fill(x,y,add);
2214 //________________________________________________________________________
2215 template <class T> T* AliAnalysisTaskChargedJetsPA::AddHistogram1D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, const char* xTitle, const char* yTitle)
2217 T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax);
2219 tmpHist->GetXaxis()->SetTitle(xTitle);
2220 tmpHist->GetYaxis()->SetTitle(yTitle);
2221 tmpHist->SetOption(options);
2222 tmpHist->SetMarkerStyle(kFullCircle);
2225 fHistList->Add(tmpHist);
2231 //________________________________________________________________________
2232 template <class T> T* AliAnalysisTaskChargedJetsPA::AddHistogram2D(const char* name, const char* title, const char* options, Int_t xBins, Double_t xMin, Double_t xMax, Int_t yBins, Double_t yMin, Double_t yMax, const char* xTitle, const char* yTitle, const char* zTitle)
2234 T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax, yBins, yMin, yMax);
2235 tmpHist->GetXaxis()->SetTitle(xTitle);
2236 tmpHist->GetYaxis()->SetTitle(yTitle);
2237 tmpHist->GetZaxis()->SetTitle(zTitle);
2238 tmpHist->SetOption(options);
2239 tmpHist->SetMarkerStyle(kFullCircle);
2242 fHistList->Add(tmpHist);
2248 //________________________________________________________________________
2249 void AliAnalysisTaskChargedJetsPA::Terminate(Option_t *)
2251 PostData(1, fOutputList);
2254 fOutputList = dynamic_cast<TList*> (GetOutputData(1)); // '1' refers to the output slot
2256 printf("ERROR: Output list not available\n");
2261 //________________________________________________________________________
2262 AliAnalysisTaskChargedJetsPA::~AliAnalysisTaskChargedJetsPA()
2264 // Destructor. Clean-up the output list, but not the histograms that are put inside
2265 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
2266 if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
2271 //________________________________________________________________________
2272 void AliAnalysisTaskChargedJetsPA::UserCreateOutputObjects()
2274 // called once to create user defined output objects like histograms, plots etc.
2275 // and to put it on the output list.
2276 // Note: Saving to file with e.g. OpenFile(0) is must be before creating other objects.
2278 fRandom = new TRandom3(0);
2281 fOutputList = new TList();
2282 fOutputList->SetOwner(); // otherwise it produces leaks in merging
2284 // NOTE: Pythia histograms
2285 AddHistogram1D<TProfile>("hPythiaXSection", "Pythia cross section distribution", "", fNumPtHardBins+1, 0, fNumPtHardBins+1, "p_{T} hard bin","dN^{Events}/dp_{T,hard}");
2286 AddHistogram1D<TH1D>("hPythiaNTrials", "Pythia trials (no correction for manual cuts)", "", fNumPtHardBins+1, 0, fNumPtHardBins+1, "p_{T} hard bin", "Trials");
2289 PostData(1, fOutputList);
2292 //________________________________________________________________________
2293 void AliAnalysisTaskChargedJetsPA::UserExec(Option_t *)
2296 AliInfo("UserExec() started.");
2301 AliError("??? Event pointer == 0 ???");
2306 ExecOnce(); // Get tracks, jets, background from arrays if not already given + Init Histos
2308 Calculate(InputEvent());
2310 PostData(1, fOutputList);