]>
Commit | Line | Data |
---|---|---|
00514d01 | 1 | // $Id$ |
91f4b7c5 | 2 | // |
980821ba | 3 | // Jet finder analysis task (S.Aiola). |
91f4b7c5 | 4 | // |
5 | // | |
25283b37 | 6 | |
7 | #include <TChain.h> | |
8 | #include <TClonesArray.h> | |
9 | #include <TH1F.h> | |
10 | #include <TH2F.h> | |
11 | #include <TList.h> | |
12 | #include <TLorentzVector.h> | |
13 | #include <TParticle.h> | |
a55e4f1d | 14 | #include <TRandom3.h> |
25283b37 | 15 | |
16 | #include "AliAnalysisManager.h" | |
17 | #include "AliCentrality.h" | |
f0a0fd33 | 18 | #include "AliVCluster.h" |
55264f20 | 19 | #include "AliVTrack.h" |
25283b37 | 20 | #include "AliEmcalJet.h" |
21 | #include "AliVEventHandler.h" | |
55264f20 | 22 | #include "AliLog.h" |
25283b37 | 23 | |
00514d01 | 24 | #include "AliAnalysisTaskSAJF.h" |
25283b37 | 25 | |
00514d01 | 26 | ClassImp(AliAnalysisTaskSAJF) |
25283b37 | 27 | |
28 | //________________________________________________________________________ | |
00514d01 | 29 | AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() : |
30 | AliAnalysisTaskSE("AliAnalysisTaskSAJF"), | |
91f4b7c5 | 31 | fAnaType(kEMCAL), |
a55e4f1d | 32 | fMinEta(-1), |
33 | fMaxEta(1), | |
34 | fMinPhi(0), | |
35 | fMaxPhi(2 * TMath::Pi()), | |
36 | fJetRadius(0.4), | |
25283b37 | 37 | fOutput(0), |
38 | fTracksName("Tracks"), | |
39 | fCaloName("CaloClusters"), | |
40 | fJetsName("Jets"), | |
c554a987 | 41 | fKtJetsName("KtJets"), |
e82e282c | 42 | fTrgClusName("ClustersL1GAMMAFEE"), |
25283b37 | 43 | fTracks(0), |
44 | fCaloClusters(0), | |
45 | fJets(0), | |
c554a987 | 46 | fKtJets(0), |
e82e282c | 47 | fTrgClusters(0), |
f0a0fd33 | 48 | fCent(0), |
55264f20 | 49 | fCentBin(-1), |
f0a0fd33 | 50 | fHistCentrality(0), |
91f4b7c5 | 51 | fHistJetPhiEta(0), |
55264f20 | 52 | fHistRhoPartVSleadJetPt(0), |
53 | fHistMedKtVSRhoPart(0), | |
a55e4f1d | 54 | fHistRCPtVSRhoPart(0), |
55264f20 | 55 | fNbins(500), |
56 | fMinPt(0), | |
57 | fMaxPt(250) | |
25283b37 | 58 | { |
59 | // Default constructor. | |
f0a0fd33 | 60 | |
61 | for (Int_t i = 0; i < 4; i++) { | |
55264f20 | 62 | fHistJetsPt[i] = 0; |
f0a0fd33 | 63 | fHistJetsNEF[i] = 0; |
64 | fHistJetsZ[i] = 0; | |
55264f20 | 65 | fHistLeadingJetPt[i] = 0; |
66 | fHist2LeadingJetPt[i] = 0; | |
f0a0fd33 | 67 | fHistTracksPtLJ[i] = 0; |
55264f20 | 68 | fHistClusEtLJ[i] = 0; |
f0a0fd33 | 69 | fHistTracksPtBkg[i] = 0; |
55264f20 | 70 | fHistClusEtBkg[i] = 0; |
c554a987 | 71 | fHistBkgClusPhiCorr[i] = 0; |
72 | fHistBkgTracksPhiCorr[i] = 0; | |
73 | fHistBkgClusMeanRho[i] = 0; | |
74 | fHistBkgTracksMeanRho[i] = 0; | |
55264f20 | 75 | fHistBkgLJetPhiCorr[i] = 0; |
76 | fHistMedianPtKtJet[i] = 0; | |
a55e4f1d | 77 | fHistDeltaPtRC[i] = 0; |
78 | fHistDeltaPtRCExLJ[i] = 0; | |
79 | fHistRCPt[i] = 0; | |
80 | fHistRCPtExLJ[i] = 0; | |
f0a0fd33 | 81 | } |
91f4b7c5 | 82 | |
83 | // Output slot #1 writes into a TH1 container | |
84 | DefineOutput(1, TList::Class()); | |
25283b37 | 85 | } |
86 | ||
87 | //________________________________________________________________________ | |
00514d01 | 88 | AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) : |
89 | AliAnalysisTaskSE(name), | |
91f4b7c5 | 90 | fAnaType(kEMCAL), |
a55e4f1d | 91 | fMinEta(-1), |
92 | fMaxEta(1), | |
93 | fMinPhi(0), | |
94 | fMaxPhi(2 * TMath::Pi()), | |
95 | fJetRadius(0.4), | |
25283b37 | 96 | fOutput(0), |
97 | fTracksName("Tracks"), | |
98 | fCaloName("CaloClusters"), | |
99 | fJetsName("Jets"), | |
c554a987 | 100 | fKtJetsName("KtJets"), |
e82e282c | 101 | fTrgClusName("ClustersL1GAMMAFEE"), |
25283b37 | 102 | fTracks(0), |
103 | fCaloClusters(0), | |
104 | fJets(0), | |
c554a987 | 105 | fKtJets(0), |
e82e282c | 106 | fTrgClusters(0), |
f0a0fd33 | 107 | fCent(0), |
55264f20 | 108 | fCentBin(-1), |
f0a0fd33 | 109 | fHistCentrality(0), |
91f4b7c5 | 110 | fHistJetPhiEta(0), |
55264f20 | 111 | fHistRhoPartVSleadJetPt(0), |
112 | fHistMedKtVSRhoPart(0), | |
a55e4f1d | 113 | fHistRCPtVSRhoPart(0), |
55264f20 | 114 | fNbins(500), |
115 | fMinPt(0), | |
116 | fMaxPt(250) | |
25283b37 | 117 | { |
118 | // Standard constructor. | |
119 | ||
f0a0fd33 | 120 | for (Int_t i = 0; i < 4; i++) { |
55264f20 | 121 | fHistJetsPt[i] = 0; |
f0a0fd33 | 122 | fHistJetsNEF[i] = 0; |
123 | fHistJetsZ[i] = 0; | |
55264f20 | 124 | fHistLeadingJetPt[i] = 0; |
125 | fHist2LeadingJetPt[i] = 0; | |
f0a0fd33 | 126 | fHistTracksPtLJ[i] = 0; |
55264f20 | 127 | fHistClusEtLJ[i] = 0; |
f0a0fd33 | 128 | fHistTracksPtBkg[i] = 0; |
55264f20 | 129 | fHistClusEtBkg[i] = 0; |
c554a987 | 130 | fHistBkgClusPhiCorr[i] = 0; |
131 | fHistBkgTracksPhiCorr[i] = 0; | |
132 | fHistBkgClusMeanRho[i] = 0; | |
133 | fHistBkgTracksMeanRho[i] = 0; | |
55264f20 | 134 | fHistBkgLJetPhiCorr[i] = 0; |
135 | fHistMedianPtKtJet[i] = 0; | |
a55e4f1d | 136 | fHistDeltaPtRC[i] = 0; |
137 | fHistDeltaPtRCExLJ[i] = 0; | |
138 | fHistRCPt[i] = 0; | |
139 | fHistRCPtExLJ[i] = 0; | |
f0a0fd33 | 140 | } |
91f4b7c5 | 141 | |
142 | // Output slot #1 writes into a TH1 container | |
143 | DefineOutput(1, TList::Class()); | |
25283b37 | 144 | } |
145 | ||
146 | //________________________________________________________________________ | |
00514d01 | 147 | AliAnalysisTaskSAJF::~AliAnalysisTaskSAJF() |
25283b37 | 148 | { |
149 | // Destructor | |
150 | } | |
151 | ||
152 | //________________________________________________________________________ | |
00514d01 | 153 | void AliAnalysisTaskSAJF::UserCreateOutputObjects() |
25283b37 | 154 | { |
f0a0fd33 | 155 | // Create histograms |
25283b37 | 156 | |
157 | fOutput = new TList(); | |
158 | fOutput->SetOwner(); // IMPORTANT! | |
159 | ||
55264f20 | 160 | fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", fNbins, 0, 100); |
f0a0fd33 | 161 | fHistCentrality->GetXaxis()->SetTitle("Centrality (%)"); |
162 | fHistCentrality->GetYaxis()->SetTitle("counts"); | |
163 | fOutput->Add(fHistCentrality); | |
25283b37 | 164 | |
91f4b7c5 | 165 | fHistJetPhiEta = new TH2F("fHistJetPhiEta","Phi-Eta distribution of jets", 20, -2, 2, 32, 0, 6.4); |
166 | fHistJetPhiEta->GetXaxis()->SetTitle("Eta"); | |
167 | fHistJetPhiEta->GetYaxis()->SetTitle("Phi"); | |
168 | fOutput->Add(fHistJetPhiEta); | |
169 | ||
55264f20 | 170 | fHistRhoPartVSleadJetPt = new TH2F("fHistRhoPartVSleadJetPt","fHistRhoPartVSleadJetPt", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt); |
171 | fHistRhoPartVSleadJetPt->GetXaxis()->SetTitle("#rho [GeV]"); | |
172 | fHistRhoPartVSleadJetPt->GetYaxis()->SetTitle("Leading jet energy [GeV]"); | |
173 | fOutput->Add(fHistRhoPartVSleadJetPt); | |
c554a987 | 174 | |
55264f20 | 175 | fHistMedKtVSRhoPart = new TH2F("fHistMedKtVSRhoPart","fHistMedKtVSRhoPart", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt); |
176 | fHistMedKtVSRhoPart->GetXaxis()->SetTitle("median kt P_{T} [GeV]"); | |
177 | fHistMedKtVSRhoPart->GetYaxis()->SetTitle("#rho [GeV]"); | |
178 | fOutput->Add(fHistMedKtVSRhoPart); | |
a55e4f1d | 179 | |
180 | fHistRCPtVSRhoPart = new TH2F("fHistRCPtVSRhoPart","fHistRCPtVSRhoPart", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt); | |
181 | fHistRCPtVSRhoPart->GetXaxis()->SetTitle("rigid cone P_{T} [GeV]"); | |
182 | fHistRCPtVSRhoPart->GetYaxis()->SetTitle("#rho [GeV]"); | |
183 | fOutput->Add(fHistRCPtVSRhoPart); | |
c554a987 | 184 | |
f0a0fd33 | 185 | TString histname; |
186 | ||
187 | for (Int_t i = 0; i < 4; i++) { | |
55264f20 | 188 | histname = "fHistJetsPt_"; |
f0a0fd33 | 189 | histname += i; |
55264f20 | 190 | fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
191 | fHistJetsPt[i]->GetXaxis()->SetTitle("E [GeV]"); | |
192 | fHistJetsPt[i]->GetYaxis()->SetTitle("counts"); | |
193 | fOutput->Add(fHistJetsPt[i]); | |
25283b37 | 194 | |
f0a0fd33 | 195 | histname = "fHistJetsNEF_"; |
196 | histname += i; | |
55264f20 | 197 | fHistJetsNEF[i] = new TH1F(histname.Data(), histname.Data(), fNbins, 0, 1.2); |
f0a0fd33 | 198 | fHistJetsNEF[i]->GetXaxis()->SetTitle("NEF"); |
199 | fHistJetsNEF[i]->GetYaxis()->SetTitle("counts"); | |
200 | fOutput->Add(fHistJetsNEF[i]); | |
201 | ||
202 | histname = "fHistJetsZ_"; | |
203 | histname += i; | |
55264f20 | 204 | fHistJetsZ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, 0, 1.2); |
f0a0fd33 | 205 | fHistJetsZ[i]->GetXaxis()->SetTitle("Z"); |
206 | fHistJetsZ[i]->GetYaxis()->SetTitle("counts"); | |
207 | fOutput->Add(fHistJetsZ[i]); | |
208 | ||
55264f20 | 209 | histname = "fHistLeadingJetPt_"; |
f0a0fd33 | 210 | histname += i; |
55264f20 | 211 | fHistLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
212 | fHistLeadingJetPt[i]->GetXaxis()->SetTitle("P_{T} [GeV]"); | |
213 | fHistLeadingJetPt[i]->GetYaxis()->SetTitle("counts"); | |
214 | fOutput->Add(fHistLeadingJetPt[i]); | |
25283b37 | 215 | |
f0a0fd33 | 216 | histname = "fHistTracksPtLJ_"; |
217 | histname += i; | |
55264f20 | 218 | fHistTracksPtLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
f0a0fd33 | 219 | fHistTracksPtLJ[i]->GetXaxis()->SetTitle("P_{T} [GeV/c]"); |
220 | fHistTracksPtLJ[i]->GetYaxis()->SetTitle("counts"); | |
221 | fOutput->Add(fHistTracksPtLJ[i]); | |
222 | ||
55264f20 | 223 | histname = "fHistClusEtLJ_"; |
f0a0fd33 | 224 | histname += i; |
55264f20 | 225 | fHistClusEtLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
226 | fHistClusEtLJ[i]->GetXaxis()->SetTitle("E_{T} [GeV]"); | |
227 | fHistClusEtLJ[i]->GetYaxis()->SetTitle("counts"); | |
228 | fOutput->Add(fHistClusEtLJ[i]); | |
f0a0fd33 | 229 | |
230 | histname = "fHistTracksPtBkg_"; | |
231 | histname += i; | |
55264f20 | 232 | fHistTracksPtBkg[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
f0a0fd33 | 233 | fHistTracksPtBkg[i]->GetXaxis()->SetTitle("P_{T} [GeV/c]"); |
234 | fHistTracksPtBkg[i]->GetYaxis()->SetTitle("counts"); | |
235 | fOutput->Add(fHistTracksPtBkg[i]); | |
236 | ||
55264f20 | 237 | histname = "fHistClusEtBkg_"; |
f0a0fd33 | 238 | histname += i; |
55264f20 | 239 | fHistClusEtBkg[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
240 | fHistClusEtBkg[i]->GetXaxis()->SetTitle("E_{T} [GeV]"); | |
241 | fHistClusEtBkg[i]->GetYaxis()->SetTitle("counts"); | |
242 | fOutput->Add(fHistClusEtBkg[i]); | |
c554a987 | 243 | |
244 | histname = "fHistBkgClusPhiCorr_"; | |
245 | histname += i; | |
246 | fHistBkgClusPhiCorr[i] = new TH1F(histname.Data(), histname.Data(), 128, -1.6, 4.8); | |
247 | fHistBkgClusPhiCorr[i]->GetXaxis()->SetTitle("#Delta#phi"); | |
248 | fHistBkgClusPhiCorr[i]->GetYaxis()->SetTitle("counts"); | |
249 | fOutput->Add(fHistBkgClusPhiCorr[i]); | |
250 | ||
251 | histname = "fHistBkgTracksPhiCorr_"; | |
252 | histname += i; | |
253 | fHistBkgTracksPhiCorr[i] = new TH1F(histname.Data(), histname.Data(), 128, -1.6, 4.8); | |
254 | fHistBkgTracksPhiCorr[i]->GetXaxis()->SetTitle("#Delta#phi"); | |
255 | fHistBkgTracksPhiCorr[i]->GetYaxis()->SetTitle("counts"); | |
256 | fOutput->Add(fHistBkgTracksPhiCorr[i]); | |
257 | ||
258 | histname = "fHistBkgClusMeanRho_"; | |
259 | histname += i; | |
55264f20 | 260 | fHistBkgClusMeanRho[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
261 | fHistBkgClusMeanRho[i]->GetXaxis()->SetTitle("#rho [GeV]"); | |
c554a987 | 262 | fHistBkgClusMeanRho[i]->GetYaxis()->SetTitle("counts"); |
263 | fOutput->Add(fHistBkgClusMeanRho[i]); | |
264 | ||
265 | histname = "fHistBkgTracksMeanRho_"; | |
266 | histname += i; | |
55264f20 | 267 | fHistBkgTracksMeanRho[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
268 | fHistBkgTracksMeanRho[i]->GetXaxis()->SetTitle("#rho [GeV/c]"); | |
c554a987 | 269 | fHistBkgTracksMeanRho[i]->GetYaxis()->SetTitle("counts"); |
270 | fOutput->Add(fHistBkgTracksMeanRho[i]); | |
271 | ||
55264f20 | 272 | histname = "fHistBkgLJetPhiCorr_"; |
c554a987 | 273 | histname += i; |
55264f20 | 274 | fHistBkgLJetPhiCorr[i] = new TH1F(histname.Data(), histname.Data(), 128, -1.6, 4.8); |
275 | fHistBkgLJetPhiCorr[i]->GetXaxis()->SetTitle("#Delta#phi"); | |
276 | fHistBkgLJetPhiCorr[i]->GetYaxis()->SetTitle("counts"); | |
277 | fOutput->Add(fHistBkgLJetPhiCorr[i]); | |
c554a987 | 278 | |
55264f20 | 279 | histname = "fHistMedianPtKtJet_"; |
c554a987 | 280 | histname += i; |
55264f20 | 281 | fHistMedianPtKtJet[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
282 | fHistMedianPtKtJet[i]->GetXaxis()->SetTitle("P_{T} [GeV/c]"); | |
283 | fHistMedianPtKtJet[i]->GetYaxis()->SetTitle("counts"); | |
284 | fOutput->Add(fHistMedianPtKtJet[i]); | |
a55e4f1d | 285 | |
286 | histname = "fHistDeltaPtRC_"; | |
287 | histname += i; | |
288 | fHistDeltaPtRC[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2, fMaxPt / 2); | |
289 | fHistDeltaPtRC[i]->GetXaxis()->SetTitle("#deltaP_{T} [GeV/c]"); | |
290 | fHistDeltaPtRC[i]->GetYaxis()->SetTitle("counts"); | |
291 | fOutput->Add(fHistDeltaPtRC[i]); | |
292 | ||
293 | histname = "fHistDeltaPtRCExLJ_"; | |
294 | histname += i; | |
295 | fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2, fMaxPt / 2); | |
296 | fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#deltaP_{T} [GeV/c]"); | |
297 | fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts"); | |
298 | fOutput->Add(fHistDeltaPtRCExLJ[i]); | |
299 | ||
300 | histname = "fHistRCPt_"; | |
301 | histname += i; | |
302 | fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); | |
303 | fHistRCPt[i]->GetXaxis()->SetTitle("rigid cone P_{T} [GeV/c]"); | |
304 | fHistRCPt[i]->GetYaxis()->SetTitle("counts"); | |
305 | fOutput->Add(fHistRCPt[i]); | |
306 | ||
307 | histname = "fHistRCPtExLJ_"; | |
308 | histname += i; | |
309 | fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); | |
310 | fHistRCPtExLJ[i]->GetXaxis()->SetTitle("rigid cone P_{T} [GeV/c]"); | |
311 | fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts"); | |
312 | fOutput->Add(fHistRCPtExLJ[i]); | |
e82e282c | 313 | } |
314 | ||
25283b37 | 315 | PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram |
316 | } | |
317 | ||
55264f20 | 318 | //________________________________________________________________________ |
00514d01 | 319 | void AliAnalysisTaskSAJF::RetrieveEventObjects() |
25283b37 | 320 | { |
321 | fCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fCaloName)); | |
f0a0fd33 | 322 | if (!fCaloClusters) { |
323 | AliWarning(Form("Could not retrieve clusters!")); | |
324 | } | |
25283b37 | 325 | |
f0a0fd33 | 326 | fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName)); |
25283b37 | 327 | if (!fTracks) { |
e82e282c | 328 | AliWarning(Form("Could not retrieve tracks!")); |
25283b37 | 329 | } |
f0a0fd33 | 330 | |
331 | fJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName)); | |
25283b37 | 332 | if (!fJets) { |
e82e282c | 333 | AliWarning(Form("Could not retrieve jets!")); |
334 | } | |
f0a0fd33 | 335 | |
c554a987 | 336 | if (strcmp(fKtJetsName,"")) { |
337 | fKtJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fKtJetsName)); | |
338 | if (!fKtJets) { | |
339 | AliWarning(Form("Could not retrieve Kt jets!")); | |
340 | } | |
341 | } | |
342 | ||
f0a0fd33 | 343 | if (strcmp(fTrgClusName,"")) { |
344 | fTrgClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrgClusName)); | |
345 | if (!fTrgClusters) { | |
346 | AliWarning(Form("Could not retrieve trigger clusters!")); | |
347 | } | |
25283b37 | 348 | } |
f0a0fd33 | 349 | |
350 | fCent = InputEvent()->GetCentrality(); | |
55264f20 | 351 | if (fCent) { |
352 | Float_t cent = fCent->GetCentralityPercentile("V0M"); | |
353 | if (cent >= 0 && cent < 10) fCentBin = 0; | |
354 | else if (cent >= 10 && cent < 30) fCentBin = 1; | |
355 | else if (cent >= 30 && cent < 50) fCentBin = 2; | |
356 | else if (cent >= 50 && cent <= 100) fCentBin = 3; | |
357 | else { | |
a55e4f1d | 358 | AliWarning(Form("Negative centrality: %f. Assuming 99", cent)); |
55264f20 | 359 | fCentBin = 3; |
360 | } | |
361 | } | |
362 | else { | |
363 | AliWarning(Form("Could not retrieve centrality information! Assuming 99")); | |
364 | fCentBin = 3; | |
c554a987 | 365 | } |
25283b37 | 366 | } |
367 | ||
55264f20 | 368 | //________________________________________________________________________ |
00514d01 | 369 | AliVTrack* AliAnalysisTaskSAJF::GetTrack(const Int_t i) const |
25283b37 | 370 | { |
e82e282c | 371 | if (fTracks) |
372 | return dynamic_cast<AliVTrack*>(fTracks->At(i)); | |
373 | else | |
374 | return 0; | |
25283b37 | 375 | } |
376 | ||
55264f20 | 377 | //________________________________________________________________________ |
00514d01 | 378 | Int_t AliAnalysisTaskSAJF::GetNumberOfTracks() const |
25283b37 | 379 | { |
e82e282c | 380 | if (fTracks) |
381 | return fTracks->GetEntriesFast(); | |
382 | else | |
383 | return 0; | |
25283b37 | 384 | } |
385 | ||
55264f20 | 386 | //________________________________________________________________________ |
00514d01 | 387 | AliVCluster* AliAnalysisTaskSAJF::GetCaloCluster(const Int_t i) const |
e82e282c | 388 | { |
389 | if (fCaloClusters) | |
390 | return dynamic_cast<AliVCluster*>(fCaloClusters->At(i)); | |
391 | else | |
392 | return 0; | |
25283b37 | 393 | } |
394 | ||
55264f20 | 395 | //________________________________________________________________________ |
00514d01 | 396 | Int_t AliAnalysisTaskSAJF::GetNumberOfCaloClusters() const |
e82e282c | 397 | { |
398 | if (fCaloClusters) | |
399 | return fCaloClusters->GetEntriesFast(); | |
400 | else | |
401 | return 0; | |
25283b37 | 402 | } |
403 | ||
55264f20 | 404 | //________________________________________________________________________ |
00514d01 | 405 | AliEmcalJet* AliAnalysisTaskSAJF::GetJet(const Int_t i) const |
25283b37 | 406 | { |
e82e282c | 407 | if (fJets) |
408 | return dynamic_cast<AliEmcalJet*>(fJets->At(i)); | |
409 | else | |
410 | return 0; | |
25283b37 | 411 | } |
412 | ||
55264f20 | 413 | //________________________________________________________________________ |
00514d01 | 414 | Int_t AliAnalysisTaskSAJF::GetNumberOfJets() const |
25283b37 | 415 | { |
e82e282c | 416 | if (fJets) |
417 | return fJets->GetEntriesFast(); | |
418 | else | |
419 | return 0; | |
420 | } | |
421 | ||
55264f20 | 422 | //________________________________________________________________________ |
c554a987 | 423 | AliEmcalJet* AliAnalysisTaskSAJF::GetKtJet(const Int_t i) const |
424 | { | |
425 | if (fKtJets) | |
426 | return dynamic_cast<AliEmcalJet*>(fKtJets->At(i)); | |
427 | else | |
428 | return 0; | |
429 | } | |
430 | ||
55264f20 | 431 | //________________________________________________________________________ |
c554a987 | 432 | Int_t AliAnalysisTaskSAJF::GetNumberOfKtJets() const |
433 | { | |
434 | if (fKtJets) | |
435 | return fKtJets->GetEntriesFast(); | |
436 | else | |
437 | return 0; | |
438 | } | |
439 | ||
55264f20 | 440 | //________________________________________________________________________ |
00514d01 | 441 | AliVCluster* AliAnalysisTaskSAJF::GetTrgCluster(const Int_t i) const |
e82e282c | 442 | { |
443 | if (fTrgClusters) | |
444 | return dynamic_cast<AliVCluster*>(fTrgClusters->At(i)); | |
445 | else | |
446 | return 0; | |
447 | } | |
448 | ||
55264f20 | 449 | //________________________________________________________________________ |
00514d01 | 450 | Int_t AliAnalysisTaskSAJF::GetNumberOfTrgClusters() const |
e82e282c | 451 | { |
452 | if (fTrgClusters) | |
453 | return fTrgClusters->GetEntriesFast(); | |
454 | else | |
455 | return 0; | |
25283b37 | 456 | } |
457 | ||
55264f20 | 458 | //________________________________________________________________________ |
00514d01 | 459 | void AliAnalysisTaskSAJF::FillHistograms() |
25283b37 | 460 | { |
a55e4f1d | 461 | Float_t A = fJetRadius * fJetRadius * TMath::Pi(); |
462 | ||
91f4b7c5 | 463 | Float_t cent = 100; |
55264f20 | 464 | |
91f4b7c5 | 465 | if (fCent) |
466 | cent = fCent->GetCentralityPercentile("V0M"); | |
25283b37 | 467 | |
f0a0fd33 | 468 | fHistCentrality->Fill(cent); |
e82e282c | 469 | |
55264f20 | 470 | Int_t maxJetIndex = -1; |
471 | Int_t max2JetIndex = -1; | |
25283b37 | 472 | |
55264f20 | 473 | DoJetLoop(maxJetIndex, max2JetIndex); |
474 | ||
475 | if (maxJetIndex < 0) | |
476 | return; | |
c554a987 | 477 | |
55264f20 | 478 | AliEmcalJet* jet = GetJet(maxJetIndex); |
479 | if (!jet) | |
480 | return; | |
c554a987 | 481 | |
55264f20 | 482 | fHistLeadingJetPt[fCentBin]->Fill(jet->Pt()); |
483 | jet->SortConstituents(); | |
484 | ||
485 | AliEmcalJet* jet2 = 0; | |
486 | if (max2JetIndex >= 0) | |
487 | jet2 = GetJet(max2JetIndex); | |
488 | ||
489 | if (jet2) { | |
490 | fHistLeadingJetPt[fCentBin]->Fill(jet2->Pt()); | |
491 | jet2->SortConstituents(); | |
c554a987 | 492 | } |
493 | ||
55264f20 | 494 | Float_t rhoKt = DoKtJetLoop(); |
495 | fHistMedianPtKtJet[fCentBin]->Fill(rhoKt); | |
496 | ||
497 | Float_t rhoTracks = DoTrackLoop(maxJetIndex, max2JetIndex); | |
498 | fHistBkgTracksMeanRho[fCentBin]->Fill(rhoTracks); | |
499 | ||
500 | Float_t rhoClus = 0; | |
501 | if (fAnaType == kEMCAL || fAnaType == kEMCALFiducial) | |
502 | rhoClus = DoClusterLoop(maxJetIndex, max2JetIndex); | |
503 | ||
504 | fHistBkgClusMeanRho[fCentBin]->Fill(rhoClus); | |
505 | ||
a55e4f1d | 506 | fHistRhoPartVSleadJetPt->Fill(A * (rhoClus + rhoTracks), jet->Pt()); |
55264f20 | 507 | |
508 | fHistMedKtVSRhoPart->Fill(rhoKt, rhoClus + rhoTracks); | |
a55e4f1d | 509 | |
510 | Int_t nRCs = GetArea() / A - 1; | |
511 | ||
512 | for (Int_t i = 0; i < nRCs; i++) { | |
513 | Float_t RCpt = GetRigidConePt(0); | |
514 | Float_t RCptExLJ = GetRigidConePt(jet); | |
515 | ||
516 | fHistDeltaPtRC[fCentBin]->Fill(RCpt - A * rhoKt); | |
517 | fHistDeltaPtRCExLJ[fCentBin]->Fill(RCptExLJ - A * rhoKt); | |
518 | ||
519 | fHistRCPt[fCentBin]->Fill(RCpt / A); | |
520 | fHistRCPtExLJ[fCentBin]->Fill(RCptExLJ / A); | |
521 | fHistRCPtVSRhoPart->Fill(RCptExLJ / A, rhoClus + rhoTracks); | |
522 | } | |
55264f20 | 523 | } |
524 | ||
525 | //________________________________________________________________________ | |
526 | void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex) | |
527 | { | |
528 | Double_t vertex[3] = {0, 0, 0}; | |
529 | InputEvent()->GetPrimaryVertex()->GetXYZ(vertex); | |
530 | ||
531 | Int_t njets = GetNumberOfJets(); | |
532 | //cout << "num of jets = " << njets << endl; | |
533 | ||
534 | Float_t maxJetPt = 0; | |
535 | Float_t max2JetPt = 0; | |
25283b37 | 536 | for (Int_t ij = 0; ij < njets; ij++) { |
f0a0fd33 | 537 | |
25283b37 | 538 | AliEmcalJet* jet = GetJet(ij); |
f0a0fd33 | 539 | |
25283b37 | 540 | if (!jet) { |
a55e4f1d | 541 | AliError(Form("Could not receive jet %d", ij)); |
25283b37 | 542 | continue; |
543 | } | |
544 | ||
55264f20 | 545 | if (jet->Pt() <= 0) |
f0a0fd33 | 546 | continue; |
547 | ||
91f4b7c5 | 548 | if (!AcceptJet(jet)) |
549 | continue; | |
550 | ||
551 | fHistJetPhiEta->Fill(jet->Eta(), jet->Phi()); | |
55264f20 | 552 | fHistJetsPt[fCentBin]->Fill(jet->Pt()); |
553 | fHistJetsNEF[fCentBin]->Fill(jet->NEF()); | |
f0a0fd33 | 554 | |
35789a2d | 555 | for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) { |
a55e4f1d | 556 | AliVTrack *track = jet->TrackAt(it, fTracks); |
35789a2d | 557 | if (track) |
55264f20 | 558 | fHistJetsZ[fCentBin]->Fill(track->Pt() / jet->Pt()); |
35789a2d | 559 | } |
a55e4f1d | 560 | |
35789a2d | 561 | for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) { |
a55e4f1d | 562 | AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters); |
55264f20 | 563 | |
564 | if (cluster) { | |
565 | TLorentzVector nPart; | |
566 | cluster->GetMomentum(nPart, vertex); | |
567 | fHistJetsZ[fCentBin]->Fill(nPart.Et() / jet->Pt()); | |
568 | } | |
f0a0fd33 | 569 | } |
570 | ||
55264f20 | 571 | if (maxJetPt < jet->Pt()) { |
572 | max2JetPt = maxJetPt; | |
c554a987 | 573 | max2JetIndex = maxJetIndex; |
55264f20 | 574 | maxJetPt = jet->Pt(); |
f0a0fd33 | 575 | maxJetIndex = ij; |
35789a2d | 576 | } |
55264f20 | 577 | else if (max2JetPt < jet->Pt()) { |
578 | max2JetPt = jet->Pt(); | |
c554a987 | 579 | max2JetIndex = ij; |
580 | } | |
25283b37 | 581 | } //jet loop |
55264f20 | 582 | } |
e82e282c | 583 | |
55264f20 | 584 | //________________________________________________________________________ |
585 | Float_t AliAnalysisTaskSAJF::DoKtJetLoop() | |
586 | { | |
587 | Float_t ktJetsMedian = 0; | |
588 | Int_t nktjets = GetNumberOfKtJets(); | |
f0a0fd33 | 589 | |
55264f20 | 590 | //cout << "num of ktjets = " << nktjets << endl; |
591 | ||
592 | Int_t NoOfZeroJets = 0; | |
593 | if (nktjets > 0) { | |
594 | ||
595 | TArrayF ktJets(nktjets); | |
596 | for (Int_t ij = 0; ij < nktjets; ij++) { | |
597 | ||
598 | AliEmcalJet* jet = GetKtJet(ij); | |
599 | ||
600 | if (!jet) { | |
a55e4f1d | 601 | AliError(Form("Could not receive jet %d", ij)); |
55264f20 | 602 | continue; |
603 | } | |
604 | ||
605 | if (jet->Pt() <= 0) { | |
606 | NoOfZeroJets++; | |
607 | continue; | |
608 | } | |
609 | ||
610 | if (!AcceptJet(jet)) { | |
611 | NoOfZeroJets++; | |
612 | continue; | |
613 | } | |
c554a987 | 614 | |
55264f20 | 615 | Float_t rho = jet->Pt() / jet->Area(); |
616 | Int_t i = nktjets - 1; | |
617 | while (rho < ktJets[i] && i > 0) | |
618 | i--; | |
619 | memmove(ktJets.GetArray() + nktjets - ij - 1, ktJets.GetArray() + nktjets - ij, (ij + i - nktjets + 1) * sizeof(Float_t)); | |
620 | ktJets[i] = rho; | |
621 | } //kt jet loop | |
622 | ||
623 | nktjets -= NoOfZeroJets; | |
624 | memmove(ktJets.GetArray(), ktJets.GetArray() + NoOfZeroJets, nktjets * sizeof(Float_t)); | |
625 | ||
626 | if (nktjets < 3) return 0; | |
627 | ||
628 | nktjets -= 2; | |
629 | if (nktjets % 2) | |
630 | ktJetsMedian = ktJets[nktjets / 2]; | |
631 | else | |
632 | ktJetsMedian = (ktJets[nktjets / 2] + ktJets[nktjets / 2 - 1]) / 2; | |
633 | } | |
634 | ||
635 | return ktJetsMedian; | |
636 | } | |
637 | ||
638 | //________________________________________________________________________ | |
639 | Float_t AliAnalysisTaskSAJF::DoTrackLoop(Int_t maxJetIndex, Int_t max2JetIndex) | |
640 | { | |
641 | AliEmcalJet* jet = GetJet(maxJetIndex); | |
642 | AliEmcalJet* jet2 = 0; | |
643 | if (max2JetIndex >= 0) | |
644 | jet2 = GetJet(max2JetIndex); | |
c554a987 | 645 | |
c554a987 | 646 | Float_t rhoTracks = 0; |
647 | Int_t ntracks = GetNumberOfTracks(); | |
648 | for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) { | |
649 | AliVTrack* track = GetTrack(iTracks); | |
650 | if(!track) { | |
651 | AliError(Form("ERROR: Could not retrieve track %d",iTracks)); | |
652 | continue; | |
653 | } | |
654 | ||
655 | if (!AcceptTrack(track)) continue; | |
656 | ||
657 | if (IsJetTrack(jet, iTracks)) { | |
55264f20 | 658 | fHistTracksPtLJ[fCentBin]->Fill(track->Pt()); |
c554a987 | 659 | } |
660 | else if (!jet2 || !IsJetTrack(jet2, iTracks)) { | |
55264f20 | 661 | fHistTracksPtBkg[fCentBin]->Fill(track->Pt()); |
c554a987 | 662 | rhoTracks += track->Pt(); |
663 | ||
664 | Float_t dphijet = jet->Phi() - track->Phi(); | |
665 | if (dphijet < -1.6) dphijet += TMath::Pi() * 2; | |
666 | if (dphijet > 4.8) dphijet -= TMath::Pi() * 2; | |
55264f20 | 667 | fHistBkgLJetPhiCorr[fCentBin]->Fill(dphijet); |
c554a987 | 668 | |
669 | for(Int_t it2 = iTracks+1; it2 < ntracks; it2++) { | |
670 | AliVTrack* track2 = GetTrack(it2); | |
671 | if(!track2) { | |
672 | AliError(Form("ERROR: Could not retrieve track %d", it2)); | |
673 | continue; | |
674 | } | |
675 | ||
676 | if (!AcceptTrack(track2)) continue; | |
677 | ||
678 | if (IsJetTrack(jet, it2)) continue; | |
679 | ||
680 | if (jet2 && IsJetTrack(jet2, it2)) continue; | |
681 | ||
682 | Float_t dphi = track->Phi() - track2->Phi(); | |
683 | if (dphi < -1.6) dphi += TMath::Pi() * 2; | |
684 | if (dphi > 4.8) dphi -= TMath::Pi() * 2; | |
55264f20 | 685 | fHistBkgTracksPhiCorr[fCentBin]->Fill(dphi); |
c554a987 | 686 | } // second track loop |
687 | } | |
55264f20 | 688 | } |
c554a987 | 689 | rhoTracks /= GetArea(); |
55264f20 | 690 | return rhoTracks; |
691 | } | |
c554a987 | 692 | |
55264f20 | 693 | //________________________________________________________________________ |
694 | Float_t AliAnalysisTaskSAJF::DoClusterLoop(Int_t maxJetIndex, Int_t max2JetIndex) | |
695 | { | |
696 | Double_t vertex[3] = {0, 0, 0}; | |
697 | InputEvent()->GetPrimaryVertex()->GetXYZ(vertex); | |
698 | ||
699 | AliEmcalJet* jet = GetJet(maxJetIndex); | |
700 | AliEmcalJet* jet2 = 0; | |
701 | if (max2JetIndex >= 0) | |
702 | jet2 = GetJet(max2JetIndex); | |
c554a987 | 703 | |
c554a987 | 704 | Float_t rhoClus = 0; |
f0a0fd33 | 705 | Int_t nclusters = GetNumberOfCaloClusters(); |
706 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
707 | AliVCluster* cluster = GetCaloCluster(iClusters); | |
e82e282c | 708 | if (!cluster) { |
a55e4f1d | 709 | AliError(Form("Could not receive cluster %d", iClusters)); |
e82e282c | 710 | continue; |
711 | } | |
712 | ||
713 | if (!(cluster->IsEMCAL())) continue; | |
f0a0fd33 | 714 | |
55264f20 | 715 | TLorentzVector nPart; |
716 | cluster->GetMomentum(nPart, vertex); | |
717 | ||
c554a987 | 718 | if (IsJetCluster(jet, iClusters)) { |
55264f20 | 719 | fHistClusEtLJ[fCentBin]->Fill(nPart.Et()); |
f0a0fd33 | 720 | } |
c554a987 | 721 | else if (!jet2 || !IsJetCluster(jet2, iClusters)) { |
55264f20 | 722 | fHistClusEtBkg[fCentBin]->Fill(nPart.Et()); |
723 | rhoClus += nPart.Et(); | |
c554a987 | 724 | |
725 | Float_t pos1[3]; | |
726 | cluster->GetPosition(pos1); | |
727 | TVector3 clusVec1(pos1); | |
728 | ||
729 | Float_t dphijet = jet->Phi() - clusVec1.Phi(); | |
730 | if (dphijet < -1.6) dphijet += TMath::Pi() * 2; | |
731 | if (dphijet > 4.8) dphijet -= TMath::Pi() * 2; | |
55264f20 | 732 | fHistBkgLJetPhiCorr[fCentBin]->Fill(dphijet); |
c554a987 | 733 | |
734 | for(Int_t ic2 = iClusters+1; ic2 < nclusters; ic2++) { | |
735 | AliVCluster* cluster2 = GetCaloCluster(ic2); | |
736 | if (!cluster2) { | |
a55e4f1d | 737 | AliError(Form("Could not receive cluster %d", ic2)); |
c554a987 | 738 | continue; |
739 | } | |
740 | ||
741 | if (!(cluster2->IsEMCAL())) continue; | |
742 | ||
743 | if (IsJetCluster(jet, ic2)) continue; | |
744 | ||
745 | if (jet2 && IsJetCluster(jet2, ic2)) continue; | |
746 | ||
747 | Float_t pos2[3]; | |
748 | cluster2->GetPosition(pos2); | |
749 | TVector3 clusVec2(pos2); | |
750 | ||
751 | Float_t dphi = clusVec1.Phi() - clusVec2.Phi(); | |
752 | if (dphi < -1.6) dphi += TMath::Pi() * 2; | |
753 | if (dphi > 4.8) dphi -= TMath::Pi() * 2; | |
55264f20 | 754 | fHistBkgClusPhiCorr[fCentBin]->Fill(dphi); |
c554a987 | 755 | } |
f0a0fd33 | 756 | } |
e82e282c | 757 | } //cluster loop |
c554a987 | 758 | rhoClus /= GetArea(); |
55264f20 | 759 | return rhoClus; |
c554a987 | 760 | } |
761 | ||
762 | //________________________________________________________________________ | |
a55e4f1d | 763 | void AliAnalysisTaskSAJF::Init() |
c554a987 | 764 | { |
765 | if (fAnaType == kFullAcceptance) { | |
a55e4f1d | 766 | fMinEta = -1; |
767 | fMaxEta = 1; | |
768 | fMinPhi = 0; | |
769 | fMaxPhi = 2 * TMath::Pi(); | |
c554a987 | 770 | } |
a55e4f1d | 771 | else if (fAnaType == kEMCAL || fAnaType == kEMCALFiducial) { |
772 | fMinEta = -0.7; | |
773 | fMaxEta = 0.7; | |
774 | fMinPhi = 80 * TMath::DegToRad(); | |
775 | fMaxPhi = 180 * TMath::DegToRad(); | |
c554a987 | 776 | } |
777 | else { | |
778 | AliWarning("Analysis type not recognized! Assuming kFullAcceptance..."); | |
a55e4f1d | 779 | fMinEta = -1; |
780 | fMaxEta = 1; | |
781 | fMinPhi = 0; | |
782 | fMaxPhi = 2 * TMath::Pi(); | |
c554a987 | 783 | } |
784 | } | |
785 | ||
a55e4f1d | 786 | //________________________________________________________________________ |
787 | Float_t AliAnalysisTaskSAJF::GetRigidConePt(AliEmcalJet *jet, Float_t minD) | |
788 | { | |
789 | static TRandom3 random; | |
790 | ||
791 | Double_t vertex[3] = {0, 0, 0}; | |
792 | InputEvent()->GetPrimaryVertex()->GetXYZ(vertex); | |
793 | ||
794 | Float_t eta = 0; | |
795 | Float_t phi = 0; | |
796 | ||
797 | Float_t LJeta = 999; | |
798 | Float_t LJphi = 999; | |
799 | ||
800 | if (jet) { | |
801 | LJeta = jet->Eta(); | |
802 | LJphi = jet->Phi(); | |
803 | } | |
804 | ||
805 | Float_t dLJ = 0; | |
806 | do { | |
807 | eta = random.Rndm() * (fMaxEta - fMinEta) + fMinEta; | |
808 | phi = random.Rndm() * (fMaxPhi - fMinPhi) + fMinPhi; | |
809 | dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi)); | |
810 | } while (dLJ < minD && !AcceptJet(eta, phi)); | |
811 | ||
812 | Float_t pt = 0; | |
813 | ||
814 | Int_t nclusters = GetNumberOfCaloClusters(); | |
815 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
816 | AliVCluster* cluster = GetCaloCluster(iClusters); | |
817 | if (!cluster) { | |
818 | AliError(Form("Could not receive cluster %d", iClusters)); | |
819 | continue; | |
820 | } | |
821 | ||
822 | if (!(cluster->IsEMCAL())) continue; | |
823 | ||
824 | TLorentzVector nPart; | |
825 | cluster->GetMomentum(nPart, vertex); | |
826 | ||
827 | Float_t pos[3]; | |
828 | cluster->GetPosition(pos); | |
829 | TVector3 clusVec(pos); | |
830 | ||
831 | Float_t d = TMath::Sqrt((clusVec.Eta() - eta) * (clusVec.Eta() - eta) + (clusVec.Phi() - phi) * (clusVec.Phi() - phi)); | |
832 | ||
833 | if (d <= fJetRadius) | |
834 | pt += nPart.Pt(); | |
835 | } | |
836 | ||
837 | Int_t ntracks = GetNumberOfTracks(); | |
838 | for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) { | |
839 | AliVTrack* track = GetTrack(iTracks); | |
840 | if(!track) { | |
841 | AliError(Form("ERROR: Could not retrieve track %d",iTracks)); | |
842 | continue; | |
843 | } | |
844 | ||
845 | if (!AcceptTrack(track)) continue; | |
846 | ||
847 | Float_t tracketa = track->Eta(); | |
848 | Float_t trackphi = track->Phi(); | |
849 | ||
850 | if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi())) | |
851 | trackphi += 2 * TMath::Pi(); | |
852 | if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi())) | |
853 | trackphi -= 2 * TMath::Pi(); | |
854 | ||
855 | Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi)); | |
856 | ||
857 | if (d <= fJetRadius) | |
858 | pt += track->Pt(); | |
859 | } | |
860 | ||
861 | return pt; | |
862 | } | |
863 | ||
864 | //________________________________________________________________________ | |
865 | Float_t AliAnalysisTaskSAJF::GetArea() const | |
866 | { | |
867 | return (fMaxEta - fMinEta) * (fMaxPhi - fMinPhi); | |
868 | } | |
869 | ||
c554a987 | 870 | //________________________________________________________________________ |
871 | Bool_t AliAnalysisTaskSAJF::IsJetTrack(AliEmcalJet* jet, Int_t itrack, Bool_t sorted) const | |
872 | { | |
873 | for (Int_t i = 0; i < jet->GetNumberOfTracks(); i++) { | |
874 | Int_t ijettrack = jet->TrackAt(i); | |
875 | if (sorted && ijettrack > itrack) | |
876 | return kFALSE; | |
877 | if (ijettrack == itrack) | |
878 | return kTRUE; | |
879 | } | |
880 | return kFALSE; | |
881 | } | |
882 | ||
883 | //________________________________________________________________________ | |
884 | Bool_t AliAnalysisTaskSAJF::IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool_t sorted) const | |
885 | { | |
886 | for (Int_t i = 0; i < jet->GetNumberOfClusters(); i++) { | |
887 | Int_t ijetclus = jet->ClusterAt(i); | |
888 | if (sorted && ijetclus > iclus) | |
889 | return kFALSE; | |
890 | if (ijetclus == iclus) | |
891 | return kTRUE; | |
25283b37 | 892 | } |
c554a987 | 893 | return kFALSE; |
f0a0fd33 | 894 | } |
895 | ||
91f4b7c5 | 896 | //________________________________________________________________________ |
a55e4f1d | 897 | Bool_t AliAnalysisTaskSAJF::AcceptJet(Float_t eta, Float_t phi) const |
91f4b7c5 | 898 | { |
899 | if (fAnaType == kFullAcceptance) { | |
900 | return kTRUE; | |
901 | } | |
902 | else if (fAnaType == kEMCAL) { | |
a55e4f1d | 903 | return (Bool_t)(eta > fMinEta && eta < fMaxEta && phi > fMinPhi && phi < fMaxPhi); |
91f4b7c5 | 904 | } |
905 | else if (fAnaType == kEMCALFiducial) { | |
a55e4f1d | 906 | return (Bool_t)(eta > fMinEta + fJetRadius && eta < fMaxEta - fJetRadius && phi > fMinPhi + fJetRadius && phi < fMaxPhi - fJetRadius); |
91f4b7c5 | 907 | } |
908 | else { | |
909 | AliWarning("Analysis type not recognized! Assuming kFullAcceptance..."); | |
910 | return kTRUE; | |
911 | } | |
912 | } | |
f0a0fd33 | 913 | |
a55e4f1d | 914 | //________________________________________________________________________ |
915 | Bool_t AliAnalysisTaskSAJF::AcceptJet(AliEmcalJet* jet) const | |
916 | { | |
917 | return AcceptJet(jet->Eta(), jet->Phi()); | |
918 | } | |
919 | ||
f0a0fd33 | 920 | //________________________________________________________________________ |
c554a987 | 921 | Bool_t AliAnalysisTaskSAJF::AcceptTrack(AliVTrack* track) const |
f0a0fd33 | 922 | { |
c554a987 | 923 | if (fAnaType == kFullAcceptance) { |
924 | return kTRUE; | |
925 | } | |
a55e4f1d | 926 | else if (fAnaType == kEMCAL || fAnaType == kEMCALFiducial) { |
927 | return (Bool_t)(track->Eta() > fMinEta && track->Eta() < fMaxEta && track->Phi() > fMinPhi && track->Phi() < fMaxPhi); | |
c554a987 | 928 | } |
929 | else { | |
930 | AliWarning("Analysis type not recognized! Assuming kFullAcceptance..."); | |
931 | return kTRUE; | |
932 | } | |
25283b37 | 933 | } |
934 | ||
935 | //________________________________________________________________________ | |
00514d01 | 936 | void AliAnalysisTaskSAJF::UserExec(Option_t *) |
25283b37 | 937 | { |
a55e4f1d | 938 | Init(); |
25283b37 | 939 | |
940 | RetrieveEventObjects(); | |
941 | ||
942 | FillHistograms(); | |
943 | ||
944 | // information for this iteration of the UserExec in the container | |
945 | PostData(1, fOutput); | |
946 | } | |
947 | ||
948 | //________________________________________________________________________ | |
00514d01 | 949 | void AliAnalysisTaskSAJF::Terminate(Option_t *) |
25283b37 | 950 | { |
951 | // Called once at the end of the analysis. | |
952 | } |