]>
Commit | Line | Data |
---|---|---|
6e8d91c9 | 1 | // $Id$ |
c3ba2d3d | 2 | // |
297edd60 | 3 | // General QA task. |
c3ba2d3d | 4 | // |
297edd60 | 5 | // Author: S.Aiola |
c3ba2d3d | 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 | ||
14 | #include "AliAnalysisManager.h" | |
15 | #include "AliCentrality.h" | |
16 | #include "AliVCluster.h" | |
17 | #include "AliVParticle.h" | |
18 | #include "AliVTrack.h" | |
19 | #include "AliEmcalJet.h" | |
20 | #include "AliVEventHandler.h" | |
21 | #include "AliLog.h" | |
22 | ||
23 | #include "AliAnalysisTaskSAQA.h" | |
24 | ||
25 | ClassImp(AliAnalysisTaskSAQA) | |
26 | ||
27 | //________________________________________________________________________ | |
28 | AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() : | |
6fd5039f | 29 | AliAnalysisTaskEmcalJet("AliAnalysisTaskSAQA"), |
c3ba2d3d | 30 | fCellEnergyCut(0.1), |
1f6fff78 | 31 | fDoTrigger(kFALSE), |
c3ba2d3d | 32 | fTrgClusName("ClustersL1GAMMAFEE"), |
33 | fTrgClusters(0), | |
34 | fHistCentrality(0), | |
35 | fHistTracksCent(0), | |
36 | fHistClusCent(0), | |
37 | fHistMaxL1FastORCent(0), | |
38 | fHistMaxL1ClusCent(0), | |
39 | fHistMaxL1ThrCent(0), | |
40 | fHistTracksPt(0), | |
41 | fHistTrPhiEta(0), | |
6fd5039f | 42 | fHistTrEmcPhiEta(0), |
c3ba2d3d | 43 | fHistClustersEnergy(0), |
44 | fHistClusPhiEta(0), | |
c3ba2d3d | 45 | fHistJetsPhiEta(0), |
c3ba2d3d | 46 | fHistCellsEnergy(0), |
47 | fHistChVSneCells(0), | |
48 | fHistChVSneClus(0), | |
49 | fHistChVSneCorrCells(0) | |
50 | { | |
51 | // Default constructor. | |
52 | ||
53 | for (Int_t i = 0; i < 5; i++) { | |
54 | fHistTrackPhi[i] = 0; | |
55 | fHistTrackEta[i] = 0; | |
56 | } | |
6fd5039f | 57 | |
58 | for (Int_t i = 0; i < 4; i++) { | |
59 | fHistJetsPtTrack[i] = 0; | |
60 | fHistJetsPtClus[i] = 0; | |
61 | fHistJetsPt[i] = 0; | |
98750b70 | 62 | fHistJetsPtArea[i] = 0; |
6fd5039f | 63 | } |
c3ba2d3d | 64 | } |
65 | ||
66 | //________________________________________________________________________ | |
67 | AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) : | |
6fd5039f | 68 | AliAnalysisTaskEmcalJet(name), |
c3ba2d3d | 69 | fCellEnergyCut(0.1), |
1f6fff78 | 70 | fDoTrigger(kFALSE), |
c3ba2d3d | 71 | fTrgClusName("ClustersL1GAMMAFEE"), |
72 | fTrgClusters(0), | |
73 | fHistCentrality(0), | |
74 | fHistTracksCent(0), | |
75 | fHistClusCent(0), | |
76 | fHistMaxL1FastORCent(0), | |
77 | fHistMaxL1ClusCent(0), | |
78 | fHistMaxL1ThrCent(0), | |
79 | fHistTracksPt(0), | |
80 | fHistTrPhiEta(0), | |
6fd5039f | 81 | fHistTrEmcPhiEta(0), |
c3ba2d3d | 82 | fHistClustersEnergy(0), |
83 | fHistClusPhiEta(0), | |
c3ba2d3d | 84 | fHistJetsPhiEta(0), |
c3ba2d3d | 85 | fHistCellsEnergy(0), |
86 | fHistChVSneCells(0), | |
87 | fHistChVSneClus(0), | |
88 | fHistChVSneCorrCells(0) | |
89 | { | |
90 | // Standard constructor. | |
91 | ||
92 | for (Int_t i = 0; i < 5; i++) { | |
93 | fHistTrackPhi[i] = 0; | |
94 | fHistTrackEta[i] = 0; | |
95 | } | |
6fd5039f | 96 | |
97 | for (Int_t i = 0; i < 4; i++) { | |
98 | fHistJetsPtTrack[i] = 0; | |
99 | fHistJetsPtClus[i] = 0; | |
100 | fHistJetsPt[i] = 0; | |
98750b70 | 101 | fHistJetsPtArea[i] = 0; |
6fd5039f | 102 | } |
c3ba2d3d | 103 | } |
104 | ||
105 | //________________________________________________________________________ | |
106 | AliAnalysisTaskSAQA::~AliAnalysisTaskSAQA() | |
107 | { | |
108 | // Destructor | |
109 | } | |
110 | ||
111 | //________________________________________________________________________ | |
112 | void AliAnalysisTaskSAQA::UserCreateOutputObjects() | |
113 | { | |
114 | // Create histograms | |
115 | ||
116 | OpenFile(1); | |
117 | fOutput = new TList(); | |
6fd5039f | 118 | fOutput->SetOwner(); |
c3ba2d3d | 119 | |
120 | fHistCentrality = new TH1F("fHistCentrality","Event centrality distribution", fNbins, 0, 100); | |
121 | fHistCentrality->GetXaxis()->SetTitle("Centrality (%)"); | |
122 | fHistCentrality->GetYaxis()->SetTitle("counts"); | |
123 | fOutput->Add(fHistCentrality); | |
124 | ||
125 | fHistTracksCent = new TH2F("fHistTracksCent","Tracks vs. centrality", fNbins, 0, 100, fNbins, 0, 4000); | |
126 | fHistTracksCent->GetXaxis()->SetTitle("Centrality (%)"); | |
127 | fHistTracksCent->GetYaxis()->SetTitle("No. of tracks"); | |
128 | fOutput->Add(fHistTracksCent); | |
129 | ||
6fd5039f | 130 | if (fAnaType == kEMCAL) { |
131 | fHistClusCent = new TH2F("fHistClusCent","Clusters vs. centrality", fNbins, 0, 100, fNbins, 0, 2000); | |
132 | fHistClusCent->GetXaxis()->SetTitle("Centrality (%)"); | |
133 | fHistClusCent->GetYaxis()->SetTitle("No. of clusters"); | |
134 | fOutput->Add(fHistClusCent); | |
135 | ||
1f6fff78 | 136 | if (fDoTrigger) { |
137 | fHistMaxL1FastORCent = new TH2F("fHistMaxL1FastORCent","fHistMaxL1ClusCent", 100, 0, 100, 250, 0, 250); | |
138 | fHistMaxL1FastORCent->GetXaxis()->SetTitle("Centrality [%]"); | |
139 | fHistMaxL1FastORCent->GetYaxis()->SetTitle("Maximum L1 FastOR"); | |
140 | fOutput->Add(fHistMaxL1FastORCent); | |
141 | ||
142 | fHistMaxL1ClusCent = new TH2F("fHistMaxL1ClusCent","fHistMaxL1ClusCent", 100, 0, 100, 250, 0, 250); | |
143 | fHistMaxL1ClusCent->GetXaxis()->SetTitle("Centrality [%]"); | |
144 | fHistMaxL1ClusCent->GetYaxis()->SetTitle("Maximum L1 trigger cluster"); | |
145 | fOutput->Add(fHistMaxL1ClusCent); | |
146 | ||
147 | fHistMaxL1ThrCent = new TH2F("fHistMaxL1ThrCent","fHistMaxL1ThrCent", 100, 0, 100, 250, 0, 250); | |
148 | fHistMaxL1ThrCent->GetXaxis()->SetTitle("Centrality [%]"); | |
149 | fHistMaxL1ThrCent->GetYaxis()->SetTitle("Maximum L1 threshold"); | |
150 | fOutput->Add(fHistMaxL1ThrCent); | |
151 | } | |
6fd5039f | 152 | } |
153 | ||
154 | fHistTracksPt = new TH1F("fHistTracksPt","p_{T} spectrum of reconstructed tracks", fNbins, fMinBinPt, fMaxBinPt); | |
155 | fHistTracksPt->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
c3ba2d3d | 156 | fHistTracksPt->GetYaxis()->SetTitle("counts"); |
157 | fOutput->Add(fHistTracksPt); | |
158 | ||
6fd5039f | 159 | fHistTrPhiEta = new TH2F("fHistTrPhiEta","Phi-Eta distribution of tracks", 80, -2, 2, 128, 0, 6.4); |
c3ba2d3d | 160 | fHistTrPhiEta->GetXaxis()->SetTitle("#eta"); |
161 | fHistTrPhiEta->GetYaxis()->SetTitle("#phi"); | |
162 | fOutput->Add(fHistTrPhiEta); | |
163 | ||
6fd5039f | 164 | fHistTrEmcPhiEta = new TH2F("fHistTrEmcPhiEta","Phi-Eta emcal distribution of tracks", 80, -2, 2, 128, 0, 6.4); |
165 | fHistTrEmcPhiEta->GetXaxis()->SetTitle("#eta"); | |
166 | fHistTrEmcPhiEta->GetYaxis()->SetTitle("#phi"); | |
167 | fOutput->Add(fHistTrEmcPhiEta); | |
168 | ||
169 | if (fAnaType == kEMCAL) { | |
170 | fHistClustersEnergy = new TH1F("fHistClustersEnergy","Energy spectrum of clusters", fNbins, fMinBinPt, fMaxBinPt); | |
171 | fHistClustersEnergy->GetXaxis()->SetTitle("E [GeV]"); | |
172 | fHistClustersEnergy->GetYaxis()->SetTitle("counts"); | |
173 | fOutput->Add(fHistClustersEnergy); | |
174 | ||
175 | fHistClusPhiEta = new TH2F("fHistClusPhiEta","Phi-Eta distribution of clusters", 80, -2, 2, 128, 0, 6.4); | |
176 | fHistClusPhiEta->GetXaxis()->SetTitle("#eta"); | |
177 | fHistClusPhiEta->GetYaxis()->SetTitle("#phi"); | |
178 | fOutput->Add(fHistClusPhiEta); | |
179 | } | |
c3ba2d3d | 180 | |
6fd5039f | 181 | fHistJetsPhiEta = new TH2F("fHistJetsPhiEta","Phi-Eta distribution of jets", 80, -2, 2, 128, 0, 6.4); |
c3ba2d3d | 182 | fHistJetsPhiEta->GetXaxis()->SetTitle("#eta"); |
183 | fHistJetsPhiEta->GetYaxis()->SetTitle("#phi"); | |
184 | fOutput->Add(fHistJetsPhiEta); | |
185 | ||
6fd5039f | 186 | if (fAnaType == kEMCAL) { |
6fd5039f | 187 | |
188 | fHistCellsEnergy = new TH1F("fHistCellsEnergy","Energy spectrum of cells", fNbins, fMinBinPt, fMaxBinPt); | |
189 | fHistCellsEnergy->GetXaxis()->SetTitle("E [GeV]"); | |
190 | fHistCellsEnergy->GetYaxis()->SetTitle("counts"); | |
191 | fOutput->Add(fHistCellsEnergy); | |
192 | ||
98750b70 | 193 | fHistChVSneCells = new TH2F("fHistChVSneCells","Charged energy vs. neutral (cells) energy", |
194 | fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5, fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5); | |
6fd5039f | 195 | fHistChVSneCells->GetXaxis()->SetTitle("E [GeV]"); |
196 | fHistChVSneCells->GetYaxis()->SetTitle("P [GeV/c]"); | |
197 | fOutput->Add(fHistChVSneCells); | |
198 | ||
98750b70 | 199 | fHistChVSneClus = new TH2F("fHistChVSneClus","Charged energy vs. neutral (clusters) energy", |
200 | fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5, fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5); | |
6fd5039f | 201 | fHistChVSneClus->GetXaxis()->SetTitle("E [GeV]"); |
202 | fHistChVSneClus->GetYaxis()->SetTitle("P [GeV/c]"); | |
203 | fOutput->Add(fHistChVSneClus); | |
204 | ||
98750b70 | 205 | fHistChVSneCorrCells = new TH2F("fHistChVSneCorrCells","Charged energy vs. neutral (corrected cells) energy", |
206 | fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5, fNbins * 2.5, fMinBinPt , fMaxBinPt * 2.5); | |
6fd5039f | 207 | fHistChVSneCorrCells->GetXaxis()->SetTitle("E [GeV]"); |
208 | fHistChVSneCorrCells->GetYaxis()->SetTitle("P [GeV/c]"); | |
209 | fOutput->Add(fHistChVSneCorrCells); | |
c3ba2d3d | 210 | } |
c3ba2d3d | 211 | |
212 | for (Int_t i = 0; i < 5; i++) { | |
213 | TString histnamephi("fHistTrackPhi_"); | |
214 | histnamephi += i; | |
215 | fHistTrackPhi[i] = new TH1F(histnamephi.Data(),histnamephi.Data(), 128, 0, 6.4); | |
216 | fHistTrackPhi[i]->GetXaxis()->SetTitle("Phi"); | |
217 | fOutput->Add(fHistTrackPhi[i]); | |
218 | ||
219 | TString histnameeta("fHistTrackEta_"); | |
220 | histnameeta += i; | |
221 | fHistTrackEta[i] = new TH1F(histnameeta.Data(),histnameeta.Data(), 100, -2, 2); | |
222 | fHistTrackEta[i]->GetXaxis()->SetTitle("Eta"); | |
223 | fOutput->Add(fHistTrackEta[i]); | |
224 | } | |
225 | ||
226 | fHistTrackPhi[0]->SetLineColor(kRed); | |
227 | fHistTrackEta[0]->SetLineColor(kRed); | |
228 | fHistTrackPhi[1]->SetLineColor(kBlue); | |
229 | fHistTrackEta[1]->SetLineColor(kBlue); | |
230 | fHistTrackPhi[2]->SetLineColor(kGreen); | |
231 | fHistTrackEta[2]->SetLineColor(kGreen); | |
232 | fHistTrackPhi[3]->SetLineColor(kOrange); | |
233 | fHistTrackEta[3]->SetLineColor(kOrange); | |
234 | fHistTrackPhi[4]->SetLineColor(kBlack); | |
235 | fHistTrackEta[4]->SetLineColor(kBlack); | |
236 | ||
6fd5039f | 237 | TString histname; |
238 | ||
239 | for (Int_t i = 0; i < 4; i++) { | |
98750b70 | 240 | histname = "fHistJetsPt_"; |
241 | histname += i; | |
242 | fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5); | |
243 | fHistJetsPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
244 | fHistJetsPt[i]->GetYaxis()->SetTitle("counts"); | |
245 | fOutput->Add(fHistJetsPt[i]); | |
246 | ||
247 | histname = "fHistJetsPtArea_"; | |
248 | histname += i; | |
249 | fHistJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5, 20, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5); | |
250 | fHistJetsPtArea[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
251 | fHistJetsPtArea[i]->GetYaxis()->SetTitle("area"); | |
252 | fOutput->Add(fHistJetsPtArea[i]); | |
6fd5039f | 253 | |
254 | histname = "fHistJetsPtTrack_"; | |
255 | histname += i; | |
98750b70 | 256 | fHistJetsPtTrack[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5); |
6fd5039f | 257 | fHistJetsPtTrack[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
258 | fHistJetsPtTrack[i]->GetYaxis()->SetTitle("counts"); | |
259 | fOutput->Add(fHistJetsPtTrack[i]); | |
260 | ||
98750b70 | 261 | if (fAnaType == kEMCAL) { |
262 | histname = "fHistJetsPtClus_"; | |
263 | histname += i; | |
264 | fHistJetsPtClus[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2.5, fMinBinPt, fMaxBinPt * 2.5); | |
265 | fHistJetsPtClus[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
266 | fHistJetsPtClus[i]->GetYaxis()->SetTitle("counts"); | |
267 | fOutput->Add(fHistJetsPtClus[i]); | |
268 | } | |
6fd5039f | 269 | } |
270 | ||
c3ba2d3d | 271 | PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram |
272 | } | |
273 | ||
274 | //________________________________________________________________________ | |
6fd5039f | 275 | Bool_t AliAnalysisTaskSAQA::RetrieveEventObjects() |
c3ba2d3d | 276 | { |
c3604199 | 277 | // Retrieve event objects. |
278 | ||
279 | if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) | |
6fd5039f | 280 | return kFALSE; |
c3ba2d3d | 281 | |
1f6fff78 | 282 | if (strcmp(fTrgClusName,"") && fDoTrigger) { |
c3ba2d3d | 283 | fTrgClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrgClusName)); |
284 | if (!fTrgClusters) { | |
285 | AliWarning(Form("Could not retrieve trigger clusters!")); | |
286 | } | |
287 | } | |
6fd5039f | 288 | |
289 | return kTRUE; | |
c3ba2d3d | 290 | } |
291 | ||
292 | //________________________________________________________________________ | |
6fd5039f | 293 | Bool_t AliAnalysisTaskSAQA::FillHistograms() |
c3ba2d3d | 294 | { |
c3604199 | 295 | // Fill histograms. |
296 | ||
c3ba2d3d | 297 | fHistCentrality->Fill(fCent); |
298 | if (fTracks) | |
299 | fHistTracksCent->Fill(fCent, fTracks->GetEntriesFast()); | |
300 | if (fCaloClusters) | |
301 | fHistClusCent->Fill(fCent, fCaloClusters->GetEntriesFast()); | |
302 | ||
c3ba2d3d | 303 | Float_t trackSum = DoTrackLoop(); |
304 | ||
c3ba2d3d | 305 | DoJetLoop(); |
306 | ||
6fd5039f | 307 | if (fAnaType == kEMCAL) { |
308 | Float_t clusSum = DoClusterLoop(); | |
c3ba2d3d | 309 | |
6fd5039f | 310 | Float_t cellSum = 0, cellCutSum = 0; |
311 | ||
312 | DoCellLoop(cellSum, cellCutSum); | |
313 | ||
314 | fHistChVSneCells->Fill(cellSum, trackSum); | |
315 | fHistChVSneClus->Fill(clusSum, trackSum); | |
316 | fHistChVSneCorrCells->Fill(cellCutSum, trackSum); | |
c3ba2d3d | 317 | |
1f6fff78 | 318 | if (fDoTrigger) { |
319 | Float_t maxTrgClus = DoTriggerClusLoop(); | |
320 | fHistMaxL1ClusCent->Fill(fCent, maxTrgClus); | |
6fd5039f | 321 | |
1f6fff78 | 322 | Int_t maxL1amp = -1; |
323 | Int_t maxL1thr = -1; | |
6fd5039f | 324 | |
1f6fff78 | 325 | DoTriggerPrimitives(maxL1amp, maxL1thr); |
326 | ||
327 | if (maxL1amp > -1) | |
328 | fHistMaxL1FastORCent->Fill(fCent, maxL1amp); | |
329 | ||
330 | if (maxL1thr > -1) | |
331 | fHistMaxL1ThrCent->Fill(fCent, maxL1thr); | |
332 | } | |
6fd5039f | 333 | } |
c3ba2d3d | 334 | |
6fd5039f | 335 | return kTRUE; |
c3ba2d3d | 336 | } |
337 | ||
338 | //________________________________________________________________________ | |
339 | void AliAnalysisTaskSAQA::DoCellLoop(Float_t &sum, Float_t &sum_cut) | |
340 | { | |
c3604199 | 341 | // Do cell loop. |
342 | ||
c3ba2d3d | 343 | AliVCaloCells *cells = InputEvent()->GetEMCALCells(); |
344 | ||
345 | if (!cells) | |
346 | return; | |
347 | ||
c3604199 | 348 | const Int_t ncells = cells->GetNumberOfCells(); |
c3ba2d3d | 349 | |
350 | for (Int_t pos = 0; pos < ncells; pos++) { | |
c3ba2d3d | 351 | Float_t amp = cells->GetAmplitude(pos); |
c3ba2d3d | 352 | fHistCellsEnergy->Fill(amp); |
c3ba2d3d | 353 | sum += amp; |
c3ba2d3d | 354 | if (amp < fCellEnergyCut) |
355 | continue; | |
c3ba2d3d | 356 | sum_cut += amp; |
c3ba2d3d | 357 | } |
358 | } | |
359 | ||
360 | //________________________________________________________________________ | |
361 | Float_t AliAnalysisTaskSAQA::DoClusterLoop() | |
362 | { | |
c3604199 | 363 | // Do cluster loop. |
364 | ||
c3ba2d3d | 365 | if (!fCaloClusters) |
366 | return 0; | |
367 | ||
368 | Float_t sum = 0; | |
369 | ||
370 | // Cluster loop | |
371 | Int_t nclusters = fCaloClusters->GetEntriesFast(); | |
372 | ||
373 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
374 | AliVCluster* cluster = dynamic_cast<AliVCluster*>(fCaloClusters->At(iClusters)); | |
375 | if (!cluster) { | |
376 | AliError(Form("Could not receive cluster %d", iClusters)); | |
377 | continue; | |
378 | } | |
379 | ||
380 | if (!(cluster->IsEMCAL())) continue; | |
381 | ||
382 | if (!AcceptCluster(cluster, kTRUE)) continue; | |
383 | ||
384 | fHistClustersEnergy->Fill(cluster->E()); | |
385 | ||
386 | sum += cluster->E(); | |
387 | ||
388 | Float_t pos[3]; | |
389 | cluster->GetPosition(pos); | |
390 | TVector3 clusVec(pos); | |
391 | fHistClusPhiEta->Fill(clusVec.Eta(), clusVec.Phi()); | |
392 | ||
c3604199 | 393 | } |
c3ba2d3d | 394 | |
395 | return sum; | |
396 | } | |
397 | ||
398 | //________________________________________________________________________ | |
399 | Float_t AliAnalysisTaskSAQA::DoTrackLoop() | |
400 | { | |
c3604199 | 401 | // Do track loop. |
402 | ||
c3ba2d3d | 403 | if (!fTracks) |
404 | return 0; | |
405 | ||
406 | Float_t sum = 0; | |
407 | ||
408 | // Track loop | |
409 | Int_t ntracks = fTracks->GetEntriesFast(); | |
410 | Int_t nclusters = 0; | |
411 | if (fCaloClusters) | |
412 | nclusters = fCaloClusters->GetEntriesFast(); | |
413 | ||
c3604199 | 414 | for (Int_t i = 0; i < ntracks; i++) { |
c3ba2d3d | 415 | |
1f6fff78 | 416 | AliVParticle* track = dynamic_cast<AliVParticle*>(fTracks->At(i)); // pointer to reconstructed to track |
417 | ||
c3604199 | 418 | if (!track) { |
c3ba2d3d | 419 | AliError(Form("Could not retrieve track %d",i)); |
420 | continue; | |
421 | } | |
c3ba2d3d | 422 | |
1f6fff78 | 423 | AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track); |
424 | ||
425 | if (vtrack && !AcceptTrack(vtrack, kTRUE)) | |
426 | continue; | |
427 | ||
c3ba2d3d | 428 | fHistTracksPt->Fill(track->Pt()); |
429 | ||
430 | sum += track->P(); | |
431 | ||
432 | Int_t label = track->GetLabel(); | |
433 | ||
434 | fHistTrPhiEta->Fill(track->Eta(), track->Phi()); | |
435 | ||
436 | fHistTrackEta[4]->Fill(track->Eta()); | |
437 | fHistTrackPhi[4]->Fill(track->Phi()); | |
438 | ||
439 | if (label >= 0 && label < 4) { | |
440 | fHistTrackEta[label]->Fill(track->Eta()); | |
441 | fHistTrackPhi[label]->Fill(track->Phi()); | |
442 | } | |
443 | ||
1f6fff78 | 444 | if (!vtrack) |
c3ba2d3d | 445 | continue; |
446 | ||
1f6fff78 | 447 | fHistTrEmcPhiEta->Fill(vtrack->GetTrackEtaOnEMCal(), vtrack->GetTrackPhiOnEMCal()); |
c3ba2d3d | 448 | } |
449 | ||
450 | return sum; | |
451 | } | |
452 | ||
453 | //________________________________________________________________________ | |
454 | void AliAnalysisTaskSAQA::DoJetLoop() | |
455 | { | |
c3604199 | 456 | // Do jet loop. |
457 | ||
c3ba2d3d | 458 | if (!fJets) |
459 | return; | |
460 | ||
461 | Int_t njets = fJets->GetEntriesFast(); | |
462 | ||
463 | for (Int_t ij = 0; ij < njets; ij++) { | |
464 | ||
465 | AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(ij)); | |
466 | ||
467 | if (!jet) { | |
468 | AliError(Form("Could not receive jet %d", ij)); | |
469 | continue; | |
470 | } | |
471 | ||
6fd5039f | 472 | if (!AcceptJet(jet, kFALSE)) |
c3ba2d3d | 473 | continue; |
6fd5039f | 474 | |
475 | fHistJetsPt[fCentBin]->Fill(jet->Pt()); | |
98750b70 | 476 | fHistJetsPtArea[fCentBin]->Fill(jet->Pt(), jet->Area()); |
6fd5039f | 477 | |
478 | if (jet->MaxTrackPt() > fPtBiasJetTrack) | |
479 | fHistJetsPtTrack[fCentBin]->Fill(jet->Pt()); | |
480 | ||
481 | if (fAnaType == kEMCAL && jet->MaxClusterPt() > fPtBiasJetClus) | |
482 | fHistJetsPtClus[fCentBin]->Fill(jet->Pt()); | |
c3ba2d3d | 483 | |
c3ba2d3d | 484 | fHistJetsPhiEta->Fill(jet->Eta(), jet->Phi()); |
485 | } | |
486 | } | |
487 | ||
488 | //________________________________________________________________________ | |
489 | Float_t AliAnalysisTaskSAQA::DoTriggerClusLoop() | |
490 | { | |
c3604199 | 491 | // Do trigger cluster loop. |
492 | ||
c3ba2d3d | 493 | if (!fTrgClusters) |
494 | return 0; | |
495 | ||
496 | Int_t ntrgclusters = fTrgClusters->GetEntriesFast(); | |
497 | Float_t maxTrgClus = 0; | |
498 | ||
499 | for (Int_t iClusters = 0; iClusters < ntrgclusters; iClusters++) { | |
500 | AliVCluster* cluster = dynamic_cast<AliVCluster*>(fTrgClusters->At(iClusters)); | |
501 | if (!cluster) { | |
502 | AliError(Form("Could not receive cluster %d", iClusters)); | |
503 | continue; | |
504 | } | |
505 | ||
506 | if (!(cluster->IsEMCAL())) continue; | |
507 | ||
508 | if (cluster->E() > maxTrgClus) | |
509 | maxTrgClus = cluster->E(); | |
510 | ||
511 | } | |
512 | return maxTrgClus; | |
513 | } | |
514 | ||
515 | //________________________________________________________________________ | |
516 | void AliAnalysisTaskSAQA::DoTriggerPrimitives(Int_t &maxL1amp, Int_t &maxL1thr) | |
517 | { | |
c3604199 | 518 | // Do trigger primitives loop. |
519 | ||
c3ba2d3d | 520 | AliVCaloTrigger *triggers = InputEvent()->GetCaloTrigger("EMCAL"); |
521 | ||
522 | if (!triggers || triggers->GetEntries() == 0) | |
523 | return; | |
524 | ||
525 | triggers->Reset(); | |
526 | Int_t L1amp = 0; | |
527 | Int_t L1thr = 0; | |
528 | maxL1amp = -1; | |
529 | maxL1thr = -1; | |
530 | ||
531 | while (triggers->Next()) { | |
532 | triggers->GetL1TimeSum(L1amp); | |
533 | if (maxL1amp < L1amp) | |
534 | maxL1amp = L1amp; | |
535 | ||
536 | triggers->GetL1Threshold(L1thr); | |
537 | if (maxL1thr < L1thr) | |
538 | maxL1thr = L1thr; | |
539 | } | |
540 | } | |
541 | ||
542 | //________________________________________________________________________ | |
543 | void AliAnalysisTaskSAQA::Terminate(Option_t *) | |
544 | { | |
545 | // Called once at the end of the analysis. | |
546 | } |