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