1 #ifndef ALIANALYSISTASKSE_H
9 #include <TProfile2D.h>
14 #include <TClonesArray.h>
18 #include <TInterpreter.h>
20 #include "AliAnalysisTask.h"
21 #include "AliCentrality.h"
23 #include "AliESDEvent.h"
24 #include "AliESDInputHandler.h"
25 #include "AliAODEvent.h"
26 #include "AliAODHandler.h"
27 #include "AliAnalysisManager.h"
28 #include "AliAnalysisTaskSE.h"
33 #include "AliGenPythiaEventHeader.h"
34 #include "AliAODMCHeader.h"
35 #include "AliMCEvent.h"
37 #include <AliEmcalJet.h>
38 #include <AliPicoTrack.h>
39 #include "AliVEventHandler.h"
40 #include "AliVParticle.h"
41 #include "AliAODMCParticle.h"
42 #include "AliAnalysisUtils.h"
43 #include "AliRhoParameter.h"
46 #include "AliAnalysisTaskChargedJetsPA.h"
49 //TODO: Not accessing the particles when using MC
50 //TODO: FillHistogram can be done better with virtual TH1(?)
51 ClassImp(AliAnalysisTaskChargedJetsPA)
53 // ######################################################################################## DEFINE HISTOGRAMS
54 void AliAnalysisTaskChargedJetsPA::Init()
57 AliInfo("Creating histograms.");
60 TH1D* tmpHisto = AddHistogram1D<TH1D>("hNumberEvents", "Number of events (0 = before cuts, 1 = after cuts)", "", 2, 0, 2, "stage","N^{Events}/cut");
61 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
62 tmpHisto->GetXaxis()->SetBinLabel(2, "After cuts");
64 tmpHisto = AddHistogram1D<TH1D>("hEventAcceptance", "Accepted events (0 = before cuts, 1 = after pile up, 2 = after vertex)", "", 3, 0, 3, "stage","N^{Events}/cut");
65 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
66 tmpHisto->GetXaxis()->SetBinLabel(2, "After pile up");
67 tmpHisto->GetXaxis()->SetBinLabel(3, "After vertex");
69 tmpHisto = AddHistogram1D<TH1D>("hTrackAcceptance", "Accepted tracks (0 = before cuts, 1 = after eta, 2 = after pT)", "", 3, 0, 3, "stage","N^{Tracks}/cut");
70 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
71 tmpHisto->GetXaxis()->SetBinLabel(2, "After eta");
72 tmpHisto->GetXaxis()->SetBinLabel(3, "After p_{T}");
74 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");
75 tmpHisto->GetXaxis()->SetBinLabel(1, "Before cuts");
76 tmpHisto->GetXaxis()->SetBinLabel(2, "After eta");
77 tmpHisto->GetXaxis()->SetBinLabel(3, "After p_{T}");
78 tmpHisto->GetXaxis()->SetBinLabel(4, "After area");
80 // NOTE: Jet histograms
83 // ######## Jet spectra
84 TH2* tmpHisto2D = AddHistogram2D<TH2D>("hJetPtCutStages", "Jets p_{T} distribution", "", 500, -50., 200., 4, 0, 4, "p_{T} (GeV/c)","Cut stage","dN^{Jets}/dp_{T}");
85 tmpHisto2D->GetYaxis()->SetBinLabel(1, "Before cuts");
86 tmpHisto2D->GetYaxis()->SetBinLabel(2, "After eta");
87 tmpHisto2D->GetYaxis()->SetBinLabel(3, "After p_{T}");
88 tmpHisto2D->GetYaxis()->SetBinLabel(4, "After area");
89 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}");
90 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedExternal_Phi1", "Jets p_{T} distribution, external background (Improved CMS) subtracted (1st part of azimuth)", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
91 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedExternal_Phi2", "Jets p_{T} distribution, external background (Improved CMS) subtracted (2nd part of azimuth)", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
93 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}");
94 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}");
98 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");
99 AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoExternal", "Mean subtracted KT (External) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean");
100 AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoPP", "Mean subtracted KT (pp from Michal) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean");
102 if(fAnalyzeDeprecatedBackgrounds)
104 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}");
105 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}");
106 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}");
107 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}");
108 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}");
109 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}");
112 // ######## Jet profiles
113 if(fAnalyzeJetProfile)
115 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");
116 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");
117 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");
118 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");
119 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");
120 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");
121 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");
123 // ######## Jet stuff
124 AddHistogram2D<TH2D>("hJetConstituentPt", "Jet constituents p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
125 AddHistogram1D<TH1D>("hJetCountAll", "Number of Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}");
126 AddHistogram1D<TH1D>("hJetCountAccepted", "Number of accepted Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}");
127 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}}");
128 AddHistogram1D<TH1D>("hLeadingJetPt", "Leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
129 AddHistogram1D<TH1D>("hSecondLeadingJetPt", "Second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
130 AddHistogram1D<TH1D>("hCorrectedLeadingJetPt", "Corrected leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
131 AddHistogram1D<TH1D>("hCorrectedSecondLeadingJetPt", "Corrected second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
132 AddHistogram1D<TH1D>("hJetDeltaPhi", "Jets combinatorial #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)");
133 AddHistogram1D<TH1D>("hLeadingJetDeltaPhi", "1st and 2nd leading jet #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)");
136 // NOTE: Jet background histograms
137 if (fAnalyzeBackground)
139 // ########## Default background estimates
140 AddHistogram2D<TH2D>("hKTBackgroundImprovedCMS", "KT background density (Improved CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
141 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");
142 AddHistogram2D<TH2D>("hKTBackgroundImprovedCMSExternal20GeV", "KT background density (Improved CMS approach from external task, jet p_{T} > 20 GeV)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
143 AddHistogram2D<TH2D>("hPPBackground", "PP background density (Michals approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
145 AddHistogram2D<TH2D>("hDeltaPtExternalBgrd", "Background fluctuations #delta p_{T} (KT, External)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
146 AddHistogram2D<TH2D>("hDeltaPtExternalBgrdVsPt", "Background fluctuations #delta p_{T} (KT, External, in p_{T} bins)", "", 1801, -40.0, 80.0, 200, 0, 200, "#delta p_{T} (GeV/c)","Raw jet p_{T}","dN^{Jets}/d#delta p_{T}");
147 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMS", "Background fluctuations #delta p_{T} (KT, Improved CMS-like)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
148 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSPartialExclusion", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, partial jet exclusion)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
149 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSPartialExclusion_Signal", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, partial jet exclusion w/ 1/N_{sig} probability)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
150 AddHistogram2D<TH2D>("hDeltaPtKTImprovedCMSFullExclusion", "Background fluctuations #delta p_{T} (KT, Improved CMS-like, full leading jet exclusion)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
151 AddHistogram2D<TH2D>("hDeltaPtNoBackground", "Background fluctuations #delta p_{T} (No background)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
153 AddHistogram1D<TProfile>("hKTMeanBackgroundImprovedCMS", "KT background mean (Improved CMS approach)", "", 100, 0, 100, "Centrality", "#rho mean");
155 if(fAnalyzeDeprecatedBackgrounds)
157 // ########## Different background estimates
158 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");
159 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");
160 AddHistogram2D<TH2D>("hKTBackgroundCMS", "KT background density (CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
161 AddHistogram2D<TH2D>("hKTBackgroundMean", "KT background density (Mean approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
162 AddHistogram2D<TH2D>("hKTBackgroundTrackLike", "KT background density (Track-like approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
164 AddHistogram2D<TH2D>("hTRBackgroundNoExcl", "TR background density (No signal excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
165 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");
166 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");
167 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");
168 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");
169 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");
171 // ########## Delta Pt
172 AddHistogram2D<TH2D>("hDeltaPtKTPbPb", "Background fluctuations #delta p_{T} (KT, PbPb w/o ghosts)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
173 AddHistogram2D<TH2D>("hDeltaPtKTPbPbWithGhosts", "Background fluctuations #delta p_{T} (KT, PbPb w/ ghosts)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
174 AddHistogram2D<TH2D>("hDeltaPtKTCMS", "Background fluctuations #delta p_{T} (KT, CMS-like)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
175 AddHistogram2D<TH2D>("hDeltaPtKTMean", "Background fluctuations #delta p_{T} (KT, Mean)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
176 AddHistogram2D<TH2D>("hDeltaPtKTTrackLike", "Background fluctuations #delta p_{T} (KT, track-like)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
177 AddHistogram2D<TH2D>("hDeltaPtTR", "Background fluctuations #delta p_{T} (TR, cone R=0.6)", "", 1801, -40.0, 80.0, fNumberOfCentralityBins, 0, 100, "#delta p_{T} (GeV/c)","Centrality","dN^{Jets}/d#delta p_{T}");
179 // ########## Profiles for background means vs. centrality
180 AddHistogram1D<TProfile>("hKTMeanBackgroundPbPb", "KT background mean (PbPb approach w/o ghosts)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
181 AddHistogram1D<TProfile>("hKTMeanBackgroundPbPbWithGhosts", "KT background mean (PbPb approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
182 AddHistogram1D<TProfile>("hKTMeanBackgroundCMS", "KT background mean (CMS approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
183 AddHistogram1D<TProfile>("hKTMeanBackgroundMean", "KT background mean (Mean approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
184 AddHistogram1D<TProfile>("hKTMeanBackgroundTPC", "KT background mean (Track-like approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
185 AddHistogram1D<TProfile>("hTRMeanBackground", "TR background mean", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
188 // NOTE: Jet constituent correlations
189 if(fAnalyzeMassCorrelation)
191 AddHistogram1D<TH1D>("hJetMassFromConstituents", "Jet mass by mass of charged constituents", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}");
192 AddHistogram1D<TH1D>("hJetMass", "Jet mass from fastjet", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}");
194 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");
195 AddHistogram2D<TH2D>("hJetPtVsJetMass", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
197 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");
198 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");
199 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");
200 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");
201 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");
202 AddHistogram1D<TH1D>("hJetConstituentProtonCount", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
203 AddHistogram1D<TH1D>("hJetConstituentPionCount", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
204 AddHistogram1D<TH1D>("hJetConstituentKaonCount", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
205 AddHistogram1D<TH1D>("hJetConstituentElectronCount", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
206 AddHistogram1D<TH1D>("hJetConstituentOthersCount", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
208 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");
209 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");
210 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");
211 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");
212 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");
213 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");
214 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");
215 AddHistogram1D<TH1D>("hJetConstituentProtonCount_6_14", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
216 AddHistogram1D<TH1D>("hJetConstituentPionCount_6_14", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
217 AddHistogram1D<TH1D>("hJetConstituentKaonCount_6_14", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
218 AddHistogram1D<TH1D>("hJetConstituentElectronCount_6_14", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
219 AddHistogram1D<TH1D>("hJetConstituentOthersCount_6_14", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
221 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");
222 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");
223 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");
224 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");
225 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");
226 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");
227 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");
228 AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_X", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
229 AddHistogram1D<TH1D>("hJetConstituentPionCount_2_X", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
230 AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_X", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
231 AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_X", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
232 AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_X", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
234 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");
235 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");
236 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");
237 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");
238 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");
239 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");
240 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");
241 AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_7", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
242 AddHistogram1D<TH1D>("hJetConstituentPionCount_2_7", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
243 AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_7", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
244 AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_7", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
245 AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_7", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
249 // NOTE: Track & Cluster & QA histograms
252 AddHistogram1D<TH1D>("hVertexX", "X distribution of the vertex", "", 2000, -1., 1., "#Delta x(cm)","dN^{Events}/dx");
253 AddHistogram1D<TH1D>("hVertexY", "Y distribution of the vertex", "", 2000, -1., 1., "#Delta y(cm)","dN^{Events}/dy");
254 AddHistogram2D<TH2D>("hVertexXY", "XY distribution of the vertex", "COLZ", 500, -1., 1., 500, -1., 1.,"#Delta x(cm)", "#Delta y(cm)","dN^{Events}/dxdy");
255 AddHistogram1D<TH1D>("hVertexZBeforeVertexCut", "Z distribution of the vertex (before std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz");
256 AddHistogram1D<TH1D>("hVertexZAfterVertexCut", "Z distribution of the vertex (after std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz");
257 AddHistogram1D<TH1D>("hVertexR", "R distribution of the vertex", "", 100, 0., 1., "#Delta r(cm)","dN^{Events}/dr");
258 AddHistogram1D<TH1D>("hCentralityV0M", "Centrality distribution V0M", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
259 AddHistogram1D<TH1D>("hCentralityV0A", "Centrality distribution V0A", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
260 AddHistogram1D<TH1D>("hCentralityV0C", "Centrality distribution V0C", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
261 AddHistogram1D<TH1D>("hCentralityZNA", "Centrality distribution ZNA", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
262 AddHistogram1D<TH1D>("hCentrality", Form("Centrality distribution %s", fCentralityType.Data()), "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
265 AddHistogram2D<TH2D>("hTrackCountAcc", "Number of tracks in acceptance vs. centrality", "LEGO2", 750, 0., 750., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}");
266 AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
267 AddHistogram2D<TH2D>("hTrackPtNegEta", "Tracks p_{T} distribution (negative #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
268 AddHistogram2D<TH2D>("hTrackPtPosEta", "Tracks p_{T} distribution (positive #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
269 AddHistogram1D<TH1D>("hTrackCharge", "Charge", "", 11, -5, 5, "Charge (e)","dN^{Tracks}/dq");
270 AddHistogram1D<TH1D>("hTrackPhi", "Track #phi distribution", "", 360, 0, TMath::TwoPi(), "#phi","dN^{Tracks}/d#phi");
271 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>("hTrackPtPhiEta", "Track p_{T} angular distribution", "LEGO2", 100, 0., 2*TMath::Pi(),100, -2.5, 2.5, "#phi","#eta","dp_{T}^{Tracks}/(d#phi d#eta)");
274 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}");
275 AddHistogram2D<TH2D>("hTrackPhiTrackType", "Track #phi distribution for different track types", "LEGO2", 360, 0, TMath::TwoPi(), 3, 0, 3, "#phi", "Label", "dN^{Tracks}/d#phi");
276 AddHistogram2D<TH2D>("hTrackEta", "Track #eta distribution", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Tracks}/d#eta");
280 AddHistogram1D<TH1D>("hRawJetArea", "Jets area distribution w/o area cut", "", 200, 0., 2., "Area","dN^{Jets}/dA");
281 AddHistogram2D<TH2D>("hJetArea", "Jets area distribution", "COLZ", 200, 0., 2., 500, -50., 200, "Area","Jet p_{T}","dN^{Jets}/dA");
282 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)");
283 AddHistogram2D<TH2D>("hJetEta", "Jets #eta distribution", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
284 AddHistogram2D<TH2D>("hJetEta2GeVTracks", "Jets #eta distribution, track p_{T} > 2 GeV", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
285 AddHistogram2D<TH2D>("hJetEta4GeVTracks", "Jets #eta distribution, track p_{T} > 4 GeV", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
286 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)");
287 AddHistogram2D<TH2D>("hJetPtPhiEta", "Jets p_{T} angular distribution", "LEGO2", 360, 0., 2*TMath::Pi(),100, -1.0, 1.0, "#phi","#eta","dp_{T}^{Jets}/(d#phi d#eta)");
288 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})");
292 // register Histograms
293 for (Int_t i = 0; i < fHistCount; i++)
295 fOutputList->Add(fHistList->At(i));
298 PostData(1,fOutputList); // important for merging
302 //________________________________________________________________________
303 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), fBackgroundForJetProfile(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), fBackgroundJetEtaWindow(0.5), fMinEta(-0.9), fMaxEta(0.9), fMinJetEta(-0.5), fMaxJetEta(0.5), 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)
306 AliInfo("Calling constructor.");
309 // Every instance of this task gets his own number
310 static Int_t instance = 0;
311 fTaskInstanceCounter = instance;
314 fTrackArrayName = new TString(trackArrayName);
315 if (fTrackArrayName->Contains("MCParticles") || fTrackArrayName->Contains("mcparticles"))
316 fIsKinematics = kTRUE;
318 fJetArrayName = new TString(jetArrayName);
319 if (strcmp(fJetArrayName->Data(),"") == 0)
321 fAnalyzeJets = kFALSE;
322 fAnalyzeJetProfile = kFALSE;
325 fAnalyzeJets = kTRUE;
327 fBackgroundJetArrayName = new TString(backgroundJetArrayName);
328 if (strcmp(fBackgroundJetArrayName->Data(),"") == 0)
329 fAnalyzeBackground = kFALSE;
331 fAnalyzeBackground = kTRUE;
333 DefineOutput(1, TList::Class());
335 fHistList = new TList();
337 for(Int_t i=0;i<1024;i++)
338 fSignalJets[i] = NULL;
342 AliInfo("Constructor done.");
347 //________________________________________________________________________
348 inline Double_t AliAnalysisTaskChargedJetsPA::GetConePt(Double_t eta, Double_t phi, Double_t radius)
350 Double_t tmpConePt = 0.0;
352 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
354 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
355 if (IsTrackInAcceptance(tmpTrack))
356 if(IsTrackInCone(tmpTrack, eta, phi, radius))
357 tmpConePt = tmpConePt + tmpTrack->Pt();
362 //________________________________________________________________________
363 inline Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedConePt(Double_t eta, Double_t phi, Double_t radius, Double_t background)
365 Double_t tmpConePt = 0.0;
367 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
369 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
370 if (IsTrackInAcceptance(tmpTrack))
371 if(IsTrackInCone(tmpTrack, eta, phi, radius))
372 tmpConePt = tmpConePt + tmpTrack->Pt();
374 Double_t realConeArea = (1.0*(fMaxEta-fMinEta)) * TMath::TwoPi() * MCGetOverlapCircleRectancle(eta, phi, radius, fMinEta, fMaxEta, 0., TMath::TwoPi());
375 tmpConePt -= background * realConeArea; // subtract background
381 //________________________________________________________________________
382 inline Double_t AliAnalysisTaskChargedJetsPA::GetPtHard()
385 AliInfo("Starting GetPtHard.");
387 AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
392 AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
396 for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++)
398 pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
399 if (pythiaHeader) break;
405 AliInfo("Ending GetPtHard.");
408 return pythiaHeader->GetPtHard();
410 AliWarning(Form("In task %s: GetPtHard() failed!", GetName()));
415 //________________________________________________________________________
416 inline Double_t AliAnalysisTaskChargedJetsPA::GetPythiaTrials()
419 AliInfo("Starting GetPythiaTrials.");
421 AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
426 AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
430 for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++)
432 pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
433 if (pythiaHeader) break;
439 AliInfo("Ending GetPythiaTrials.");
442 return pythiaHeader->Trials();
444 AliWarning(Form("In task %s: GetPythiaTrials() failed!", GetName()));
450 //________________________________________________________________________
451 inline Int_t AliAnalysisTaskChargedJetsPA::GetPtHardBin()
454 AliInfo("Starting GetPtHardBin.");
456 // ########## PT HARD BIN EDGES
457 const Int_t kPtHardLowerEdges[] = { 0, 5,11,21,36,57, 84,117,152,191,234};
458 const Int_t kPtHardHigherEdges[] = { 5,11,21,36,57,84,117,152,191,234,1000000};
460 Int_t tmpPtHardBin = 0;
461 Double_t tmpPtHard = GetPtHard();
463 for (tmpPtHardBin = 0; tmpPtHardBin <= fNumPtHardBins; tmpPtHardBin++)
464 if (tmpPtHard >= kPtHardLowerEdges[tmpPtHardBin] && tmpPtHard < kPtHardHigherEdges[tmpPtHardBin])
468 AliInfo("Ending GetPtHardBin.");
473 //________________________________________________________________________
474 Double_t AliAnalysisTaskChargedJetsPA::GetExternalRho()
476 // Get rho from event.
477 AliRhoParameter *rho = 0;
478 if (!fRhoTaskName.IsNull()) {
479 rho = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoTaskName.Data()));
481 AliWarning(Form("%s: Could not retrieve rho with name %s!", GetName(), fRhoTaskName.Data()));
488 return (rho->GetVal());
492 //________________________________________________________________________
493 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius)
495 // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi)
496 Double_t trackPhi = 0.0;
497 if (track->Phi() > (TMath::TwoPi() - (radius-phi)))
498 trackPhi = track->Phi() - TMath::TwoPi();
499 else if (track->Phi() < (phi+radius - TMath::TwoPi()))
500 trackPhi = track->Phi() + TMath::TwoPi();
502 trackPhi = track->Phi();
504 if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius)
510 //________________________________________________________________________
511 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex)
513 for (Int_t i = 0; i < jet->GetNumberOfTracks(); ++i)
515 Int_t jetTrack = jet->TrackAt(i);
516 if (jetTrack == trackIndex)
522 //________________________________________________________________________
523 inline Bool_t AliAnalysisTaskChargedJetsPA::IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2)
525 for (Int_t i = 0; i < jet1->GetNumberOfTracks(); ++i)
527 Int_t jet1Track = jet1->TrackAt(i);
528 for (Int_t j = 0; j < jet2->GetNumberOfTracks(); ++j)
530 Int_t jet2Track = jet2->TrackAt(j);
531 if (jet1Track == jet2Track)
538 //________________________________________________________________________
539 inline Bool_t AliAnalysisTaskChargedJetsPA::IsEventInAcceptance(AliVEvent* event)
544 FillHistogram("hEventAcceptance", 0.5); // number of events before manual cuts
546 if(fHelperClass->IsPileUpEvent(event))
549 FillHistogram("hEventAcceptance", 1.5); // number of events after pileup cuts
552 FillHistogram("hVertexZBeforeVertexCut",event->GetPrimaryVertex()->GetZ());
554 if(fUseDefaultVertexCut)
556 if(!fHelperClass->IsVertexSelected2013pA(event))
559 else // Failsafe vertex cut
561 if(!event->GetPrimaryVertex() || (TMath::Abs(event->GetPrimaryVertex()->GetZ()) > 10.0) || (event->GetPrimaryVertex()->GetNContributors()<1))
566 FillHistogram("hVertexZAfterVertexCut",event->GetPrimaryVertex()->GetZ());
568 FillHistogram("hEventAcceptance", 2.5); // number of events after vertex cut
573 //________________________________________________________________________
574 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInAcceptance(AliVParticle* track)
576 FillHistogram("hTrackAcceptance", 0.5);
581 // TODO: Only working for AOD MC
582 if((!track->Charge()) || (!(static_cast<AliAODMCParticle*>(track))->IsPhysicalPrimary()) )
585 if ((track->Eta() < fMaxEta) && (track->Eta() >= fMinEta))
587 FillHistogram("hTrackAcceptance", 1.5);
588 if (track->Pt() >= fMinTrackPt)
590 FillHistogram("hTrackAcceptance", 2.5);
598 //________________________________________________________________________
599 inline Bool_t AliAnalysisTaskChargedJetsPA::IsBackgroundJetInAcceptance(AliEmcalJet *jet)
602 if (TMath::Abs(jet->Eta()) <= fBackgroundJetEtaWindow)
603 if (jet->Pt() >= fMinBackgroundJetPt)
609 //________________________________________________________________________
610 inline Bool_t AliAnalysisTaskChargedJetsPA::IsSignalJetInAcceptance(AliEmcalJet *jet, Bool_t usePtCut)
612 Bool_t acceptedWithPtCut = kFALSE;
613 Bool_t acceptedWithoutPtCut = kFALSE;
615 FillHistogram("hJetAcceptance", 0.5);
617 if ((jet->Eta() >= fMinJetEta) && (jet->Eta() < fMaxJetEta))
619 FillHistogram("hJetAcceptance", 1.5);
620 if (jet->Pt() >= fMinJetPt) // jet fulfills pt cut
622 FillHistogram("hJetAcceptance", 2.5);
623 if (jet->Area() >= fMinJetArea)
625 FillHistogram("hJetAcceptance", 3.5);
626 acceptedWithPtCut = kTRUE;
629 else if(!usePtCut) // jet does not fulfill pt cut
631 if (jet->Area() >= fMinJetArea)
632 acceptedWithoutPtCut = kTRUE;
637 return (acceptedWithPtCut);
639 return (acceptedWithPtCut || acceptedWithoutPtCut);
643 //________________________________________________________________________
644 inline Bool_t AliAnalysisTaskChargedJetsPA::IsDijet(AliEmcalJet *jet1, AliEmcalJet *jet2)
646 // Output from GetDeltaPhi is < pi in any case
647 if ((jet1 != 0) && (jet2 != 0))
648 if((TMath::Pi() - GetDeltaPhi(jet1->Phi(),jet2->Phi())) < fDijetMaxAngleDeviation)
649 if ((jet1->Pt() > fMinDijetLeadingPt) && (jet2->Pt() > fMinDijetLeadingPt)) //TODO: Introduce recoil jet?
655 //________________________________________________________________________
656 void AliAnalysisTaskChargedJetsPA::ExecOnce()
659 AliInfo("Starting ExecOnce.");
661 fInitialized = kTRUE;
663 // Check for track array
664 if (strcmp(fTrackArrayName->Data(), "") != 0)
666 fTrackArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrackArrayName->Data()));
670 AliWarning(Form("%s: Could not retrieve tracks %s! This is OK, if tracks are not demanded.", GetName(), fTrackArrayName->Data()));
675 TClass *cl = fTrackArray->GetClass();
676 if (!cl->GetBaseClass("AliVParticle"))
678 AliError(Form("%s: Collection %s does not contain AliVParticle objects!", GetName(), fTrackArrayName->Data()));
685 // Check for jet array
686 if (strcmp(fJetArrayName->Data(), "") != 0)
688 fJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetArrayName->Data()));
693 AliWarning(Form("%s: Could not retrieve jets %s! This is OK, if jets are not demanded.", GetName(), fJetArrayName->Data()));
698 if (!fJetArray->GetClass()->GetBaseClass("AliEmcalJet"))
700 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fJetArrayName->Data()));
707 // Check for background object
708 if (strcmp(fBackgroundJetArrayName->Data(), "") != 0)
710 fBackgroundJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fBackgroundJetArrayName->Data()));
711 fHasBackgroundJets = kTRUE;
712 if (!fBackgroundJetArray)
714 AliInfo(Form("%s: Could not retrieve background jets %s! This is OK, if background is not demanded.", GetName(), fBackgroundJetArrayName->Data()));
715 fHasBackgroundJets = kFALSE;
719 // Look, if initialization is OK
720 if (!fHasTracks && fAnalyzeBackground)
722 AliError(Form("%s: Tracks NOT successfully casted although demanded! Deactivating background analysis",GetName()));
723 fAnalyzeBackground = kFALSE;
725 if ((!fHasJets && fAnalyzeJets) || (!fHasJets && fAnalyzeBackground))
727 AliError(Form("%s: Jets NOT successfully casted although demanded! Deactivating jet- and background analysis",GetName()));
728 fAnalyzeJets = kFALSE;
729 fAnalyzeBackground = kFALSE;
731 if (!fHasBackgroundJets && fAnalyzeBackground)
733 AliError(Form("%s: Background NOT successfully casted although demanded! Deactivating background analysis",GetName()));
734 fAnalyzeBackground = kFALSE;
737 // Initialize helper class (for vertex selection & pile up correction)
738 fHelperClass = new AliAnalysisUtils();
739 fHelperClass->SetCutOnZVertexSPD(kFALSE);
744 AliInfo("ExecOnce done.");
749 //________________________________________________________________________
750 void AliAnalysisTaskChargedJetsPA::GetSignalJets()
753 fFirstLeadingJet = NULL;
754 fSecondLeadingJet = NULL;
755 fNumberSignalJets = 0;
758 for (Int_t i = 0; i < fJetArray->GetEntries(); i++)
760 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJetArray->At(i));
763 AliError(Form("%s: Could not receive jet %d", GetName(), i));
766 if (!IsSignalJetInAcceptance(jet, kTRUE))
769 for (Int_t j = 0; j <= tmpJets.GetEntries(); j++)
771 if (j>tmpJets.GetEntries()-1) // When passed last item add the jet at the end
777 AliEmcalJet* listJet = static_cast<AliEmcalJet*>(tmpJets.At(j));
779 if(jet->Pt() < listJet->Pt()) // Insert jet before that one in list if pt smaller
781 tmpJets.AddAt(jet, j);
787 for (Int_t i = 0; i < tmpJets.GetEntries(); i++)
789 AliEmcalJet* jet = static_cast<AliEmcalJet*>(tmpJets.At(i));
790 fSignalJets[fNumberSignalJets] = jet;
794 Int_t leadingJets[] = {-1, -1};
795 GetLeadingJets(fJetArray, &leadingJets[0], kTRUE);
797 if (leadingJets[0] > -1)
798 fFirstLeadingJet = static_cast<AliEmcalJet*>(fJetArray->At(leadingJets[0]));
799 if (leadingJets[1] > -1)
800 fSecondLeadingJet = static_cast<AliEmcalJet*>(fJetArray->At(leadingJets[1]));
803 //________________________________________________________________________
804 Int_t AliAnalysisTaskChargedJetsPA::GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets)
806 // Writes first two leading jets into already registered array jetIDArray
810 AliError("Could not get the jet array to get leading jets from it!");
814 Float_t maxJetPts[] = {0, 0};
818 Int_t jetCount = jetArray->GetEntries();
819 Int_t jetCountAccepted = 0;
821 for (Int_t i = 0; i < jetCount; i++)
823 AliEmcalJet* jet = static_cast<AliEmcalJet*>(jetArray->At(i));
826 AliError(Form("%s: Could not receive jet %d", GetName(), i));
832 if (!IsSignalJetInAcceptance(jet)) continue;
836 if (!IsBackgroundJetInAcceptance(jet)) continue;
839 if (jet->Pt() > maxJetPts[0])
841 maxJetPts[1] = maxJetPts[0];
842 jetIDArray[1] = jetIDArray[0];
843 maxJetPts[0] = jet->Pt();
846 else if (jet->Pt() > maxJetPts[1])
848 maxJetPts[1] = jet->Pt();
853 return jetCountAccepted;
857 //________________________________________________________________________
858 Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedJetPt(AliEmcalJet* jet, Double_t background)
861 AliInfo("Getting corrected jet spectra.");
866 AliError("Jet pointer passed to GetCorrectedJetPt() not valid!");
870 Double_t correctedPt = -1.0;
872 // if the passed background is not valid, do not subtract it
876 // Subtract background
877 correctedPt = jet->Pt() - background * jet->Area();
880 AliInfo("Got corrected jet spectra.");
888 //________________________________________________________________________
889 Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability)
892 AliInfo("Getting Delta Pt.");
895 // Define an invalid delta pt
896 Double_t deltaPt = -10000.0;
899 Double_t etaMin, etaMax;
900 etaMin = fMinEta+fRandConeRadius;
901 etaMax = fMaxEta-fRandConeRadius;
903 // Define random cone
904 Bool_t coneValid = kTRUE;
905 Double_t tmpRandConeEta = etaMin + fRandom->Rndm()*(etaMax-etaMin);
906 Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
908 // if there is a jet, check for overlap if demanded
909 if(leadingJetExclusionProbability)
911 AliEmcalJet* tmpLeading = dynamic_cast<AliEmcalJet*>(fJetArray->At(0));
912 // Get leading jet (regardless of pT)
913 for (Int_t i = 1; i<fJetArray->GetEntries(); i++)
915 AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i));
916 // if jet is in acceptance and higher, take as new leading
918 if ( ((tmpJet->Eta() >= fMinJetEta) && (tmpJet->Eta() < fMaxJetEta)) && (tmpJet->Area() >= fMinJetArea))
919 if((!tmpLeading) || (tmpJet->Pt() > tmpLeading->Pt()))
924 Double_t excludedJetPhi = tmpLeading->Phi();
925 Double_t excludedJetEta = tmpLeading->Eta();
926 Double_t tmpDeltaPhi = GetDeltaPhi(tmpRandConePhi, excludedJetPhi);
928 // Check, if cone has overlap with jet
929 if ( tmpDeltaPhi*tmpDeltaPhi + TMath::Abs(tmpRandConeEta-excludedJetEta)*TMath::Abs(tmpRandConeEta-excludedJetEta) <= fRandConeRadius*fRandConeRadius)
931 // Define probability to exclude the RC
932 Double_t probability = leadingJetExclusionProbability;
934 // Only exclude cone with a given probability
935 if (fRandom->Rndm()<=probability)
942 // Get the cones' pt and calculate delta pt
944 deltaPt = GetConePt(tmpRandConeEta,tmpRandConePhi,fRandConeRadius) - (rho*fRandConeRadius*fRandConeRadius*TMath::Pi());
948 AliInfo("Got Delta Pt.");
952 //________________________________________________________________________
953 void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike)
956 AliInfo("Getting ALL KT background density.");
959 static Double_t tmpRhoPbPb[1024];
960 static Double_t tmpRhoPbPbWithGhosts[1024];
961 static Double_t tmpRhoMean[1024];
962 static Double_t tmpRhoCMS[1024];
963 static Double_t tmpRhoImprovedCMS[1024];
964 Double_t tmpCoveredArea = 0.0;
965 Double_t tmpSummedArea = 0.0;
966 Double_t tmpPtTrackLike = 0.0;
967 Double_t tmpAreaTrackLike = 0.0;
969 // Setting invalid values
971 rhoPbPbWithGhosts = 0.0;
973 rhoImprovedCMS = 0.0;
977 Int_t rhoPbPbJetCount = 0;
978 Int_t rhoPbPbWithGhostsJetCount = 0;
979 Int_t rhoCMSJetCount = 0;
980 Int_t rhoImprovedCMSJetCount = 0;
981 Int_t rhoMeanJetCount = 0;
984 // Find 2 leading KT jets for the original PbPb approach
985 Int_t leadingKTJets[] = {-1, -1};
986 GetLeadingJets(fBackgroundJetArray, &leadingKTJets[0], kFALSE);
988 // Exclude UP TO numberExcludeLeadingJets
989 if(numberExcludeLeadingJets==-1)
990 numberExcludeLeadingJets = fNumberSignalJets;
991 if (fNumberSignalJets < numberExcludeLeadingJets)
992 numberExcludeLeadingJets = fNumberSignalJets;
994 for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++)
996 AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i));
1000 AliError(Form("%s: Could not receive jet %d", GetName(), i));
1004 tmpSummedArea += backgroundJet->Area();
1005 if(backgroundJet->Pt() > 0.150)
1006 tmpCoveredArea += backgroundJet->Area();
1008 if (!IsBackgroundJetInAcceptance(backgroundJet))
1011 // Search for overlap with signal jets
1012 Bool_t isOverlapping = kFALSE;
1013 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1015 AliEmcalJet* signalJet = fSignalJets[j];
1017 if(signalJet->Pt() >= 5.0)
1018 if(IsJetOverlapping(signalJet, backgroundJet))
1020 isOverlapping = kTRUE;
1025 Double_t tmpRho = 0.0;
1026 if(backgroundJet->Area())
1027 tmpRho = backgroundJet->Pt() / backgroundJet->Area();
1029 // PbPb approach (take ghosts into account)
1030 if ((i != leadingKTJets[0]) && (i != leadingKTJets[1]))
1032 tmpRhoPbPbWithGhosts[rhoPbPbWithGhostsJetCount] = tmpRho;
1033 rhoPbPbWithGhostsJetCount++;
1036 if(backgroundJet->Pt() > 0.150)
1038 // CMS approach: don't take ghosts into acount
1039 tmpRhoCMS[rhoCMSJetCount] = tmpRho;
1042 // Improved CMS approach: like CMS but excluding signal
1045 tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho;
1046 rhoImprovedCMSJetCount++;
1049 // PbPb w/o ghosts approach (just neglect ghosts)
1050 if ((i != leadingKTJets[0]) && (i != leadingKTJets[1]))
1052 tmpRhoPbPb[rhoPbPbJetCount] = tmpRho;
1057 // (no overlap with signal jets)
1061 tmpRhoMean[rhoMeanJetCount] = tmpRho;
1064 // Track like approach approach
1065 tmpPtTrackLike += backgroundJet->Pt();
1066 tmpAreaTrackLike += backgroundJet->Area();
1071 if (tmpAreaTrackLike > 0)
1072 rhoTrackLike = tmpPtTrackLike/tmpAreaTrackLike;
1073 if (rhoPbPbJetCount > 0)
1074 rhoPbPb = TMath::Median(rhoPbPbJetCount, tmpRhoPbPb);
1075 if (rhoPbPbWithGhostsJetCount > 0)
1076 rhoPbPbWithGhosts = TMath::Median(rhoPbPbWithGhostsJetCount, tmpRhoPbPbWithGhosts);
1077 if (rhoCMSJetCount > 0)
1078 rhoCMS = TMath::Median(rhoCMSJetCount, tmpRhoCMS) * tmpCoveredArea/tmpSummedArea;
1079 if (rhoImprovedCMSJetCount > 0)
1081 rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
1083 if (rhoMeanJetCount > 0)
1084 rhoMean = TMath::Mean(rhoMeanJetCount, tmpRhoMean);
1087 AliInfo("Got ALL KT background density.");
1091 //________________________________________________________________________
1092 void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS)
1095 AliInfo("Getting KT background density.");
1098 static Double_t tmpRhoImprovedCMS[1024];
1099 Double_t tmpCoveredArea = 0.0;
1100 Double_t tmpSummedArea = 0.0;
1102 // Setting invalid values
1103 rhoImprovedCMS = 0.0;
1105 Int_t rhoImprovedCMSJetCount = 0;
1107 // Exclude UP TO numberExcludeLeadingJets
1108 if(numberExcludeLeadingJets==-1)
1109 numberExcludeLeadingJets = fNumberSignalJets;
1110 if (fNumberSignalJets < numberExcludeLeadingJets)
1111 numberExcludeLeadingJets = fNumberSignalJets;
1113 for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++)
1115 AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i));
1119 AliError(Form("%s: Could not receive jet %d", GetName(), i));
1123 // Search for overlap with signal jets
1124 Bool_t isOverlapping = kFALSE;
1125 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1127 AliEmcalJet* signalJet = fSignalJets[j];
1128 if(signalJet->Pt() >= 5.0)
1129 if(IsJetOverlapping(signalJet, backgroundJet))
1131 isOverlapping = kTRUE;
1136 tmpSummedArea += backgroundJet->Area();
1137 if(backgroundJet->Pt() > 0.150)
1138 tmpCoveredArea += backgroundJet->Area();
1140 if (!IsBackgroundJetInAcceptance(backgroundJet))
1143 Double_t tmpRho = backgroundJet->Pt() / backgroundJet->Area();
1145 if(backgroundJet->Pt() > 0.150)
1148 tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho;
1149 rhoImprovedCMSJetCount++;
1153 if (rhoImprovedCMSJetCount > 0)
1155 rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
1158 AliInfo("Got KT background density.");
1163 //________________________________________________________________________
1164 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion)
1167 AliInfo("Getting TR background density.");
1170 Double_t summedTracksPtCone04 = 0.0;
1171 Double_t summedTracksPtCone02 = 0.0;
1172 Double_t summedTracksPtCone06 = 0.0;
1173 Double_t summedTracksPtCone08 = 0.0;
1174 Double_t summedTracksPtWithinJets = 0.0;
1175 Double_t summedTracksPt = 0.0;
1177 // Setting invalid values
1178 rhoNoExclusion = 0.0;
1179 rhoConeExclusion02 = 0.0;
1180 rhoConeExclusion04 = 0.0;
1181 rhoConeExclusion06 = 0.0;
1182 rhoConeExclusion08 = 0.0;
1183 rhoExactExclusion = 0.0;
1185 // Exclude UP TO numberExcludeLeadingJets
1186 if(numberExcludeLeadingJets==-1)
1187 numberExcludeLeadingJets = fNumberSignalJets;
1188 if (fNumberSignalJets < numberExcludeLeadingJets)
1189 numberExcludeLeadingJets = fNumberSignalJets;
1191 Int_t fSignalJetCount5GeV = 0;
1192 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1194 AliEmcalJet* signalJet = fSignalJets[j];
1195 if(signalJet->Pt() < 5.0)
1197 fSignalJetCount5GeV++;
1200 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
1202 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
1203 Bool_t trackWithinJet = kFALSE; Bool_t trackWithin02Cone = kFALSE; Bool_t trackWithin04Cone = kFALSE; Bool_t trackWithin06Cone = kFALSE; Bool_t trackWithin08Cone = kFALSE;
1205 if (IsTrackInAcceptance(tmpTrack))
1207 // Check if tracks overlaps with jet
1208 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1210 AliEmcalJet* signalJet = fSignalJets[j];
1212 if(signalJet->Pt() < 5.0)
1215 // Exact jet exclusion
1216 if (IsTrackInJet(signalJet, i))
1217 trackWithinJet = kTRUE;
1220 if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.2))
1222 trackWithin02Cone = kTRUE;
1223 trackWithin04Cone = kTRUE;
1224 trackWithin06Cone = kTRUE;
1225 trackWithin08Cone = kTRUE;
1228 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.4))
1230 trackWithin04Cone = kTRUE;
1231 trackWithin06Cone = kTRUE;
1232 trackWithin08Cone = kTRUE;
1234 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.6))
1236 trackWithin06Cone = kTRUE;
1237 trackWithin08Cone = kTRUE;
1239 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.8))
1241 trackWithin08Cone = kTRUE;
1245 if(!trackWithin08Cone)
1247 summedTracksPtCone08 += tmpTrack->Pt();
1249 if(!trackWithin06Cone)
1251 summedTracksPtCone06 += tmpTrack->Pt();
1253 if(!trackWithin04Cone)
1255 summedTracksPtCone04 += tmpTrack->Pt();
1257 if(!trackWithin02Cone)
1259 summedTracksPtCone02 += tmpTrack->Pt();
1263 summedTracksPtWithinJets += tmpTrack->Pt();
1265 summedTracksPt += tmpTrack->Pt();
1270 // Calculate the correct area where the tracks were taking from
1272 Double_t tmpFullTPCArea = (1.0*(fMaxEta-fMinEta)) * TMath::TwoPi();
1273 Double_t tmpAreaCone02 = tmpFullTPCArea;
1274 Double_t tmpAreaCone04 = tmpFullTPCArea;
1275 Double_t tmpAreaCone06 = tmpFullTPCArea;
1276 Double_t tmpAreaCone08 = tmpFullTPCArea;
1277 Double_t tmpAreaWithinJets = tmpFullTPCArea;
1278 std::vector<Double_t> tmpEtas(fSignalJetCount5GeV);
1279 std::vector<Double_t> tmpPhis(fSignalJetCount5GeV);
1282 for(Int_t i=0;i<numberExcludeLeadingJets;i++)
1284 AliEmcalJet* tmpJet = fSignalJets[i];
1286 if(tmpJet->Pt() < 5.0)
1289 tmpEtas[iSignal] = tmpJet->Eta();
1290 tmpPhis[iSignal] = tmpJet->Phi();
1291 tmpAreaWithinJets -= tmpJet->Area();
1296 tmpAreaCone02 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.2, fMinEta, fMaxEta, 0., TMath::TwoPi());
1297 tmpAreaCone04 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.4, fMinEta, fMaxEta, 0., TMath::TwoPi());
1298 tmpAreaCone06 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.6, fMinEta, fMaxEta, 0., TMath::TwoPi());
1299 tmpAreaCone08 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.8, fMinEta, fMaxEta, 0., TMath::TwoPi());
1301 rhoConeExclusion02 = summedTracksPtCone02/tmpAreaCone02;
1302 rhoConeExclusion04 = summedTracksPtCone04/tmpAreaCone04;
1303 rhoConeExclusion06 = summedTracksPtCone06/tmpAreaCone06;
1304 rhoConeExclusion08 = summedTracksPtCone08/tmpAreaCone08;
1305 rhoExactExclusion = summedTracksPtWithinJets/tmpAreaWithinJets;
1306 rhoNoExclusion = summedTracksPt/tmpFullTPCArea;
1310 AliInfo("Got TR background density.");
1314 //________________________________________________________________________
1315 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular)
1318 AliInfo("Getting TR background density.");
1321 // Setting invalid values
1322 Double_t summedTracksPt = 0.0;
1326 Double_t tmpRadius = 0.0;
1327 if (doSearchPerpendicular)
1328 tmpRadius = 0.4*TMath::Pi(); // exclude 90 degrees around jets
1332 numberExcludeLeadingJets = 2; // dijet is excluded here in any case
1336 if (!fTrackArray || !fJetArray)
1338 AliError("Could not get the track/jet array to calculate track rho!");
1342 Int_t trackCount = fTrackArray->GetEntries();
1343 Int_t trackCountAccepted = 0;
1344 for (Int_t i = 0; i < trackCount; i++)
1346 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
1347 if (IsTrackInAcceptance(tmpTrack))
1349 if (IsTrackInCone(tmpTrack, excludeJet1->Eta(), excludeJet1->Phi(), tmpRadius))
1352 if (numberExcludeLeadingJets > 1)
1353 if (IsTrackInCone(tmpTrack, excludeJet2->Eta(), excludeJet2->Phi(), tmpRadius))
1356 // Add track pt to array
1357 summedTracksPt = summedTracksPt + tmpTrack->Pt();
1358 trackCountAccepted++;
1362 if (trackCountAccepted > 0)
1364 Double_t tmpArea = 1.0*(fMaxEta-fMinEta)*TMath::TwoPi() - 2*(tmpRadius*tmpRadius * TMath::Pi()); //TPC area - excluding jet area
1365 rhoMean = summedTracksPt/tmpArea;
1370 AliInfo("Got TR background density.");
1374 //________________________________________________________________________
1375 void AliAnalysisTaskChargedJetsPA::GetPPBackgroundDensity(Double_t& background)
1377 // This is the background that was used for the pp 7 TeV ALICE paper
1378 // The background is estimated using the leading jet
1383 Int_t leadingJets[] = {-1, -1};
1384 GetLeadingJets(fJetArray, &leadingJets[0], kTRUE);
1385 AliEmcalJet* jet = NULL;
1386 if(leadingJets[0] != -1)
1387 jet = static_cast<AliEmcalJet*>(fJetArray->At(leadingJets[0]));
1391 Double_t jetMom[3] = { jet->Px(), jet->Py(), jet->Pz() };
1392 TVector3 jet3mom1(jetMom);
1393 TVector3 jet3mom2(jetMom);
1395 jet3mom1.RotateZ(TMath::Pi());
1396 jet3mom2.RotateZ(-TMath::Pi());
1398 for (int i = 0; i < fTrackArray->GetEntries(); i++)
1400 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1401 if (!IsTrackInAcceptance(track))
1404 Double_t trackMom[3] = { track->Px(), track->Py(), track->Pz() };
1405 TVector3 track3mom(trackMom);
1407 Double_t dR1 = jet3mom1.DeltaR(track3mom);
1408 Double_t dR2 = jet3mom2.DeltaR(track3mom);
1410 if (dR1 <= fSignalJetRadius || dR2 <= fSignalJetRadius)
1411 background += track3mom.Pt();
1414 background /= (2 * TMath::Pi() * fSignalJetRadius * fSignalJetRadius);
1417 //________________________________________________________________________
1418 void AliAnalysisTaskChargedJetsPA::Calculate(AliVEvent* event)
1421 AliInfo("Starting Calculate().");
1423 ////////////////////// NOTE: initialization & casting
1427 // Check, if analysis should be done in pt hard bins
1428 if(fUsePtHardBin != -1)
1429 if(GetPtHardBin() != fUsePtHardBin)
1432 // This is to take only every Nth event
1433 if((fEventCounter+fPartialAnalysisIndex) % fPartialAnalysisNParts != 0)
1436 FillHistogram("hNumberEvents",0.5);
1438 if(!IsEventInAcceptance(event))
1441 FillHistogram("hNumberEvents",1.5);
1444 AliInfo("Calculate()::Init done.");
1447 ////////////////////// NOTE: Get Centrality, (Leading)Signal jets and Background
1450 AliCentrality* tmpCentrality = NULL;
1451 tmpCentrality = event->GetCentrality();
1452 Double_t centralityPercentile = -1.0;
1453 Double_t centralityPercentileV0A = 0.0;
1454 Double_t centralityPercentileV0C = 0.0;
1455 Double_t centralityPercentileV0M = 0.0;
1456 Double_t centralityPercentileZNA = 0.0;
1457 if (tmpCentrality != NULL)
1459 centralityPercentile = tmpCentrality->GetCentralityPercentile(fCentralityType.Data());
1460 centralityPercentileV0A = tmpCentrality->GetCentralityPercentile("V0A");
1461 centralityPercentileV0C = tmpCentrality->GetCentralityPercentile("V0C");
1462 centralityPercentileV0M = tmpCentrality->GetCentralityPercentile("V0M");
1463 centralityPercentileZNA = tmpCentrality->GetCentralityPercentile("ZNA");
1466 if((centralityPercentile < 0.0) || (centralityPercentile > 100.0))
1467 AliWarning(Form("Centrality value not valid (c=%E)",centralityPercentile));
1469 if(fSetCentralityToOne)
1470 centralityPercentile = 1.0;
1473 if (fAnalyzeBackground || fAnalyzeJets)
1476 // Get background estimates
1477 Double_t backgroundKTImprovedCMS = -1.0;
1478 Double_t backgroundKTImprovedCMSExternal = -1.0;
1479 Double_t backgroundKTPbPb = -1.0;
1480 Double_t backgroundKTPbPbWithGhosts = -1.0;
1481 Double_t backgroundKTCMS = -1.0;
1482 Double_t backgroundKTMean = -1.0;
1483 Double_t backgroundKTTrackLike = -1.0;
1484 Double_t backgroundTRNoExcl = -1.0;
1485 Double_t backgroundTRCone02 = -1.0;
1486 Double_t backgroundTRCone04 = -1.0;
1487 Double_t backgroundTRCone06 = -1.0;
1488 Double_t backgroundTRCone08 = -1.0;
1489 Double_t backgroundTRExact = -1.0;
1490 Double_t backgroundPP = -1.0;
1491 Double_t backgroundJetProfile = -1.0;
1492 // Calculate background for different jet exclusions
1494 if (fAnalyzeBackground)
1497 if(fAnalyzeDeprecatedBackgrounds)
1498 GetKTBackgroundDensityAll (fNumberExcludedJets, backgroundKTPbPb, backgroundKTPbPbWithGhosts, backgroundKTCMS, backgroundKTImprovedCMS, backgroundKTMean, backgroundKTTrackLike);
1500 GetKTBackgroundDensity (fNumberExcludedJets, backgroundKTImprovedCMS);
1502 if(fAnalyzeDeprecatedBackgrounds)
1503 GetTRBackgroundDensity (fNumberExcludedJets, backgroundTRNoExcl, backgroundTRCone02, backgroundTRCone04, backgroundTRCone06, backgroundTRCone08, backgroundTRExact);
1506 GetPPBackgroundDensity(backgroundPP);
1508 backgroundKTImprovedCMSExternal = GetExternalRho();
1509 if(fNoExternalBackground)
1510 backgroundKTImprovedCMSExternal = 0;
1512 if(fBackgroundForJetProfile==0)
1513 backgroundJetProfile = backgroundKTImprovedCMSExternal;
1514 else if(fBackgroundForJetProfile==1)
1515 backgroundJetProfile = backgroundKTImprovedCMS;
1516 else if(fBackgroundForJetProfile==2)
1517 backgroundJetProfile = backgroundKTCMS;
1518 else if(fBackgroundForJetProfile==3)
1519 backgroundJetProfile = backgroundPP;
1520 else if(fBackgroundForJetProfile==4)
1521 backgroundJetProfile = backgroundTRCone06;
1522 else if(fBackgroundForJetProfile==5)
1523 backgroundJetProfile = 0;
1527 AliInfo("Calculate()::Centrality&SignalJets&Background-Calculation done.");
1532 FillHistogram("hVertexX",event->GetPrimaryVertex()->GetX());
1533 FillHistogram("hVertexY",event->GetPrimaryVertex()->GetY());
1534 FillHistogram("hVertexXY",event->GetPrimaryVertex()->GetX(), event->GetPrimaryVertex()->GetY());
1535 FillHistogram("hVertexR",TMath::Sqrt(event->GetPrimaryVertex()->GetX()*event->GetPrimaryVertex()->GetX() + event->GetPrimaryVertex()->GetY()*event->GetPrimaryVertex()->GetY()));
1536 FillHistogram("hCentralityV0M",centralityPercentileV0M);
1537 FillHistogram("hCentralityV0A",centralityPercentileV0A);
1538 FillHistogram("hCentralityV0C",centralityPercentileV0C);
1539 FillHistogram("hCentralityZNA",centralityPercentileZNA);
1540 FillHistogram("hCentrality",centralityPercentile);
1542 Int_t trackCountAcc = 0;
1543 Int_t nTracks = fTrackArray->GetEntries();
1544 for (Int_t i = 0; i < nTracks; i++)
1546 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1549 if (track->Pt() >= fMinTrackPt)
1551 FillHistogram("hTrackPhiEta", track->Phi(),track->Eta(), 1);
1552 FillHistogram("hTrackPtPhiEta", track->Phi(),track->Eta(), track->Pt());
1555 if (IsTrackInAcceptance(track))
1557 FillHistogram("hTrackPt", track->Pt(), centralityPercentile);
1558 if(track->Eta() >= 0)
1559 FillHistogram("hTrackPtPosEta", track->Pt(), centralityPercentile);
1561 FillHistogram("hTrackPtNegEta", track->Pt(), centralityPercentile);
1563 FillHistogram("hTrackEta", track->Eta(), centralityPercentile);
1564 FillHistogram("hTrackPhi", track->Phi());
1566 if(static_cast<AliPicoTrack*>(track))
1567 FillHistogram("hTrackPhiTrackType", track->Phi(), (static_cast<AliPicoTrack*>(track))->GetTrackType());
1569 for(Int_t j=0;j<20;j++)
1571 FillHistogram("hTrackPhiPtCut", track->Phi(), track->Pt());
1573 FillHistogram("hTrackCharge", track->Charge());
1577 FillHistogram("hTrackCountAcc", trackCountAcc, centralityPercentile);
1581 // This is code that is run locally to get some special events
1582 TFile* fileOutput = new TFile("SpecialEvents.root", "UPDATE");
1583 if(fSecondLeadingJet&&(fSecondLeadingJet->Pt()>10.))
1585 cout << "Event found\n";
1586 TH2D* tmpEvent = new TH2D(Form("Event%lu", fEventCounter), "", 40, -0.9, 0.9, 40, 0., TMath::TwoPi());
1587 tmpEvent->GetXaxis()->SetTitle("#eta");
1588 tmpEvent->GetYaxis()->SetTitle("#phi");
1589 tmpEvent->SetOption("LEGO2");
1592 for (Int_t i = 0; i < nTracks; i++)
1594 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1596 if (IsTrackInAcceptance(track))
1598 tmpEvent->Fill(track->Eta(), track->Phi(), track->Pt());
1601 tmpEvent->Write(0, kOverwrite);
1603 fileOutput->Close();
1607 AliInfo("Calculate()::QA done.");
1610 ////////////////////// NOTE: Jet analysis and calculations
1614 for (Int_t i = 0; i<fJetArray->GetEntries(); i++)
1616 AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i));
1620 // ### RAW JET ANALYSIS
1621 if (tmpJet->Area() >= fMinJetArea)
1622 FillHistogram("hRawJetPhiEta", tmpJet->Phi(), tmpJet->Eta());
1623 if ((tmpJet->Eta() >= fMinJetEta) && (tmpJet->Eta() < fMaxJetEta))
1624 FillHistogram("hRawJetArea", tmpJet->Area());
1626 // Jet pt for different area cut
1627 FillHistogram("hJetPtCutStages", tmpJet->Pt(), 0.5);
1628 if ((tmpJet->Eta() >= fMinJetEta) && (tmpJet->Eta() < fMaxJetEta))
1630 FillHistogram("hJetPtCutStages", tmpJet->Pt(), 1.5);
1631 if (tmpJet->Pt() >= fMinJetPt)
1633 FillHistogram("hJetPtCutStages", tmpJet->Pt(), 2.5);
1634 if (tmpJet->Area() >= fMinJetArea)
1636 FillHistogram("hJetPtCutStages", tmpJet->Pt(), 3.5);
1642 if(IsSignalJetInAcceptance(tmpJet))
1644 // ### SIGNAL JET ANALYSIS
1646 FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile);
1647 FillHistogram("hJetPtBgrdSubtractedPP", GetCorrectedJetPt(tmpJet, backgroundPP), centralityPercentile);
1648 FillHistogram("hJetPtBgrdSubtractedExternal", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal), centralityPercentile);
1649 if(tmpJet->Phi() >= TMath::Pi())
1650 FillHistogram("hJetPtBgrdSubtractedExternal_Phi2", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal), centralityPercentile);
1652 FillHistogram("hJetPtBgrdSubtractedExternal_Phi1", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal), centralityPercentile);
1654 FillHistogram("hJetPtSubtractedRhoKTImprovedCMS", tmpJet->Pt(), centralityPercentile, tmpJet->Pt() - GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS));
1655 FillHistogram("hJetPtSubtractedRhoExternal", tmpJet->Pt(), centralityPercentile, tmpJet->Pt() - GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1656 FillHistogram("hJetPtSubtractedRhoPP", tmpJet->Pt(), centralityPercentile, tmpJet->Pt() - GetCorrectedJetPt(tmpJet, backgroundPP));
1657 FillHistogram("hDeltaPtExternalBgrdVsPt", GetDeltaPt(backgroundKTImprovedCMSExternal), GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1660 if(fAnalyzeDeprecatedBackgrounds)
1662 FillHistogram("hJetPtBgrdSubtractedTR", GetCorrectedJetPt(tmpJet, backgroundTRCone06), centralityPercentile);
1663 FillHistogram("hJetPtBgrdSubtractedKTPbPb", GetCorrectedJetPt(tmpJet, backgroundKTPbPb), centralityPercentile);
1664 FillHistogram("hJetPtBgrdSubtractedKTPbPbWithGhosts", GetCorrectedJetPt(tmpJet, backgroundKTPbPbWithGhosts), centralityPercentile);
1665 FillHistogram("hJetPtBgrdSubtractedKTCMS", GetCorrectedJetPt(tmpJet, backgroundKTCMS), centralityPercentile);
1666 FillHistogram("hJetPtBgrdSubtractedKTMean", GetCorrectedJetPt(tmpJet, backgroundKTMean), centralityPercentile);
1667 FillHistogram("hJetPtBgrdSubtractedKTTrackLike", GetCorrectedJetPt(tmpJet, backgroundKTTrackLike), centralityPercentile);
1670 // Jet profile analysis
1671 if(TMath::Abs(tmpJet->Eta()) <= 0.3)
1673 if(tmpJet->Pt()>=70.0)
1675 FillHistogram("hJetProfile70GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1676 FillHistogram("hJetProfile70GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1677 FillHistogram("hJetProfile70GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1678 FillHistogram("hJetProfile70GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1679 FillHistogram("hJetProfile70GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1680 FillHistogram("hJetProfile70GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1681 FillHistogram("hJetProfile70GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1682 FillHistogram("hJetProfile70GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1683 FillHistogram("hJetProfile70GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1684 FillHistogram("hJetProfile70GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1685 FillHistogram("hJetProfile70GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1686 FillHistogram("hJetProfile70GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1688 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=60.0)
1690 FillHistogram("hJetProfile60GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1691 FillHistogram("hJetProfile60GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1692 FillHistogram("hJetProfile60GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1693 FillHistogram("hJetProfile60GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1694 FillHistogram("hJetProfile60GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1695 FillHistogram("hJetProfile60GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1696 FillHistogram("hJetProfile60GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1697 FillHistogram("hJetProfile60GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1698 FillHistogram("hJetProfile60GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1699 FillHistogram("hJetProfile60GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1700 FillHistogram("hJetProfile60GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1701 FillHistogram("hJetProfile60GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1703 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=50.0)
1705 FillHistogram("hJetProfile50GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1706 FillHistogram("hJetProfile50GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1707 FillHistogram("hJetProfile50GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1708 FillHistogram("hJetProfile50GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1709 FillHistogram("hJetProfile50GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1710 FillHistogram("hJetProfile50GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1711 FillHistogram("hJetProfile50GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1712 FillHistogram("hJetProfile50GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1713 FillHistogram("hJetProfile50GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1714 FillHistogram("hJetProfile50GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1715 FillHistogram("hJetProfile50GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1716 FillHistogram("hJetProfile50GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1718 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=40.0)
1720 FillHistogram("hJetProfile40GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1721 FillHistogram("hJetProfile40GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1722 FillHistogram("hJetProfile40GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1723 FillHistogram("hJetProfile40GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1724 FillHistogram("hJetProfile40GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1725 FillHistogram("hJetProfile40GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1726 FillHistogram("hJetProfile40GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1727 FillHistogram("hJetProfile40GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1728 FillHistogram("hJetProfile40GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1729 FillHistogram("hJetProfile40GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1730 FillHistogram("hJetProfile40GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1731 FillHistogram("hJetProfile40GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1733 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=30.0)
1735 FillHistogram("hJetProfile30GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1736 FillHistogram("hJetProfile30GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1737 FillHistogram("hJetProfile30GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1738 FillHistogram("hJetProfile30GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1739 FillHistogram("hJetProfile30GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1740 FillHistogram("hJetProfile30GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1741 FillHistogram("hJetProfile30GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1742 FillHistogram("hJetProfile30GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1743 FillHistogram("hJetProfile30GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1744 FillHistogram("hJetProfile30GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1745 FillHistogram("hJetProfile30GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1746 FillHistogram("hJetProfile30GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1748 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=20.0)
1750 FillHistogram("hJetProfile20GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1751 FillHistogram("hJetProfile20GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1752 FillHistogram("hJetProfile20GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1753 FillHistogram("hJetProfile20GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1754 FillHistogram("hJetProfile20GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1755 FillHistogram("hJetProfile20GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1756 FillHistogram("hJetProfile20GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1757 FillHistogram("hJetProfile20GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1758 FillHistogram("hJetProfile20GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1759 FillHistogram("hJetProfile20GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1760 FillHistogram("hJetProfile20GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1761 FillHistogram("hJetProfile20GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1763 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=10.0)
1765 FillHistogram("hJetProfile10GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1766 FillHistogram("hJetProfile10GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1767 FillHistogram("hJetProfile10GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1768 FillHistogram("hJetProfile10GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1769 FillHistogram("hJetProfile10GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1770 FillHistogram("hJetProfile10GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1771 FillHistogram("hJetProfile10GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1772 FillHistogram("hJetProfile10GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1773 FillHistogram("hJetProfile10GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1774 FillHistogram("hJetProfile10GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1775 FillHistogram("hJetProfile10GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1776 FillHistogram("hJetProfile10GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1779 FillHistogram("hJetPtVsConstituentCount", tmpJet->Pt(),tmpJet->GetNumberOfTracks());
1781 if((fAnalyzeQA) && (tmpJet->Pt() >= 5.0))
1783 Double_t lowestTrackPt = 1e99;
1784 Double_t highestTrackPt = 0.0;
1785 for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++)
1787 FillHistogram("hJetConstituentPt", tmpJet->TrackAt(j, fTrackArray)->Pt(), centralityPercentile);
1788 // Find the lowest pT of a track in the jet
1789 if (tmpJet->TrackAt(j, fTrackArray)->Pt() < lowestTrackPt)
1790 lowestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt();
1791 if (tmpJet->TrackAt(j, fTrackArray)->Pt() > highestTrackPt)
1792 highestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt();
1794 FillHistogram("hJetArea", tmpJet->Area(), tmpJet->Pt());
1795 // Signal jet vs. signal jet - "Combinatorial"
1796 for (Int_t j = i+1; j<fNumberSignalJets; j++)
1797 FillHistogram("hJetDeltaPhi", GetDeltaPhi(tmpJet->Phi(), fSignalJets[j]->Phi()));
1799 FillHistogram("hJetPhiEta", tmpJet->Phi(),tmpJet->Eta());
1800 FillHistogram("hJetPtPhiEta", tmpJet->Phi(),tmpJet->Eta(),tmpJet->Pt());
1801 FillHistogram("hJetEta", tmpJet->Eta(), centralityPercentile);
1803 if(lowestTrackPt>=2.0)
1804 FillHistogram("hJetEta2GeVTracks", tmpJet->Eta(), centralityPercentile);
1805 if(lowestTrackPt>=4.0)
1806 FillHistogram("hJetEta4GeVTracks", tmpJet->Eta(), centralityPercentile);
1810 // Jet constituent mass analyses (for PYTHIA)
1811 if (fAnalyzeMassCorrelation)
1813 Double_t jetMass = 0.0;
1814 Int_t constituentCount = tmpJet->GetNumberOfTracks();
1815 Int_t electronCount = 0;
1816 Int_t pionCount = 0;
1817 Int_t protonCount = 0;
1818 Int_t kaonCount = 0;
1819 Int_t othersCount = 0;
1821 for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++)
1823 AliVParticle* tmpParticle = tmpJet->TrackAt(j, fTrackArray);
1825 jetMass += tmpParticle->M();
1826 if(TMath::Abs(tmpParticle->PdgCode()) == 11) // electron, positron
1828 else if(TMath::Abs(tmpParticle->PdgCode()) == 211) // p-, p+
1830 else if(TMath::Abs(tmpParticle->PdgCode()) == 2212) // p, pbar
1832 else if(TMath::Abs(tmpParticle->PdgCode()) == 321) // kaon+,kaon-
1838 FillHistogram("hJetMassFromConstituents", jetMass);
1839 FillHistogram("hJetMass", tmpJet->M());
1841 FillHistogram("hJetPtVsMass", tmpJet->Pt(), jetMass);
1842 FillHistogram("hJetPtVsJetMass", tmpJet->Pt(), tmpJet->M());
1844 FillHistogram("hJetPtVsProtonCount", tmpJet->Pt(), protonCount/(static_cast<Double_t>(constituentCount)));
1845 FillHistogram("hJetPtVsPionCount", tmpJet->Pt(), pionCount/(static_cast<Double_t>(constituentCount)));
1846 FillHistogram("hJetPtVsKaonCount", tmpJet->Pt(), kaonCount/(static_cast<Double_t>(constituentCount)));
1847 FillHistogram("hJetPtVsElectronCount", tmpJet->Pt(), electronCount/(static_cast<Double_t>(constituentCount)));
1848 FillHistogram("hJetPtVsOthersCount", tmpJet->Pt(), othersCount/(static_cast<Double_t>(constituentCount)));
1849 FillHistogram("hJetConstituentProtonCount", protonCount);
1850 FillHistogram("hJetConstituentPionCount", pionCount);
1851 FillHistogram("hJetConstituentKaonCount", kaonCount);
1852 FillHistogram("hJetConstituentElectronCount", electronCount);
1853 FillHistogram("hJetConstituentOthersCount", othersCount);
1855 // Results for the "normal" jet (avoiding single particle jets)
1856 if((constituentCount>=6) && (constituentCount<=14))
1858 FillHistogram("hJetPtVsMass_6_14", tmpJet->Pt(), jetMass);
1859 FillHistogram("hJetPtVsJetMass_6_14", tmpJet->Pt(), tmpJet->M());
1861 FillHistogram("hJetPtVsProtonCount_6_14", tmpJet->Pt(), protonCount);
1862 FillHistogram("hJetPtVsPionCount_6_14", tmpJet->Pt(), pionCount);
1863 FillHistogram("hJetPtVsKaonCount_6_14", tmpJet->Pt(), kaonCount);
1864 FillHistogram("hJetPtVsElectronCount_6_14", tmpJet->Pt(), electronCount);
1865 FillHistogram("hJetPtVsOthersCount_6_14", tmpJet->Pt(), othersCount);
1866 FillHistogram("hJetConstituentProtonCount_6_14", protonCount);
1867 FillHistogram("hJetConstituentPionCount_6_14", pionCount);
1868 FillHistogram("hJetConstituentKaonCount_6_14", kaonCount);
1869 FillHistogram("hJetConstituentElectronCount_6_14", electronCount);
1870 FillHistogram("hJetConstituentOthersCount_6_14", othersCount);
1872 if((constituentCount>=2))
1874 FillHistogram("hJetPtVsMass_2_X", tmpJet->Pt(), jetMass);
1875 FillHistogram("hJetPtVsJetMass_2_X", tmpJet->Pt(), tmpJet->M());
1877 FillHistogram("hJetPtVsProtonCount_2_X", tmpJet->Pt(), protonCount);
1878 FillHistogram("hJetPtVsPionCount_2_X", tmpJet->Pt(), pionCount);
1879 FillHistogram("hJetPtVsKaonCount_2_X", tmpJet->Pt(), kaonCount);
1880 FillHistogram("hJetPtVsElectronCount_2_X", tmpJet->Pt(), electronCount);
1881 FillHistogram("hJetPtVsOthersCount_2_X", tmpJet->Pt(), othersCount);
1882 FillHistogram("hJetConstituentProtonCount_2_X", protonCount);
1883 FillHistogram("hJetConstituentPionCount_2_X", pionCount);
1884 FillHistogram("hJetConstituentKaonCount_2_X", kaonCount);
1885 FillHistogram("hJetConstituentElectronCount_2_X", electronCount);
1886 FillHistogram("hJetConstituentOthersCount_2_X", othersCount);
1888 if((constituentCount>=2) && (constituentCount<=7))
1890 FillHistogram("hJetPtVsMass_2_7", tmpJet->Pt(), jetMass);
1891 FillHistogram("hJetPtVsJetMass_2_7", tmpJet->Pt(), tmpJet->M());
1893 FillHistogram("hJetPtVsProtonCount_2_7", tmpJet->Pt(), protonCount);
1894 FillHistogram("hJetPtVsPionCount_2_7", tmpJet->Pt(), pionCount);
1895 FillHistogram("hJetPtVsKaonCount_2_7", tmpJet->Pt(), kaonCount);
1896 FillHistogram("hJetPtVsElectronCount_2_7", tmpJet->Pt(), electronCount);
1897 FillHistogram("hJetPtVsOthersCount_2_7", tmpJet->Pt(), othersCount);
1898 FillHistogram("hJetConstituentProtonCount_2_7", protonCount);
1899 FillHistogram("hJetConstituentPionCount_2_7", pionCount);
1900 FillHistogram("hJetConstituentKaonCount_2_7", kaonCount);
1901 FillHistogram("hJetConstituentElectronCount_2_7", electronCount);
1902 FillHistogram("hJetConstituentOthersCount_2_7", othersCount);
1908 // ### SOME JET PLOTS
1909 FillHistogram("hJetCountAll", fJetArray->GetEntries());
1910 FillHistogram("hJetCountAccepted", fNumberSignalJets);
1911 FillHistogram("hJetCount", fJetArray->GetEntries(), fNumberSignalJets);
1912 if (fFirstLeadingJet)
1914 FillHistogram("hLeadingJetPt", fFirstLeadingJet->Pt());
1915 FillHistogram("hCorrectedLeadingJetPt", GetCorrectedJetPt(fFirstLeadingJet,backgroundKTImprovedCMSExternal));
1917 if (fSecondLeadingJet)
1919 FillHistogram("hSecondLeadingJetPt", fSecondLeadingJet->Pt());
1920 FillHistogram("hCorrectedSecondLeadingJetPt", GetCorrectedJetPt(fSecondLeadingJet,backgroundKTImprovedCMSExternal));
1922 } //endif AnalyzeJets
1925 AliInfo("Calculate()::Jets done.");
1927 ////////////////////// NOTE: Background analysis
1929 if (fAnalyzeBackground)
1931 // Calculate background in centrality classes
1932 FillHistogram("hKTBackgroundImprovedCMS", backgroundKTImprovedCMS, centralityPercentile);
1933 FillHistogram("hKTBackgroundImprovedCMSExternal", backgroundKTImprovedCMSExternal, centralityPercentile);
1934 if(fFirstLeadingJet && (fFirstLeadingJet->Pt()>=20.))
1935 FillHistogram("hKTBackgroundImprovedCMSExternal20GeV", backgroundKTImprovedCMSExternal, centralityPercentile);
1938 FillHistogram("hPPBackground", backgroundPP, centralityPercentile);
1939 FillHistogram("hKTMeanBackgroundImprovedCMS", centralityPercentile, backgroundKTImprovedCMS);
1941 if(fAnalyzeDeprecatedBackgrounds)
1943 FillHistogram("hKTBackgroundPbPb", backgroundKTPbPb, centralityPercentile);
1944 FillHistogram("hKTBackgroundPbPbWithGhosts", backgroundKTPbPbWithGhosts, centralityPercentile);
1945 FillHistogram("hKTBackgroundCMS", backgroundKTCMS, centralityPercentile);
1946 FillHistogram("hKTBackgroundMean", backgroundKTMean, centralityPercentile);
1947 FillHistogram("hKTBackgroundTrackLike", backgroundKTTrackLike, centralityPercentile);
1949 FillHistogram("hTRBackgroundNoExcl", backgroundTRNoExcl, centralityPercentile);
1950 FillHistogram("hTRBackgroundCone02", backgroundTRCone02, centralityPercentile);
1951 FillHistogram("hTRBackgroundCone04", backgroundTRCone04, centralityPercentile);
1952 FillHistogram("hTRBackgroundCone06", backgroundTRCone06, centralityPercentile);
1953 FillHistogram("hTRBackgroundCone08", backgroundTRCone08, centralityPercentile);
1954 FillHistogram("hTRBackgroundExact", backgroundTRExact, centralityPercentile);
1956 // Calculate background profiles in terms of centrality
1957 FillHistogram("hKTMeanBackgroundPbPb", centralityPercentile, backgroundKTPbPb);
1958 FillHistogram("hKTMeanBackgroundPbPbWithGhosts", centralityPercentile, backgroundKTPbPbWithGhosts);
1959 FillHistogram("hKTMeanBackgroundCMS", centralityPercentile, backgroundKTCMS);
1960 FillHistogram("hKTMeanBackgroundMean", centralityPercentile, backgroundKTMean);
1961 FillHistogram("hKTMeanBackgroundTPC", centralityPercentile, backgroundKTTrackLike);
1962 FillHistogram("hTRMeanBackground", centralityPercentile, backgroundTRCone06);
1966 // Calculate the delta pt
1967 Double_t tmpDeltaPtNoBackground = GetDeltaPt(0.0);
1968 Double_t tmpDeltaPtKTImprovedCMS = GetDeltaPt(backgroundKTImprovedCMS);
1969 Double_t tmpDeltaPtExternalBgrd = GetDeltaPt(backgroundKTImprovedCMSExternal);
1972 Double_t tmpDeltaPtKTImprovedCMSPartialExclusion = 0.0;
1974 tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNcoll);
1976 tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1978 Double_t tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = 0.0;
1979 if(fNumberSignalJets)
1980 tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNumberSignalJets);
1982 tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1984 Double_t tmpDeltaPtKTImprovedCMSFullExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1986 Double_t tmpDeltaPtKTPbPb = 0;
1987 Double_t tmpDeltaPtKTPbPbWithGhosts = 0;
1988 Double_t tmpDeltaPtKTCMS = 0;
1989 Double_t tmpDeltaPtKTMean = 0;
1990 Double_t tmpDeltaPtKTTrackLike = 0;
1991 Double_t tmpDeltaPtTR = 0;
1993 if(fAnalyzeDeprecatedBackgrounds)
1995 tmpDeltaPtKTPbPb = GetDeltaPt(backgroundKTPbPb);
1996 tmpDeltaPtKTPbPbWithGhosts = GetDeltaPt(backgroundKTPbPbWithGhosts);
1997 tmpDeltaPtKTCMS = GetDeltaPt(backgroundKTCMS);
1998 tmpDeltaPtKTMean = GetDeltaPt(backgroundKTMean);
1999 tmpDeltaPtKTTrackLike = GetDeltaPt(backgroundKTTrackLike);
2000 tmpDeltaPtTR = GetDeltaPt(backgroundTRCone06);
2003 // If valid, fill the delta pt histograms
2005 if(tmpDeltaPtExternalBgrd > -10000.0)
2006 FillHistogram("hDeltaPtExternalBgrd", tmpDeltaPtExternalBgrd, centralityPercentile);
2007 if(tmpDeltaPtKTImprovedCMS > -10000.0)
2008 FillHistogram("hDeltaPtKTImprovedCMS", tmpDeltaPtKTImprovedCMS, centralityPercentile);
2009 if(tmpDeltaPtKTImprovedCMSPartialExclusion > -10000.0)
2010 FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion", tmpDeltaPtKTImprovedCMSPartialExclusion, centralityPercentile);
2011 if(tmpDeltaPtKTImprovedCMSPartialExclusion_Signal > -10000.0)
2012 FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion_Signal", tmpDeltaPtKTImprovedCMSPartialExclusion_Signal, centralityPercentile);
2013 if(tmpDeltaPtKTImprovedCMSFullExclusion > -10000.0)
2014 FillHistogram("hDeltaPtKTImprovedCMSFullExclusion", tmpDeltaPtKTImprovedCMSFullExclusion, centralityPercentile);
2016 if(tmpDeltaPtNoBackground > -10000.0)
2017 FillHistogram("hDeltaPtNoBackground", tmpDeltaPtNoBackground, centralityPercentile);
2020 if(fAnalyzeDeprecatedBackgrounds)
2022 if(tmpDeltaPtKTPbPb > -10000.0)
2023 FillHistogram("hDeltaPtKTPbPb", tmpDeltaPtKTPbPb, centralityPercentile);
2024 if(tmpDeltaPtKTPbPbWithGhosts > -10000.0)
2025 FillHistogram("hDeltaPtKTPbPbWithGhosts", tmpDeltaPtKTPbPbWithGhosts, centralityPercentile);
2026 if(tmpDeltaPtKTCMS > -10000.0)
2027 FillHistogram("hDeltaPtKTCMS", tmpDeltaPtKTCMS, centralityPercentile);
2028 if(tmpDeltaPtKTMean > -10000.0)
2029 FillHistogram("hDeltaPtKTMean", tmpDeltaPtKTMean, centralityPercentile);
2030 if(tmpDeltaPtKTTrackLike > -10000.0)
2031 FillHistogram("hDeltaPtKTTrackLike", tmpDeltaPtKTTrackLike, centralityPercentile);
2032 if(tmpDeltaPtTR > -10000.0)
2033 FillHistogram("hDeltaPtTR", tmpDeltaPtTR, centralityPercentile);
2038 AliInfo("Calculate()::Background done.");
2042 AliInfo("Calculate() done.");
2046 //________________________________________________________________________
2047 Bool_t AliAnalysisTaskChargedJetsPA::UserNotify()
2049 // Implemented Notify() to read the cross sections
2050 // and number of trials from pyxsec.root
2053 AliInfo("UserNotify started.");
2058 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
2059 TFile *currFile = tree->GetCurrentFile();
2061 TString file(currFile->GetName());
2063 if(file.Contains("root_archive.zip#")){
2064 Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
2065 Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
2066 file.Replace(pos+1,20,"");
2069 // not an archive take the basename....
2070 file.ReplaceAll(gSystem->BaseName(file.Data()),"");
2073 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
2075 // next trial fetch the histgram file
2076 fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
2078 // not a severe condition but inciate that we have no information
2082 // find the tlist we want to be independtent of the name so use the Tkey
2083 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
2088 TList *list = dynamic_cast<TList*>(key->ReadObj());
2093 fCrossSection = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
2094 fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
2097 } // no tree pyxsec.root
2099 TTree *xtree = (TTree*)fxsec->Get("Xsection");
2105 Double_t xsection = 0;
2106 xtree->SetBranchAddress("xsection",&xsection);
2107 xtree->SetBranchAddress("ntrials",&ntrials);
2110 fCrossSection = xsection;
2115 AliInfo("UserNotify ended.");
2121 //________________________________________________________________________
2122 inline Double_t AliAnalysisTaskChargedJetsPA::EtaToTheta(Double_t arg)
2123 {return 2.*atan(exp(-arg));}
2124 //________________________________________________________________________
2125 inline Double_t AliAnalysisTaskChargedJetsPA::ThetaToEta(Double_t arg)
2127 if ((arg > TMath::Pi()) || (arg < 0.0))
2129 AliError(Form("ThetaToEta got wrong input! (%f)", arg));
2132 return -log(tan(arg/2.));
2134 //________________________________________________________________________
2135 inline Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPhi(Double_t phi1, Double_t phi2)
2136 {return min(TMath::Abs(phi1-phi2),TMath::TwoPi() - TMath::Abs(phi1-phi2));}
2138 //________________________________________________________________________
2139 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)
2141 const Int_t kTests = 1000;
2143 TRandom3 randomGen(0);
2145 // Loop over kTests-many tests
2146 for (Int_t i=0; i<kTests; i++)
2148 //Choose random position in rectangle for the tester
2149 Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax);
2150 Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax);
2152 //Check, if tester is in circle. If yes, increment circle counter.
2153 Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX)*(tmpTestX - cPosX) + (tmpTestY - cPosY)*(tmpTestY - cPosY) );
2154 if(tmpDistance < cRadius)
2159 return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests));
2162 //________________________________________________________________________
2163 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)
2166 const Int_t kTests = 1000;
2168 TRandom3 randomGen(0);
2170 // Loop over kTests-many tests
2171 for (Int_t i=0; i<kTests; i++)
2173 //Choose random position in rectangle for the tester
2174 Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax);
2175 Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax);
2177 //Check, if tester is in one of the circles. If yes, increment circle counter.
2178 for(Int_t j=0; j<numCircles; j++)
2180 Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX[j])*(tmpTestX - cPosX[j]) + (tmpTestY - cPosY[j])*(tmpTestY - cPosY[j]) );
2181 if(tmpDistance < cRadius)
2190 return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests));
2194 //________________________________________________________________________
2195 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x)
2197 TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key)));
2200 AliError(Form("Cannot find histogram <%s> ",key)) ;
2207 //________________________________________________________________________
2208 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y)
2210 TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key)));
2213 AliError(Form("Cannot find histogram <%s> ",key));
2217 if (tmpHist->IsA()->GetBaseClass("TH1"))
2218 static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
2219 else if (tmpHist->IsA()->GetBaseClass("TH2"))
2220 static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
2223 //________________________________________________________________________
2224 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y, Double_t add)
2226 TH2* tmpHist = static_cast<TH2*>(fOutputList->FindObject(GetHistoName(key)));
2229 AliError(Form("Cannot find histogram <%s> ",key));
2233 tmpHist->Fill(x,y,add);
2235 //________________________________________________________________________
2236 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)
2238 T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax);
2240 tmpHist->GetXaxis()->SetTitle(xTitle);
2241 tmpHist->GetYaxis()->SetTitle(yTitle);
2242 tmpHist->SetOption(options);
2243 tmpHist->SetMarkerStyle(kFullCircle);
2246 fHistList->Add(tmpHist);
2252 //________________________________________________________________________
2253 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)
2255 T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax, yBins, yMin, yMax);
2256 tmpHist->GetXaxis()->SetTitle(xTitle);
2257 tmpHist->GetYaxis()->SetTitle(yTitle);
2258 tmpHist->GetZaxis()->SetTitle(zTitle);
2259 tmpHist->SetOption(options);
2260 tmpHist->SetMarkerStyle(kFullCircle);
2263 fHistList->Add(tmpHist);
2269 //________________________________________________________________________
2270 void AliAnalysisTaskChargedJetsPA::Terminate(Option_t *)
2272 PostData(1, fOutputList);
2275 fOutputList = dynamic_cast<TList*> (GetOutputData(1)); // '1' refers to the output slot
2277 printf("ERROR: Output list not available\n");
2282 //________________________________________________________________________
2283 AliAnalysisTaskChargedJetsPA::~AliAnalysisTaskChargedJetsPA()
2285 // Destructor. Clean-up the output list, but not the histograms that are put inside
2286 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
2287 if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
2292 //________________________________________________________________________
2293 void AliAnalysisTaskChargedJetsPA::UserCreateOutputObjects()
2295 // called once to create user defined output objects like histograms, plots etc.
2296 // and to put it on the output list.
2297 // Note: Saving to file with e.g. OpenFile(0) is must be before creating other objects.
2299 fRandom = new TRandom3(0);
2302 fOutputList = new TList();
2303 fOutputList->SetOwner(); // otherwise it produces leaks in merging
2305 PostData(1, fOutputList);
2308 //________________________________________________________________________
2309 void AliAnalysisTaskChargedJetsPA::UserExec(Option_t *)
2312 AliInfo("UserExec() started.");
2317 AliError("??? Event pointer == 0 ???");
2322 ExecOnce(); // Get tracks, jets, background from arrays if not already given + Init Histos
2324 Calculate(InputEvent());
2326 PostData(1, fOutputList);