]>
Commit | Line | Data |
---|---|---|
6e8d91c9 | 1 | // $Id$ |
c3ba2d3d | 2 | // |
3 | // General QA task (S.Aiola). | |
4 | // | |
5 | // | |
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), |
46 | fHistJetsPtArea(0), | |
c3ba2d3d | 47 | fHistCellsEnergy(0), |
48 | fHistChVSneCells(0), | |
49 | fHistChVSneClus(0), | |
50 | fHistChVSneCorrCells(0) | |
51 | { | |
52 | // Default constructor. | |
53 | ||
54 | for (Int_t i = 0; i < 5; i++) { | |
55 | fHistTrackPhi[i] = 0; | |
56 | fHistTrackEta[i] = 0; | |
57 | } | |
6fd5039f | 58 | |
59 | for (Int_t i = 0; i < 4; i++) { | |
60 | fHistJetsPtTrack[i] = 0; | |
61 | fHistJetsPtClus[i] = 0; | |
62 | fHistJetsPt[i] = 0; | |
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), |
85 | fHistJetsPtArea(0), | |
c3ba2d3d | 86 | fHistCellsEnergy(0), |
87 | fHistChVSneCells(0), | |
88 | fHistChVSneClus(0), | |
89 | fHistChVSneCorrCells(0) | |
90 | { | |
91 | // Standard constructor. | |
92 | ||
93 | for (Int_t i = 0; i < 5; i++) { | |
94 | fHistTrackPhi[i] = 0; | |
95 | fHistTrackEta[i] = 0; | |
96 | } | |
6fd5039f | 97 | |
98 | for (Int_t i = 0; i < 4; i++) { | |
99 | fHistJetsPtTrack[i] = 0; | |
100 | fHistJetsPtClus[i] = 0; | |
101 | fHistJetsPt[i] = 0; | |
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 | fHistJetsPtArea = new TH2F("fHistJetsPtArea","p_{T} vs. area of reconstructed jets", fNbins, fMinBinPt, fMaxBinPt, 20, 0, fJetRadius * fJetRadius * TMath::Pi() * 1.5); |
187 | fHistJetsPtArea->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
c3ba2d3d | 188 | fHistJetsPtArea->GetYaxis()->SetTitle("area"); |
189 | fOutput->Add(fHistJetsPtArea); | |
190 | ||
6fd5039f | 191 | if (fAnaType == kEMCAL) { |
6fd5039f | 192 | |
193 | fHistCellsEnergy = new TH1F("fHistCellsEnergy","Energy spectrum of cells", fNbins, fMinBinPt, fMaxBinPt); | |
194 | fHistCellsEnergy->GetXaxis()->SetTitle("E [GeV]"); | |
195 | fHistCellsEnergy->GetYaxis()->SetTitle("counts"); | |
196 | fOutput->Add(fHistCellsEnergy); | |
197 | ||
198 | fHistChVSneCells = new TH2F("fHistChVSneCells","Charged energy vs. neutral (cells) energy", fNbins, fMinBinPt * 4, fMaxBinPt * 4, fNbins, fMinBinPt * 4, fMaxBinPt * 4); | |
199 | fHistChVSneCells->GetXaxis()->SetTitle("E [GeV]"); | |
200 | fHistChVSneCells->GetYaxis()->SetTitle("P [GeV/c]"); | |
201 | fOutput->Add(fHistChVSneCells); | |
202 | ||
203 | fHistChVSneClus = new TH2F("fHistChVSneClus","Charged energy vs. neutral (clusters) energy", fNbins, fMinBinPt * 4, fMaxBinPt * 4, fNbins, fMinBinPt * 4, fMaxBinPt * 4); | |
204 | fHistChVSneClus->GetXaxis()->SetTitle("E [GeV]"); | |
205 | fHistChVSneClus->GetYaxis()->SetTitle("P [GeV/c]"); | |
206 | fOutput->Add(fHistChVSneClus); | |
207 | ||
208 | fHistChVSneCorrCells = new TH2F("fHistChVSneCorrCells","Charged energy vs. neutral (corrected cells) energy", fNbins, fMinBinPt * 4, fMaxBinPt * 4, fNbins, fMinBinPt * 4, fMaxBinPt * 4); | |
209 | fHistChVSneCorrCells->GetXaxis()->SetTitle("E [GeV]"); | |
210 | fHistChVSneCorrCells->GetYaxis()->SetTitle("P [GeV/c]"); | |
211 | fOutput->Add(fHistChVSneCorrCells); | |
c3ba2d3d | 212 | } |
c3ba2d3d | 213 | |
214 | for (Int_t i = 0; i < 5; i++) { | |
215 | TString histnamephi("fHistTrackPhi_"); | |
216 | histnamephi += i; | |
217 | fHistTrackPhi[i] = new TH1F(histnamephi.Data(),histnamephi.Data(), 128, 0, 6.4); | |
218 | fHistTrackPhi[i]->GetXaxis()->SetTitle("Phi"); | |
219 | fOutput->Add(fHistTrackPhi[i]); | |
220 | ||
221 | TString histnameeta("fHistTrackEta_"); | |
222 | histnameeta += i; | |
223 | fHistTrackEta[i] = new TH1F(histnameeta.Data(),histnameeta.Data(), 100, -2, 2); | |
224 | fHistTrackEta[i]->GetXaxis()->SetTitle("Eta"); | |
225 | fOutput->Add(fHistTrackEta[i]); | |
226 | } | |
227 | ||
228 | fHistTrackPhi[0]->SetLineColor(kRed); | |
229 | fHistTrackEta[0]->SetLineColor(kRed); | |
230 | fHistTrackPhi[1]->SetLineColor(kBlue); | |
231 | fHistTrackEta[1]->SetLineColor(kBlue); | |
232 | fHistTrackPhi[2]->SetLineColor(kGreen); | |
233 | fHistTrackEta[2]->SetLineColor(kGreen); | |
234 | fHistTrackPhi[3]->SetLineColor(kOrange); | |
235 | fHistTrackEta[3]->SetLineColor(kOrange); | |
236 | fHistTrackPhi[4]->SetLineColor(kBlack); | |
237 | fHistTrackEta[4]->SetLineColor(kBlack); | |
238 | ||
6fd5039f | 239 | TString histname; |
240 | ||
241 | for (Int_t i = 0; i < 4; i++) { | |
242 | if (fAnaType == kEMCAL) { | |
243 | histname = "fHistJetsPtClus_"; | |
244 | histname += i; | |
1f6fff78 | 245 | fHistJetsPtClus[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2.5); |
6fd5039f | 246 | fHistJetsPtClus[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
247 | fHistJetsPtClus[i]->GetYaxis()->SetTitle("counts"); | |
248 | fOutput->Add(fHistJetsPtClus[i]); | |
249 | } | |
250 | ||
251 | histname = "fHistJetsPtTrack_"; | |
252 | histname += i; | |
1f6fff78 | 253 | fHistJetsPtTrack[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2.5); |
6fd5039f | 254 | fHistJetsPtTrack[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
255 | fHistJetsPtTrack[i]->GetYaxis()->SetTitle("counts"); | |
256 | fOutput->Add(fHistJetsPtTrack[i]); | |
257 | ||
258 | histname = "fHistJetsPt_"; | |
259 | histname += i; | |
1f6fff78 | 260 | fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2.5); |
6fd5039f | 261 | fHistJetsPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
262 | fHistJetsPt[i]->GetYaxis()->SetTitle("counts"); | |
263 | fOutput->Add(fHistJetsPt[i]); | |
264 | } | |
265 | ||
c3ba2d3d | 266 | PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram |
267 | } | |
268 | ||
269 | //________________________________________________________________________ | |
6fd5039f | 270 | Bool_t AliAnalysisTaskSAQA::RetrieveEventObjects() |
c3ba2d3d | 271 | { |
6fd5039f | 272 | if(!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) |
273 | return kFALSE; | |
c3ba2d3d | 274 | |
1f6fff78 | 275 | if (strcmp(fTrgClusName,"") && fDoTrigger) { |
c3ba2d3d | 276 | fTrgClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrgClusName)); |
277 | if (!fTrgClusters) { | |
278 | AliWarning(Form("Could not retrieve trigger clusters!")); | |
279 | } | |
280 | } | |
6fd5039f | 281 | |
282 | return kTRUE; | |
c3ba2d3d | 283 | } |
284 | ||
285 | //________________________________________________________________________ | |
6fd5039f | 286 | Bool_t AliAnalysisTaskSAQA::FillHistograms() |
c3ba2d3d | 287 | { |
288 | fHistCentrality->Fill(fCent); | |
289 | if (fTracks) | |
290 | fHistTracksCent->Fill(fCent, fTracks->GetEntriesFast()); | |
291 | if (fCaloClusters) | |
292 | fHistClusCent->Fill(fCent, fCaloClusters->GetEntriesFast()); | |
293 | ||
c3ba2d3d | 294 | Float_t trackSum = DoTrackLoop(); |
295 | ||
c3ba2d3d | 296 | DoJetLoop(); |
297 | ||
6fd5039f | 298 | if (fAnaType == kEMCAL) { |
299 | Float_t clusSum = DoClusterLoop(); | |
c3ba2d3d | 300 | |
6fd5039f | 301 | Float_t cellSum = 0, cellCutSum = 0; |
302 | ||
303 | DoCellLoop(cellSum, cellCutSum); | |
304 | ||
305 | fHistChVSneCells->Fill(cellSum, trackSum); | |
306 | fHistChVSneClus->Fill(clusSum, trackSum); | |
307 | fHistChVSneCorrCells->Fill(cellCutSum, trackSum); | |
c3ba2d3d | 308 | |
1f6fff78 | 309 | if (fDoTrigger) { |
310 | Float_t maxTrgClus = DoTriggerClusLoop(); | |
311 | fHistMaxL1ClusCent->Fill(fCent, maxTrgClus); | |
6fd5039f | 312 | |
1f6fff78 | 313 | Int_t maxL1amp = -1; |
314 | Int_t maxL1thr = -1; | |
6fd5039f | 315 | |
1f6fff78 | 316 | DoTriggerPrimitives(maxL1amp, maxL1thr); |
317 | ||
318 | if (maxL1amp > -1) | |
319 | fHistMaxL1FastORCent->Fill(fCent, maxL1amp); | |
320 | ||
321 | if (maxL1thr > -1) | |
322 | fHistMaxL1ThrCent->Fill(fCent, maxL1thr); | |
323 | } | |
6fd5039f | 324 | } |
c3ba2d3d | 325 | |
6fd5039f | 326 | return kTRUE; |
c3ba2d3d | 327 | } |
328 | ||
329 | //________________________________________________________________________ | |
330 | void AliAnalysisTaskSAQA::DoCellLoop(Float_t &sum, Float_t &sum_cut) | |
331 | { | |
332 | AliVCaloCells *cells = InputEvent()->GetEMCALCells(); | |
333 | ||
334 | if (!cells) | |
335 | return; | |
336 | ||
337 | Int_t ncells = cells->GetNumberOfCells(); | |
338 | ||
339 | for (Int_t pos = 0; pos < ncells; pos++) { | |
340 | ||
341 | Float_t amp = cells->GetAmplitude(pos); | |
342 | ||
343 | fHistCellsEnergy->Fill(amp); | |
344 | ||
345 | sum += amp; | |
346 | ||
347 | if (amp < fCellEnergyCut) | |
348 | continue; | |
349 | ||
350 | sum_cut += amp; | |
351 | ||
352 | } | |
353 | } | |
354 | ||
355 | //________________________________________________________________________ | |
356 | Float_t AliAnalysisTaskSAQA::DoClusterLoop() | |
357 | { | |
358 | if (!fCaloClusters) | |
359 | return 0; | |
360 | ||
361 | Float_t sum = 0; | |
362 | ||
363 | // Cluster loop | |
364 | Int_t nclusters = fCaloClusters->GetEntriesFast(); | |
365 | ||
366 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
367 | AliVCluster* cluster = dynamic_cast<AliVCluster*>(fCaloClusters->At(iClusters)); | |
368 | if (!cluster) { | |
369 | AliError(Form("Could not receive cluster %d", iClusters)); | |
370 | continue; | |
371 | } | |
372 | ||
373 | if (!(cluster->IsEMCAL())) continue; | |
374 | ||
375 | if (!AcceptCluster(cluster, kTRUE)) continue; | |
376 | ||
377 | fHistClustersEnergy->Fill(cluster->E()); | |
378 | ||
379 | sum += cluster->E(); | |
380 | ||
381 | Float_t pos[3]; | |
382 | cluster->GetPosition(pos); | |
383 | TVector3 clusVec(pos); | |
384 | fHistClusPhiEta->Fill(clusVec.Eta(), clusVec.Phi()); | |
385 | ||
386 | } //cluster loop | |
387 | ||
388 | return sum; | |
389 | } | |
390 | ||
391 | //________________________________________________________________________ | |
392 | Float_t AliAnalysisTaskSAQA::DoTrackLoop() | |
393 | { | |
394 | if (!fTracks) | |
395 | return 0; | |
396 | ||
397 | Float_t sum = 0; | |
398 | ||
399 | // Track loop | |
400 | Int_t ntracks = fTracks->GetEntriesFast(); | |
401 | Int_t nclusters = 0; | |
402 | if (fCaloClusters) | |
403 | nclusters = fCaloClusters->GetEntriesFast(); | |
404 | ||
405 | for(Int_t i = 0; i < ntracks; i++) { | |
406 | ||
1f6fff78 | 407 | AliVParticle* track = dynamic_cast<AliVParticle*>(fTracks->At(i)); // pointer to reconstructed to track |
408 | ||
c3ba2d3d | 409 | if(!track) { |
410 | AliError(Form("Could not retrieve track %d",i)); | |
411 | continue; | |
412 | } | |
c3ba2d3d | 413 | |
1f6fff78 | 414 | AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track); |
415 | ||
416 | if (vtrack && !AcceptTrack(vtrack, kTRUE)) | |
417 | continue; | |
418 | ||
c3ba2d3d | 419 | fHistTracksPt->Fill(track->Pt()); |
420 | ||
421 | sum += track->P(); | |
422 | ||
423 | Int_t label = track->GetLabel(); | |
424 | ||
425 | fHistTrPhiEta->Fill(track->Eta(), track->Phi()); | |
426 | ||
427 | fHistTrackEta[4]->Fill(track->Eta()); | |
428 | fHistTrackPhi[4]->Fill(track->Phi()); | |
429 | ||
430 | if (label >= 0 && label < 4) { | |
431 | fHistTrackEta[label]->Fill(track->Eta()); | |
432 | fHistTrackPhi[label]->Fill(track->Phi()); | |
433 | } | |
434 | ||
1f6fff78 | 435 | if (!vtrack) |
c3ba2d3d | 436 | continue; |
437 | ||
1f6fff78 | 438 | fHistTrEmcPhiEta->Fill(vtrack->GetTrackEtaOnEMCal(), vtrack->GetTrackPhiOnEMCal()); |
439 | ||
c3ba2d3d | 440 | } |
441 | ||
442 | return sum; | |
443 | } | |
444 | ||
445 | //________________________________________________________________________ | |
446 | void AliAnalysisTaskSAQA::DoJetLoop() | |
447 | { | |
448 | if (!fJets) | |
449 | return; | |
450 | ||
451 | Int_t njets = fJets->GetEntriesFast(); | |
452 | ||
453 | for (Int_t ij = 0; ij < njets; ij++) { | |
454 | ||
455 | AliEmcalJet* jet = dynamic_cast<AliEmcalJet*>(fJets->At(ij)); | |
456 | ||
457 | if (!jet) { | |
458 | AliError(Form("Could not receive jet %d", ij)); | |
459 | continue; | |
460 | } | |
461 | ||
6fd5039f | 462 | if (!AcceptJet(jet, kFALSE)) |
c3ba2d3d | 463 | continue; |
6fd5039f | 464 | |
465 | fHistJetsPt[fCentBin]->Fill(jet->Pt()); | |
466 | ||
467 | if (jet->MaxTrackPt() > fPtBiasJetTrack) | |
468 | fHistJetsPtTrack[fCentBin]->Fill(jet->Pt()); | |
469 | ||
470 | if (fAnaType == kEMCAL && jet->MaxClusterPt() > fPtBiasJetClus) | |
471 | fHistJetsPtClus[fCentBin]->Fill(jet->Pt()); | |
c3ba2d3d | 472 | |
c3ba2d3d | 473 | fHistJetsPtArea->Fill(jet->Pt(), jet->Area()); |
474 | fHistJetsPhiEta->Fill(jet->Eta(), jet->Phi()); | |
475 | } | |
476 | } | |
477 | ||
478 | //________________________________________________________________________ | |
479 | Float_t AliAnalysisTaskSAQA::DoTriggerClusLoop() | |
480 | { | |
481 | if (!fTrgClusters) | |
482 | return 0; | |
483 | ||
484 | Int_t ntrgclusters = fTrgClusters->GetEntriesFast(); | |
485 | Float_t maxTrgClus = 0; | |
486 | ||
487 | for (Int_t iClusters = 0; iClusters < ntrgclusters; iClusters++) { | |
488 | AliVCluster* cluster = dynamic_cast<AliVCluster*>(fTrgClusters->At(iClusters)); | |
489 | if (!cluster) { | |
490 | AliError(Form("Could not receive cluster %d", iClusters)); | |
491 | continue; | |
492 | } | |
493 | ||
494 | if (!(cluster->IsEMCAL())) continue; | |
495 | ||
496 | if (cluster->E() > maxTrgClus) | |
497 | maxTrgClus = cluster->E(); | |
498 | ||
499 | } | |
500 | return maxTrgClus; | |
501 | } | |
502 | ||
503 | //________________________________________________________________________ | |
504 | void AliAnalysisTaskSAQA::DoTriggerPrimitives(Int_t &maxL1amp, Int_t &maxL1thr) | |
505 | { | |
506 | AliVCaloTrigger *triggers = InputEvent()->GetCaloTrigger("EMCAL"); | |
507 | ||
508 | if (!triggers || triggers->GetEntries() == 0) | |
509 | return; | |
510 | ||
511 | triggers->Reset(); | |
512 | Int_t L1amp = 0; | |
513 | Int_t L1thr = 0; | |
514 | maxL1amp = -1; | |
515 | maxL1thr = -1; | |
516 | ||
517 | while (triggers->Next()) { | |
518 | triggers->GetL1TimeSum(L1amp); | |
519 | if (maxL1amp < L1amp) | |
520 | maxL1amp = L1amp; | |
521 | ||
522 | triggers->GetL1Threshold(L1thr); | |
523 | if (maxL1thr < L1thr) | |
524 | maxL1thr = L1thr; | |
525 | } | |
526 | } | |
527 | ||
528 | //________________________________________________________________________ | |
529 | void AliAnalysisTaskSAQA::Terminate(Option_t *) | |
530 | { | |
531 | // Called once at the end of the analysis. | |
532 | } |