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 AddHistogram1D<TH1D>("hRawJetPt", "Raw jets p_{T} distribution (before cuts)", "", 500, 0., 250., "p_{T} (GeV/c)", "dN^{Jets}/dp_{T}");
85 AddHistogram2D<TH2D>("hJetPt", "Jets p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
86 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}");
87 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTImprovedCMS_Phi1", "Jets p_{T} distribution, KT background (Improved CMS) subtracted (1st part of azimuth)", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
88 AddHistogram2D<TH2D>("hJetPtBgrdSubtractedKTImprovedCMS_Phi2", "Jets p_{T} distribution, KT background (Improved CMS) subtracted (2nd part of azimuth)", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Jets}/dp_{T}");
90 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}");
91 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}");
95 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");
96 AddHistogram2D<TProfile2D>("hJetPtSubtractedRhoExternal", "Mean subtracted KT (External) background from jets", "COLZ", 600, 0, 150, fNumberOfCentralityBins, 0, 100, "Jet p_{T}", "Centrality", "#rho mean");
97 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");
99 if(fAnalyzeDeprecatedBackgrounds)
101 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}");
102 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}");
103 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}");
104 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}");
105 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}");
106 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}");
109 // ######## Jet profiles
110 if(fAnalyzeJetProfile)
112 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");
113 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");
114 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");
115 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");
116 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");
117 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");
118 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");
120 // ######## Jet stuff
121 AddHistogram2D<TH2D>("hJetConstituentPt", "Jet constituents p_{T} distribution", "", 500, -50., 200., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
122 AddHistogram1D<TH1D>("hJetCountAll", "Number of Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}");
123 AddHistogram1D<TH1D>("hJetCountAccepted", "Number of accepted Jets", "", 200, 0., 200., "N jets","dN^{Events}/dN^{Jets}");
124 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}}");
125 AddHistogram1D<TH1D>("hLeadingJetPt", "Leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
126 AddHistogram1D<TH1D>("hSecondLeadingJetPt", "Second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
127 AddHistogram1D<TH1D>("hCorrectedLeadingJetPt", "Corrected leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
128 AddHistogram1D<TH1D>("hCorrectedSecondLeadingJetPt", "Corrected second leading jet p_{T}", "", 500, -50., 200., "p_{T} (GeV/c)","dN^{Jets}/dp_{T}");
129 AddHistogram1D<TH1D>("hJetDeltaPhi", "Jets combinatorial #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)");
130 AddHistogram1D<TH1D>("hLeadingJetDeltaPhi", "1st and 2nd leading jet #Delta #phi", "", 250, 0., TMath::Pi(), "#Delta #phi","dN^{Jets}/d(#Delta #phi)");
133 // NOTE: Jet background histograms
134 if (fAnalyzeBackground)
136 // ########## Default background estimates
137 AddHistogram2D<TH2D>("hKTBackgroundImprovedCMS", "KT background density (Improved CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
138 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");
139 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");
140 AddHistogram2D<TH2D>("hPPBackground", "PP background density (Michals approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
142 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}");
143 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}");
144 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}");
145 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}");
146 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}");
147 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}");
148 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}");
150 AddHistogram1D<TProfile>("hKTMeanBackgroundImprovedCMS", "KT background mean (Improved CMS approach)", "", 100, 0, 100, "Centrality", "#rho mean");
152 if(fAnalyzeDeprecatedBackgrounds)
154 // ########## Different background estimates
155 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");
156 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");
157 AddHistogram2D<TH2D>("hKTBackgroundCMS", "KT background density (CMS approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
158 AddHistogram2D<TH2D>("hKTBackgroundMean", "KT background density (Mean approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
159 AddHistogram2D<TH2D>("hKTBackgroundTrackLike", "KT background density (Track-like approach)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
161 AddHistogram2D<TH2D>("hTRBackgroundNoExcl", "TR background density (No signal excluded)", "LEGO2", 400, 0., 40., fNumberOfCentralityBins, 0, 100, "#rho (GeV/c)","Centrality", "dN^{Events}/d#rho");
162 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");
163 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");
164 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");
165 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");
166 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");
168 // ########## Delta Pt
169 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}");
170 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}");
171 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}");
172 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}");
173 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}");
174 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}");
176 // ########## Profiles for background means vs. centrality
177 AddHistogram1D<TProfile>("hKTMeanBackgroundPbPb", "KT background mean (PbPb approach w/o ghosts)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
178 AddHistogram1D<TProfile>("hKTMeanBackgroundPbPbWithGhosts", "KT background mean (PbPb approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
179 AddHistogram1D<TProfile>("hKTMeanBackgroundCMS", "KT background mean (CMS approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
180 AddHistogram1D<TProfile>("hKTMeanBackgroundMean", "KT background mean (Mean approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
181 AddHistogram1D<TProfile>("hKTMeanBackgroundTPC", "KT background mean (Track-like approach)", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
182 AddHistogram1D<TProfile>("hTRMeanBackground", "TR background mean", "", fNumberOfCentralityBins, 0, 100, "Centrality", "#rho mean");
185 // NOTE: Jet constituent correlations
186 if(fAnalyzeMassCorrelation)
188 AddHistogram1D<TH1D>("hJetMassFromConstituents", "Jet mass by mass of charged constituents", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}");
189 AddHistogram1D<TH1D>("hJetMass", "Jet mass from fastjet", "", 200, 0., 200., "N jets","dN^{Jets}/dN^{mass}");
191 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");
192 AddHistogram2D<TH2D>("hJetPtVsJetMass", "Correlation jet pt/summed jet", "", 400, 0., 100., 400, 0., 100., "p_{T}","Mass", "d^{2}N}/dN^{p_{T}dM");
194 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");
195 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");
196 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");
197 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");
198 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");
199 AddHistogram1D<TH1D>("hJetConstituentProtonCount", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
200 AddHistogram1D<TH1D>("hJetConstituentPionCount", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
201 AddHistogram1D<TH1D>("hJetConstituentKaonCount", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
202 AddHistogram1D<TH1D>("hJetConstituentElectronCount", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
203 AddHistogram1D<TH1D>("hJetConstituentOthersCount", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
205 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");
206 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");
207 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");
208 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");
209 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");
210 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");
211 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");
212 AddHistogram1D<TH1D>("hJetConstituentProtonCount_6_14", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
213 AddHistogram1D<TH1D>("hJetConstituentPionCount_6_14", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
214 AddHistogram1D<TH1D>("hJetConstituentKaonCount_6_14", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
215 AddHistogram1D<TH1D>("hJetConstituentElectronCount_6_14", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
216 AddHistogram1D<TH1D>("hJetConstituentOthersCount_6_14", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
218 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");
219 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");
220 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");
221 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");
222 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");
223 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");
224 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");
225 AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_X", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
226 AddHistogram1D<TH1D>("hJetConstituentPionCount_2_X", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
227 AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_X", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
228 AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_X", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
229 AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_X", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
231 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");
232 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");
233 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");
234 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");
235 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");
236 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");
237 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");
238 AddHistogram1D<TH1D>("hJetConstituentProtonCount_2_7", "Proton count in jets", "", 100, 0., 100., "N protons","dN^{Jets}/dN^{protons}");
239 AddHistogram1D<TH1D>("hJetConstituentPionCount_2_7", "Pion count in jets", "", 100, 0., 100., "N pions","dN^{Jets}/dN^{pions}");
240 AddHistogram1D<TH1D>("hJetConstituentKaonCount_2_7", "Kaon count in jets", "", 100, 0., 100., "N kaons","dN^{Jets}/dN^{kaons}");
241 AddHistogram1D<TH1D>("hJetConstituentElectronCount_2_7", "Electron count in jets", "", 100, 0., 100., "N electrons","dN^{Jets}/dN^{electrons}");
242 AddHistogram1D<TH1D>("hJetConstituentOthersCount_2_7", "Others count in jets", "", 100, 0., 100., "N others","dN^{Jets}/dN^{others}");
246 // NOTE: Track & Cluster & QA histograms
249 AddHistogram1D<TH1D>("hVertexX", "X distribution of the vertex", "", 2000, -1., 1., "#Delta x(cm)","dN^{Events}/dx");
250 AddHistogram1D<TH1D>("hVertexY", "Y distribution of the vertex", "", 2000, -1., 1., "#Delta y(cm)","dN^{Events}/dy");
251 AddHistogram2D<TH2D>("hVertexXY", "XY distribution of the vertex", "COLZ", 500, -1., 1., 500, -1., 1.,"#Delta x(cm)", "#Delta y(cm)","dN^{Events}/dxdy");
252 AddHistogram1D<TH1D>("hVertexZBeforeVertexCut", "Z distribution of the vertex (before std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz");
253 AddHistogram1D<TH1D>("hVertexZAfterVertexCut", "Z distribution of the vertex (after std. vertex cut)", "", 200, -20., 20., "#Delta z(cm)","dN^{Events}/dz");
254 AddHistogram1D<TH1D>("hVertexR", "R distribution of the vertex", "", 100, 0., 1., "#Delta r(cm)","dN^{Events}/dr");
255 AddHistogram1D<TH1D>("hCentralityV0M", "Centrality distribution V0M", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
256 AddHistogram1D<TH1D>("hCentralityV0A", "Centrality distribution V0A", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
257 AddHistogram1D<TH1D>("hCentralityV0C", "Centrality distribution V0C", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
258 AddHistogram1D<TH1D>("hCentralityZNA", "Centrality distribution ZNA", "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
259 AddHistogram1D<TH1D>("hCentrality", Form("Centrality distribution %s", fCentralityType.Data()), "", fNumberOfCentralityBins, 0., 100., "Centrality","dN^{Events}");
262 AddHistogram2D<TH2D>("hTrackCountAcc", "Number of tracks in acceptance vs. centrality", "LEGO2", 750, 0., 750., fNumberOfCentralityBins, 0, 100, "N tracks","Centrality", "dN^{Events}/dN^{Tracks}");
263 AddHistogram2D<TH2D>("hTrackPt", "Tracks p_{T} distribution", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)", "Centrality", "dN^{Tracks}/dp_{T}");
264 AddHistogram2D<TH2D>("hTrackPtNegEta", "Tracks p_{T} distribution (negative #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
265 AddHistogram2D<TH2D>("hTrackPtPosEta", "Tracks p_{T} distribution (positive #eta)", "", 1000, 0., 250., fNumberOfCentralityBins, 0, 100, "p_{T} (GeV/c)","Centrality","dN^{Tracks}/dp_{T}");
266 AddHistogram1D<TH1D>("hTrackCharge", "Charge", "", 11, -5, 5, "Charge (e)","dN^{Tracks}/dq");
267 AddHistogram1D<TH1D>("hTrackPhi", "Track #phi distribution", "", 360, 0, TMath::TwoPi(), "#phi","dN^{Tracks}/d#phi");
268 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)");
269 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)");
271 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}");
272 AddHistogram2D<TH2D>("hTrackPhiTrackType", "Track #phi distribution for different track types", "LEGO2", 360, 0, TMath::TwoPi(), 3, 0, 3, "#phi", "Label", "dN^{Tracks}/d#phi");
273 AddHistogram2D<TH2D>("hTrackEta", "Track #eta distribution", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Tracks}/d#eta");
277 AddHistogram1D<TH1D>("hRawJetArea", "Jets area distribution w/o area cut", "", 200, 0., 2., "Area","dN^{Jets}/dA");
278 AddHistogram2D<TH2D>("hJetArea", "Jets area distribution", "COLZ", 200, 0., 2., 150, 0.,150., "Area","Jet p_{T}","dN^{Jets}/dA");
279 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)");
280 AddHistogram2D<TH2D>("hJetEta", "Jets #eta distribution", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
281 AddHistogram2D<TH2D>("hJetEta2GeVTracks", "Jets #eta distribution, track p_{T} > 2 GeV", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
282 AddHistogram2D<TH2D>("hJetEta4GeVTracks", "Jets #eta distribution, track p_{T} > 4 GeV", "COLZ", 180, fMinEta, fMaxEta, fNumberOfCentralityBins, 0., 100., "#eta", "Centrality", "dN^{Jets}/d#eta");
283 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)");
284 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)");
285 AddHistogram2D<TH2D>("hJetPtVsConstituentCount", "Jets number of constituents vs. jet p_{T}", "COLZ", 400, 0., 200., 100, 0., 100., "p_{T}","N^{Tracks}","dN^{Jets}/(dp_{T} dN^{tracks})");
289 // register Histograms
290 for (Int_t i = 0; i < fHistCount; i++)
292 fOutputList->Add(fHistList->At(i));
295 PostData(1,fOutputList); // important for merging
299 //________________________________________________________________________
300 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)
303 AliInfo("Calling constructor.");
306 // Every instance of this task gets his own number
307 static Int_t instance = 0;
308 fTaskInstanceCounter = instance;
311 fTrackArrayName = new TString(trackArrayName);
312 if (fTrackArrayName->Contains("MCParticles") || fTrackArrayName->Contains("mcparticles"))
313 fIsKinematics = kTRUE;
315 fJetArrayName = new TString(jetArrayName);
316 if (strcmp(fJetArrayName->Data(),"") == 0)
318 fAnalyzeJets = kFALSE;
319 fAnalyzeJetProfile = kFALSE;
322 fAnalyzeJets = kTRUE;
324 fBackgroundJetArrayName = new TString(backgroundJetArrayName);
325 if (strcmp(fBackgroundJetArrayName->Data(),"") == 0)
326 fAnalyzeBackground = kFALSE;
328 fAnalyzeBackground = kTRUE;
330 DefineOutput(1, TList::Class());
332 fHistList = new TList();
334 for(Int_t i=0;i<1024;i++)
335 fSignalJets[i] = NULL;
339 AliInfo("Constructor done.");
344 //________________________________________________________________________
345 inline Double_t AliAnalysisTaskChargedJetsPA::GetConePt(Double_t eta, Double_t phi, Double_t radius)
347 Double_t tmpConePt = 0.0;
349 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
351 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
352 if (IsTrackInAcceptance(tmpTrack))
353 if(IsTrackInCone(tmpTrack, eta, phi, radius))
354 tmpConePt = tmpConePt + tmpTrack->Pt();
359 //________________________________________________________________________
360 inline Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedConePt(Double_t eta, Double_t phi, Double_t radius, Double_t background)
362 Double_t tmpConePt = 0.0;
364 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
366 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
367 if (IsTrackInAcceptance(tmpTrack))
368 if(IsTrackInCone(tmpTrack, eta, phi, radius))
369 tmpConePt = tmpConePt + tmpTrack->Pt();
371 Double_t realConeArea = (2.0*(fMaxEta-fMinEta)) * TMath::TwoPi() * MCGetOverlapCircleRectancle(eta, phi, radius, fMinEta, fMaxEta, 0., TMath::TwoPi());
372 tmpConePt -= background * realConeArea; // subtract background
378 //________________________________________________________________________
379 inline Double_t AliAnalysisTaskChargedJetsPA::GetPtHard()
382 AliInfo("Starting GetPtHard.");
384 AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
389 AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
393 for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++)
395 pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
396 if (pythiaHeader) break;
402 AliInfo("Ending GetPtHard.");
405 return pythiaHeader->GetPtHard();
407 AliWarning(Form("In task %s: GetPtHard() failed!", GetName()));
412 //________________________________________________________________________
413 inline Double_t AliAnalysisTaskChargedJetsPA::GetPythiaTrials()
416 AliInfo("Starting GetPythiaTrials.");
418 AliGenPythiaEventHeader* pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(MCEvent()->GenEventHeader());
423 AliAODMCHeader* aodMCH = dynamic_cast<AliAODMCHeader*>(InputEvent()->FindListObject(AliAODMCHeader::StdBranchName()));
427 for(UInt_t i = 0;i<aodMCH->GetNCocktailHeaders();i++)
429 pythiaHeader = dynamic_cast<AliGenPythiaEventHeader*>(aodMCH->GetCocktailHeader(i));
430 if (pythiaHeader) break;
436 AliInfo("Ending GetPythiaTrials.");
439 return pythiaHeader->Trials();
441 AliWarning(Form("In task %s: GetPythiaTrials() failed!", GetName()));
447 //________________________________________________________________________
448 inline Int_t AliAnalysisTaskChargedJetsPA::GetPtHardBin()
451 AliInfo("Starting GetPtHardBin.");
453 // ########## PT HARD BIN EDGES
454 const Int_t kPtHardLowerEdges[] = { 0, 5,11,21,36,57, 84,117,152,191,234};
455 const Int_t kPtHardHigherEdges[] = { 5,11,21,36,57,84,117,152,191,234,1000000};
457 Int_t tmpPtHardBin = 0;
458 Double_t tmpPtHard = GetPtHard();
460 for (tmpPtHardBin = 0; tmpPtHardBin <= fNumPtHardBins; tmpPtHardBin++)
461 if (tmpPtHard >= kPtHardLowerEdges[tmpPtHardBin] && tmpPtHard < kPtHardHigherEdges[tmpPtHardBin])
465 AliInfo("Ending GetPtHardBin.");
470 //________________________________________________________________________
471 Double_t AliAnalysisTaskChargedJetsPA::GetExternalRho()
473 // Get rho from event.
474 AliRhoParameter *rho = 0;
475 if (!fRhoTaskName.IsNull()) {
476 rho = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoTaskName.Data()));
478 AliWarning(Form("%s: Could not retrieve rho with name %s!", GetName(), fRhoTaskName.Data()));
485 return (rho->GetVal());
489 //________________________________________________________________________
490 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInCone(AliVTrack* track, Double_t eta, Double_t phi, Double_t radius)
492 // This is to use a full cone in phi even at the edges of phi (2pi -> 0) (0 -> 2pi)
493 Double_t trackPhi = 0.0;
494 if (track->Phi() > (TMath::TwoPi() - (radius-phi)))
495 trackPhi = track->Phi() - TMath::TwoPi();
496 else if (track->Phi() < (phi+radius - TMath::TwoPi()))
497 trackPhi = track->Phi() + TMath::TwoPi();
499 trackPhi = track->Phi();
501 if ( TMath::Abs(trackPhi-phi)*TMath::Abs(trackPhi-phi) + TMath::Abs(track->Eta()-eta)*TMath::Abs(track->Eta()-eta) <= radius*radius)
507 //________________________________________________________________________
508 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInJet(AliEmcalJet* jet, Int_t trackIndex)
510 for (Int_t i = 0; i < jet->GetNumberOfTracks(); ++i)
512 Int_t jetTrack = jet->TrackAt(i);
513 if (jetTrack == trackIndex)
519 //________________________________________________________________________
520 inline Bool_t AliAnalysisTaskChargedJetsPA::IsJetOverlapping(AliEmcalJet* jet1, AliEmcalJet* jet2)
522 for (Int_t i = 0; i < jet1->GetNumberOfTracks(); ++i)
524 Int_t jet1Track = jet1->TrackAt(i);
525 for (Int_t j = 0; j < jet2->GetNumberOfTracks(); ++j)
527 Int_t jet2Track = jet2->TrackAt(j);
528 if (jet1Track == jet2Track)
535 //________________________________________________________________________
536 inline Bool_t AliAnalysisTaskChargedJetsPA::IsEventInAcceptance(AliVEvent* event)
541 FillHistogram("hEventAcceptance", 0.5); // number of events before manual cuts
543 if(fHelperClass->IsPileUpEvent(event))
546 FillHistogram("hEventAcceptance", 1.5); // number of events after pileup cuts
549 FillHistogram("hVertexZBeforeVertexCut",event->GetPrimaryVertex()->GetZ());
551 if(fUseDefaultVertexCut)
553 if(!fHelperClass->IsVertexSelected2013pA(event))
556 else // Failsafe vertex cut
558 if(!event->GetPrimaryVertex() || (TMath::Abs(event->GetPrimaryVertex()->GetZ()) > 10.0) || (event->GetPrimaryVertex()->GetNContributors()<1))
563 FillHistogram("hVertexZAfterVertexCut",event->GetPrimaryVertex()->GetZ());
565 FillHistogram("hEventAcceptance", 2.5); // number of events after vertex cut
570 //________________________________________________________________________
571 inline Bool_t AliAnalysisTaskChargedJetsPA::IsTrackInAcceptance(AliVParticle* track)
573 FillHistogram("hTrackAcceptance", 0.5);
578 // TODO: Only working for AOD MC
579 if((!track->Charge()) || (!(static_cast<AliAODMCParticle*>(track))->IsPhysicalPrimary()) )
582 if ((track->Eta() < fMaxEta) && (track->Eta() >= fMinEta))
584 FillHistogram("hTrackAcceptance", 1.5);
585 if (track->Pt() >= fMinTrackPt)
587 FillHistogram("hTrackAcceptance", 2.5);
595 //________________________________________________________________________
596 inline Bool_t AliAnalysisTaskChargedJetsPA::IsBackgroundJetInAcceptance(AliEmcalJet *jet)
599 if (TMath::Abs(jet->Eta()) <= fBackgroundJetEtaWindow)
600 if (jet->Pt() >= fMinBackgroundJetPt)
606 //________________________________________________________________________
607 inline Bool_t AliAnalysisTaskChargedJetsPA::IsSignalJetInAcceptance(AliEmcalJet *jet)
609 FillHistogram("hJetAcceptance", 0.5);
611 if ((jet->Eta() >= fMinJetEta) && (jet->Eta() < fMaxJetEta))
613 FillHistogram("hJetAcceptance", 1.5);
614 if (jet->Pt() >= fMinJetPt)
616 FillHistogram("hJetAcceptance", 2.5);
617 if (jet->Area() >= fMinJetArea)
619 FillHistogram("hJetAcceptance", 3.5);
627 //________________________________________________________________________
628 inline Bool_t AliAnalysisTaskChargedJetsPA::IsDijet(AliEmcalJet *jet1, AliEmcalJet *jet2)
630 // Output from GetDeltaPhi is < pi in any case
631 if ((jet1 != 0) && (jet2 != 0))
632 if((TMath::Pi() - GetDeltaPhi(jet1->Phi(),jet2->Phi())) < fDijetMaxAngleDeviation)
633 if ((jet1->Pt() > fMinDijetLeadingPt) && (jet2->Pt() > fMinDijetLeadingPt)) //TODO: Introduce recoil jet?
639 //________________________________________________________________________
640 void AliAnalysisTaskChargedJetsPA::ExecOnce()
643 AliInfo("Starting ExecOnce.");
645 fInitialized = kTRUE;
647 // Check for track array
648 if (strcmp(fTrackArrayName->Data(), "") != 0)
650 fTrackArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrackArrayName->Data()));
654 AliWarning(Form("%s: Could not retrieve tracks %s! This is OK, if tracks are not demanded.", GetName(), fTrackArrayName->Data()));
659 TClass *cl = fTrackArray->GetClass();
660 if (!cl->GetBaseClass("AliVParticle"))
662 AliError(Form("%s: Collection %s does not contain AliVParticle objects!", GetName(), fTrackArrayName->Data()));
669 // Check for jet array
670 if (strcmp(fJetArrayName->Data(), "") != 0)
672 fJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetArrayName->Data()));
677 AliWarning(Form("%s: Could not retrieve jets %s! This is OK, if jets are not demanded.", GetName(), fJetArrayName->Data()));
682 if (!fJetArray->GetClass()->GetBaseClass("AliEmcalJet"))
684 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fJetArrayName->Data()));
691 // Check for background object
692 if (strcmp(fBackgroundJetArrayName->Data(), "") != 0)
694 fBackgroundJetArray = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fBackgroundJetArrayName->Data()));
695 fHasBackgroundJets = kTRUE;
696 if (!fBackgroundJetArray)
698 AliInfo(Form("%s: Could not retrieve background jets %s! This is OK, if background is not demanded.", GetName(), fBackgroundJetArrayName->Data()));
699 fHasBackgroundJets = kFALSE;
703 // Look, if initialization is OK
704 if (!fHasTracks && fAnalyzeBackground)
706 AliError(Form("%s: Tracks NOT successfully casted although demanded! Deactivating background analysis",GetName()));
707 fAnalyzeBackground = kFALSE;
709 if ((!fHasJets && fAnalyzeJets) || (!fHasJets && fAnalyzeBackground))
711 AliError(Form("%s: Jets NOT successfully casted although demanded! Deactivating jet- and background analysis",GetName()));
712 fAnalyzeJets = kFALSE;
713 fAnalyzeBackground = kFALSE;
715 if (!fHasBackgroundJets && fAnalyzeBackground)
717 AliError(Form("%s: Background NOT successfully casted although demanded! Deactivating background analysis",GetName()));
718 fAnalyzeBackground = kFALSE;
721 // Initialize helper class (for vertex selection & pile up correction)
722 fHelperClass = new AliAnalysisUtils();
723 fHelperClass->SetCutOnZVertexSPD(kFALSE);
728 AliInfo("ExecOnce done.");
733 //________________________________________________________________________
734 void AliAnalysisTaskChargedJetsPA::GetSignalJets()
737 fFirstLeadingJet = NULL;
738 fSecondLeadingJet = NULL;
739 fNumberSignalJets = 0;
742 for (Int_t i = 0; i < fJetArray->GetEntries(); i++)
744 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJetArray->At(i));
747 AliError(Form("%s: Could not receive jet %d", GetName(), i));
750 if (!IsSignalJetInAcceptance(jet))
753 for (Int_t j = 0; j <= tmpJets.GetEntries(); j++)
755 if (j>tmpJets.GetEntries()-1) // When passed last item add the jet at the end
761 AliEmcalJet* listJet = static_cast<AliEmcalJet*>(tmpJets.At(j));
763 if(jet->Pt() < listJet->Pt()) // Insert jet before that one in list if pt smaller
765 tmpJets.AddAt(jet, j);
771 for (Int_t i = 0; i < tmpJets.GetEntries(); i++)
773 AliEmcalJet* jet = static_cast<AliEmcalJet*>(tmpJets.At(i));
774 fSignalJets[fNumberSignalJets] = jet;
778 Int_t leadingJets[] = {-1, -1};
779 GetLeadingJets(fJetArray, &leadingJets[0], kTRUE);
781 if (leadingJets[0] > -1)
782 fFirstLeadingJet = static_cast<AliEmcalJet*>(fJetArray->At(leadingJets[0]));
783 if (leadingJets[1] > -1)
784 fSecondLeadingJet = static_cast<AliEmcalJet*>(fJetArray->At(leadingJets[1]));
787 //________________________________________________________________________
788 Int_t AliAnalysisTaskChargedJetsPA::GetLeadingJets(TClonesArray* jetArray, Int_t* jetIDArray, Bool_t isSignalJets)
790 // Writes first two leading jets into already registered array jetIDArray
794 AliError("Could not get the jet array to get leading jets from it!");
798 Float_t maxJetPts[] = {0, 0};
802 Int_t jetCount = jetArray->GetEntries();
803 Int_t jetCountAccepted = 0;
805 for (Int_t i = 0; i < jetCount; i++)
807 AliEmcalJet* jet = static_cast<AliEmcalJet*>(jetArray->At(i));
810 AliError(Form("%s: Could not receive jet %d", GetName(), i));
816 if (!IsSignalJetInAcceptance(jet)) continue;
820 if (!IsBackgroundJetInAcceptance(jet)) continue;
823 if (jet->Pt() > maxJetPts[0])
825 maxJetPts[1] = maxJetPts[0];
826 jetIDArray[1] = jetIDArray[0];
827 maxJetPts[0] = jet->Pt();
830 else if (jet->Pt() > maxJetPts[1])
832 maxJetPts[1] = jet->Pt();
837 return jetCountAccepted;
841 //________________________________________________________________________
842 Double_t AliAnalysisTaskChargedJetsPA::GetCorrectedJetPt(AliEmcalJet* jet, Double_t background)
845 AliInfo("Getting corrected jet spectra.");
850 AliError("Jet pointer passed to GetCorrectedJetPt() not valid!");
854 Double_t correctedPt = -1.0;
856 // if the passed background is not valid, do not subtract it
860 // Subtract background
861 correctedPt = jet->Pt() - background * jet->Area();
864 AliInfo("Got corrected jet spectra.");
872 //________________________________________________________________________
873 Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPt(Double_t rho, Double_t leadingJetExclusionProbability)
876 AliInfo("Getting Delta Pt.");
879 // Define an invalid delta pt
880 Double_t deltaPt = -10000.0;
883 Double_t etaMin, etaMax;
884 etaMin = fMinEta+fRandConeRadius;
885 etaMax = fMaxEta-fRandConeRadius;
887 // Define random cone
888 Bool_t coneValid = kTRUE;
889 Double_t tmpRandConeEta = etaMin + fRandom->Rndm()*(etaMax-etaMin);
890 Double_t tmpRandConePhi = fRandom->Rndm()*TMath::TwoPi();
892 // if there is a jet, check for overlap if demanded
893 if(leadingJetExclusionProbability)
895 AliEmcalJet* tmpLeading = dynamic_cast<AliEmcalJet*>(fJetArray->At(0));
896 // Get leading jet (regardless of pT)
897 for (Int_t i = 1; i<fJetArray->GetEntries(); i++)
899 AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i));
900 // if jet is in acceptance and higher, take as new leading
902 if ( ((tmpJet->Eta() >= fMinJetEta) && (tmpJet->Eta() < fMaxJetEta)) && (tmpJet->Area() >= fMinJetArea))
903 if((!tmpLeading) || (tmpJet->Pt() > tmpLeading->Pt()))
908 Double_t excludedJetPhi = tmpLeading->Phi();
909 Double_t excludedJetEta = tmpLeading->Eta();
910 Double_t tmpDeltaPhi = GetDeltaPhi(tmpRandConePhi, excludedJetPhi);
912 // Check, if cone has overlap with jet
913 if ( tmpDeltaPhi*tmpDeltaPhi + TMath::Abs(tmpRandConeEta-excludedJetEta)*TMath::Abs(tmpRandConeEta-excludedJetEta) <= fRandConeRadius*fRandConeRadius)
915 // Define probability to exclude the RC
916 Double_t probability = leadingJetExclusionProbability;
918 // Only exclude cone with a given probability
919 if (fRandom->Rndm()<=probability)
926 // Get the cones' pt and calculate delta pt
928 deltaPt = GetConePt(tmpRandConeEta,tmpRandConePhi,fRandConeRadius) - (rho*fRandConeRadius*fRandConeRadius*TMath::Pi());
932 AliInfo("Got Delta Pt.");
936 //________________________________________________________________________
937 void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensityAll(Int_t numberExcludeLeadingJets, Double_t& rhoPbPb, Double_t& rhoPbPbWithGhosts, Double_t& rhoCMS, Double_t& rhoImprovedCMS, Double_t& rhoMean, Double_t& rhoTrackLike)
940 AliInfo("Getting ALL KT background density.");
943 static Double_t tmpRhoPbPb[1024];
944 static Double_t tmpRhoPbPbWithGhosts[1024];
945 static Double_t tmpRhoMean[1024];
946 static Double_t tmpRhoCMS[1024];
947 static Double_t tmpRhoImprovedCMS[1024];
948 Double_t tmpCoveredArea = 0.0;
949 Double_t tmpSummedArea = 0.0;
950 Double_t tmpPtTrackLike = 0.0;
951 Double_t tmpAreaTrackLike = 0.0;
953 // Setting invalid values
955 rhoPbPbWithGhosts = 0.0;
957 rhoImprovedCMS = 0.0;
961 Int_t rhoPbPbJetCount = 0;
962 Int_t rhoPbPbWithGhostsJetCount = 0;
963 Int_t rhoCMSJetCount = 0;
964 Int_t rhoImprovedCMSJetCount = 0;
965 Int_t rhoMeanJetCount = 0;
968 // Find 2 leading KT jets for the original PbPb approach
969 Int_t leadingKTJets[] = {-1, -1};
970 GetLeadingJets(fBackgroundJetArray, &leadingKTJets[0], kFALSE);
972 // Exclude UP TO numberExcludeLeadingJets
973 if(numberExcludeLeadingJets==-1)
974 numberExcludeLeadingJets = fNumberSignalJets;
975 if (fNumberSignalJets < numberExcludeLeadingJets)
976 numberExcludeLeadingJets = fNumberSignalJets;
978 for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++)
980 AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i));
984 AliError(Form("%s: Could not receive jet %d", GetName(), i));
988 tmpSummedArea += backgroundJet->Area();
989 if(backgroundJet->Pt() > 0.150)
990 tmpCoveredArea += backgroundJet->Area();
992 if (!IsBackgroundJetInAcceptance(backgroundJet))
995 // Search for overlap with signal jets
996 Bool_t isOverlapping = kFALSE;
997 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
999 AliEmcalJet* signalJet = fSignalJets[j];
1001 if(signalJet->Pt() >= 5.0)
1002 if(IsJetOverlapping(signalJet, backgroundJet))
1004 isOverlapping = kTRUE;
1009 Double_t tmpRho = 0.0;
1010 if(backgroundJet->Area())
1011 tmpRho = backgroundJet->Pt() / backgroundJet->Area();
1013 // PbPb approach (take ghosts into account)
1014 if ((i != leadingKTJets[0]) && (i != leadingKTJets[1]))
1016 tmpRhoPbPbWithGhosts[rhoPbPbWithGhostsJetCount] = tmpRho;
1017 rhoPbPbWithGhostsJetCount++;
1020 if(backgroundJet->Pt() > 0.150)
1022 // CMS approach: don't take ghosts into acount
1023 tmpRhoCMS[rhoCMSJetCount] = tmpRho;
1026 // Improved CMS approach: like CMS but excluding signal
1029 tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho;
1030 rhoImprovedCMSJetCount++;
1033 // PbPb w/o ghosts approach (just neglect ghosts)
1034 if ((i != leadingKTJets[0]) && (i != leadingKTJets[1]))
1036 tmpRhoPbPb[rhoPbPbJetCount] = tmpRho;
1041 // (no overlap with signal jets)
1045 tmpRhoMean[rhoMeanJetCount] = tmpRho;
1048 // Track like approach approach
1049 tmpPtTrackLike += backgroundJet->Pt();
1050 tmpAreaTrackLike += backgroundJet->Area();
1055 if (tmpAreaTrackLike > 0)
1056 rhoTrackLike = tmpPtTrackLike/tmpAreaTrackLike;
1057 if (rhoPbPbJetCount > 0)
1058 rhoPbPb = TMath::Median(rhoPbPbJetCount, tmpRhoPbPb);
1059 if (rhoPbPbWithGhostsJetCount > 0)
1060 rhoPbPbWithGhosts = TMath::Median(rhoPbPbWithGhostsJetCount, tmpRhoPbPbWithGhosts);
1061 if (rhoCMSJetCount > 0)
1062 rhoCMS = TMath::Median(rhoCMSJetCount, tmpRhoCMS) * tmpCoveredArea/tmpSummedArea;
1063 if (rhoImprovedCMSJetCount > 0)
1065 rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
1067 if (rhoMeanJetCount > 0)
1068 rhoMean = TMath::Mean(rhoMeanJetCount, tmpRhoMean);
1071 AliInfo("Got ALL KT background density.");
1075 //________________________________________________________________________
1076 void AliAnalysisTaskChargedJetsPA::GetKTBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoImprovedCMS)
1079 AliInfo("Getting KT background density.");
1082 static Double_t tmpRhoImprovedCMS[1024];
1083 Double_t tmpCoveredArea = 0.0;
1084 Double_t tmpSummedArea = 0.0;
1086 // Setting invalid values
1087 rhoImprovedCMS = 0.0;
1089 Int_t rhoImprovedCMSJetCount = 0;
1091 // Exclude UP TO numberExcludeLeadingJets
1092 if(numberExcludeLeadingJets==-1)
1093 numberExcludeLeadingJets = fNumberSignalJets;
1094 if (fNumberSignalJets < numberExcludeLeadingJets)
1095 numberExcludeLeadingJets = fNumberSignalJets;
1097 for (Int_t i = 0; i < fBackgroundJetArray->GetEntries(); i++)
1099 AliEmcalJet* backgroundJet = static_cast<AliEmcalJet*>(fBackgroundJetArray->At(i));
1103 AliError(Form("%s: Could not receive jet %d", GetName(), i));
1107 // Search for overlap with signal jets
1108 Bool_t isOverlapping = kFALSE;
1109 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1111 AliEmcalJet* signalJet = fSignalJets[j];
1112 if(signalJet->Pt() >= 5.0)
1113 if(IsJetOverlapping(signalJet, backgroundJet))
1115 isOverlapping = kTRUE;
1120 tmpSummedArea += backgroundJet->Area();
1121 if(backgroundJet->Pt() > 0.150)
1122 tmpCoveredArea += backgroundJet->Area();
1124 if (!IsBackgroundJetInAcceptance(backgroundJet))
1127 Double_t tmpRho = backgroundJet->Pt() / backgroundJet->Area();
1129 if(backgroundJet->Pt() > 0.150)
1132 tmpRhoImprovedCMS[rhoImprovedCMSJetCount] = tmpRho;
1133 rhoImprovedCMSJetCount++;
1137 if (rhoImprovedCMSJetCount > 0)
1139 rhoImprovedCMS = TMath::Median(rhoImprovedCMSJetCount, tmpRhoImprovedCMS) * tmpCoveredArea/tmpSummedArea;
1142 AliInfo("Got KT background density.");
1147 //________________________________________________________________________
1148 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoNoExclusion, Double_t& rhoConeExclusion02, Double_t& rhoConeExclusion04, Double_t& rhoConeExclusion06, Double_t& rhoConeExclusion08, Double_t& rhoExactExclusion)
1151 AliInfo("Getting TR background density.");
1154 Double_t summedTracksPtCone04 = 0.0;
1155 Double_t summedTracksPtCone02 = 0.0;
1156 Double_t summedTracksPtCone06 = 0.0;
1157 Double_t summedTracksPtCone08 = 0.0;
1158 Double_t summedTracksPtWithinJets = 0.0;
1159 Double_t summedTracksPt = 0.0;
1161 // Setting invalid values
1162 rhoNoExclusion = 0.0;
1163 rhoConeExclusion02 = 0.0;
1164 rhoConeExclusion04 = 0.0;
1165 rhoConeExclusion06 = 0.0;
1166 rhoConeExclusion08 = 0.0;
1167 rhoExactExclusion = 0.0;
1169 // Exclude UP TO numberExcludeLeadingJets
1170 if(numberExcludeLeadingJets==-1)
1171 numberExcludeLeadingJets = fNumberSignalJets;
1172 if (fNumberSignalJets < numberExcludeLeadingJets)
1173 numberExcludeLeadingJets = fNumberSignalJets;
1175 Int_t fSignalJetCount5GeV = 0;
1176 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1178 AliEmcalJet* signalJet = fSignalJets[j];
1179 if(signalJet->Pt() < 5.0)
1181 fSignalJetCount5GeV++;
1184 for (Int_t i = 0; i < fTrackArray->GetEntries(); i++)
1186 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
1187 Bool_t trackWithinJet = kFALSE; Bool_t trackWithin02Cone = kFALSE; Bool_t trackWithin04Cone = kFALSE; Bool_t trackWithin06Cone = kFALSE; Bool_t trackWithin08Cone = kFALSE;
1189 if (IsTrackInAcceptance(tmpTrack))
1191 // Check if tracks overlaps with jet
1192 for(Int_t j=0;j<numberExcludeLeadingJets;j++)
1194 AliEmcalJet* signalJet = fSignalJets[j];
1196 if(signalJet->Pt() < 5.0)
1199 // Exact jet exclusion
1200 if (IsTrackInJet(signalJet, i))
1201 trackWithinJet = kTRUE;
1204 if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.2))
1206 trackWithin02Cone = kTRUE;
1207 trackWithin04Cone = kTRUE;
1208 trackWithin06Cone = kTRUE;
1209 trackWithin08Cone = kTRUE;
1212 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.4))
1214 trackWithin04Cone = kTRUE;
1215 trackWithin06Cone = kTRUE;
1216 trackWithin08Cone = kTRUE;
1218 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.6))
1220 trackWithin06Cone = kTRUE;
1221 trackWithin08Cone = kTRUE;
1223 else if (IsTrackInCone(tmpTrack, signalJet->Eta(), signalJet->Phi(), 0.8))
1225 trackWithin08Cone = kTRUE;
1229 if(!trackWithin08Cone)
1231 summedTracksPtCone08 += tmpTrack->Pt();
1233 if(!trackWithin06Cone)
1235 summedTracksPtCone06 += tmpTrack->Pt();
1237 if(!trackWithin04Cone)
1239 summedTracksPtCone04 += tmpTrack->Pt();
1241 if(!trackWithin02Cone)
1243 summedTracksPtCone02 += tmpTrack->Pt();
1247 summedTracksPtWithinJets += tmpTrack->Pt();
1249 summedTracksPt += tmpTrack->Pt();
1254 // Calculate the correct area where the tracks were taking from
1256 Double_t tmpFullTPCArea = (2.0*(fMaxEta-fMinEta)) * TMath::TwoPi();
1257 Double_t tmpAreaCone02 = tmpFullTPCArea;
1258 Double_t tmpAreaCone04 = tmpFullTPCArea;
1259 Double_t tmpAreaCone06 = tmpFullTPCArea;
1260 Double_t tmpAreaCone08 = tmpFullTPCArea;
1261 Double_t tmpAreaWithinJets = tmpFullTPCArea;
1262 std::vector<Double_t> tmpEtas(fSignalJetCount5GeV);
1263 std::vector<Double_t> tmpPhis(fSignalJetCount5GeV);
1266 for(Int_t i=0;i<numberExcludeLeadingJets;i++)
1268 AliEmcalJet* tmpJet = fSignalJets[i];
1270 if(tmpJet->Pt() < 5.0)
1273 tmpEtas[iSignal] = tmpJet->Eta();
1274 tmpPhis[iSignal] = tmpJet->Phi();
1275 tmpAreaWithinJets -= tmpJet->Area();
1280 tmpAreaCone02 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.2, fMinEta, fMaxEta, 0., TMath::TwoPi());
1281 tmpAreaCone04 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.4, fMinEta, fMaxEta, 0., TMath::TwoPi());
1282 tmpAreaCone06 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.6, fMinEta, fMaxEta, 0., TMath::TwoPi());
1283 tmpAreaCone08 -= tmpFullTPCArea * MCGetOverlapMultipleCirclesRectancle(fSignalJetCount5GeV, tmpEtas, tmpPhis, 0.8, fMinEta, fMaxEta, 0., TMath::TwoPi());
1285 rhoConeExclusion02 = summedTracksPtCone02/tmpAreaCone02;
1286 rhoConeExclusion04 = summedTracksPtCone04/tmpAreaCone04;
1287 rhoConeExclusion06 = summedTracksPtCone06/tmpAreaCone06;
1288 rhoConeExclusion08 = summedTracksPtCone08/tmpAreaCone08;
1289 rhoExactExclusion = summedTracksPtWithinJets/tmpAreaWithinJets;
1290 rhoNoExclusion = summedTracksPt/tmpFullTPCArea;
1294 AliInfo("Got TR background density.");
1298 //________________________________________________________________________
1299 void AliAnalysisTaskChargedJetsPA::GetTRBackgroundDensity(Int_t numberExcludeLeadingJets, Double_t& rhoMean, Double_t& area, AliEmcalJet* excludeJet1, AliEmcalJet* excludeJet2, Bool_t doSearchPerpendicular)
1302 AliInfo("Getting TR background density.");
1305 // Setting invalid values
1306 Double_t summedTracksPt = 0.0;
1310 Double_t tmpRadius = 0.0;
1311 if (doSearchPerpendicular)
1312 tmpRadius = 0.4*TMath::Pi(); // exclude 90 degrees around jets
1316 numberExcludeLeadingJets = 2; // dijet is excluded here in any case
1320 if (!fTrackArray || !fJetArray)
1322 AliError("Could not get the track/jet array to calculate track rho!");
1326 Int_t trackCount = fTrackArray->GetEntries();
1327 Int_t trackCountAccepted = 0;
1328 for (Int_t i = 0; i < trackCount; i++)
1330 AliVTrack* tmpTrack = static_cast<AliVTrack*>(fTrackArray->At(i));
1331 if (IsTrackInAcceptance(tmpTrack))
1333 if (IsTrackInCone(tmpTrack, excludeJet1->Eta(), excludeJet1->Phi(), tmpRadius))
1336 if (numberExcludeLeadingJets > 1)
1337 if (IsTrackInCone(tmpTrack, excludeJet2->Eta(), excludeJet2->Phi(), tmpRadius))
1340 // Add track pt to array
1341 summedTracksPt = summedTracksPt + tmpTrack->Pt();
1342 trackCountAccepted++;
1346 if (trackCountAccepted > 0)
1348 Double_t tmpArea = 2.0*(fMaxEta-fMinEta)*TMath::TwoPi() - 2*(tmpRadius*tmpRadius * TMath::Pi()); //TPC area - excluding jet area
1349 rhoMean = summedTracksPt/tmpArea;
1354 AliInfo("Got TR background density.");
1358 //________________________________________________________________________
1359 void AliAnalysisTaskChargedJetsPA::GetPPBackgroundDensity(Double_t& background)
1361 // This is the background that was used for the pp 7 TeV ALICE paper
1362 // The background is estimated using the leading jet
1367 Int_t leadingJets[] = {-1, -1};
1368 GetLeadingJets(fJetArray, &leadingJets[0], kTRUE);
1369 AliEmcalJet* jet = NULL;
1370 if(leadingJets[0] != -1)
1371 jet = static_cast<AliEmcalJet*>(fJetArray->At(leadingJets[0]));
1375 Double_t jetMom[3] = { jet->Px(), jet->Py(), jet->Pz() };
1376 TVector3 jet3mom1(jetMom);
1377 TVector3 jet3mom2(jetMom);
1379 jet3mom1.RotateZ(TMath::Pi());
1380 jet3mom2.RotateZ(-TMath::Pi());
1382 for (int i = 0; i < fTrackArray->GetEntries(); i++)
1384 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1385 if (!IsTrackInAcceptance(track))
1388 Double_t trackMom[3] = { track->Px(), track->Py(), track->Pz() };
1389 TVector3 track3mom(trackMom);
1391 Double_t dR1 = jet3mom1.DeltaR(track3mom);
1392 Double_t dR2 = jet3mom2.DeltaR(track3mom);
1394 if (dR1 <= fSignalJetRadius || dR2 <= fSignalJetRadius)
1395 background += track3mom.Pt();
1398 background /= (2 * TMath::Pi() * fSignalJetRadius * fSignalJetRadius);
1401 //________________________________________________________________________
1402 void AliAnalysisTaskChargedJetsPA::Calculate(AliVEvent* event)
1405 AliInfo("Starting Calculate().");
1407 ////////////////////// NOTE: initialization & casting
1411 // Check, if analysis should be done in pt hard bins
1412 if(fUsePtHardBin != -1)
1413 if(GetPtHardBin() != fUsePtHardBin)
1416 // This is to take only every Nth event
1417 if((fEventCounter+fPartialAnalysisIndex) % fPartialAnalysisNParts != 0)
1420 FillHistogram("hNumberEvents",0.5);
1422 if(!IsEventInAcceptance(event))
1425 FillHistogram("hNumberEvents",1.5);
1428 AliInfo("Calculate()::Init done.");
1431 ////////////////////// NOTE: Get Centrality, (Leading)Signal jets and Background
1434 AliCentrality* tmpCentrality = NULL;
1435 tmpCentrality = event->GetCentrality();
1436 Double_t centralityPercentile = -1.0;
1437 Double_t centralityPercentileV0A = 0.0;
1438 Double_t centralityPercentileV0C = 0.0;
1439 Double_t centralityPercentileV0M = 0.0;
1440 Double_t centralityPercentileZNA = 0.0;
1441 if (tmpCentrality != NULL)
1443 centralityPercentile = tmpCentrality->GetCentralityPercentile(fCentralityType.Data());
1444 centralityPercentileV0A = tmpCentrality->GetCentralityPercentile("V0A");
1445 centralityPercentileV0C = tmpCentrality->GetCentralityPercentile("V0C");
1446 centralityPercentileV0M = tmpCentrality->GetCentralityPercentile("V0M");
1447 centralityPercentileZNA = tmpCentrality->GetCentralityPercentile("ZNA");
1450 if((centralityPercentile < 0.0) || (centralityPercentile > 100.0))
1451 AliWarning(Form("Centrality value not valid (c=%E)",centralityPercentile));
1453 if(fSetCentralityToOne)
1454 centralityPercentile = 1.0;
1457 if (fAnalyzeBackground || fAnalyzeJets)
1460 // Get background estimates
1461 Double_t backgroundKTImprovedCMS = -1.0;
1462 Double_t backgroundKTImprovedCMSExternal = -1.0;
1463 Double_t backgroundKTPbPb = -1.0;
1464 Double_t backgroundKTPbPbWithGhosts = -1.0;
1465 Double_t backgroundKTCMS = -1.0;
1466 Double_t backgroundKTMean = -1.0;
1467 Double_t backgroundKTTrackLike = -1.0;
1468 Double_t backgroundTRNoExcl = -1.0;
1469 Double_t backgroundTRCone02 = -1.0;
1470 Double_t backgroundTRCone04 = -1.0;
1471 Double_t backgroundTRCone06 = -1.0;
1472 Double_t backgroundTRCone08 = -1.0;
1473 Double_t backgroundTRExact = -1.0;
1474 Double_t backgroundPP = -1.0;
1475 Double_t backgroundJetProfile = -1.0;
1476 // Calculate background for different jet exclusions
1478 if (fAnalyzeBackground)
1481 if(fAnalyzeDeprecatedBackgrounds)
1482 GetKTBackgroundDensityAll (fNumberExcludedJets, backgroundKTPbPb, backgroundKTPbPbWithGhosts, backgroundKTCMS, backgroundKTImprovedCMS, backgroundKTMean, backgroundKTTrackLike);
1484 GetKTBackgroundDensity (fNumberExcludedJets, backgroundKTImprovedCMS);
1486 if(fAnalyzeDeprecatedBackgrounds)
1487 GetTRBackgroundDensity (fNumberExcludedJets, backgroundTRNoExcl, backgroundTRCone02, backgroundTRCone04, backgroundTRCone06, backgroundTRCone08, backgroundTRExact);
1490 GetPPBackgroundDensity(backgroundPP);
1492 backgroundKTImprovedCMSExternal = GetExternalRho();
1493 if(fNoExternalBackground)
1494 backgroundKTImprovedCMSExternal = 0;
1496 if(fBackgroundForJetProfile==0)
1497 backgroundJetProfile = backgroundKTImprovedCMSExternal;
1498 else if(fBackgroundForJetProfile==1)
1499 backgroundJetProfile = backgroundKTImprovedCMS;
1500 else if(fBackgroundForJetProfile==2)
1501 backgroundJetProfile = backgroundKTCMS;
1502 else if(fBackgroundForJetProfile==3)
1503 backgroundJetProfile = backgroundPP;
1504 else if(fBackgroundForJetProfile==4)
1505 backgroundJetProfile = backgroundTRCone06;
1506 else if(fBackgroundForJetProfile==5)
1507 backgroundJetProfile = 0;
1511 AliInfo("Calculate()::Centrality&SignalJets&Background-Calculation done.");
1516 FillHistogram("hVertexX",event->GetPrimaryVertex()->GetX());
1517 FillHistogram("hVertexY",event->GetPrimaryVertex()->GetY());
1518 FillHistogram("hVertexXY",event->GetPrimaryVertex()->GetX(), event->GetPrimaryVertex()->GetY());
1519 FillHistogram("hVertexR",TMath::Sqrt(event->GetPrimaryVertex()->GetX()*event->GetPrimaryVertex()->GetX() + event->GetPrimaryVertex()->GetY()*event->GetPrimaryVertex()->GetY()));
1520 FillHistogram("hCentralityV0M",centralityPercentileV0M);
1521 FillHistogram("hCentralityV0A",centralityPercentileV0A);
1522 FillHistogram("hCentralityV0C",centralityPercentileV0C);
1523 FillHistogram("hCentralityZNA",centralityPercentileZNA);
1524 FillHistogram("hCentrality",centralityPercentile);
1526 Int_t trackCountAcc = 0;
1527 Int_t nTracks = fTrackArray->GetEntries();
1528 for (Int_t i = 0; i < nTracks; i++)
1530 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1533 if (track->Pt() >= fMinTrackPt)
1535 FillHistogram("hTrackPhiEta", track->Phi(),track->Eta(), 1);
1536 FillHistogram("hTrackPtPhiEta", track->Phi(),track->Eta(), track->Pt());
1539 if (IsTrackInAcceptance(track))
1541 FillHistogram("hTrackPt", track->Pt(), centralityPercentile);
1542 if(track->Eta() >= 0)
1543 FillHistogram("hTrackPtPosEta", track->Pt(), centralityPercentile);
1545 FillHistogram("hTrackPtNegEta", track->Pt(), centralityPercentile);
1547 FillHistogram("hTrackEta", track->Eta(), centralityPercentile);
1548 FillHistogram("hTrackPhi", track->Phi());
1550 if(static_cast<AliPicoTrack*>(track))
1551 FillHistogram("hTrackPhiTrackType", track->Phi(), (static_cast<AliPicoTrack*>(track))->GetTrackType());
1553 for(Int_t j=0;j<20;j++)
1555 FillHistogram("hTrackPhiPtCut", track->Phi(), track->Pt());
1557 FillHistogram("hTrackCharge", track->Charge());
1561 FillHistogram("hTrackCountAcc", trackCountAcc, centralityPercentile);
1565 // This is code that is run locally to get some special events
1566 TFile* fileOutput = new TFile("SpecialEvents.root", "UPDATE");
1567 if(fSecondLeadingJet&&(fSecondLeadingJet->Pt()>10.))
1569 cout << "Event found\n";
1570 TH2D* tmpEvent = new TH2D(Form("Event%lu", fEventCounter), "", 40, -0.9, 0.9, 40, 0., TMath::TwoPi());
1571 tmpEvent->GetXaxis()->SetTitle("#eta");
1572 tmpEvent->GetYaxis()->SetTitle("#phi");
1573 tmpEvent->SetOption("LEGO2");
1576 for (Int_t i = 0; i < nTracks; i++)
1578 AliVTrack* track = static_cast<AliVTrack*>(fTrackArray->At(i));
1580 if (IsTrackInAcceptance(track))
1582 tmpEvent->Fill(track->Eta(), track->Phi(), track->Pt());
1585 tmpEvent->Write(0, kOverwrite);
1587 fileOutput->Close();
1591 AliInfo("Calculate()::QA done.");
1594 ////////////////////// NOTE: Jet analysis and calculations
1598 for (Int_t i = 0; i<fJetArray->GetEntries(); i++)
1600 AliEmcalJet* tmpJet = static_cast<AliEmcalJet*>(fJetArray->At(i));
1604 FillHistogram("hRawJetPt", tmpJet->Pt());
1605 if (tmpJet->Pt() >= 5.0)
1607 // ### RAW JET ANALYSIS
1608 if (tmpJet->Area() >= fMinJetArea)
1609 FillHistogram("hRawJetPhiEta", tmpJet->Phi(), tmpJet->Eta());
1610 if ((tmpJet->Eta() >= fMinJetEta) && (tmpJet->Eta() < fMaxJetEta))
1611 FillHistogram("hRawJetArea", tmpJet->Area());
1614 if(IsSignalJetInAcceptance(tmpJet))
1616 // ### SIGNAL JET ANALYSIS
1618 FillHistogram("hJetPt", tmpJet->Pt(), centralityPercentile);
1619 FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile);
1620 if(tmpJet->Phi() >= TMath::Pi())
1621 FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS_Phi2", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile);
1623 FillHistogram("hJetPtBgrdSubtractedKTImprovedCMS_Phi1", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS), centralityPercentile);
1625 FillHistogram("hJetPtBgrdSubtractedPP", GetCorrectedJetPt(tmpJet, backgroundPP), centralityPercentile);
1626 FillHistogram("hJetPtBgrdSubtractedExternal", GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal), centralityPercentile);
1627 FillHistogram("hJetPtSubtractedRhoKTImprovedCMS", tmpJet->Pt(), centralityPercentile, tmpJet->Pt() - GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMS));
1628 FillHistogram("hJetPtSubtractedRhoExternal", tmpJet->Pt(), centralityPercentile, tmpJet->Pt() - GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1629 FillHistogram("hJetPtSubtractedRhoPP", tmpJet->Pt(), centralityPercentile, tmpJet->Pt() - GetCorrectedJetPt(tmpJet, backgroundPP));
1630 FillHistogram("hDeltaPtExternalBgrdVsPt", GetDeltaPt(backgroundKTImprovedCMSExternal), GetCorrectedJetPt(tmpJet, backgroundKTImprovedCMSExternal));
1633 if(fAnalyzeDeprecatedBackgrounds)
1635 FillHistogram("hJetPtBgrdSubtractedTR", GetCorrectedJetPt(tmpJet, backgroundTRCone06), centralityPercentile);
1636 FillHistogram("hJetPtBgrdSubtractedKTPbPb", GetCorrectedJetPt(tmpJet, backgroundKTPbPb), centralityPercentile);
1637 FillHistogram("hJetPtBgrdSubtractedKTPbPbWithGhosts", GetCorrectedJetPt(tmpJet, backgroundKTPbPbWithGhosts), centralityPercentile);
1638 FillHistogram("hJetPtBgrdSubtractedKTCMS", GetCorrectedJetPt(tmpJet, backgroundKTCMS), centralityPercentile);
1639 FillHistogram("hJetPtBgrdSubtractedKTMean", GetCorrectedJetPt(tmpJet, backgroundKTMean), centralityPercentile);
1640 FillHistogram("hJetPtBgrdSubtractedKTTrackLike", GetCorrectedJetPt(tmpJet, backgroundKTTrackLike), centralityPercentile);
1643 // Jet profile analysis
1644 if(TMath::Abs(tmpJet->Eta()) <= 0.3)
1646 if(tmpJet->Pt()>=70.0)
1648 FillHistogram("hJetProfile70GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1649 FillHistogram("hJetProfile70GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1650 FillHistogram("hJetProfile70GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1651 FillHistogram("hJetProfile70GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1652 FillHistogram("hJetProfile70GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1653 FillHistogram("hJetProfile70GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1654 FillHistogram("hJetProfile70GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1655 FillHistogram("hJetProfile70GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1656 FillHistogram("hJetProfile70GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1657 FillHistogram("hJetProfile70GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1658 FillHistogram("hJetProfile70GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1659 FillHistogram("hJetProfile70GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1661 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=60.0)
1663 FillHistogram("hJetProfile60GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1664 FillHistogram("hJetProfile60GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1665 FillHistogram("hJetProfile60GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1666 FillHistogram("hJetProfile60GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1667 FillHistogram("hJetProfile60GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1668 FillHistogram("hJetProfile60GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1669 FillHistogram("hJetProfile60GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1670 FillHistogram("hJetProfile60GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1671 FillHistogram("hJetProfile60GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1672 FillHistogram("hJetProfile60GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1673 FillHistogram("hJetProfile60GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1674 FillHistogram("hJetProfile60GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1676 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=50.0)
1678 FillHistogram("hJetProfile50GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1679 FillHistogram("hJetProfile50GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1680 FillHistogram("hJetProfile50GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1681 FillHistogram("hJetProfile50GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1682 FillHistogram("hJetProfile50GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1683 FillHistogram("hJetProfile50GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1684 FillHistogram("hJetProfile50GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1685 FillHistogram("hJetProfile50GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1686 FillHistogram("hJetProfile50GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1687 FillHistogram("hJetProfile50GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1688 FillHistogram("hJetProfile50GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1689 FillHistogram("hJetProfile50GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1691 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=40.0)
1693 FillHistogram("hJetProfile40GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1694 FillHistogram("hJetProfile40GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1695 FillHistogram("hJetProfile40GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1696 FillHistogram("hJetProfile40GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1697 FillHistogram("hJetProfile40GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1698 FillHistogram("hJetProfile40GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1699 FillHistogram("hJetProfile40GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1700 FillHistogram("hJetProfile40GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1701 FillHistogram("hJetProfile40GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1702 FillHistogram("hJetProfile40GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1703 FillHistogram("hJetProfile40GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1704 FillHistogram("hJetProfile40GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1706 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=30.0)
1708 FillHistogram("hJetProfile30GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1709 FillHistogram("hJetProfile30GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1710 FillHistogram("hJetProfile30GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1711 FillHistogram("hJetProfile30GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1712 FillHistogram("hJetProfile30GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1713 FillHistogram("hJetProfile30GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1714 FillHistogram("hJetProfile30GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1715 FillHistogram("hJetProfile30GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1716 FillHistogram("hJetProfile30GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1717 FillHistogram("hJetProfile30GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1718 FillHistogram("hJetProfile30GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1719 FillHistogram("hJetProfile30GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1721 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=20.0)
1723 FillHistogram("hJetProfile20GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1724 FillHistogram("hJetProfile20GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1725 FillHistogram("hJetProfile20GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1726 FillHistogram("hJetProfile20GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1727 FillHistogram("hJetProfile20GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1728 FillHistogram("hJetProfile20GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1729 FillHistogram("hJetProfile20GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1730 FillHistogram("hJetProfile20GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1731 FillHistogram("hJetProfile20GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1732 FillHistogram("hJetProfile20GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1733 FillHistogram("hJetProfile20GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1734 FillHistogram("hJetProfile20GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1736 else if(GetCorrectedJetPt(tmpJet, backgroundJetProfile)>=10.0)
1738 FillHistogram("hJetProfile10GeV", 0.05-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.05, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1739 FillHistogram("hJetProfile10GeV", 0.10-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.10, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1740 FillHistogram("hJetProfile10GeV", 0.15-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.15, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1741 FillHistogram("hJetProfile10GeV", 0.20-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.20, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1742 FillHistogram("hJetProfile10GeV", 0.25-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.25, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1743 FillHistogram("hJetProfile10GeV", 0.30-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.30, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1744 FillHistogram("hJetProfile10GeV", 0.35-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.35, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1745 FillHistogram("hJetProfile10GeV", 0.40-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.40, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1746 FillHistogram("hJetProfile10GeV", 0.45-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.45, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1747 FillHistogram("hJetProfile10GeV", 0.50-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.50, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1748 FillHistogram("hJetProfile10GeV", 0.55-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.55, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1749 FillHistogram("hJetProfile10GeV", 0.60-0.05/2, (GetCorrectedConePt(tmpJet->Eta(), tmpJet->Phi(), 0.60, backgroundJetProfile))/GetCorrectedJetPt(tmpJet, backgroundJetProfile));
1752 FillHistogram("hJetPtVsConstituentCount", tmpJet->Pt(),tmpJet->GetNumberOfTracks());
1754 if((fAnalyzeQA) && (tmpJet->Pt() >= 5.0))
1756 Double_t lowestTrackPt = 1e99;
1757 Double_t highestTrackPt = 0.0;
1758 for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++)
1760 FillHistogram("hJetConstituentPt", tmpJet->TrackAt(j, fTrackArray)->Pt(), centralityPercentile);
1761 // Find the lowest pT of a track in the jet
1762 if (tmpJet->TrackAt(j, fTrackArray)->Pt() < lowestTrackPt)
1763 lowestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt();
1764 if (tmpJet->TrackAt(j, fTrackArray)->Pt() > highestTrackPt)
1765 highestTrackPt = tmpJet->TrackAt(j, fTrackArray)->Pt();
1767 FillHistogram("hJetArea", tmpJet->Area(), tmpJet->Pt());
1768 // Signal jet vs. signal jet - "Combinatorial"
1769 for (Int_t j = i+1; j<fNumberSignalJets; j++)
1770 FillHistogram("hJetDeltaPhi", GetDeltaPhi(tmpJet->Phi(), fSignalJets[j]->Phi()));
1772 FillHistogram("hJetPhiEta", tmpJet->Phi(),tmpJet->Eta());
1773 FillHistogram("hJetPtPhiEta", tmpJet->Phi(),tmpJet->Eta(),tmpJet->Pt());
1774 FillHistogram("hJetEta", tmpJet->Eta(), centralityPercentile);
1776 if(lowestTrackPt>=2.0)
1777 FillHistogram("hJetEta2GeVTracks", tmpJet->Eta(), centralityPercentile);
1778 if(lowestTrackPt>=4.0)
1779 FillHistogram("hJetEta4GeVTracks", tmpJet->Eta(), centralityPercentile);
1783 // Jet constituent mass analyses (for PYTHIA)
1784 if (fAnalyzeMassCorrelation)
1786 Double_t jetMass = 0.0;
1787 Int_t constituentCount = tmpJet->GetNumberOfTracks();
1788 Int_t electronCount = 0;
1789 Int_t pionCount = 0;
1790 Int_t protonCount = 0;
1791 Int_t kaonCount = 0;
1792 Int_t othersCount = 0;
1794 for(Int_t j=0; j<tmpJet->GetNumberOfTracks(); j++)
1796 AliVParticle* tmpParticle = tmpJet->TrackAt(j, fTrackArray);
1798 jetMass += tmpParticle->M();
1799 if(TMath::Abs(tmpParticle->PdgCode()) == 11) // electron, positron
1801 else if(TMath::Abs(tmpParticle->PdgCode()) == 211) // p-, p+
1803 else if(TMath::Abs(tmpParticle->PdgCode()) == 2212) // p, pbar
1805 else if(TMath::Abs(tmpParticle->PdgCode()) == 321) // kaon+,kaon-
1811 FillHistogram("hJetMassFromConstituents", jetMass);
1812 FillHistogram("hJetMass", tmpJet->M());
1814 FillHistogram("hJetPtVsMass", tmpJet->Pt(), jetMass);
1815 FillHistogram("hJetPtVsJetMass", tmpJet->Pt(), tmpJet->M());
1817 FillHistogram("hJetPtVsProtonCount", tmpJet->Pt(), protonCount/(static_cast<Double_t>(constituentCount)));
1818 FillHistogram("hJetPtVsPionCount", tmpJet->Pt(), pionCount/(static_cast<Double_t>(constituentCount)));
1819 FillHistogram("hJetPtVsKaonCount", tmpJet->Pt(), kaonCount/(static_cast<Double_t>(constituentCount)));
1820 FillHistogram("hJetPtVsElectronCount", tmpJet->Pt(), electronCount/(static_cast<Double_t>(constituentCount)));
1821 FillHistogram("hJetPtVsOthersCount", tmpJet->Pt(), othersCount/(static_cast<Double_t>(constituentCount)));
1822 FillHistogram("hJetConstituentProtonCount", protonCount);
1823 FillHistogram("hJetConstituentPionCount", pionCount);
1824 FillHistogram("hJetConstituentKaonCount", kaonCount);
1825 FillHistogram("hJetConstituentElectronCount", electronCount);
1826 FillHistogram("hJetConstituentOthersCount", othersCount);
1828 // Results for the "normal" jet (avoiding single particle jets)
1829 if((constituentCount>=6) && (constituentCount<=14))
1831 FillHistogram("hJetPtVsMass_6_14", tmpJet->Pt(), jetMass);
1832 FillHistogram("hJetPtVsJetMass_6_14", tmpJet->Pt(), tmpJet->M());
1834 FillHistogram("hJetPtVsProtonCount_6_14", tmpJet->Pt(), protonCount);
1835 FillHistogram("hJetPtVsPionCount_6_14", tmpJet->Pt(), pionCount);
1836 FillHistogram("hJetPtVsKaonCount_6_14", tmpJet->Pt(), kaonCount);
1837 FillHistogram("hJetPtVsElectronCount_6_14", tmpJet->Pt(), electronCount);
1838 FillHistogram("hJetPtVsOthersCount_6_14", tmpJet->Pt(), othersCount);
1839 FillHistogram("hJetConstituentProtonCount_6_14", protonCount);
1840 FillHistogram("hJetConstituentPionCount_6_14", pionCount);
1841 FillHistogram("hJetConstituentKaonCount_6_14", kaonCount);
1842 FillHistogram("hJetConstituentElectronCount_6_14", electronCount);
1843 FillHistogram("hJetConstituentOthersCount_6_14", othersCount);
1845 if((constituentCount>=2))
1847 FillHistogram("hJetPtVsMass_2_X", tmpJet->Pt(), jetMass);
1848 FillHistogram("hJetPtVsJetMass_2_X", tmpJet->Pt(), tmpJet->M());
1850 FillHistogram("hJetPtVsProtonCount_2_X", tmpJet->Pt(), protonCount);
1851 FillHistogram("hJetPtVsPionCount_2_X", tmpJet->Pt(), pionCount);
1852 FillHistogram("hJetPtVsKaonCount_2_X", tmpJet->Pt(), kaonCount);
1853 FillHistogram("hJetPtVsElectronCount_2_X", tmpJet->Pt(), electronCount);
1854 FillHistogram("hJetPtVsOthersCount_2_X", tmpJet->Pt(), othersCount);
1855 FillHistogram("hJetConstituentProtonCount_2_X", protonCount);
1856 FillHistogram("hJetConstituentPionCount_2_X", pionCount);
1857 FillHistogram("hJetConstituentKaonCount_2_X", kaonCount);
1858 FillHistogram("hJetConstituentElectronCount_2_X", electronCount);
1859 FillHistogram("hJetConstituentOthersCount_2_X", othersCount);
1861 if((constituentCount>=2) && (constituentCount<=7))
1863 FillHistogram("hJetPtVsMass_2_7", tmpJet->Pt(), jetMass);
1864 FillHistogram("hJetPtVsJetMass_2_7", tmpJet->Pt(), tmpJet->M());
1866 FillHistogram("hJetPtVsProtonCount_2_7", tmpJet->Pt(), protonCount);
1867 FillHistogram("hJetPtVsPionCount_2_7", tmpJet->Pt(), pionCount);
1868 FillHistogram("hJetPtVsKaonCount_2_7", tmpJet->Pt(), kaonCount);
1869 FillHistogram("hJetPtVsElectronCount_2_7", tmpJet->Pt(), electronCount);
1870 FillHistogram("hJetPtVsOthersCount_2_7", tmpJet->Pt(), othersCount);
1871 FillHistogram("hJetConstituentProtonCount_2_7", protonCount);
1872 FillHistogram("hJetConstituentPionCount_2_7", pionCount);
1873 FillHistogram("hJetConstituentKaonCount_2_7", kaonCount);
1874 FillHistogram("hJetConstituentElectronCount_2_7", electronCount);
1875 FillHistogram("hJetConstituentOthersCount_2_7", othersCount);
1881 // ### SOME JET PLOTS
1882 FillHistogram("hJetCountAll", fJetArray->GetEntries());
1883 FillHistogram("hJetCountAccepted", fNumberSignalJets);
1884 FillHistogram("hJetCount", fJetArray->GetEntries(), fNumberSignalJets);
1885 if (fFirstLeadingJet)
1887 FillHistogram("hLeadingJetPt", fFirstLeadingJet->Pt());
1888 FillHistogram("hCorrectedLeadingJetPt", GetCorrectedJetPt(fFirstLeadingJet,backgroundKTImprovedCMS));
1890 if (fSecondLeadingJet)
1892 FillHistogram("hSecondLeadingJetPt", fSecondLeadingJet->Pt());
1893 FillHistogram("hCorrectedSecondLeadingJetPt", GetCorrectedJetPt(fSecondLeadingJet,backgroundKTImprovedCMS));
1895 } //endif AnalyzeJets
1898 AliInfo("Calculate()::Jets done.");
1900 ////////////////////// NOTE: Background analysis
1902 if (fAnalyzeBackground)
1904 // Calculate background in centrality classes
1905 FillHistogram("hKTBackgroundImprovedCMS", backgroundKTImprovedCMS, centralityPercentile);
1906 FillHistogram("hKTBackgroundImprovedCMSExternal", backgroundKTImprovedCMSExternal, centralityPercentile);
1907 if(fFirstLeadingJet && (fFirstLeadingJet->Pt()>=20.))
1908 FillHistogram("hKTBackgroundImprovedCMSExternal20GeV", backgroundKTImprovedCMSExternal, centralityPercentile);
1911 FillHistogram("hPPBackground", backgroundPP, centralityPercentile);
1912 FillHistogram("hKTMeanBackgroundImprovedCMS", centralityPercentile, backgroundKTImprovedCMS);
1914 if(fAnalyzeDeprecatedBackgrounds)
1916 FillHistogram("hKTBackgroundPbPb", backgroundKTPbPb, centralityPercentile);
1917 FillHistogram("hKTBackgroundPbPbWithGhosts", backgroundKTPbPbWithGhosts, centralityPercentile);
1918 FillHistogram("hKTBackgroundCMS", backgroundKTCMS, centralityPercentile);
1919 FillHistogram("hKTBackgroundMean", backgroundKTMean, centralityPercentile);
1920 FillHistogram("hKTBackgroundTrackLike", backgroundKTTrackLike, centralityPercentile);
1922 FillHistogram("hTRBackgroundNoExcl", backgroundTRNoExcl, centralityPercentile);
1923 FillHistogram("hTRBackgroundCone02", backgroundTRCone02, centralityPercentile);
1924 FillHistogram("hTRBackgroundCone04", backgroundTRCone04, centralityPercentile);
1925 FillHistogram("hTRBackgroundCone06", backgroundTRCone06, centralityPercentile);
1926 FillHistogram("hTRBackgroundCone08", backgroundTRCone08, centralityPercentile);
1927 FillHistogram("hTRBackgroundExact", backgroundTRExact, centralityPercentile);
1929 // Calculate background profiles in terms of centrality
1930 FillHistogram("hKTMeanBackgroundPbPb", centralityPercentile, backgroundKTPbPb);
1931 FillHistogram("hKTMeanBackgroundPbPbWithGhosts", centralityPercentile, backgroundKTPbPbWithGhosts);
1932 FillHistogram("hKTMeanBackgroundCMS", centralityPercentile, backgroundKTCMS);
1933 FillHistogram("hKTMeanBackgroundMean", centralityPercentile, backgroundKTMean);
1934 FillHistogram("hKTMeanBackgroundTPC", centralityPercentile, backgroundKTTrackLike);
1935 FillHistogram("hTRMeanBackground", centralityPercentile, backgroundTRCone06);
1939 // Calculate the delta pt
1940 Double_t tmpDeltaPtNoBackground = GetDeltaPt(0.0);
1941 Double_t tmpDeltaPtKTImprovedCMS = GetDeltaPt(backgroundKTImprovedCMS);
1942 Double_t tmpDeltaPtExternalBgrd = GetDeltaPt(backgroundKTImprovedCMSExternal);
1945 Double_t tmpDeltaPtKTImprovedCMSPartialExclusion = 0.0;
1947 tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNcoll);
1949 tmpDeltaPtKTImprovedCMSPartialExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1951 Double_t tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = 0.0;
1952 if(fNumberSignalJets)
1953 tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0/fNumberSignalJets);
1955 tmpDeltaPtKTImprovedCMSPartialExclusion_Signal = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1957 Double_t tmpDeltaPtKTImprovedCMSFullExclusion = GetDeltaPt(backgroundKTImprovedCMS, 1.0);
1959 Double_t tmpDeltaPtKTPbPb = 0;
1960 Double_t tmpDeltaPtKTPbPbWithGhosts = 0;
1961 Double_t tmpDeltaPtKTCMS = 0;
1962 Double_t tmpDeltaPtKTMean = 0;
1963 Double_t tmpDeltaPtKTTrackLike = 0;
1964 Double_t tmpDeltaPtTR = 0;
1966 if(fAnalyzeDeprecatedBackgrounds)
1968 tmpDeltaPtKTPbPb = GetDeltaPt(backgroundKTPbPb);
1969 tmpDeltaPtKTPbPbWithGhosts = GetDeltaPt(backgroundKTPbPbWithGhosts);
1970 tmpDeltaPtKTCMS = GetDeltaPt(backgroundKTCMS);
1971 tmpDeltaPtKTMean = GetDeltaPt(backgroundKTMean);
1972 tmpDeltaPtKTTrackLike = GetDeltaPt(backgroundKTTrackLike);
1973 tmpDeltaPtTR = GetDeltaPt(backgroundTRCone06);
1976 // If valid, fill the delta pt histograms
1978 if(tmpDeltaPtExternalBgrd > -10000.0)
1979 FillHistogram("hDeltaPtExternalBgrd", tmpDeltaPtExternalBgrd, centralityPercentile);
1980 if(tmpDeltaPtKTImprovedCMS > -10000.0)
1981 FillHistogram("hDeltaPtKTImprovedCMS", tmpDeltaPtKTImprovedCMS, centralityPercentile);
1982 if(tmpDeltaPtKTImprovedCMSPartialExclusion > -10000.0)
1983 FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion", tmpDeltaPtKTImprovedCMSPartialExclusion, centralityPercentile);
1984 if(tmpDeltaPtKTImprovedCMSPartialExclusion_Signal > -10000.0)
1985 FillHistogram("hDeltaPtKTImprovedCMSPartialExclusion_Signal", tmpDeltaPtKTImprovedCMSPartialExclusion_Signal, centralityPercentile);
1986 if(tmpDeltaPtKTImprovedCMSFullExclusion > -10000.0)
1987 FillHistogram("hDeltaPtKTImprovedCMSFullExclusion", tmpDeltaPtKTImprovedCMSFullExclusion, centralityPercentile);
1989 if(tmpDeltaPtNoBackground > -10000.0)
1990 FillHistogram("hDeltaPtNoBackground", tmpDeltaPtNoBackground, centralityPercentile);
1993 if(fAnalyzeDeprecatedBackgrounds)
1995 if(tmpDeltaPtKTPbPb > -10000.0)
1996 FillHistogram("hDeltaPtKTPbPb", tmpDeltaPtKTPbPb, centralityPercentile);
1997 if(tmpDeltaPtKTPbPbWithGhosts > -10000.0)
1998 FillHistogram("hDeltaPtKTPbPbWithGhosts", tmpDeltaPtKTPbPbWithGhosts, centralityPercentile);
1999 if(tmpDeltaPtKTCMS > -10000.0)
2000 FillHistogram("hDeltaPtKTCMS", tmpDeltaPtKTCMS, centralityPercentile);
2001 if(tmpDeltaPtKTMean > -10000.0)
2002 FillHistogram("hDeltaPtKTMean", tmpDeltaPtKTMean, centralityPercentile);
2003 if(tmpDeltaPtKTTrackLike > -10000.0)
2004 FillHistogram("hDeltaPtKTTrackLike", tmpDeltaPtKTTrackLike, centralityPercentile);
2005 if(tmpDeltaPtTR > -10000.0)
2006 FillHistogram("hDeltaPtTR", tmpDeltaPtTR, centralityPercentile);
2011 AliInfo("Calculate()::Background done.");
2015 AliInfo("Calculate() done.");
2019 //________________________________________________________________________
2020 Bool_t AliAnalysisTaskChargedJetsPA::UserNotify()
2022 // Implemented Notify() to read the cross sections
2023 // and number of trials from pyxsec.root
2026 AliInfo("UserNotify started.");
2031 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
2032 TFile *currFile = tree->GetCurrentFile();
2034 TString file(currFile->GetName());
2036 if(file.Contains("root_archive.zip#")){
2037 Ssiz_t pos1 = file.Index("root_archive",12,TString::kExact);
2038 Ssiz_t pos = file.Index("#",1,pos1,TString::kExact);
2039 file.Replace(pos+1,20,"");
2042 // not an archive take the basename....
2043 file.ReplaceAll(gSystem->BaseName(file.Data()),"");
2046 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
2048 // next trial fetch the histgram file
2049 fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec_hists.root"));
2051 // not a severe condition but inciate that we have no information
2055 // find the tlist we want to be independtent of the name so use the Tkey
2056 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
2061 TList *list = dynamic_cast<TList*>(key->ReadObj());
2066 fCrossSection = ((TProfile*)list->FindObject("h1Xsec"))->GetBinContent(1);
2067 fTrials = ((TH1F*)list->FindObject("h1Trials"))->GetBinContent(1);
2070 } // no tree pyxsec.root
2072 TTree *xtree = (TTree*)fxsec->Get("Xsection");
2078 Double_t xsection = 0;
2079 xtree->SetBranchAddress("xsection",&xsection);
2080 xtree->SetBranchAddress("ntrials",&ntrials);
2083 fCrossSection = xsection;
2088 AliInfo("UserNotify ended.");
2094 //________________________________________________________________________
2095 inline Double_t AliAnalysisTaskChargedJetsPA::EtaToTheta(Double_t arg)
2096 {return 2.*atan(exp(-arg));}
2097 //________________________________________________________________________
2098 inline Double_t AliAnalysisTaskChargedJetsPA::ThetaToEta(Double_t arg)
2100 if ((arg > TMath::Pi()) || (arg < 0.0))
2102 AliError(Form("ThetaToEta got wrong input! (%f)", arg));
2105 return -log(tan(arg/2.));
2107 //________________________________________________________________________
2108 inline Double_t AliAnalysisTaskChargedJetsPA::GetDeltaPhi(Double_t phi1, Double_t phi2)
2109 {return min(TMath::Abs(phi1-phi2),TMath::TwoPi() - TMath::Abs(phi1-phi2));}
2111 //________________________________________________________________________
2112 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)
2114 const Int_t kTests = 1000;
2116 TRandom3 randomGen(0);
2118 // Loop over kTests-many tests
2119 for (Int_t i=0; i<kTests; i++)
2121 //Choose random position in rectangle for the tester
2122 Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax);
2123 Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax);
2125 //Check, if tester is in circle. If yes, increment circle counter.
2126 Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX)*(tmpTestX - cPosX) + (tmpTestY - cPosY)*(tmpTestY - cPosY) );
2127 if(tmpDistance < cRadius)
2132 return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests));
2135 //________________________________________________________________________
2136 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)
2139 const Int_t kTests = 1000;
2141 TRandom3 randomGen(0);
2143 // Loop over kTests-many tests
2144 for (Int_t i=0; i<kTests; i++)
2146 //Choose random position in rectangle for the tester
2147 Double_t tmpTestX = randomGen.Uniform(rPosXmin, rPosXmax);
2148 Double_t tmpTestY = randomGen.Uniform(rPosYmin, rPosYmax);
2150 //Check, if tester is in one of the circles. If yes, increment circle counter.
2151 for(Int_t j=0; j<numCircles; j++)
2153 Double_t tmpDistance = TMath::Sqrt( (tmpTestX - cPosX[j])*(tmpTestX - cPosX[j]) + (tmpTestY - cPosY[j])*(tmpTestY - cPosY[j]) );
2154 if(tmpDistance < cRadius)
2163 return (static_cast<Double_t>(hits)/static_cast<Double_t>(kTests));
2167 //________________________________________________________________________
2168 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x)
2170 TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key)));
2173 AliError(Form("Cannot find histogram <%s> ",key)) ;
2180 //________________________________________________________________________
2181 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y)
2183 TH1* tmpHist = static_cast<TH1*>(fOutputList->FindObject(GetHistoName(key)));
2186 AliError(Form("Cannot find histogram <%s> ",key));
2190 if (tmpHist->IsA()->GetBaseClass("TH1"))
2191 static_cast<TH1*>(tmpHist)->Fill(x,y); // Fill x with y
2192 else if (tmpHist->IsA()->GetBaseClass("TH2"))
2193 static_cast<TH2*>(tmpHist)->Fill(x,y); // Fill x,y with 1
2196 //________________________________________________________________________
2197 inline void AliAnalysisTaskChargedJetsPA::FillHistogram(const char * key, Double_t x, Double_t y, Double_t add)
2199 TH2* tmpHist = static_cast<TH2*>(fOutputList->FindObject(GetHistoName(key)));
2202 AliError(Form("Cannot find histogram <%s> ",key));
2206 tmpHist->Fill(x,y,add);
2208 //________________________________________________________________________
2209 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)
2211 T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax);
2213 tmpHist->GetXaxis()->SetTitle(xTitle);
2214 tmpHist->GetYaxis()->SetTitle(yTitle);
2215 tmpHist->SetOption(options);
2216 tmpHist->SetMarkerStyle(kFullCircle);
2219 fHistList->Add(tmpHist);
2225 //________________________________________________________________________
2226 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)
2228 T* tmpHist = new T(GetHistoName(name), GetHistoName(title), xBins, xMin, xMax, yBins, yMin, yMax);
2229 tmpHist->GetXaxis()->SetTitle(xTitle);
2230 tmpHist->GetYaxis()->SetTitle(yTitle);
2231 tmpHist->GetZaxis()->SetTitle(zTitle);
2232 tmpHist->SetOption(options);
2233 tmpHist->SetMarkerStyle(kFullCircle);
2236 fHistList->Add(tmpHist);
2242 //________________________________________________________________________
2243 void AliAnalysisTaskChargedJetsPA::Terminate(Option_t *)
2245 PostData(1, fOutputList);
2248 fOutputList = dynamic_cast<TList*> (GetOutputData(1)); // '1' refers to the output slot
2250 printf("ERROR: Output list not available\n");
2255 //________________________________________________________________________
2256 AliAnalysisTaskChargedJetsPA::~AliAnalysisTaskChargedJetsPA()
2258 // Destructor. Clean-up the output list, but not the histograms that are put inside
2259 // (the list is owner and will clean-up these histograms). Protect in PROOF case.
2260 if (fOutputList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
2265 //________________________________________________________________________
2266 void AliAnalysisTaskChargedJetsPA::UserCreateOutputObjects()
2268 // called once to create user defined output objects like histograms, plots etc.
2269 // and to put it on the output list.
2270 // Note: Saving to file with e.g. OpenFile(0) is must be before creating other objects.
2272 fRandom = new TRandom3(0);
2275 fOutputList = new TList();
2276 fOutputList->SetOwner(); // otherwise it produces leaks in merging
2278 PostData(1, fOutputList);
2281 //________________________________________________________________________
2282 void AliAnalysisTaskChargedJetsPA::UserExec(Option_t *)
2285 AliInfo("UserExec() started.");
2290 AliError("??? Event pointer == 0 ???");
2295 ExecOnce(); // Get tracks, jets, background from arrays if not already given + Init Histos
2297 Calculate(InputEvent());
2299 PostData(1, fOutputList);