]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/EMCALJetTasks/AliAnalysisTaskSAJF.cxx
fix from Salvatore
[u/mrichter/AliRoot.git] / PWGGA / EMCALJetTasks / AliAnalysisTaskSAJF.cxx
CommitLineData
00514d01 1// $Id$
91f4b7c5 2//
b12a85c3 3// Jet analysis task (S.Aiola).
91f4b7c5 4//
5//
25283b37 6
b5ee47fb 7#include <TObject.h>
25283b37 8#include <TChain.h>
9#include <TClonesArray.h>
10#include <TH1F.h>
11#include <TH2F.h>
12#include <TList.h>
13#include <TLorentzVector.h>
a55e4f1d 14#include <TRandom3.h>
226f511d 15#include <TParameter.h>
25283b37 16
17#include "AliAnalysisManager.h"
18#include "AliCentrality.h"
f0a0fd33 19#include "AliVCluster.h"
df43b607 20#include "AliVParticle.h"
25283b37 21#include "AliEmcalJet.h"
22#include "AliVEventHandler.h"
55264f20 23#include "AliLog.h"
25283b37 24
00514d01 25#include "AliAnalysisTaskSAJF.h"
25283b37 26
00514d01 27ClassImp(AliAnalysisTaskSAJF)
25283b37 28
29//________________________________________________________________________
00514d01 30AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() :
df43b607 31 AliAnalysisTaskEmcal("AliAnalysisTaskSAJF"),
b12a85c3 32 fMinRC2LJ(1.0),
2bee31e9 33 fEmbJetsName("EmbJets"),
b12a85c3 34 fRandTracksName("TracksRandomized"),
35 fRandCaloName("CaloClustersRandomized"),
226f511d 36 fRhoName("Rho"),
2bee31e9 37 fEmbJets(0),
b12a85c3 38 fRandTracks(0),
39 fRandCaloClusters(0),
b12a85c3 40 fRho(0),
f0a0fd33 41 fHistCentrality(0),
b12a85c3 42 fHistRhoVSleadJetPt(0),
43 fHistRCPhiEta(0),
44 fHistRCPtExLJVSDPhiLJ(0),
45 fHistRhoVSRCPt(0),
b5ee47fb 46 fHistEmbJetPhiEta(0),
47 fHistEmbPartPhiEta(0),
b12a85c3 48 fHistRhoVSEmbBkg(0)
226f511d 49
25283b37 50{
51 // Default constructor.
f0a0fd33 52
53 for (Int_t i = 0; i < 4; i++) {
df43b607 54 fHistJetPhiEta[i] = 0;
55264f20 55 fHistJetsPt[i] = 0;
df43b607 56 fHistJetsPtArea[i] = 0;
b12a85c3 57 fHistJetsPtTrack[i] = 0;
58 fHistJetsPtClus[i] = 0;
11d4d636 59 fHistJetsPtNonBias[i] = 0;
55264f20 60 fHistLeadingJetPt[i] = 0;
61 fHist2LeadingJetPt[i] = 0;
b12a85c3 62 fHistJetsNEFvsPt[i] = 0;
63 fHistJetsZvsPt[i] = 0;
f0a0fd33 64 fHistTracksPtLJ[i] = 0;
55264f20 65 fHistClusEtLJ[i] = 0;
f0a0fd33 66 fHistTracksPtBkg[i] = 0;
55264f20 67 fHistClusEtBkg[i] = 0;
b12a85c3 68 fHistRho[i] = 0;
69 fHistCorrJetsPt[i] = 0;
70 fHistCorrJetsPtClus[i] = 0;
71 fHistCorrJetsPtTrack[i] = 0;
72 fHistCorrJetsPtNonBias[i] = 0;
73 fHistCorrLeadingJetPt[i] = 0;
a55e4f1d 74 fHistRCPt[i] = 0;
75 fHistRCPtExLJ[i] = 0;
b12a85c3 76 fHistRCPtRand[i] = 0;
77 fHistDeltaPtRC[i] = 0;
78 fHistDeltaPtRCExLJ[i] = 0;
79 fHistDeltaPtRCRand[i] = 0;
2bee31e9 80 fHistEmbJets[i] = 0;
81 fHistEmbPart[i] = 0;
b12a85c3 82 fHistDeltaPtEmb[i] = 0;
f0a0fd33 83 }
91f4b7c5 84
25283b37 85}
86
87//________________________________________________________________________
00514d01 88AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) :
df43b607 89 AliAnalysisTaskEmcal(name),
b12a85c3 90 fMinRC2LJ(1.0),
2bee31e9 91 fEmbJetsName("EmbJets"),
b12a85c3 92 fRandTracksName("TracksRandomized"),
93 fRandCaloName("CaloClustersRandomized"),
226f511d 94 fRhoName("Rho"),
2bee31e9 95 fEmbJets(0),
b12a85c3 96 fRandTracks(0),
97 fRandCaloClusters(0),
b12a85c3 98 fRho(0),
f0a0fd33 99 fHistCentrality(0),
b12a85c3 100 fHistRhoVSleadJetPt(0),
101 fHistRCPhiEta(0),
102 fHistRCPtExLJVSDPhiLJ(0),
103 fHistRhoVSRCPt(0),
b5ee47fb 104 fHistEmbJetPhiEta(0),
105 fHistEmbPartPhiEta(0),
b12a85c3 106 fHistRhoVSEmbBkg(0)
25283b37 107{
108 // Standard constructor.
109
f0a0fd33 110 for (Int_t i = 0; i < 4; i++) {
df43b607 111 fHistJetPhiEta[i] = 0;
55264f20 112 fHistJetsPt[i] = 0;
df43b607 113 fHistJetsPtArea[i] = 0;
b12a85c3 114 fHistJetsPtTrack[i] = 0;
115 fHistJetsPtClus[i] = 0;
11d4d636 116 fHistJetsPtNonBias[i] = 0;
55264f20 117 fHistLeadingJetPt[i] = 0;
118 fHist2LeadingJetPt[i] = 0;
b12a85c3 119 fHistJetsNEFvsPt[i] = 0;
120 fHistJetsZvsPt[i] = 0;
f0a0fd33 121 fHistTracksPtLJ[i] = 0;
55264f20 122 fHistClusEtLJ[i] = 0;
f0a0fd33 123 fHistTracksPtBkg[i] = 0;
55264f20 124 fHistClusEtBkg[i] = 0;
b12a85c3 125 fHistRho[i] = 0;
126 fHistCorrJetsPt[i] = 0;
127 fHistCorrJetsPtClus[i] = 0;
128 fHistCorrJetsPtTrack[i] = 0;
129 fHistCorrJetsPtNonBias[i] = 0;
130 fHistCorrLeadingJetPt[i] = 0;
a55e4f1d 131 fHistRCPt[i] = 0;
132 fHistRCPtExLJ[i] = 0;
b12a85c3 133 fHistRCPtRand[i] = 0;
134 fHistDeltaPtRC[i] = 0;
135 fHistDeltaPtRCExLJ[i] = 0;
136 fHistDeltaPtRCRand[i] = 0;
2bee31e9 137 fHistEmbJets[i] = 0;
138 fHistEmbPart[i] = 0;
b12a85c3 139 fHistDeltaPtEmb[i] = 0;
f0a0fd33 140 }
91f4b7c5 141
25283b37 142}
143
144//________________________________________________________________________
00514d01 145AliAnalysisTaskSAJF::~AliAnalysisTaskSAJF()
25283b37 146{
147 // Destructor
148}
149
150//________________________________________________________________________
00514d01 151void AliAnalysisTaskSAJF::UserCreateOutputObjects()
25283b37 152{
df43b607 153 AliAnalysisTaskEmcal::UserCreateOutputObjects();
154
f0a0fd33 155 // Create histograms
11d4d636 156
b12a85c3 157 const Float_t binWidth = (fMaxPt - fMinPt) / fNbins;
25283b37 158
226f511d 159 OpenFile(1);
25283b37 160 fOutput = new TList();
226f511d 161 fOutput->SetOwner();
25283b37 162
55264f20 163 fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", fNbins, 0, 100);
f0a0fd33 164 fHistCentrality->GetXaxis()->SetTitle("Centrality (%)");
165 fHistCentrality->GetYaxis()->SetTitle("counts");
166 fOutput->Add(fHistCentrality);
25283b37 167
b12a85c3 168 fHistRhoVSleadJetPt = new TH2F("fHistRhoVSleadJetPt","fHistRhoVSleadJetPt", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt);
169 fHistRhoVSleadJetPt->GetXaxis()->SetTitle("#rho * area [GeV/c]");
170 fHistRhoVSleadJetPt->GetYaxis()->SetTitle("Leading jet p_{T} [GeV/c]");
171 fOutput->Add(fHistRhoVSleadJetPt);
b5ee47fb 172
b12a85c3 173 fHistRCPhiEta = new TH2F("fHistRCPhiEta","Phi-Eta distribution of rigid cones", 20, -2, 2, 32, 0, 6.4);
174 fHistRCPhiEta->GetXaxis()->SetTitle("#eta");
175 fHistRCPhiEta->GetYaxis()->SetTitle("#phi");
176 fOutput->Add(fHistRCPhiEta);
b5ee47fb 177
178 fHistRCPtExLJVSDPhiLJ = new TH2F("fHistRCPtExLJVSDPhiLJ","fHistRCPtExLJVSDPhiLJ", fNbins, fMinPt, fMaxPt, 128, -1.6, 4.8);
b12a85c3 179 fHistRCPtExLJVSDPhiLJ->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
b5ee47fb 180 fHistRCPtExLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi");
181 fOutput->Add(fHistRCPtExLJVSDPhiLJ);
182
b12a85c3 183 fHistRhoVSRCPt = new TH2F("fHistRhoVSRCPt","fHistRhoVSRCPt", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt);
184 fHistRhoVSRCPt->GetXaxis()->SetTitle("#rho * area [GeV/c]");
185 fHistRhoVSRCPt->GetYaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
186 fOutput->Add(fHistRhoVSRCPt);
187
188 fHistEmbJetPhiEta = new TH2F("fHistEmbJetPhiEta","Phi-Eta distribution of embedded jets", 20, -2, 2, 32, 0, 6.4);
189 fHistEmbJetPhiEta->GetXaxis()->SetTitle("#eta");
190 fHistEmbJetPhiEta->GetYaxis()->SetTitle("#phi");
191 fOutput->Add(fHistEmbJetPhiEta);
192
193 fHistEmbPartPhiEta = new TH2F("fHistEmbPartPhiEta","Phi-Eta distribution of embedded particles", 20, -2, 2, 32, 0, 6.4);
194 fHistEmbPartPhiEta->GetXaxis()->SetTitle("#eta");
195 fHistEmbPartPhiEta->GetYaxis()->SetTitle("#phi");
196 fOutput->Add(fHistEmbPartPhiEta);
197
198 fHistRhoVSEmbBkg = new TH2F("fHistRhoVSEmbBkg","fHistRhoVSEmbBkg", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt);
199 fHistRhoVSEmbBkg->GetXaxis()->SetTitle("rho * area [GeV/c]");
200 fHistRhoVSEmbBkg->GetYaxis()->SetTitle("background of embedded track [GeV/c]");
201 fOutput->Add(fHistRhoVSEmbBkg);
b5ee47fb 202
f0a0fd33 203 TString histname;
204
205 for (Int_t i = 0; i < 4; i++) {
df43b607 206 histname = "fHistJetPhiEta_";
207 histname += i;
208 fHistJetPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 20, -2, 2, 32, 0, 6.4);
209 fHistJetPhiEta[i]->GetXaxis()->SetTitle("#eta");
210 fHistJetPhiEta[i]->GetYaxis()->SetTitle("#phi");
211 fOutput->Add(fHistJetPhiEta[i]);
212
55264f20 213 histname = "fHistJetsPt_";
f0a0fd33 214 histname += i;
55264f20 215 fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
b12a85c3 216 fHistJetsPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
55264f20 217 fHistJetsPt[i]->GetYaxis()->SetTitle("counts");
218 fOutput->Add(fHistJetsPt[i]);
226f511d 219
df43b607 220 histname = "fHistJetsPtArea_";
221 histname += i;
222 fHistJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt, fNbins, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5);
223 fHistJetsPtArea[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
224 fHistJetsPtArea[i]->GetYaxis()->SetTitle("area");
225 fOutput->Add(fHistJetsPtArea[i]);
226
b12a85c3 227 if (fAnaType == kEMCAL) {
228 histname = "fHistJetsPtClus_";
229 histname += i;
230 fHistJetsPtClus[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
231 fHistJetsPtClus[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
232 fHistJetsPtClus[i]->GetYaxis()->SetTitle("counts");
233 fOutput->Add(fHistJetsPtClus[i]);
234 }
226f511d 235
b12a85c3 236 histname = "fHistJetsPtTrack_";
11d4d636 237 histname += i;
b12a85c3 238 fHistJetsPtTrack[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
239 fHistJetsPtTrack[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
240 fHistJetsPtTrack[i]->GetYaxis()->SetTitle("counts");
241 fOutput->Add(fHistJetsPtTrack[i]);
11d4d636 242
243 histname = "fHistJetsPtNonBias_";
226f511d 244 histname += i;
11d4d636 245 fHistJetsPtNonBias[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
b12a85c3 246 fHistJetsPtNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
11d4d636 247 fHistJetsPtNonBias[i]->GetYaxis()->SetTitle("counts");
248 fOutput->Add(fHistJetsPtNonBias[i]);
226f511d 249
55264f20 250 histname = "fHistLeadingJetPt_";
f0a0fd33 251 histname += i;
55264f20 252 fHistLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
b12a85c3 253 fHistLeadingJetPt[i]->GetXaxis()->SetTitle("p_{T} [GeV]");
55264f20 254 fHistLeadingJetPt[i]->GetYaxis()->SetTitle("counts");
255 fOutput->Add(fHistLeadingJetPt[i]);
b5ee47fb 256
257 histname = "fHist2LeadingJetPt_";
258 histname += i;
259 fHist2LeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
b12a85c3 260 fHist2LeadingJetPt[i]->GetXaxis()->SetTitle("p_{T} [GeV]");
b5ee47fb 261 fHist2LeadingJetPt[i]->GetYaxis()->SetTitle("counts");
262 fOutput->Add(fHist2LeadingJetPt[i]);
263
b12a85c3 264 histname = "fHistJetsZvsPt_";
b5ee47fb 265 histname += i;
b12a85c3 266 fHistJetsZvsPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, 0, 1.2, fNbins, fMinPt, fMaxPt);
267 fHistJetsZvsPt[i]->GetXaxis()->SetTitle("Z");
268 fHistJetsZvsPt[i]->GetYaxis()->SetTitle("p_{T} [GeV/c]");
269 fOutput->Add(fHistJetsZvsPt[i]);
270
271 if (fAnaType == kEMCAL) {
272 histname = "fHistJetsNEFvsPt_";
273 histname += i;
274 fHistJetsNEFvsPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, 0, 1.2, fNbins, fMinPt, fMaxPt);
275 fHistJetsNEFvsPt[i]->GetXaxis()->SetTitle("NEF");
276 fHistJetsNEFvsPt[i]->GetYaxis()->SetTitle("p_{T} [GeV/c]");
277 fOutput->Add(fHistJetsNEFvsPt[i]);
278
279 histname = "fHistClusEtLJ_";
280 histname += i;
281 fHistClusEtLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5);
282 fHistClusEtLJ[i]->GetXaxis()->SetTitle("E_{T} [GeV]");
283 fHistClusEtLJ[i]->GetYaxis()->SetTitle("counts");
284 fOutput->Add(fHistClusEtLJ[i]);
285
286 histname = "fHistClusEtBkg_";
287 histname += i;
288 fHistClusEtBkg[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5);
289 fHistClusEtBkg[i]->GetXaxis()->SetTitle("E_{T} [GeV]");
290 fHistClusEtBkg[i]->GetYaxis()->SetTitle("counts");
291 fOutput->Add(fHistClusEtBkg[i]);
292 }
293
f0a0fd33 294 histname = "fHistTracksPtLJ_";
295 histname += i;
b5ee47fb 296 fHistTracksPtLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5);
b12a85c3 297 fHistTracksPtLJ[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
f0a0fd33 298 fHistTracksPtLJ[i]->GetYaxis()->SetTitle("counts");
299 fOutput->Add(fHistTracksPtLJ[i]);
f0a0fd33 300
301 histname = "fHistTracksPtBkg_";
302 histname += i;
b5ee47fb 303 fHistTracksPtBkg[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5);
b12a85c3 304 fHistTracksPtBkg[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
f0a0fd33 305 fHistTracksPtBkg[i]->GetYaxis()->SetTitle("counts");
306 fOutput->Add(fHistTracksPtBkg[i]);
b12a85c3 307
308 histname = "fHistRho_";
309 histname += i;
310 fHistRho[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2);
311 fHistRho[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
312 fHistRho[i]->GetYaxis()->SetTitle("counts");
313 fOutput->Add(fHistRho[i]);
314
315 histname = "fHistCorrJetsPt_";
316 histname += i;
317 fHistCorrJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt);
318 fHistCorrJetsPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
319 fHistCorrJetsPt[i]->GetYaxis()->SetTitle("counts");
320 fOutput->Add(fHistCorrJetsPt[i]);
321
322 if (fAnaType == kEMCAL) {
323 histname = "fHistCorrJetsPtClus_";
324 histname += i;
325 fHistCorrJetsPtClus[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt);
326 fHistCorrJetsPtClus[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
327 fHistCorrJetsPtClus[i]->GetYaxis()->SetTitle("counts");
328 fOutput->Add(fHistCorrJetsPtClus[i]);
329 }
330
331 histname = "fHistCorrJetsPtTrack_";
f0a0fd33 332 histname += i;
b12a85c3 333 fHistCorrJetsPtTrack[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt);
334 fHistCorrJetsPtTrack[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
335 fHistCorrJetsPtTrack[i]->GetYaxis()->SetTitle("counts");
336 fOutput->Add(fHistCorrJetsPtTrack[i]);
c554a987 337
b12a85c3 338 histname = "fHistCorrJetsPtNonBias_";
339 histname += i;
340 fHistCorrJetsPtNonBias[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt);
341 fHistCorrJetsPtNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
342 fHistCorrJetsPtNonBias[i]->GetYaxis()->SetTitle("counts");
343 fOutput->Add(fHistCorrJetsPtNonBias[i]);
344
345 histname = "fHistCorrLeadingJetPt_";
346 histname += i;
347 fHistCorrLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt);
348 fHistCorrLeadingJetPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]");
349 fHistCorrLeadingJetPt[i]->GetYaxis()->SetTitle("counts");
350 fOutput->Add(fHistCorrLeadingJetPt[i]);
351
352 histname = "fHistRCPt_";
c554a987 353 histname += i;
b12a85c3 354 fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2);
355 fHistRCPt[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
356 fHistRCPt[i]->GetYaxis()->SetTitle("counts");
357 fOutput->Add(fHistRCPt[i]);
c554a987 358
b12a85c3 359 histname = "fHistRCPtExLJ_";
c554a987 360 histname += i;
b12a85c3 361 fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2);
362 fHistRCPtExLJ[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
363 fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts");
364 fOutput->Add(fHistRCPtExLJ[i]);
c554a987 365
b12a85c3 366 histname = "fHistRCPtRand_";
c554a987 367 histname += i;
b12a85c3 368 fHistRCPtRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2);
369 fHistRCPtRand[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
370 fHistRCPtRand[i]->GetYaxis()->SetTitle("counts");
371 fOutput->Add(fHistRCPtRand[i]);
a55e4f1d 372
373 histname = "fHistDeltaPtRC_";
374 histname += i;
11d4d636 375 fHistDeltaPtRC[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2);
b12a85c3 376 fHistDeltaPtRC[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]");
a55e4f1d 377 fHistDeltaPtRC[i]->GetYaxis()->SetTitle("counts");
378 fOutput->Add(fHistDeltaPtRC[i]);
379
380 histname = "fHistDeltaPtRCExLJ_";
381 histname += i;
11d4d636 382 fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2);
b12a85c3 383 fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]");
a55e4f1d 384 fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts");
385 fOutput->Add(fHistDeltaPtRCExLJ[i]);
386
b12a85c3 387 histname = "fHistDeltaPtRCRand_";
a55e4f1d 388 histname += i;
b12a85c3 389 fHistDeltaPtRCRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2);
390 fHistDeltaPtRCRand[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]");
391 fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts");
392 fOutput->Add(fHistDeltaPtRCRand[i]);
2bee31e9 393
394 histname = "fHistEmbJets_";
395 histname += i;
396 fHistEmbJets[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
b12a85c3 397 fHistEmbJets[i]->GetXaxis()->SetTitle("embedded jet p_{T} [GeV/c]");
2bee31e9 398 fHistEmbJets[i]->GetYaxis()->SetTitle("counts");
399 fOutput->Add(fHistEmbJets[i]);
400
401 histname = "fHistEmbPart_";
402 histname += i;
403 fHistEmbPart[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt);
b12a85c3 404 fHistEmbPart[i]->GetXaxis()->SetTitle("embedded particle p_{T} [GeV/c]");
2bee31e9 405 fHistEmbPart[i]->GetYaxis()->SetTitle("counts");
406 fOutput->Add(fHistEmbPart[i]);
407
b12a85c3 408 histname = "fHistDeltaPtEmb_";
2bee31e9 409 histname += i;
b12a85c3 410 fHistDeltaPtEmb[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2);
411 fHistDeltaPtEmb[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]");
412 fHistDeltaPtEmb[i]->GetYaxis()->SetTitle("counts");
413 fOutput->Add(fHistDeltaPtEmb[i]);
e82e282c 414 }
415
25283b37 416 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
417}
418
55264f20 419//________________________________________________________________________
00514d01 420void AliAnalysisTaskSAJF::RetrieveEventObjects()
25283b37 421{
df43b607 422 AliAnalysisTaskEmcal::RetrieveEventObjects();
423
2bee31e9 424 if (strcmp(fEmbJetsName,"")) {
425 fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName));
426 if (!fEmbJets) {
b12a85c3 427 AliWarning(Form("Could not retrieve emb jets %s!", fEmbJetsName.Data()));
428 }
429 }
430
431 if (strcmp(fRandCaloName,"") && fAnaType == kEMCAL) {
432 fRandCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandCaloName));
433 if (!fRandCaloClusters) {
434 AliWarning(Form("Could not retrieve randomized clusters %s!", fRandCaloName.Data()));
435 }
436 }
437
438 if (strcmp(fRandTracksName,"")) {
439 fRandTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandTracksName));
440 if (!fRandTracks) {
441 AliWarning(Form("Could not retrieve randomized tracks %s!", fRandTracksName.Data()));
2bee31e9 442 }
443 }
f0a0fd33 444
226f511d 445
11d4d636 446 fRho = -1;
226f511d 447
11d4d636 448 if (strcmp(fRhoName,"")) {
449 TParameter<Double_t> *rho = dynamic_cast<TParameter<Double_t>*>(InputEvent()->FindListObject(fRhoName));
450
451 if (rho) {
452 fRho = rho->GetVal();
453 }
454 else {
b12a85c3 455 AliWarning(Form("Could not retrieve rho %s!", fRhoName.Data()));
11d4d636 456 }
226f511d 457 }
2bee31e9 458}
459
55264f20 460//________________________________________________________________________
00514d01 461void AliAnalysisTaskSAJF::FillHistograms()
25283b37 462{
df43b607 463 if (fRho < 0) {
464 AliWarning(Form("Could not retrieve rho information! Event skipped!"));
465 return;
466 }
467
55264f20 468 Int_t maxJetIndex = -1;
469 Int_t max2JetIndex = -1;
25283b37 470
b12a85c3 471 // ************
472 // General histograms
473 // _________________________________
474
55264f20 475 DoJetLoop(maxJetIndex, max2JetIndex);
476
477 if (maxJetIndex < 0)
478 return;
c554a987 479
df43b607 480 AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(maxJetIndex));
55264f20 481 if (!jet)
482 return;
c554a987 483
11d4d636 484 fHistCentrality->Fill(fCent);
485
55264f20 486 fHistLeadingJetPt[fCentBin]->Fill(jet->Pt());
b12a85c3 487 fHistRhoVSleadJetPt->Fill(fRho * jet->Area(), jet->Pt());
488
55264f20 489 jet->SortConstituents();
490
491 AliEmcalJet* jet2 = 0;
492 if (max2JetIndex >= 0)
df43b607 493 jet2 = dynamic_cast<AliEmcalJet*>(fJets->At(max2JetIndex));
55264f20 494
b5ee47fb 495 if (jet2) {
496 fHist2LeadingJetPt[fCentBin]->Fill(jet2->Pt());
55264f20 497 jet2->SortConstituents();
b5ee47fb 498 }
c554a987 499
b12a85c3 500 fHistRho[fCentBin]->Fill(fRho);
b5ee47fb 501
226f511d 502 Float_t maxJetCorrPt = jet->Pt() - fRho * jet->Area();
503 if (maxJetCorrPt > 0)
504 fHistCorrLeadingJetPt[fCentBin]->Fill(maxJetCorrPt);
55264f20 505
b12a85c3 506 DoTrackLoop(maxJetIndex);
55264f20 507
b5ee47fb 508 if (fAnaType == kEMCAL)
b12a85c3 509 DoClusterLoop(maxJetIndex);
55264f20 510
b12a85c3 511 // ************
512 // Random cones
513 // _________________________________
a55e4f1d 514
d41a0b1c 515 const Float_t rcArea = fJetRadius * fJetRadius * TMath::Pi();
516
b12a85c3 517 // Simple random cones
518 Float_t RCpt = 0;
519 Float_t RCeta = 0;
520 Float_t RCphi = 0;
521 GetRigidCone(RCpt, RCeta, RCphi, kFALSE, 0);
522 if (RCpt > 0) {
d41a0b1c 523 fHistRCPt[fCentBin]->Fill(RCpt / rcArea);
524 fHistDeltaPtRC[fCentBin]->Fill(RCpt - rcArea * fRho);
b12a85c3 525 }
526
527 // Random cones far from leading jet
528 Float_t RCptExLJ = 0;
529 Float_t RCetaExLJ = 0;
530 Float_t RCphiExLJ = 0;
531 GetRigidCone(RCptExLJ, RCetaExLJ, RCphiExLJ, kFALSE, jet);
532 if (RCptExLJ > 0) {
533 fHistRCPhiEta->Fill(RCetaExLJ, RCphiExLJ);
d41a0b1c 534 fHistRhoVSRCPt->Fill(fRho, RCptExLJ / rcArea);
b5ee47fb 535
536 Float_t dphi = RCphiExLJ - jet->Phi();
537 if (dphi > 4.8) dphi -= TMath::Pi() * 2;
538 if (dphi < -1.6) dphi += TMath::Pi() * 2;
539 fHistRCPtExLJVSDPhiLJ->Fill(RCptExLJ, dphi);
b12a85c3 540
d41a0b1c 541 fHistRCPtExLJ[fCentBin]->Fill(RCptExLJ / rcArea);
542 fHistDeltaPtRCExLJ[fCentBin]->Fill(RCptExLJ - rcArea * fRho);
b12a85c3 543 }
544
545 // Random cones with randomized particles
546 Float_t RCptRand = 0;
547 Float_t RCetaRand = 0;
548 Float_t RCphiRand = 0;
549 GetRigidCone(RCptRand, RCetaRand, RCphiRand, kTRUE, 0, fRandTracks, fRandCaloClusters);
550 if (RCptRand > 0) {
d41a0b1c 551 fHistRCPtRand[fCentBin]->Fill(RCptRand / rcArea);
552 fHistDeltaPtRCRand[fCentBin]->Fill(RCptRand - rcArea * fRho);
a55e4f1d 553 }
2bee31e9 554
b12a85c3 555 // ************
556 // Embedding
557 // _________________________________
558
df43b607 559 if (!fEmbJets)
560 return;
561
b12a85c3 562 AliEmcalJet *embJet = 0;
b5ee47fb 563 TObject *maxPart = 0;
2bee31e9 564
b12a85c3 565 DoEmbJetLoop(embJet, maxPart);
2bee31e9 566
b12a85c3 567 if (embJet && maxPart) {
b5ee47fb 568 Float_t maxEmbPartPt = 0;
569 Float_t maxEmbPartEta = 0;
570 Float_t maxEmbPartPhi = 0;
b12a85c3 571
572 AliVCluster *cluster = dynamic_cast<AliVCluster*>(maxPart);
b5ee47fb 573 if (cluster) {
b5ee47fb 574 TLorentzVector nPart;
b12a85c3 575 cluster->GetMomentum(nPart, fVertex);
b5ee47fb 576 Float_t pos[3];
577 cluster->GetPosition(pos);
578 TVector3 clusVec(pos);
579
580 maxEmbPartPt = nPart.Et();
581 maxEmbPartEta = clusVec.Eta();
582 maxEmbPartPhi = clusVec.Phi();
583 }
b5ee47fb 584 else {
df43b607 585 AliVParticle *track = dynamic_cast<AliVParticle*>(maxPart);
b12a85c3 586 if (track) {
587 maxEmbPartPt = track->Pt();
588 maxEmbPartEta = track->Eta();
589 maxEmbPartPhi = track->Phi();
590 }
591 else {
df43b607 592 AliWarning(Form("%s - Embedded particle type not recognized (neither AliVCluster nor AliVParticle)!", GetName()));
b12a85c3 593 return;
594 }
b5ee47fb 595 }
b12a85c3 596 fHistEmbJets[fCentBin]->Fill(embJet->Pt());
2bee31e9 597 fHistEmbPart[fCentBin]->Fill(maxEmbPartPt);
b12a85c3 598 fHistEmbJetPhiEta->Fill(embJet->Eta(), embJet->Phi());
b5ee47fb 599 fHistEmbPartPhiEta->Fill(maxEmbPartEta, maxEmbPartPhi);
b12a85c3 600
601 fHistDeltaPtEmb[fCentBin]->Fill(embJet->Pt() - embJet->Area() * fRho - maxEmbPartPt);
602 fHistRhoVSEmbBkg->Fill(embJet->Area() * fRho, embJet->Pt() - maxEmbPartPt);
2bee31e9 603 }
604 else {
b12a85c3 605 AliWarning(Form("%s - Embedded particle not found in the event!", GetName()));
2bee31e9 606 }
55264f20 607}
608
609//________________________________________________________________________
610void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex)
611{
df43b607 612 if (!fJets)
613 return;
614
615 Int_t njets = fJets->GetEntriesFast();
55264f20 616
617 Float_t maxJetPt = 0;
618 Float_t max2JetPt = 0;
25283b37 619 for (Int_t ij = 0; ij < njets; ij++) {
f0a0fd33 620
df43b607 621 AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(ij));
f0a0fd33 622
25283b37 623 if (!jet) {
a55e4f1d 624 AliError(Form("Could not receive jet %d", ij));
25283b37 625 continue;
626 }
f0a0fd33 627
91f4b7c5 628 if (!AcceptJet(jet))
629 continue;
630
226f511d 631 Float_t corrPt = jet->Pt() - fRho * jet->Area();
632
11d4d636 633 fHistJetsPtNonBias[fCentBin]->Fill(jet->Pt());
634 fHistCorrJetsPtNonBias[fCentBin]->Fill(corrPt);
226f511d 635
b12a85c3 636 if (jet->MaxTrackPt() > fPtBiasJetTrack) {
637 fHistJetsPtTrack[fCentBin]->Fill(jet->Pt());
638 fHistCorrJetsPtTrack[fCentBin]->Fill(corrPt);
639 }
640
641 if (fAnaType == kEMCAL && jet->MaxClusterPt() > fPtBiasJetClus) {
642 fHistJetsPtClus[fCentBin]->Fill(jet->Pt());
643 fHistCorrJetsPtClus[fCentBin]->Fill(corrPt);
644 }
645
646 if (jet->MaxTrackPt() < fPtBiasJetTrack && (fAnaType == kTPC || jet->MaxClusterPt() < fPtBiasJetClus))
647 continue;
226f511d 648
11d4d636 649 fHistJetsPt[fCentBin]->Fill(jet->Pt());
df43b607 650 fHistJetsPtArea[fCentBin]->Fill(corrPt, jet->Area());
11d4d636 651 fHistCorrJetsPt[fCentBin]->Fill(corrPt);
f0a0fd33 652
df43b607 653 fHistJetPhiEta[fCentBin]->Fill(jet->Eta(), jet->Phi());
b12a85c3 654
655 if (fAnaType == kEMCAL)
656 fHistJetsNEFvsPt[fCentBin]->Fill(jet->NEF(), jet->Pt());
226f511d 657
35789a2d 658 for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
df43b607 659 AliVParticle *track = jet->TrackAt(it, fTracks);
35789a2d 660 if (track)
b12a85c3 661 fHistJetsZvsPt[fCentBin]->Fill(track->Pt() / jet->Pt(), jet->Pt());
35789a2d 662 }
a55e4f1d 663
35789a2d 664 for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
a55e4f1d 665 AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters);
55264f20 666
667 if (cluster) {
668 TLorentzVector nPart;
b12a85c3 669 cluster->GetMomentum(nPart, fVertex);
df43b607 670 fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), jet->Pt());
55264f20 671 }
f0a0fd33 672 }
673
11d4d636 674 if (maxJetPt < corrPt) {
55264f20 675 max2JetPt = maxJetPt;
c554a987 676 max2JetIndex = maxJetIndex;
11d4d636 677 maxJetPt = corrPt;
f0a0fd33 678 maxJetIndex = ij;
35789a2d 679 }
11d4d636 680 else if (max2JetPt < corrPt) {
681 max2JetPt = corrPt;
c554a987 682 max2JetIndex = ij;
683 }
25283b37 684 } //jet loop
55264f20 685}
e82e282c 686
55264f20 687//________________________________________________________________________
b12a85c3 688void AliAnalysisTaskSAJF::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &maxPart)
55264f20 689{
df43b607 690 if (!fEmbJets)
691 return;
692
b12a85c3 693 TLorentzVector *maxClusVect = new TLorentzVector();
2bee31e9 694
df43b607 695 Int_t nembjets = fEmbJets->GetEntriesFast();
2bee31e9 696
2bee31e9 697 for (Int_t ij = 0; ij < nembjets; ij++) {
698
df43b607 699 AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fEmbJets->At(ij));
2bee31e9 700
701 if (!jet) {
702 AliError(Form("Could not receive jet %d", ij));
703 continue;
704 }
705
df43b607 706 if (!AcceptJet(jet))
707 continue;
2bee31e9 708
df43b607 709 AliVParticle *maxTrack = 0;
2bee31e9 710
b12a85c3 711 for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
df43b607 712 AliVParticle *track = jet->TrackAt(it, fTracks);
b12a85c3 713
714 if (!track) continue;
715
716 if (!maxTrack || track->Pt() > maxTrack->Pt())
717 maxTrack = track;
2bee31e9 718 }
2bee31e9 719
b12a85c3 720 AliVCluster *maxClus = 0;
2bee31e9 721
b12a85c3 722 for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
723 AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters);
724
725 if (!cluster) continue;
726
727 TLorentzVector nPart;
728 cluster->GetMomentum(nPart, fVertex);
729
730 if (!maxClus || nPart.Et() > maxClusVect->Et()) {
731 new (maxClusVect) TLorentzVector(nPart);
732 maxClus = cluster;
733 }
734 }
2bee31e9 735
b12a85c3 736 if ((maxClus && maxTrack && maxClusVect->Et() > maxTrack->Pt()) || (maxClus && !maxTrack)) {
737 if (maxClus->Chi2() == 100) {
738 maxPart = maxClus;
739 embJet = jet;
740 delete maxClusVect;
741 return;
742 }
743 }
744 else if (maxTrack) {
745 if (maxTrack->GetLabel() == 100) {
746 maxPart = maxTrack;
747 embJet = jet;
748 delete maxClusVect;
749 return;
750 }
751 }
2bee31e9 752 }
b12a85c3 753
754 delete maxClusVect;
2bee31e9 755}
756
757//________________________________________________________________________
b12a85c3 758void AliAnalysisTaskSAJF::DoTrackLoop(Int_t maxJetIndex)
2bee31e9 759{
df43b607 760 if (!fTracks)
761 return;
762
27b20058 763 AliEmcalJet* jet = 0;
df43b607 764 if (maxJetIndex >= 0 && fJets)
765 jet = dynamic_cast<AliEmcalJet*>(fJets->At(maxJetIndex));
27b20058 766
df43b607 767 Int_t ntracks = fTracks->GetEntriesFast();
2bee31e9 768
c554a987 769 for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
df43b607 770 AliVParticle* track = dynamic_cast<AliVParticle*>(fTracks->At(iTracks));
c554a987 771 if(!track) {
27b20058 772 AliError(Form("Could not retrieve track %d",iTracks));
c554a987 773 continue;
774 }
775
776 if (!AcceptTrack(track)) continue;
32bf39af 777
27b20058 778 if (jet && IsJetTrack(jet, iTracks)) {
55264f20 779 fHistTracksPtLJ[fCentBin]->Fill(track->Pt());
c554a987 780 }
b12a85c3 781 else {
55264f20 782 fHistTracksPtBkg[fCentBin]->Fill(track->Pt());
c554a987 783 }
55264f20 784 }
55264f20 785}
c554a987 786
55264f20 787//________________________________________________________________________
b12a85c3 788void AliAnalysisTaskSAJF::DoClusterLoop(Int_t maxJetIndex)
55264f20 789{
df43b607 790 if (!fCaloClusters)
791 return;
792
27b20058 793 AliEmcalJet* jet = 0;
df43b607 794 if (maxJetIndex >= 0 && fJets)
795 jet = dynamic_cast<AliEmcalJet*>(fJets->At(maxJetIndex));
27b20058 796
df43b607 797 Int_t nclusters = fCaloClusters->GetEntriesFast();
f0a0fd33 798 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
df43b607 799 AliVCluster* cluster = dynamic_cast<AliVCluster*>(fCaloClusters->At(iClusters));
e82e282c 800 if (!cluster) {
a55e4f1d 801 AliError(Form("Could not receive cluster %d", iClusters));
e82e282c 802 continue;
803 }
804
805 if (!(cluster->IsEMCAL())) continue;
f0a0fd33 806
2bee31e9 807 if (!AcceptCluster(cluster)) continue;
808
55264f20 809 TLorentzVector nPart;
b12a85c3 810 cluster->GetMomentum(nPart, fVertex);
32bf39af 811
27b20058 812 if (jet && IsJetCluster(jet, iClusters)) {
55264f20 813 fHistClusEtLJ[fCentBin]->Fill(nPart.Et());
f0a0fd33 814 }
b12a85c3 815 else {
55264f20 816 fHistClusEtBkg[fCentBin]->Fill(nPart.Et());
f0a0fd33 817 }
e82e282c 818 } //cluster loop
c554a987 819}
820
a55e4f1d 821//________________________________________________________________________
b12a85c3 822void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi, Bool_t acceptMC,
823 AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const
a55e4f1d 824{
b12a85c3 825 if (!tracks)
826 tracks = fTracks;
a55e4f1d 827
b12a85c3 828 if (!clusters)
829 clusters = fCaloClusters;
a55e4f1d 830
df43b607 831 if (!tracks && !clusters)
832 return;
833
b5ee47fb 834 eta = 0;
835 phi = 0;
b12a85c3 836 pt = 0;
a55e4f1d 837
838 Float_t LJeta = 999;
839 Float_t LJphi = 999;
840
841 if (jet) {
842 LJeta = jet->Eta();
843 LJphi = jet->Phi();
844 }
845
b5ee47fb 846 Float_t maxEta = fMaxEta - fJetRadius;
847 Float_t minEta = fMinEta + fJetRadius;
848 Float_t maxPhi = fMaxPhi - fJetRadius;
849 Float_t minPhi = fMinPhi + fJetRadius;
850
851 if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2;
852 if (minPhi < 0) minPhi = 0;
853
a55e4f1d 854 Float_t dLJ = 0;
b12a85c3 855 Int_t repeats = 0;
a55e4f1d 856 do {
b12a85c3 857 eta = gRandom->Rndm() * (maxEta - minEta) + minEta;
858 phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi;
a55e4f1d 859 dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi));
b12a85c3 860 repeats++;
861 } while (dLJ < fMinRC2LJ && repeats < 999);
862
863 if (repeats == 999)
864 return;
b5ee47fb 865
df43b607 866 if (fAnaType == kEMCAL && clusters) {
b12a85c3 867 Int_t nclusters = clusters->GetEntriesFast();
b5ee47fb 868 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
b12a85c3 869 AliVCluster* cluster = dynamic_cast<AliVCluster*>(clusters->At(iClusters));
b5ee47fb 870 if (!cluster) {
871 AliError(Form("Could not receive cluster %d", iClusters));
872 continue;
873 }
874
875 if (!(cluster->IsEMCAL())) continue;
876
b12a85c3 877 if (!AcceptCluster(cluster, acceptMC)) continue;
b5ee47fb 878
879 TLorentzVector nPart;
b12a85c3 880 cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
b5ee47fb 881
882 Float_t pos[3];
883 cluster->GetPosition(pos);
884 TVector3 clusVec(pos);
885
886 Float_t d = TMath::Sqrt((clusVec.Eta() - eta) * (clusVec.Eta() - eta) + (clusVec.Phi() - phi) * (clusVec.Phi() - phi));
887
888 if (d <= fJetRadius)
889 pt += nPart.Pt();
890 }
a55e4f1d 891 }
892
df43b607 893 if (tracks) {
894 Int_t ntracks = tracks->GetEntriesFast();
895 for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
896 AliVParticle* track = dynamic_cast<AliVParticle*>(tracks->At(iTracks));
897 if(!track) {
898 AliError(Form("Could not retrieve track %d",iTracks));
899 continue;
900 }
901
902 if (!AcceptTrack(track, acceptMC)) continue;
903
904 Float_t tracketa = track->Eta();
905 Float_t trackphi = track->Phi();
906
907 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
908 trackphi += 2 * TMath::Pi();
909 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
910 trackphi -= 2 * TMath::Pi();
911
912 Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
a55e4f1d 913
df43b607 914 if (d <= fJetRadius)
915 pt += track->Pt();
916 }
25283b37 917 }
f0a0fd33 918}
a55e4f1d 919//________________________________________________________________________
df43b607 920void AliAnalysisTaskSAJF::Init()
25283b37 921{
df43b607 922 AliAnalysisTaskEmcal::Init();
25283b37 923
df43b607 924 const Float_t semiDiag = TMath::Sqrt((fMaxPhi - fMinPhi) * (fMaxPhi - fMinPhi) + (fMaxEta - fMinEta) * (fMaxEta - fMinEta)) / 2;
925 if (fMinRC2LJ > semiDiag * 0.5) {
926 AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. Will use fMinRC2LJ = %f", fMinRC2LJ, semiDiag * 0.5));
927 fMinRC2LJ = semiDiag * 0.5;
b12a85c3 928 }
25283b37 929}
930
931//________________________________________________________________________
00514d01 932void AliAnalysisTaskSAJF::Terminate(Option_t *)
25283b37 933{
934 // Called once at the end of the analysis.
935}