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