]>
Commit | Line | Data |
---|---|---|
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" |
55264f20 | 20 | #include "AliVTrack.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 | 27 | ClassImp(AliAnalysisTaskSAJF) |
25283b37 | 28 | |
29 | //________________________________________________________________________ | |
00514d01 | 30 | AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() : |
31 | AliAnalysisTaskSE("AliAnalysisTaskSAJF"), | |
b5ee47fb | 32 | fAnaType(kTPC), |
d41a0b1c | 33 | fInitialized(kFALSE), |
b5ee47fb | 34 | fMinEta(-0.9), |
35 | fMaxEta(0.9), | |
36 | fMinPhi(-10), | |
37 | fMaxPhi(10), | |
a55e4f1d | 38 | fJetRadius(0.4), |
b12a85c3 | 39 | fMinRC2LJ(1.0), |
25283b37 | 40 | fTracksName("Tracks"), |
41 | fCaloName("CaloClusters"), | |
42 | fJetsName("Jets"), | |
2bee31e9 | 43 | fEmbJetsName("EmbJets"), |
b12a85c3 | 44 | fRandTracksName("TracksRandomized"), |
45 | fRandCaloName("CaloClustersRandomized"), | |
226f511d | 46 | fRhoName("Rho"), |
47 | fNbins(500), | |
48 | fMinPt(0), | |
49 | fMaxPt(250), | |
50 | fPtCut(0.15), | |
b12a85c3 | 51 | fPtBiasJetTrack(10), |
52 | fPtBiasJetClus(10), | |
25283b37 | 53 | fTracks(0), |
54 | fCaloClusters(0), | |
55 | fJets(0), | |
2bee31e9 | 56 | fEmbJets(0), |
b12a85c3 | 57 | fRandTracks(0), |
58 | fRandCaloClusters(0), | |
f0a0fd33 | 59 | fCent(0), |
55264f20 | 60 | fCentBin(-1), |
b12a85c3 | 61 | fRho(0), |
226f511d | 62 | fOutput(0), |
f0a0fd33 | 63 | fHistCentrality(0), |
91f4b7c5 | 64 | fHistJetPhiEta(0), |
b12a85c3 | 65 | fHistRhoVSleadJetPt(0), |
66 | fHistRCPhiEta(0), | |
67 | fHistRCPtExLJVSDPhiLJ(0), | |
68 | fHistRhoVSRCPt(0), | |
b5ee47fb | 69 | fHistEmbJetPhiEta(0), |
70 | fHistEmbPartPhiEta(0), | |
b12a85c3 | 71 | fHistRhoVSEmbBkg(0) |
226f511d | 72 | |
25283b37 | 73 | { |
74 | // Default constructor. | |
f0a0fd33 | 75 | |
76 | for (Int_t i = 0; i < 4; i++) { | |
55264f20 | 77 | fHistJetsPt[i] = 0; |
b12a85c3 | 78 | fHistJetsPtTrack[i] = 0; |
79 | fHistJetsPtClus[i] = 0; | |
11d4d636 | 80 | fHistJetsPtNonBias[i] = 0; |
55264f20 | 81 | fHistLeadingJetPt[i] = 0; |
82 | fHist2LeadingJetPt[i] = 0; | |
b12a85c3 | 83 | fHistJetsNEFvsPt[i] = 0; |
84 | fHistJetsZvsPt[i] = 0; | |
f0a0fd33 | 85 | fHistTracksPtLJ[i] = 0; |
55264f20 | 86 | fHistClusEtLJ[i] = 0; |
f0a0fd33 | 87 | fHistTracksPtBkg[i] = 0; |
55264f20 | 88 | fHistClusEtBkg[i] = 0; |
b12a85c3 | 89 | fHistRho[i] = 0; |
90 | fHistCorrJetsPt[i] = 0; | |
91 | fHistCorrJetsPtClus[i] = 0; | |
92 | fHistCorrJetsPtTrack[i] = 0; | |
93 | fHistCorrJetsPtNonBias[i] = 0; | |
94 | fHistCorrLeadingJetPt[i] = 0; | |
a55e4f1d | 95 | fHistRCPt[i] = 0; |
96 | fHistRCPtExLJ[i] = 0; | |
b12a85c3 | 97 | fHistRCPtRand[i] = 0; |
98 | fHistDeltaPtRC[i] = 0; | |
99 | fHistDeltaPtRCExLJ[i] = 0; | |
100 | fHistDeltaPtRCRand[i] = 0; | |
2bee31e9 | 101 | fHistEmbJets[i] = 0; |
102 | fHistEmbPart[i] = 0; | |
b12a85c3 | 103 | fHistDeltaPtEmb[i] = 0; |
f0a0fd33 | 104 | } |
91f4b7c5 | 105 | |
d41a0b1c | 106 | fVertex[0] = 0; |
107 | fVertex[1] = 0; | |
108 | fVertex[2] = 0; | |
109 | ||
91f4b7c5 | 110 | // Output slot #1 writes into a TH1 container |
111 | DefineOutput(1, TList::Class()); | |
25283b37 | 112 | } |
113 | ||
114 | //________________________________________________________________________ | |
00514d01 | 115 | AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) : |
116 | AliAnalysisTaskSE(name), | |
b5ee47fb | 117 | fAnaType(kTPC), |
d41a0b1c | 118 | fInitialized(kFALSE), |
b5ee47fb | 119 | fMinEta(-0.9), |
120 | fMaxEta(0.9), | |
121 | fMinPhi(-10), | |
122 | fMaxPhi(10), | |
a55e4f1d | 123 | fJetRadius(0.4), |
b12a85c3 | 124 | fMinRC2LJ(1.0), |
25283b37 | 125 | fTracksName("Tracks"), |
126 | fCaloName("CaloClusters"), | |
127 | fJetsName("Jets"), | |
2bee31e9 | 128 | fEmbJetsName("EmbJets"), |
b12a85c3 | 129 | fRandTracksName("TracksRandomized"), |
130 | fRandCaloName("CaloClustersRandomized"), | |
226f511d | 131 | fRhoName("Rho"), |
132 | fNbins(500), | |
133 | fMinPt(0), | |
134 | fMaxPt(250), | |
135 | fPtCut(0.15), | |
b12a85c3 | 136 | fPtBiasJetTrack(10), |
137 | fPtBiasJetClus(10), | |
25283b37 | 138 | fTracks(0), |
139 | fCaloClusters(0), | |
140 | fJets(0), | |
2bee31e9 | 141 | fEmbJets(0), |
b12a85c3 | 142 | fRandTracks(0), |
143 | fRandCaloClusters(0), | |
f0a0fd33 | 144 | fCent(0), |
55264f20 | 145 | fCentBin(-1), |
b12a85c3 | 146 | fRho(0), |
226f511d | 147 | fOutput(0), |
f0a0fd33 | 148 | fHistCentrality(0), |
91f4b7c5 | 149 | fHistJetPhiEta(0), |
b12a85c3 | 150 | fHistRhoVSleadJetPt(0), |
151 | fHistRCPhiEta(0), | |
152 | fHistRCPtExLJVSDPhiLJ(0), | |
153 | fHistRhoVSRCPt(0), | |
b5ee47fb | 154 | fHistEmbJetPhiEta(0), |
155 | fHistEmbPartPhiEta(0), | |
b12a85c3 | 156 | fHistRhoVSEmbBkg(0) |
25283b37 | 157 | { |
158 | // Standard constructor. | |
159 | ||
f0a0fd33 | 160 | for (Int_t i = 0; i < 4; i++) { |
55264f20 | 161 | fHistJetsPt[i] = 0; |
b12a85c3 | 162 | fHistJetsPtTrack[i] = 0; |
163 | fHistJetsPtClus[i] = 0; | |
11d4d636 | 164 | fHistJetsPtNonBias[i] = 0; |
55264f20 | 165 | fHistLeadingJetPt[i] = 0; |
166 | fHist2LeadingJetPt[i] = 0; | |
b12a85c3 | 167 | fHistJetsNEFvsPt[i] = 0; |
168 | fHistJetsZvsPt[i] = 0; | |
f0a0fd33 | 169 | fHistTracksPtLJ[i] = 0; |
55264f20 | 170 | fHistClusEtLJ[i] = 0; |
f0a0fd33 | 171 | fHistTracksPtBkg[i] = 0; |
55264f20 | 172 | fHistClusEtBkg[i] = 0; |
b12a85c3 | 173 | fHistRho[i] = 0; |
174 | fHistCorrJetsPt[i] = 0; | |
175 | fHistCorrJetsPtClus[i] = 0; | |
176 | fHistCorrJetsPtTrack[i] = 0; | |
177 | fHistCorrJetsPtNonBias[i] = 0; | |
178 | fHistCorrLeadingJetPt[i] = 0; | |
a55e4f1d | 179 | fHistRCPt[i] = 0; |
180 | fHistRCPtExLJ[i] = 0; | |
b12a85c3 | 181 | fHistRCPtRand[i] = 0; |
182 | fHistDeltaPtRC[i] = 0; | |
183 | fHistDeltaPtRCExLJ[i] = 0; | |
184 | fHistDeltaPtRCRand[i] = 0; | |
2bee31e9 | 185 | fHistEmbJets[i] = 0; |
186 | fHistEmbPart[i] = 0; | |
b12a85c3 | 187 | fHistDeltaPtEmb[i] = 0; |
f0a0fd33 | 188 | } |
91f4b7c5 | 189 | |
d41a0b1c | 190 | fVertex[0] = 0; |
191 | fVertex[1] = 0; | |
192 | fVertex[2] = 0; | |
193 | ||
91f4b7c5 | 194 | // Output slot #1 writes into a TH1 container |
195 | DefineOutput(1, TList::Class()); | |
25283b37 | 196 | } |
197 | ||
198 | //________________________________________________________________________ | |
00514d01 | 199 | AliAnalysisTaskSAJF::~AliAnalysisTaskSAJF() |
25283b37 | 200 | { |
201 | // Destructor | |
202 | } | |
203 | ||
204 | //________________________________________________________________________ | |
00514d01 | 205 | void AliAnalysisTaskSAJF::UserCreateOutputObjects() |
25283b37 | 206 | { |
f0a0fd33 | 207 | // Create histograms |
11d4d636 | 208 | |
b12a85c3 | 209 | const Float_t binWidth = (fMaxPt - fMinPt) / fNbins; |
25283b37 | 210 | |
226f511d | 211 | OpenFile(1); |
25283b37 | 212 | fOutput = new TList(); |
226f511d | 213 | fOutput->SetOwner(); |
25283b37 | 214 | |
55264f20 | 215 | fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", fNbins, 0, 100); |
f0a0fd33 | 216 | fHistCentrality->GetXaxis()->SetTitle("Centrality (%)"); |
217 | fHistCentrality->GetYaxis()->SetTitle("counts"); | |
218 | fOutput->Add(fHistCentrality); | |
25283b37 | 219 | |
91f4b7c5 | 220 | fHistJetPhiEta = new TH2F("fHistJetPhiEta","Phi-Eta distribution of jets", 20, -2, 2, 32, 0, 6.4); |
b12a85c3 | 221 | fHistJetPhiEta->GetXaxis()->SetTitle("#eta"); |
222 | fHistJetPhiEta->GetYaxis()->SetTitle("#phi"); | |
91f4b7c5 | 223 | fOutput->Add(fHistJetPhiEta); |
224 | ||
b12a85c3 | 225 | fHistRhoVSleadJetPt = new TH2F("fHistRhoVSleadJetPt","fHistRhoVSleadJetPt", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt); |
226 | fHistRhoVSleadJetPt->GetXaxis()->SetTitle("#rho * area [GeV/c]"); | |
227 | fHistRhoVSleadJetPt->GetYaxis()->SetTitle("Leading jet p_{T} [GeV/c]"); | |
228 | fOutput->Add(fHistRhoVSleadJetPt); | |
b5ee47fb | 229 | |
b12a85c3 | 230 | fHistRCPhiEta = new TH2F("fHistRCPhiEta","Phi-Eta distribution of rigid cones", 20, -2, 2, 32, 0, 6.4); |
231 | fHistRCPhiEta->GetXaxis()->SetTitle("#eta"); | |
232 | fHistRCPhiEta->GetYaxis()->SetTitle("#phi"); | |
233 | fOutput->Add(fHistRCPhiEta); | |
b5ee47fb | 234 | |
235 | fHistRCPtExLJVSDPhiLJ = new TH2F("fHistRCPtExLJVSDPhiLJ","fHistRCPtExLJVSDPhiLJ", fNbins, fMinPt, fMaxPt, 128, -1.6, 4.8); | |
b12a85c3 | 236 | fHistRCPtExLJVSDPhiLJ->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); |
b5ee47fb | 237 | fHistRCPtExLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi"); |
238 | fOutput->Add(fHistRCPtExLJVSDPhiLJ); | |
239 | ||
b12a85c3 | 240 | fHistRhoVSRCPt = new TH2F("fHistRhoVSRCPt","fHistRhoVSRCPt", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt); |
241 | fHistRhoVSRCPt->GetXaxis()->SetTitle("#rho * area [GeV/c]"); | |
242 | fHistRhoVSRCPt->GetYaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); | |
243 | fOutput->Add(fHistRhoVSRCPt); | |
244 | ||
245 | fHistEmbJetPhiEta = new TH2F("fHistEmbJetPhiEta","Phi-Eta distribution of embedded jets", 20, -2, 2, 32, 0, 6.4); | |
246 | fHistEmbJetPhiEta->GetXaxis()->SetTitle("#eta"); | |
247 | fHistEmbJetPhiEta->GetYaxis()->SetTitle("#phi"); | |
248 | fOutput->Add(fHistEmbJetPhiEta); | |
249 | ||
250 | fHistEmbPartPhiEta = new TH2F("fHistEmbPartPhiEta","Phi-Eta distribution of embedded particles", 20, -2, 2, 32, 0, 6.4); | |
251 | fHistEmbPartPhiEta->GetXaxis()->SetTitle("#eta"); | |
252 | fHistEmbPartPhiEta->GetYaxis()->SetTitle("#phi"); | |
253 | fOutput->Add(fHistEmbPartPhiEta); | |
254 | ||
255 | fHistRhoVSEmbBkg = new TH2F("fHistRhoVSEmbBkg","fHistRhoVSEmbBkg", fNbins, fMinPt, fMaxPt, fNbins, fMinPt, fMaxPt); | |
256 | fHistRhoVSEmbBkg->GetXaxis()->SetTitle("rho * area [GeV/c]"); | |
257 | fHistRhoVSEmbBkg->GetYaxis()->SetTitle("background of embedded track [GeV/c]"); | |
258 | fOutput->Add(fHistRhoVSEmbBkg); | |
b5ee47fb | 259 | |
f0a0fd33 | 260 | TString histname; |
261 | ||
262 | for (Int_t i = 0; i < 4; i++) { | |
55264f20 | 263 | histname = "fHistJetsPt_"; |
f0a0fd33 | 264 | histname += i; |
55264f20 | 265 | fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
b12a85c3 | 266 | fHistJetsPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
55264f20 | 267 | fHistJetsPt[i]->GetYaxis()->SetTitle("counts"); |
268 | fOutput->Add(fHistJetsPt[i]); | |
226f511d | 269 | |
b12a85c3 | 270 | if (fAnaType == kEMCAL) { |
271 | histname = "fHistJetsPtClus_"; | |
272 | histname += i; | |
273 | fHistJetsPtClus[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); | |
274 | fHistJetsPtClus[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
275 | fHistJetsPtClus[i]->GetYaxis()->SetTitle("counts"); | |
276 | fOutput->Add(fHistJetsPtClus[i]); | |
277 | } | |
226f511d | 278 | |
b12a85c3 | 279 | histname = "fHistJetsPtTrack_"; |
11d4d636 | 280 | histname += i; |
b12a85c3 | 281 | fHistJetsPtTrack[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
282 | fHistJetsPtTrack[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
283 | fHistJetsPtTrack[i]->GetYaxis()->SetTitle("counts"); | |
284 | fOutput->Add(fHistJetsPtTrack[i]); | |
11d4d636 | 285 | |
286 | histname = "fHistJetsPtNonBias_"; | |
226f511d | 287 | histname += i; |
11d4d636 | 288 | fHistJetsPtNonBias[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
b12a85c3 | 289 | fHistJetsPtNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
11d4d636 | 290 | fHistJetsPtNonBias[i]->GetYaxis()->SetTitle("counts"); |
291 | fOutput->Add(fHistJetsPtNonBias[i]); | |
226f511d | 292 | |
55264f20 | 293 | histname = "fHistLeadingJetPt_"; |
f0a0fd33 | 294 | histname += i; |
55264f20 | 295 | fHistLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); |
b12a85c3 | 296 | fHistLeadingJetPt[i]->GetXaxis()->SetTitle("p_{T} [GeV]"); |
55264f20 | 297 | fHistLeadingJetPt[i]->GetYaxis()->SetTitle("counts"); |
298 | fOutput->Add(fHistLeadingJetPt[i]); | |
b5ee47fb | 299 | |
300 | histname = "fHist2LeadingJetPt_"; | |
301 | histname += i; | |
302 | fHist2LeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); | |
b12a85c3 | 303 | fHist2LeadingJetPt[i]->GetXaxis()->SetTitle("p_{T} [GeV]"); |
b5ee47fb | 304 | fHist2LeadingJetPt[i]->GetYaxis()->SetTitle("counts"); |
305 | fOutput->Add(fHist2LeadingJetPt[i]); | |
306 | ||
b12a85c3 | 307 | histname = "fHistJetsZvsPt_"; |
b5ee47fb | 308 | histname += i; |
b12a85c3 | 309 | fHistJetsZvsPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, 0, 1.2, fNbins, fMinPt, fMaxPt); |
310 | fHistJetsZvsPt[i]->GetXaxis()->SetTitle("Z"); | |
311 | fHistJetsZvsPt[i]->GetYaxis()->SetTitle("p_{T} [GeV/c]"); | |
312 | fOutput->Add(fHistJetsZvsPt[i]); | |
313 | ||
314 | if (fAnaType == kEMCAL) { | |
315 | histname = "fHistJetsNEFvsPt_"; | |
316 | histname += i; | |
317 | fHistJetsNEFvsPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, 0, 1.2, fNbins, fMinPt, fMaxPt); | |
318 | fHistJetsNEFvsPt[i]->GetXaxis()->SetTitle("NEF"); | |
319 | fHistJetsNEFvsPt[i]->GetYaxis()->SetTitle("p_{T} [GeV/c]"); | |
320 | fOutput->Add(fHistJetsNEFvsPt[i]); | |
321 | ||
322 | histname = "fHistClusEtLJ_"; | |
323 | histname += i; | |
324 | fHistClusEtLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5); | |
325 | fHistClusEtLJ[i]->GetXaxis()->SetTitle("E_{T} [GeV]"); | |
326 | fHistClusEtLJ[i]->GetYaxis()->SetTitle("counts"); | |
327 | fOutput->Add(fHistClusEtLJ[i]); | |
328 | ||
329 | histname = "fHistClusEtBkg_"; | |
330 | histname += i; | |
331 | fHistClusEtBkg[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5); | |
332 | fHistClusEtBkg[i]->GetXaxis()->SetTitle("E_{T} [GeV]"); | |
333 | fHistClusEtBkg[i]->GetYaxis()->SetTitle("counts"); | |
334 | fOutput->Add(fHistClusEtBkg[i]); | |
335 | } | |
336 | ||
f0a0fd33 | 337 | histname = "fHistTracksPtLJ_"; |
338 | histname += i; | |
b5ee47fb | 339 | fHistTracksPtLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5); |
b12a85c3 | 340 | fHistTracksPtLJ[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
f0a0fd33 | 341 | fHistTracksPtLJ[i]->GetYaxis()->SetTitle("counts"); |
342 | fOutput->Add(fHistTracksPtLJ[i]); | |
f0a0fd33 | 343 | |
344 | histname = "fHistTracksPtBkg_"; | |
345 | histname += i; | |
b5ee47fb | 346 | fHistTracksPtBkg[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt / 5); |
b12a85c3 | 347 | fHistTracksPtBkg[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
f0a0fd33 | 348 | fHistTracksPtBkg[i]->GetYaxis()->SetTitle("counts"); |
349 | fOutput->Add(fHistTracksPtBkg[i]); | |
b12a85c3 | 350 | |
351 | histname = "fHistRho_"; | |
352 | histname += i; | |
353 | fHistRho[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2); | |
354 | fHistRho[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
355 | fHistRho[i]->GetYaxis()->SetTitle("counts"); | |
356 | fOutput->Add(fHistRho[i]); | |
357 | ||
358 | histname = "fHistCorrJetsPt_"; | |
359 | histname += i; | |
360 | fHistCorrJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt); | |
361 | fHistCorrJetsPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
362 | fHistCorrJetsPt[i]->GetYaxis()->SetTitle("counts"); | |
363 | fOutput->Add(fHistCorrJetsPt[i]); | |
364 | ||
365 | if (fAnaType == kEMCAL) { | |
366 | histname = "fHistCorrJetsPtClus_"; | |
367 | histname += i; | |
368 | fHistCorrJetsPtClus[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt); | |
369 | fHistCorrJetsPtClus[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
370 | fHistCorrJetsPtClus[i]->GetYaxis()->SetTitle("counts"); | |
371 | fOutput->Add(fHistCorrJetsPtClus[i]); | |
372 | } | |
373 | ||
374 | histname = "fHistCorrJetsPtTrack_"; | |
f0a0fd33 | 375 | histname += i; |
b12a85c3 | 376 | fHistCorrJetsPtTrack[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt); |
377 | fHistCorrJetsPtTrack[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
378 | fHistCorrJetsPtTrack[i]->GetYaxis()->SetTitle("counts"); | |
379 | fOutput->Add(fHistCorrJetsPtTrack[i]); | |
c554a987 | 380 | |
b12a85c3 | 381 | histname = "fHistCorrJetsPtNonBias_"; |
382 | histname += i; | |
383 | fHistCorrJetsPtNonBias[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt); | |
384 | fHistCorrJetsPtNonBias[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
385 | fHistCorrJetsPtNonBias[i]->GetYaxis()->SetTitle("counts"); | |
386 | fOutput->Add(fHistCorrJetsPtNonBias[i]); | |
387 | ||
388 | histname = "fHistCorrLeadingJetPt_"; | |
389 | histname += i; | |
390 | fHistCorrLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxPt, fMaxPt); | |
391 | fHistCorrLeadingJetPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
392 | fHistCorrLeadingJetPt[i]->GetYaxis()->SetTitle("counts"); | |
393 | fOutput->Add(fHistCorrLeadingJetPt[i]); | |
394 | ||
395 | histname = "fHistRCPt_"; | |
c554a987 | 396 | histname += i; |
b12a85c3 | 397 | fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2); |
398 | fHistRCPt[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); | |
399 | fHistRCPt[i]->GetYaxis()->SetTitle("counts"); | |
400 | fOutput->Add(fHistRCPt[i]); | |
c554a987 | 401 | |
b12a85c3 | 402 | histname = "fHistRCPtExLJ_"; |
c554a987 | 403 | histname += i; |
b12a85c3 | 404 | fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2); |
405 | fHistRCPtExLJ[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); | |
406 | fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts"); | |
407 | fOutput->Add(fHistRCPtExLJ[i]); | |
c554a987 | 408 | |
b12a85c3 | 409 | histname = "fHistRCPtRand_"; |
c554a987 | 410 | histname += i; |
b12a85c3 | 411 | fHistRCPtRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt * 2); |
412 | fHistRCPtRand[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); | |
413 | fHistRCPtRand[i]->GetYaxis()->SetTitle("counts"); | |
414 | fOutput->Add(fHistRCPtRand[i]); | |
a55e4f1d | 415 | |
416 | histname = "fHistDeltaPtRC_"; | |
417 | histname += i; | |
11d4d636 | 418 | fHistDeltaPtRC[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2); |
b12a85c3 | 419 | fHistDeltaPtRC[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]"); |
a55e4f1d | 420 | fHistDeltaPtRC[i]->GetYaxis()->SetTitle("counts"); |
421 | fOutput->Add(fHistDeltaPtRC[i]); | |
422 | ||
423 | histname = "fHistDeltaPtRCExLJ_"; | |
424 | histname += i; | |
11d4d636 | 425 | fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2); |
b12a85c3 | 426 | fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]"); |
a55e4f1d | 427 | fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts"); |
428 | fOutput->Add(fHistDeltaPtRCExLJ[i]); | |
429 | ||
b12a85c3 | 430 | histname = "fHistDeltaPtRCRand_"; |
a55e4f1d | 431 | histname += i; |
b12a85c3 | 432 | fHistDeltaPtRCRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2); |
433 | fHistDeltaPtRCRand[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]"); | |
434 | fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts"); | |
435 | fOutput->Add(fHistDeltaPtRCRand[i]); | |
2bee31e9 | 436 | |
437 | histname = "fHistEmbJets_"; | |
438 | histname += i; | |
439 | fHistEmbJets[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); | |
b12a85c3 | 440 | fHistEmbJets[i]->GetXaxis()->SetTitle("embedded jet p_{T} [GeV/c]"); |
2bee31e9 | 441 | fHistEmbJets[i]->GetYaxis()->SetTitle("counts"); |
442 | fOutput->Add(fHistEmbJets[i]); | |
443 | ||
444 | histname = "fHistEmbPart_"; | |
445 | histname += i; | |
446 | fHistEmbPart[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt, fMaxPt); | |
b12a85c3 | 447 | fHistEmbPart[i]->GetXaxis()->SetTitle("embedded particle p_{T} [GeV/c]"); |
2bee31e9 | 448 | fHistEmbPart[i]->GetYaxis()->SetTitle("counts"); |
449 | fOutput->Add(fHistEmbPart[i]); | |
450 | ||
b12a85c3 | 451 | histname = "fHistDeltaPtEmb_"; |
2bee31e9 | 452 | histname += i; |
b12a85c3 | 453 | fHistDeltaPtEmb[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinPt - fMaxPt / 2 + binWidth / 2, fMinPt + fMaxPt / 2 + binWidth / 2); |
454 | fHistDeltaPtEmb[i]->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]"); | |
455 | fHistDeltaPtEmb[i]->GetYaxis()->SetTitle("counts"); | |
456 | fOutput->Add(fHistDeltaPtEmb[i]); | |
e82e282c | 457 | } |
458 | ||
25283b37 | 459 | PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram |
460 | } | |
461 | ||
55264f20 | 462 | //________________________________________________________________________ |
00514d01 | 463 | void AliAnalysisTaskSAJF::RetrieveEventObjects() |
25283b37 | 464 | { |
11d4d636 | 465 | if (strcmp(fCaloName,"") && fAnaType == kEMCAL) { |
b5ee47fb | 466 | fCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fCaloName)); |
467 | if (!fCaloClusters) { | |
b12a85c3 | 468 | AliWarning(Form("Could not retrieve clusters %s!", fCaloName.Data())); |
b5ee47fb | 469 | } |
f0a0fd33 | 470 | } |
25283b37 | 471 | |
b12a85c3 | 472 | if (strcmp(fTracksName,"")) { |
473 | fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName)); | |
474 | if (!fTracks) { | |
475 | AliWarning(Form("Could not retrieve tracks %s!", fTracksName.Data())); | |
476 | } | |
25283b37 | 477 | } |
f0a0fd33 | 478 | |
b12a85c3 | 479 | if (strcmp(fJetsName,"")) { |
480 | fJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fJetsName)); | |
481 | if (!fJets) { | |
482 | AliWarning(Form("Could not retrieve jets %s!", fJetsName.Data())); | |
483 | } | |
e82e282c | 484 | } |
f0a0fd33 | 485 | |
2bee31e9 | 486 | if (strcmp(fEmbJetsName,"")) { |
487 | fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName)); | |
488 | if (!fEmbJets) { | |
b12a85c3 | 489 | AliWarning(Form("Could not retrieve emb jets %s!", fEmbJetsName.Data())); |
490 | } | |
491 | } | |
492 | ||
493 | if (strcmp(fRandCaloName,"") && fAnaType == kEMCAL) { | |
494 | fRandCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandCaloName)); | |
495 | if (!fRandCaloClusters) { | |
496 | AliWarning(Form("Could not retrieve randomized clusters %s!", fRandCaloName.Data())); | |
497 | } | |
498 | } | |
499 | ||
500 | if (strcmp(fRandTracksName,"")) { | |
501 | fRandTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandTracksName)); | |
502 | if (!fRandTracks) { | |
503 | AliWarning(Form("Could not retrieve randomized tracks %s!", fRandTracksName.Data())); | |
2bee31e9 | 504 | } |
505 | } | |
f0a0fd33 | 506 | |
11d4d636 | 507 | AliCentrality *aliCent = InputEvent()->GetCentrality(); |
508 | if (aliCent) { | |
509 | fCent = aliCent->GetCentralityPercentile("V0M"); | |
510 | if (fCent >= 0 && fCent < 10) fCentBin = 0; | |
511 | else if (fCent >= 10 && fCent < 30) fCentBin = 1; | |
512 | else if (fCent >= 30 && fCent < 50) fCentBin = 2; | |
513 | else if (fCent >= 50 && fCent <= 100) fCentBin = 3; | |
55264f20 | 514 | else { |
11d4d636 | 515 | AliWarning(Form("Negative centrality: %f. Assuming 99", fCent)); |
55264f20 | 516 | fCentBin = 3; |
517 | } | |
518 | } | |
519 | else { | |
520 | AliWarning(Form("Could not retrieve centrality information! Assuming 99")); | |
521 | fCentBin = 3; | |
c554a987 | 522 | } |
226f511d | 523 | |
11d4d636 | 524 | fRho = -1; |
226f511d | 525 | |
11d4d636 | 526 | if (strcmp(fRhoName,"")) { |
527 | TParameter<Double_t> *rho = dynamic_cast<TParameter<Double_t>*>(InputEvent()->FindListObject(fRhoName)); | |
528 | ||
529 | if (rho) { | |
530 | fRho = rho->GetVal(); | |
531 | } | |
532 | else { | |
b12a85c3 | 533 | AliWarning(Form("Could not retrieve rho %s!", fRhoName.Data())); |
11d4d636 | 534 | } |
226f511d | 535 | } |
b12a85c3 | 536 | |
537 | fVertex[0] = 0; | |
538 | fVertex[1] = 0; | |
539 | fVertex[2] = 0; | |
540 | InputEvent()->GetPrimaryVertex()->GetXYZ(fVertex); | |
25283b37 | 541 | } |
542 | ||
55264f20 | 543 | //________________________________________________________________________ |
00514d01 | 544 | AliVTrack* AliAnalysisTaskSAJF::GetTrack(const Int_t i) const |
25283b37 | 545 | { |
e82e282c | 546 | if (fTracks) |
547 | return dynamic_cast<AliVTrack*>(fTracks->At(i)); | |
548 | else | |
549 | return 0; | |
25283b37 | 550 | } |
551 | ||
55264f20 | 552 | //________________________________________________________________________ |
00514d01 | 553 | Int_t AliAnalysisTaskSAJF::GetNumberOfTracks() const |
25283b37 | 554 | { |
e82e282c | 555 | if (fTracks) |
556 | return fTracks->GetEntriesFast(); | |
557 | else | |
558 | return 0; | |
25283b37 | 559 | } |
560 | ||
55264f20 | 561 | //________________________________________________________________________ |
00514d01 | 562 | AliVCluster* AliAnalysisTaskSAJF::GetCaloCluster(const Int_t i) const |
e82e282c | 563 | { |
564 | if (fCaloClusters) | |
565 | return dynamic_cast<AliVCluster*>(fCaloClusters->At(i)); | |
566 | else | |
567 | return 0; | |
25283b37 | 568 | } |
569 | ||
55264f20 | 570 | //________________________________________________________________________ |
00514d01 | 571 | Int_t AliAnalysisTaskSAJF::GetNumberOfCaloClusters() const |
e82e282c | 572 | { |
573 | if (fCaloClusters) | |
574 | return fCaloClusters->GetEntriesFast(); | |
575 | else | |
576 | return 0; | |
25283b37 | 577 | } |
578 | ||
55264f20 | 579 | //________________________________________________________________________ |
00514d01 | 580 | AliEmcalJet* AliAnalysisTaskSAJF::GetJet(const Int_t i) const |
25283b37 | 581 | { |
e82e282c | 582 | if (fJets) |
583 | return dynamic_cast<AliEmcalJet*>(fJets->At(i)); | |
584 | else | |
585 | return 0; | |
25283b37 | 586 | } |
587 | ||
55264f20 | 588 | //________________________________________________________________________ |
00514d01 | 589 | Int_t AliAnalysisTaskSAJF::GetNumberOfJets() const |
25283b37 | 590 | { |
e82e282c | 591 | if (fJets) |
592 | return fJets->GetEntriesFast(); | |
593 | else | |
594 | return 0; | |
595 | } | |
596 | ||
2bee31e9 | 597 | //________________________________________________________________________ |
598 | AliEmcalJet* AliAnalysisTaskSAJF::GetEmbJet(const Int_t i) const | |
599 | { | |
600 | if (fEmbJets) | |
601 | return dynamic_cast<AliEmcalJet*>(fEmbJets->At(i)); | |
602 | else | |
603 | return 0; | |
604 | } | |
605 | ||
606 | //________________________________________________________________________ | |
607 | Int_t AliAnalysisTaskSAJF::GetNumberOfEmbJets() const | |
608 | { | |
609 | if (fEmbJets) | |
610 | return fEmbJets->GetEntriesFast(); | |
611 | else | |
612 | return 0; | |
613 | } | |
614 | ||
55264f20 | 615 | //________________________________________________________________________ |
00514d01 | 616 | void AliAnalysisTaskSAJF::FillHistograms() |
25283b37 | 617 | { |
55264f20 | 618 | Int_t maxJetIndex = -1; |
619 | Int_t max2JetIndex = -1; | |
25283b37 | 620 | |
b12a85c3 | 621 | // ************ |
622 | // General histograms | |
623 | // _________________________________ | |
624 | ||
55264f20 | 625 | DoJetLoop(maxJetIndex, max2JetIndex); |
626 | ||
627 | if (maxJetIndex < 0) | |
628 | return; | |
c554a987 | 629 | |
55264f20 | 630 | AliEmcalJet* jet = GetJet(maxJetIndex); |
631 | if (!jet) | |
632 | return; | |
c554a987 | 633 | |
11d4d636 | 634 | fHistCentrality->Fill(fCent); |
635 | ||
55264f20 | 636 | fHistLeadingJetPt[fCentBin]->Fill(jet->Pt()); |
b12a85c3 | 637 | fHistRhoVSleadJetPt->Fill(fRho * jet->Area(), jet->Pt()); |
638 | ||
55264f20 | 639 | jet->SortConstituents(); |
640 | ||
641 | AliEmcalJet* jet2 = 0; | |
642 | if (max2JetIndex >= 0) | |
643 | jet2 = GetJet(max2JetIndex); | |
644 | ||
b5ee47fb | 645 | if (jet2) { |
646 | fHist2LeadingJetPt[fCentBin]->Fill(jet2->Pt()); | |
55264f20 | 647 | jet2->SortConstituents(); |
b5ee47fb | 648 | } |
c554a987 | 649 | |
b12a85c3 | 650 | fHistRho[fCentBin]->Fill(fRho); |
b5ee47fb | 651 | |
226f511d | 652 | Float_t maxJetCorrPt = jet->Pt() - fRho * jet->Area(); |
653 | if (maxJetCorrPt > 0) | |
654 | fHistCorrLeadingJetPt[fCentBin]->Fill(maxJetCorrPt); | |
55264f20 | 655 | |
b12a85c3 | 656 | DoTrackLoop(maxJetIndex); |
55264f20 | 657 | |
b5ee47fb | 658 | if (fAnaType == kEMCAL) |
b12a85c3 | 659 | DoClusterLoop(maxJetIndex); |
55264f20 | 660 | |
b12a85c3 | 661 | // ************ |
662 | // Random cones | |
663 | // _________________________________ | |
a55e4f1d | 664 | |
d41a0b1c | 665 | const Float_t rcArea = fJetRadius * fJetRadius * TMath::Pi(); |
666 | ||
b12a85c3 | 667 | // Simple random cones |
668 | Float_t RCpt = 0; | |
669 | Float_t RCeta = 0; | |
670 | Float_t RCphi = 0; | |
671 | GetRigidCone(RCpt, RCeta, RCphi, kFALSE, 0); | |
672 | if (RCpt > 0) { | |
d41a0b1c | 673 | fHistRCPt[fCentBin]->Fill(RCpt / rcArea); |
674 | fHistDeltaPtRC[fCentBin]->Fill(RCpt - rcArea * fRho); | |
b12a85c3 | 675 | } |
676 | ||
677 | // Random cones far from leading jet | |
678 | Float_t RCptExLJ = 0; | |
679 | Float_t RCetaExLJ = 0; | |
680 | Float_t RCphiExLJ = 0; | |
681 | GetRigidCone(RCptExLJ, RCetaExLJ, RCphiExLJ, kFALSE, jet); | |
682 | if (RCptExLJ > 0) { | |
683 | fHistRCPhiEta->Fill(RCetaExLJ, RCphiExLJ); | |
d41a0b1c | 684 | fHistRhoVSRCPt->Fill(fRho, RCptExLJ / rcArea); |
b5ee47fb | 685 | |
686 | Float_t dphi = RCphiExLJ - jet->Phi(); | |
687 | if (dphi > 4.8) dphi -= TMath::Pi() * 2; | |
688 | if (dphi < -1.6) dphi += TMath::Pi() * 2; | |
689 | fHistRCPtExLJVSDPhiLJ->Fill(RCptExLJ, dphi); | |
b12a85c3 | 690 | |
d41a0b1c | 691 | fHistRCPtExLJ[fCentBin]->Fill(RCptExLJ / rcArea); |
692 | fHistDeltaPtRCExLJ[fCentBin]->Fill(RCptExLJ - rcArea * fRho); | |
b12a85c3 | 693 | } |
694 | ||
695 | // Random cones with randomized particles | |
696 | Float_t RCptRand = 0; | |
697 | Float_t RCetaRand = 0; | |
698 | Float_t RCphiRand = 0; | |
699 | GetRigidCone(RCptRand, RCetaRand, RCphiRand, kTRUE, 0, fRandTracks, fRandCaloClusters); | |
700 | if (RCptRand > 0) { | |
d41a0b1c | 701 | fHistRCPtRand[fCentBin]->Fill(RCptRand / rcArea); |
702 | fHistDeltaPtRCRand[fCentBin]->Fill(RCptRand - rcArea * fRho); | |
a55e4f1d | 703 | } |
2bee31e9 | 704 | |
b12a85c3 | 705 | // ************ |
706 | // Embedding | |
707 | // _________________________________ | |
708 | ||
709 | AliEmcalJet *embJet = 0; | |
b5ee47fb | 710 | TObject *maxPart = 0; |
2bee31e9 | 711 | |
b12a85c3 | 712 | DoEmbJetLoop(embJet, maxPart); |
2bee31e9 | 713 | |
b12a85c3 | 714 | if (embJet && maxPart) { |
b5ee47fb | 715 | Float_t maxEmbPartPt = 0; |
716 | Float_t maxEmbPartEta = 0; | |
717 | Float_t maxEmbPartPhi = 0; | |
b12a85c3 | 718 | |
719 | AliVCluster *cluster = dynamic_cast<AliVCluster*>(maxPart); | |
b5ee47fb | 720 | if (cluster) { |
b5ee47fb | 721 | TLorentzVector nPart; |
b12a85c3 | 722 | cluster->GetMomentum(nPart, fVertex); |
b5ee47fb | 723 | Float_t pos[3]; |
724 | cluster->GetPosition(pos); | |
725 | TVector3 clusVec(pos); | |
726 | ||
727 | maxEmbPartPt = nPart.Et(); | |
728 | maxEmbPartEta = clusVec.Eta(); | |
729 | maxEmbPartPhi = clusVec.Phi(); | |
730 | } | |
b5ee47fb | 731 | else { |
b12a85c3 | 732 | AliVTrack *track = dynamic_cast<AliVTrack*>(maxPart); |
733 | if (track) { | |
734 | maxEmbPartPt = track->Pt(); | |
735 | maxEmbPartEta = track->Eta(); | |
736 | maxEmbPartPhi = track->Phi(); | |
737 | } | |
738 | else { | |
739 | AliWarning(Form("%s - Embedded particle type not recognized (neither AliVCluster nor AliVTrack)!", GetName())); | |
740 | return; | |
741 | } | |
b5ee47fb | 742 | } |
b12a85c3 | 743 | fHistEmbJets[fCentBin]->Fill(embJet->Pt()); |
2bee31e9 | 744 | fHistEmbPart[fCentBin]->Fill(maxEmbPartPt); |
b12a85c3 | 745 | fHistEmbJetPhiEta->Fill(embJet->Eta(), embJet->Phi()); |
b5ee47fb | 746 | fHistEmbPartPhiEta->Fill(maxEmbPartEta, maxEmbPartPhi); |
b12a85c3 | 747 | |
748 | fHistDeltaPtEmb[fCentBin]->Fill(embJet->Pt() - embJet->Area() * fRho - maxEmbPartPt); | |
749 | fHistRhoVSEmbBkg->Fill(embJet->Area() * fRho, embJet->Pt() - maxEmbPartPt); | |
2bee31e9 | 750 | } |
751 | else { | |
b12a85c3 | 752 | AliWarning(Form("%s - Embedded particle not found in the event!", GetName())); |
2bee31e9 | 753 | } |
55264f20 | 754 | } |
755 | ||
756 | //________________________________________________________________________ | |
757 | void AliAnalysisTaskSAJF::DoJetLoop(Int_t &maxJetIndex, Int_t &max2JetIndex) | |
758 | { | |
55264f20 | 759 | Int_t njets = GetNumberOfJets(); |
55264f20 | 760 | |
761 | Float_t maxJetPt = 0; | |
762 | Float_t max2JetPt = 0; | |
25283b37 | 763 | for (Int_t ij = 0; ij < njets; ij++) { |
f0a0fd33 | 764 | |
25283b37 | 765 | AliEmcalJet* jet = GetJet(ij); |
f0a0fd33 | 766 | |
25283b37 | 767 | if (!jet) { |
a55e4f1d | 768 | AliError(Form("Could not receive jet %d", ij)); |
25283b37 | 769 | continue; |
770 | } | |
771 | ||
55264f20 | 772 | if (jet->Pt() <= 0) |
f0a0fd33 | 773 | continue; |
774 | ||
91f4b7c5 | 775 | if (!AcceptJet(jet)) |
776 | continue; | |
777 | ||
226f511d | 778 | Float_t corrPt = jet->Pt() - fRho * jet->Area(); |
779 | ||
11d4d636 | 780 | fHistJetsPtNonBias[fCentBin]->Fill(jet->Pt()); |
781 | fHistCorrJetsPtNonBias[fCentBin]->Fill(corrPt); | |
226f511d | 782 | |
b12a85c3 | 783 | if (jet->MaxTrackPt() > fPtBiasJetTrack) { |
784 | fHistJetsPtTrack[fCentBin]->Fill(jet->Pt()); | |
785 | fHistCorrJetsPtTrack[fCentBin]->Fill(corrPt); | |
786 | } | |
787 | ||
788 | if (fAnaType == kEMCAL && jet->MaxClusterPt() > fPtBiasJetClus) { | |
789 | fHistJetsPtClus[fCentBin]->Fill(jet->Pt()); | |
790 | fHistCorrJetsPtClus[fCentBin]->Fill(corrPt); | |
791 | } | |
792 | ||
793 | if (jet->MaxTrackPt() < fPtBiasJetTrack && (fAnaType == kTPC || jet->MaxClusterPt() < fPtBiasJetClus)) | |
794 | continue; | |
226f511d | 795 | |
11d4d636 | 796 | fHistJetsPt[fCentBin]->Fill(jet->Pt()); |
797 | fHistCorrJetsPt[fCentBin]->Fill(corrPt); | |
f0a0fd33 | 798 | |
11d4d636 | 799 | fHistJetPhiEta->Fill(jet->Eta(), jet->Phi()); |
b12a85c3 | 800 | |
801 | if (fAnaType == kEMCAL) | |
802 | fHistJetsNEFvsPt[fCentBin]->Fill(jet->NEF(), jet->Pt()); | |
226f511d | 803 | |
35789a2d | 804 | for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) { |
a55e4f1d | 805 | AliVTrack *track = jet->TrackAt(it, fTracks); |
35789a2d | 806 | if (track) |
b12a85c3 | 807 | fHistJetsZvsPt[fCentBin]->Fill(track->Pt() / jet->Pt(), jet->Pt()); |
35789a2d | 808 | } |
a55e4f1d | 809 | |
35789a2d | 810 | for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) { |
a55e4f1d | 811 | AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters); |
55264f20 | 812 | |
813 | if (cluster) { | |
814 | TLorentzVector nPart; | |
b12a85c3 | 815 | cluster->GetMomentum(nPart, fVertex); |
11d4d636 | 816 | fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), corrPt); |
55264f20 | 817 | } |
f0a0fd33 | 818 | } |
819 | ||
11d4d636 | 820 | if (maxJetPt < corrPt) { |
55264f20 | 821 | max2JetPt = maxJetPt; |
c554a987 | 822 | max2JetIndex = maxJetIndex; |
11d4d636 | 823 | maxJetPt = corrPt; |
f0a0fd33 | 824 | maxJetIndex = ij; |
35789a2d | 825 | } |
11d4d636 | 826 | else if (max2JetPt < corrPt) { |
827 | max2JetPt = corrPt; | |
c554a987 | 828 | max2JetIndex = ij; |
829 | } | |
25283b37 | 830 | } //jet loop |
55264f20 | 831 | } |
e82e282c | 832 | |
55264f20 | 833 | //________________________________________________________________________ |
b12a85c3 | 834 | void AliAnalysisTaskSAJF::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &maxPart) |
55264f20 | 835 | { |
b12a85c3 | 836 | TLorentzVector *maxClusVect = new TLorentzVector(); |
2bee31e9 | 837 | |
838 | Int_t nembjets = GetNumberOfEmbJets(); | |
839 | ||
2bee31e9 | 840 | for (Int_t ij = 0; ij < nembjets; ij++) { |
841 | ||
842 | AliEmcalJet* jet = GetEmbJet(ij); | |
843 | ||
844 | if (!jet) { | |
845 | AliError(Form("Could not receive jet %d", ij)); | |
846 | continue; | |
847 | } | |
848 | ||
849 | if (jet->Pt() <= 0) | |
850 | continue; | |
851 | ||
b12a85c3 | 852 | //if (!AcceptJet(jet)) |
853 | //continue; | |
2bee31e9 | 854 | |
b12a85c3 | 855 | AliVTrack *maxTrack = 0; |
2bee31e9 | 856 | |
b12a85c3 | 857 | for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) { |
858 | AliVTrack *track = jet->TrackAt(it, fTracks); | |
859 | ||
860 | if (!track) continue; | |
861 | ||
862 | if (!maxTrack || track->Pt() > maxTrack->Pt()) | |
863 | maxTrack = track; | |
2bee31e9 | 864 | } |
2bee31e9 | 865 | |
b12a85c3 | 866 | AliVCluster *maxClus = 0; |
2bee31e9 | 867 | |
b12a85c3 | 868 | for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) { |
869 | AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters); | |
870 | ||
871 | if (!cluster) continue; | |
872 | ||
873 | TLorentzVector nPart; | |
874 | cluster->GetMomentum(nPart, fVertex); | |
875 | ||
876 | if (!maxClus || nPart.Et() > maxClusVect->Et()) { | |
877 | new (maxClusVect) TLorentzVector(nPart); | |
878 | maxClus = cluster; | |
879 | } | |
880 | } | |
2bee31e9 | 881 | |
b12a85c3 | 882 | if ((maxClus && maxTrack && maxClusVect->Et() > maxTrack->Pt()) || (maxClus && !maxTrack)) { |
883 | if (maxClus->Chi2() == 100) { | |
884 | maxPart = maxClus; | |
885 | embJet = jet; | |
886 | delete maxClusVect; | |
887 | return; | |
888 | } | |
889 | } | |
890 | else if (maxTrack) { | |
891 | if (maxTrack->GetLabel() == 100) { | |
892 | maxPart = maxTrack; | |
893 | embJet = jet; | |
894 | delete maxClusVect; | |
895 | return; | |
896 | } | |
897 | } | |
2bee31e9 | 898 | } |
b12a85c3 | 899 | |
900 | delete maxClusVect; | |
2bee31e9 | 901 | } |
902 | ||
903 | //________________________________________________________________________ | |
b12a85c3 | 904 | void AliAnalysisTaskSAJF::DoTrackLoop(Int_t maxJetIndex) |
2bee31e9 | 905 | { |
27b20058 | 906 | AliEmcalJet* jet = 0; |
b12a85c3 | 907 | if (maxJetIndex >= 0) |
27b20058 | 908 | jet = GetJet(maxJetIndex); |
909 | ||
c554a987 | 910 | Int_t ntracks = GetNumberOfTracks(); |
2bee31e9 | 911 | |
c554a987 | 912 | for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) { |
913 | AliVTrack* track = GetTrack(iTracks); | |
914 | if(!track) { | |
27b20058 | 915 | AliError(Form("Could not retrieve track %d",iTracks)); |
c554a987 | 916 | continue; |
917 | } | |
918 | ||
919 | if (!AcceptTrack(track)) continue; | |
32bf39af | 920 | |
27b20058 | 921 | if (jet && IsJetTrack(jet, iTracks)) { |
55264f20 | 922 | fHistTracksPtLJ[fCentBin]->Fill(track->Pt()); |
c554a987 | 923 | } |
b12a85c3 | 924 | else { |
55264f20 | 925 | fHistTracksPtBkg[fCentBin]->Fill(track->Pt()); |
c554a987 | 926 | } |
55264f20 | 927 | } |
55264f20 | 928 | } |
c554a987 | 929 | |
55264f20 | 930 | //________________________________________________________________________ |
b12a85c3 | 931 | void AliAnalysisTaskSAJF::DoClusterLoop(Int_t maxJetIndex) |
55264f20 | 932 | { |
27b20058 | 933 | AliEmcalJet* jet = 0; |
b12a85c3 | 934 | if (maxJetIndex >= 0) |
27b20058 | 935 | jet = GetJet(maxJetIndex); |
936 | ||
f0a0fd33 | 937 | Int_t nclusters = GetNumberOfCaloClusters(); |
938 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
939 | AliVCluster* cluster = GetCaloCluster(iClusters); | |
e82e282c | 940 | if (!cluster) { |
a55e4f1d | 941 | AliError(Form("Could not receive cluster %d", iClusters)); |
e82e282c | 942 | continue; |
943 | } | |
944 | ||
945 | if (!(cluster->IsEMCAL())) continue; | |
f0a0fd33 | 946 | |
2bee31e9 | 947 | if (!AcceptCluster(cluster)) continue; |
948 | ||
55264f20 | 949 | TLorentzVector nPart; |
b12a85c3 | 950 | cluster->GetMomentum(nPart, fVertex); |
32bf39af | 951 | |
27b20058 | 952 | if (jet && IsJetCluster(jet, iClusters)) { |
55264f20 | 953 | fHistClusEtLJ[fCentBin]->Fill(nPart.Et()); |
f0a0fd33 | 954 | } |
b12a85c3 | 955 | else { |
55264f20 | 956 | fHistClusEtBkg[fCentBin]->Fill(nPart.Et()); |
f0a0fd33 | 957 | } |
e82e282c | 958 | } //cluster loop |
c554a987 | 959 | } |
960 | ||
961 | //________________________________________________________________________ | |
a55e4f1d | 962 | void AliAnalysisTaskSAJF::Init() |
c554a987 | 963 | { |
b5ee47fb | 964 | if (fAnaType == kTPC) { |
d41a0b1c | 965 | SetEtaLimits(-0.9, 0.9); |
966 | SetPhiLimits(-10, 10); | |
c554a987 | 967 | } |
b5ee47fb | 968 | else if (fAnaType == kEMCAL) { |
d41a0b1c | 969 | SetEtaLimits(-0.7, 0.7); |
970 | SetPhiLimits(80 * TMath::DegToRad(), 180 * TMath::DegToRad()); | |
c554a987 | 971 | } |
972 | else { | |
b5ee47fb | 973 | AliWarning("Analysis type not recognized! Assuming kTPC..."); |
d41a0b1c | 974 | SetAnaType(kTPC); |
b5ee47fb | 975 | Init(); |
c554a987 | 976 | } |
b12a85c3 | 977 | |
978 | const Float_t semiDiag = TMath::Sqrt((fMaxPhi - fMinPhi) * (fMaxPhi - fMinPhi) + (fMaxEta - fMinEta) * (fMaxEta - fMinEta)) / 2; | |
979 | if (fMinRC2LJ > semiDiag * 0.5) { | |
980 | AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. Will use fMinRC2LJ = %f", fMinRC2LJ, semiDiag * 0.5)); | |
d41a0b1c | 981 | SetJetMinRC2LJ(semiDiag * 0.5); |
b12a85c3 | 982 | } |
d41a0b1c | 983 | |
984 | SetInitialized(); | |
c554a987 | 985 | } |
986 | ||
a55e4f1d | 987 | //________________________________________________________________________ |
b12a85c3 | 988 | void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &eta, Float_t &phi, Bool_t acceptMC, |
989 | AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const | |
a55e4f1d | 990 | { |
b12a85c3 | 991 | if (!tracks) |
992 | tracks = fTracks; | |
a55e4f1d | 993 | |
b12a85c3 | 994 | if (!clusters) |
995 | clusters = fCaloClusters; | |
a55e4f1d | 996 | |
b5ee47fb | 997 | eta = 0; |
998 | phi = 0; | |
b12a85c3 | 999 | pt = 0; |
a55e4f1d | 1000 | |
1001 | Float_t LJeta = 999; | |
1002 | Float_t LJphi = 999; | |
1003 | ||
1004 | if (jet) { | |
1005 | LJeta = jet->Eta(); | |
1006 | LJphi = jet->Phi(); | |
1007 | } | |
1008 | ||
b5ee47fb | 1009 | Float_t maxEta = fMaxEta - fJetRadius; |
1010 | Float_t minEta = fMinEta + fJetRadius; | |
1011 | Float_t maxPhi = fMaxPhi - fJetRadius; | |
1012 | Float_t minPhi = fMinPhi + fJetRadius; | |
1013 | ||
1014 | if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2; | |
1015 | if (minPhi < 0) minPhi = 0; | |
1016 | ||
a55e4f1d | 1017 | Float_t dLJ = 0; |
b12a85c3 | 1018 | Int_t repeats = 0; |
a55e4f1d | 1019 | do { |
b12a85c3 | 1020 | eta = gRandom->Rndm() * (maxEta - minEta) + minEta; |
1021 | phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi; | |
a55e4f1d | 1022 | dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi)); |
b12a85c3 | 1023 | repeats++; |
1024 | } while (dLJ < fMinRC2LJ && repeats < 999); | |
1025 | ||
1026 | if (repeats == 999) | |
1027 | return; | |
b5ee47fb | 1028 | |
1029 | if (fAnaType == kEMCAL) { | |
b12a85c3 | 1030 | Int_t nclusters = clusters->GetEntriesFast(); |
b5ee47fb | 1031 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { |
b12a85c3 | 1032 | AliVCluster* cluster = dynamic_cast<AliVCluster*>(clusters->At(iClusters)); |
b5ee47fb | 1033 | if (!cluster) { |
1034 | AliError(Form("Could not receive cluster %d", iClusters)); | |
1035 | continue; | |
1036 | } | |
1037 | ||
1038 | if (!(cluster->IsEMCAL())) continue; | |
1039 | ||
b12a85c3 | 1040 | if (!AcceptCluster(cluster, acceptMC)) continue; |
b5ee47fb | 1041 | |
1042 | TLorentzVector nPart; | |
b12a85c3 | 1043 | cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex)); |
b5ee47fb | 1044 | |
1045 | Float_t pos[3]; | |
1046 | cluster->GetPosition(pos); | |
1047 | TVector3 clusVec(pos); | |
1048 | ||
1049 | Float_t d = TMath::Sqrt((clusVec.Eta() - eta) * (clusVec.Eta() - eta) + (clusVec.Phi() - phi) * (clusVec.Phi() - phi)); | |
1050 | ||
1051 | if (d <= fJetRadius) | |
1052 | pt += nPart.Pt(); | |
1053 | } | |
a55e4f1d | 1054 | } |
1055 | ||
b12a85c3 | 1056 | Int_t ntracks = tracks->GetEntriesFast(); |
a55e4f1d | 1057 | for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) { |
b12a85c3 | 1058 | AliVTrack* track = dynamic_cast<AliVTrack*>(tracks->At(iTracks)); |
a55e4f1d | 1059 | if(!track) { |
27b20058 | 1060 | AliError(Form("Could not retrieve track %d",iTracks)); |
a55e4f1d | 1061 | continue; |
1062 | } | |
1063 | ||
b12a85c3 | 1064 | if (!AcceptTrack(track, acceptMC)) continue; |
a55e4f1d | 1065 | |
1066 | Float_t tracketa = track->Eta(); | |
1067 | Float_t trackphi = track->Phi(); | |
1068 | ||
1069 | if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi())) | |
1070 | trackphi += 2 * TMath::Pi(); | |
1071 | if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi())) | |
1072 | trackphi -= 2 * TMath::Pi(); | |
1073 | ||
1074 | Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi)); | |
1075 | ||
1076 | if (d <= fJetRadius) | |
1077 | pt += track->Pt(); | |
1078 | } | |
a55e4f1d | 1079 | } |
1080 | ||
c554a987 | 1081 | //________________________________________________________________________ |
1082 | Bool_t AliAnalysisTaskSAJF::IsJetTrack(AliEmcalJet* jet, Int_t itrack, Bool_t sorted) const | |
1083 | { | |
1084 | for (Int_t i = 0; i < jet->GetNumberOfTracks(); i++) { | |
1085 | Int_t ijettrack = jet->TrackAt(i); | |
1086 | if (sorted && ijettrack > itrack) | |
1087 | return kFALSE; | |
1088 | if (ijettrack == itrack) | |
1089 | return kTRUE; | |
1090 | } | |
1091 | return kFALSE; | |
1092 | } | |
1093 | ||
1094 | //________________________________________________________________________ | |
1095 | Bool_t AliAnalysisTaskSAJF::IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool_t sorted) const | |
1096 | { | |
1097 | for (Int_t i = 0; i < jet->GetNumberOfClusters(); i++) { | |
1098 | Int_t ijetclus = jet->ClusterAt(i); | |
1099 | if (sorted && ijetclus > iclus) | |
1100 | return kFALSE; | |
1101 | if (ijetclus == iclus) | |
1102 | return kTRUE; | |
25283b37 | 1103 | } |
c554a987 | 1104 | return kFALSE; |
f0a0fd33 | 1105 | } |
1106 | ||
91f4b7c5 | 1107 | //________________________________________________________________________ |
a55e4f1d | 1108 | Bool_t AliAnalysisTaskSAJF::AcceptJet(Float_t eta, Float_t phi) const |
91f4b7c5 | 1109 | { |
b5ee47fb | 1110 | return (Bool_t)(eta > fMinEta + fJetRadius && eta < fMaxEta - fJetRadius && phi > fMinPhi + fJetRadius && phi < fMaxPhi - fJetRadius); |
91f4b7c5 | 1111 | } |
f0a0fd33 | 1112 | |
a55e4f1d | 1113 | //________________________________________________________________________ |
b12a85c3 | 1114 | Bool_t AliAnalysisTaskSAJF::AcceptJet(AliEmcalJet *jet) const |
a55e4f1d | 1115 | { |
1116 | return AcceptJet(jet->Eta(), jet->Phi()); | |
1117 | } | |
1118 | ||
f0a0fd33 | 1119 | //________________________________________________________________________ |
b12a85c3 | 1120 | Bool_t AliAnalysisTaskSAJF::AcceptCluster(AliVCluster* clus, Bool_t acceptMC) const |
2bee31e9 | 1121 | { |
1122 | if (!acceptMC && clus->Chi2() == 100) | |
1123 | return kFALSE; | |
1124 | ||
226f511d | 1125 | TLorentzVector nPart; |
b12a85c3 | 1126 | clus->GetMomentum(nPart, const_cast<Double_t*>(fVertex)); |
226f511d | 1127 | |
1128 | if (nPart.Et() < fPtCut) | |
1129 | return kFALSE; | |
1130 | ||
2bee31e9 | 1131 | return kTRUE; |
1132 | } | |
1133 | ||
2bee31e9 | 1134 | //________________________________________________________________________ |
1135 | Bool_t AliAnalysisTaskSAJF::AcceptTrack(AliVTrack* track, Bool_t acceptMC) const | |
f0a0fd33 | 1136 | { |
2bee31e9 | 1137 | if (!acceptMC && track->GetLabel() == 100) |
1138 | return kFALSE; | |
226f511d | 1139 | |
1140 | if (track->Pt() < fPtCut) | |
1141 | return kFALSE; | |
2bee31e9 | 1142 | |
b5ee47fb | 1143 | return (Bool_t)(track->Eta() > fMinEta && track->Eta() < fMaxEta && track->Phi() > fMinPhi && track->Phi() < fMaxPhi); |
25283b37 | 1144 | } |
1145 | ||
1146 | //________________________________________________________________________ | |
00514d01 | 1147 | void AliAnalysisTaskSAJF::UserExec(Option_t *) |
25283b37 | 1148 | { |
d41a0b1c | 1149 | if (!fInitialized) |
1150 | Init(); | |
25283b37 | 1151 | |
1152 | RetrieveEventObjects(); | |
1153 | ||
b12a85c3 | 1154 | if (fRho < 0) { |
1155 | AliWarning(Form("Could not retrieve rho information! Event skipped!")); | |
1156 | return; | |
1157 | } | |
1158 | ||
25283b37 | 1159 | FillHistograms(); |
1160 | ||
1161 | // information for this iteration of the UserExec in the container | |
1162 | PostData(1, fOutput); | |
1163 | } | |
1164 | ||
1165 | //________________________________________________________________________ | |
00514d01 | 1166 | void AliAnalysisTaskSAJF::Terminate(Option_t *) |
25283b37 | 1167 | { |
1168 | // Called once at the end of the analysis. | |
1169 | } |