]>
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" | |
079b4732 | 22 | #include "AliAODEvent.h" |
23 | #include "AliExternalTrackParam.h" | |
24 | #include "AliTrackerBase.h" | |
c3ba2d3d | 25 | #include "AliLog.h" |
59f16b27 | 26 | #include "AliEMCALGeometry.h" |
27 | #include "AliEMCALGeoParams.h" | |
c3ba2d3d | 28 | |
29 | #include "AliAnalysisTaskSAQA.h" | |
30 | ||
31 | ClassImp(AliAnalysisTaskSAQA) | |
32 | ||
33 | //________________________________________________________________________ | |
34 | AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() : | |
99cfd012 | 35 | AliAnalysisTaskEmcalJet("AliAnalysisTaskSAQA", kTRUE), |
c3ba2d3d | 36 | fCellEnergyCut(0.1), |
7c1d624c | 37 | fNclusters(0), |
38 | fNtracks(0), | |
39 | fNjets(0), | |
c3ba2d3d | 40 | fHistTracksCent(0), |
41 | fHistClusCent(0), | |
7c1d624c | 42 | fHistJetsCent(0), |
090a0c3e | 43 | fHistClusTracks(0), |
7c1d624c | 44 | fHistJetsParts(0), |
be7b6e63 | 45 | fHistCellsCent(0), |
46 | fHistCellsTracks(0), | |
6fd5039f | 47 | fHistTrEmcPhiEta(0), |
079b4732 | 48 | fHistTrPhiEtaNonProp(0), |
3e951e32 | 49 | fHistDeltaEtaPt(0), |
50 | fHistDeltaPhiPt(0), | |
7cf4626b | 51 | fHistNCellsEnergy(0), |
59f16b27 | 52 | fHistFcrossEnergy(0), |
090a0c3e | 53 | fHistClusTimeEnergy(0), |
f483218e | 54 | fHistCellsAbsIdEnergy(0), |
c3ba2d3d | 55 | fHistChVSneCells(0), |
56 | fHistChVSneClus(0), | |
57 | fHistChVSneCorrCells(0) | |
58 | { | |
59 | // Default constructor. | |
60 | ||
61 | for (Int_t i = 0; i < 5; i++) { | |
62 | fHistTrackPhi[i] = 0; | |
63 | fHistTrackEta[i] = 0; | |
64 | } | |
6fd5039f | 65 | |
66 | for (Int_t i = 0; i < 4; i++) { | |
a487deae | 67 | fHistTrPhiEtaPt[i] = 0; |
68 | fHistClusPhiEtaEnergy[i] = 0; | |
69 | fHistJetsPhiEtaPt[i] = 0; | |
98750b70 | 70 | fHistJetsPtArea[i] = 0; |
6fd5039f | 71 | } |
a487deae | 72 | |
73 | SetMakeGeneralHistograms(kTRUE); | |
c3ba2d3d | 74 | } |
75 | ||
76 | //________________________________________________________________________ | |
77 | AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) : | |
99cfd012 | 78 | AliAnalysisTaskEmcalJet(name, kTRUE), |
c3ba2d3d | 79 | fCellEnergyCut(0.1), |
7c1d624c | 80 | fNclusters(0), |
81 | fNtracks(0), | |
82 | fNjets(0), | |
c3ba2d3d | 83 | fHistTracksCent(0), |
84 | fHistClusCent(0), | |
7c1d624c | 85 | fHistJetsCent(0), |
090a0c3e | 86 | fHistClusTracks(0), |
7c1d624c | 87 | fHistJetsParts(0), |
be7b6e63 | 88 | fHistCellsCent(0), |
89 | fHistCellsTracks(0), | |
6fd5039f | 90 | fHistTrEmcPhiEta(0), |
079b4732 | 91 | fHistTrPhiEtaNonProp(0), |
3e951e32 | 92 | fHistDeltaEtaPt(0), |
93 | fHistDeltaPhiPt(0), | |
7cf4626b | 94 | fHistNCellsEnergy(0), |
59f16b27 | 95 | fHistFcrossEnergy(0), |
090a0c3e | 96 | fHistClusTimeEnergy(0), |
f483218e | 97 | fHistCellsAbsIdEnergy(0), |
c3ba2d3d | 98 | fHistChVSneCells(0), |
99 | fHistChVSneClus(0), | |
100 | fHistChVSneCorrCells(0) | |
101 | { | |
102 | // Standard constructor. | |
103 | ||
104 | for (Int_t i = 0; i < 5; i++) { | |
105 | fHistTrackPhi[i] = 0; | |
106 | fHistTrackEta[i] = 0; | |
107 | } | |
6fd5039f | 108 | |
109 | for (Int_t i = 0; i < 4; i++) { | |
a487deae | 110 | fHistTrPhiEtaPt[i] = 0; |
111 | fHistClusPhiEtaEnergy[i] = 0; | |
112 | fHistJetsPhiEtaPt[i] = 0; | |
98750b70 | 113 | fHistJetsPtArea[i] = 0; |
6fd5039f | 114 | } |
a487deae | 115 | |
116 | SetMakeGeneralHistograms(kTRUE); | |
c3ba2d3d | 117 | } |
118 | ||
119 | //________________________________________________________________________ | |
120 | AliAnalysisTaskSAQA::~AliAnalysisTaskSAQA() | |
121 | { | |
122 | // Destructor | |
123 | } | |
124 | ||
125 | //________________________________________________________________________ | |
126 | void AliAnalysisTaskSAQA::UserCreateOutputObjects() | |
127 | { | |
128 | // Create histograms | |
129 | ||
a487deae | 130 | AliAnalysisTaskEmcalJet::UserCreateOutputObjects(); |
c3ba2d3d | 131 | |
a487deae | 132 | if (!fTracksName.IsNull()) { |
133 | fHistTracksCent = new TH2F("fHistTracksCent","Tracks vs. centrality", 100, 0, 100, fNbins, 0, 4000); | |
134 | fHistTracksCent->GetXaxis()->SetTitle("Centrality (%)"); | |
135 | fHistTracksCent->GetYaxis()->SetTitle("No. of tracks"); | |
136 | fOutput->Add(fHistTracksCent); | |
c3ba2d3d | 137 | |
a487deae | 138 | TString histname; |
be7b6e63 | 139 | |
a487deae | 140 | for (Int_t i = 0; i < 4; i++) { |
141 | histname = "fHistTrPhiEtaPt_"; | |
142 | histname += i; | |
143 | fHistTrPhiEtaPt[i] = new TH3F(histname,histname, 100, -1, 1, 201, 0, TMath::Pi() * 2.01, fNbins, fMinBinPt, fMaxBinPt); | |
144 | fHistTrPhiEtaPt[i] ->GetXaxis()->SetTitle("#eta"); | |
145 | fHistTrPhiEtaPt[i] ->GetYaxis()->SetTitle("#phi"); | |
146 | fHistTrPhiEtaPt[i] ->GetZaxis()->SetTitle("p_{T} (GeV/c)"); | |
147 | fOutput->Add(fHistTrPhiEtaPt[i]); | |
148 | } | |
c3ba2d3d | 149 | |
a487deae | 150 | fHistTrEmcPhiEta = new TH2F("fHistTrEmcPhiEta","Phi-Eta emcal distribution of tracks", 100, -1, 1, 201, 0, TMath::Pi() * 2.01); |
151 | fHistTrEmcPhiEta->GetXaxis()->SetTitle("#eta"); | |
152 | fHistTrEmcPhiEta->GetYaxis()->SetTitle("#phi"); | |
153 | fOutput->Add(fHistTrEmcPhiEta); | |
154 | ||
155 | fHistTrPhiEtaNonProp = new TH2F("fHistTrPhiEtaNonProp","fHistTrPhiEtaNonProp", 100, -1, 1, 201, 0, TMath::Pi() * 2.01); | |
156 | fHistTrPhiEtaNonProp->GetXaxis()->SetTitle("#eta"); | |
157 | fHistTrPhiEtaNonProp->GetYaxis()->SetTitle("#phi"); | |
158 | fOutput->Add(fHistTrPhiEtaNonProp); | |
159 | ||
160 | fHistDeltaEtaPt = new TH2F("fHistDeltaEtaPt","fHistDeltaEtaPt", fNbins, fMinBinPt, fMaxBinPt, 80, -0.5, 0.5); | |
161 | fHistDeltaEtaPt->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
162 | fHistDeltaEtaPt->GetYaxis()->SetTitle("#delta#eta"); | |
163 | fOutput->Add(fHistDeltaEtaPt); | |
164 | ||
165 | fHistDeltaPhiPt = new TH2F("fHistDeltaPhiPt","fHistDeltaPhiPt", fNbins, fMinBinPt, fMaxBinPt, 256, -1.6, 4.8); | |
166 | fHistDeltaPhiPt->GetXaxis()->SetTitle("p_{T} [GeV/c]"); | |
167 | fHistDeltaPhiPt->GetYaxis()->SetTitle("#delta#phi"); | |
168 | fOutput->Add(fHistDeltaPhiPt); | |
169 | ||
170 | for (Int_t i = 0; i < 5; i++) { | |
171 | TString histnamephi("fHistTrackPhi_"); | |
172 | histnamephi += i; | |
173 | fHistTrackPhi[i] = new TH1F(histnamephi.Data(),histnamephi.Data(), 201, 0, TMath::Pi() * 2.01); | |
174 | fHistTrackPhi[i]->GetXaxis()->SetTitle("Phi"); | |
175 | fOutput->Add(fHistTrackPhi[i]); | |
176 | ||
177 | TString histnameeta("fHistTrackEta_"); | |
178 | histnameeta += i; | |
179 | fHistTrackEta[i] = new TH1F(histnameeta.Data(),histnameeta.Data(), 100, -1, 1); | |
180 | fHistTrackEta[i]->GetXaxis()->SetTitle("Eta"); | |
181 | fOutput->Add(fHistTrackEta[i]); | |
182 | } | |
7c1d624c | 183 | |
a487deae | 184 | fHistTrackPhi[0]->SetLineColor(kRed); |
185 | fHistTrackEta[0]->SetLineColor(kRed); | |
186 | fHistTrackPhi[1]->SetLineColor(kBlue); | |
187 | fHistTrackEta[1]->SetLineColor(kBlue); | |
188 | fHistTrackPhi[2]->SetLineColor(kGreen); | |
189 | fHistTrackEta[2]->SetLineColor(kGreen); | |
190 | fHistTrackPhi[3]->SetLineColor(kOrange); | |
191 | fHistTrackEta[3]->SetLineColor(kOrange); | |
192 | fHistTrackPhi[4]->SetLineColor(kBlack); | |
193 | fHistTrackEta[4]->SetLineColor(kBlack); | |
194 | } | |
7c1d624c | 195 | |
a487deae | 196 | if (!fCaloName.IsNull()) { |
a5621834 | 197 | fHistClusCent = new TH2F("fHistClusCent","Clusters vs. centrality", 100, 0, 100, fNbins, 0, 2000); |
6fd5039f | 198 | fHistClusCent->GetXaxis()->SetTitle("Centrality (%)"); |
199 | fHistClusCent->GetYaxis()->SetTitle("No. of clusters"); | |
200 | fOutput->Add(fHistClusCent); | |
090a0c3e | 201 | |
202 | fHistClusTracks = new TH2F("fHistClusTracks","Clusters vs. tracks", fNbins, 0, 4000, fNbins, 0, 2000); | |
203 | fHistClusTracks->GetXaxis()->SetTitle("No. of tracks"); | |
204 | fHistClusTracks->GetYaxis()->SetTitle("No. of clusters"); | |
205 | fOutput->Add(fHistClusTracks); | |
206 | ||
be7b6e63 | 207 | fHistCellsCent = new TH2F("fHistCellsCent","Cells vs. centrality", 100, 0, 100, fNbins, 0, 6000); |
208 | fHistCellsCent->GetXaxis()->SetTitle("Centrality (%)"); | |
209 | fHistCellsCent->GetYaxis()->SetTitle("No. of EMCal cells"); | |
210 | fOutput->Add(fHistCellsCent); | |
211 | ||
212 | fHistCellsTracks = new TH2F("fHistCellsTracks","Cells vs. tracks", fNbins, 0, 4000, fNbins, 0, 6000); | |
213 | fHistCellsTracks->GetXaxis()->SetTitle("No. of tracks"); | |
214 | fHistCellsTracks->GetYaxis()->SetTitle("No. of EMCal cells"); | |
215 | fOutput->Add(fHistCellsTracks); | |
216 | ||
a487deae | 217 | TString histname; |
218 | ||
219 | for (Int_t i = 0; i < 4; i++) { | |
220 | histname = "fHistClusPhiEtaEnergy_"; | |
221 | histname += i; | |
222 | fHistClusPhiEtaEnergy[i] = new TH3F(histname, histname, 100, -1.2, 1.2, 201, 0, TMath::Pi() * 2.01, fNbins, fMinBinPt, fMaxBinPt); | |
223 | fHistClusPhiEtaEnergy[i]->GetXaxis()->SetTitle("#eta"); | |
224 | fHistClusPhiEtaEnergy[i]->GetYaxis()->SetTitle("#phi"); | |
59f16b27 | 225 | fHistClusPhiEtaEnergy[i]->GetZaxis()->SetTitle("E_{cluster} (GeV)"); |
a487deae | 226 | fOutput->Add(fHistClusPhiEtaEnergy[i]); |
227 | } | |
228 | ||
781da0a3 | 229 | fHistClusTimeEnergy = new TH2F("fHistClusTimeEnergy","Time vs. energy of clusters", fNbins, fMinBinPt, fMaxBinPt, fNbins, -1e-6, 1e-6); |
59f16b27 | 230 | fHistClusTimeEnergy->GetXaxis()->SetTitle("E_{cluster} (GeV)"); |
090a0c3e | 231 | fHistClusTimeEnergy->GetYaxis()->SetTitle("Time"); |
232 | fOutput->Add(fHistClusTimeEnergy); | |
233 | ||
7cf4626b | 234 | fHistNCellsEnergy = new TH2F("fHistNCellsEnergy","Number of cells vs. energy of clusters", fNbins, fMinBinPt, fMaxBinPt, 30, 0, 30); |
59f16b27 | 235 | fHistNCellsEnergy->GetXaxis()->SetTitle("E_{cluster} (GeV)"); |
7cf4626b | 236 | fHistNCellsEnergy->GetYaxis()->SetTitle("N_{cells}"); |
a487deae | 237 | fOutput->Add(fHistNCellsEnergy); |
59f16b27 | 238 | |
239 | fHistFcrossEnergy = new TH2F("fHistFcrossEnergy","fHistFcrossEnergy", fNbins, fMinBinPt, fMaxBinPt, 200, -3.5, 1.5); | |
240 | fHistFcrossEnergy->GetXaxis()->SetTitle("E_{cluster} (GeV)"); | |
241 | fHistFcrossEnergy->GetYaxis()->SetTitle("F_{cross}"); | |
242 | fOutput->Add(fHistFcrossEnergy); | |
a487deae | 243 | |
f483218e | 244 | fHistCellsAbsIdEnergy = new TH2F("fHistCellsAbsIdEnergy","fHistCellsAbsIdEnergy", 11600,0,11599,(Int_t)(fNbins / 2), fMinBinPt, fMaxBinPt / 2); |
245 | fHistCellsAbsIdEnergy->GetXaxis()->SetTitle("cell abs. Id"); | |
59f16b27 | 246 | fHistCellsAbsIdEnergy->GetYaxis()->SetTitle("E_{cluster} (GeV)"); |
f483218e | 247 | fHistCellsAbsIdEnergy->GetZaxis()->SetTitle("counts"); |
248 | fOutput->Add(fHistCellsAbsIdEnergy); | |
6fd5039f | 249 | |
98750b70 | 250 | fHistChVSneCells = new TH2F("fHistChVSneCells","Charged energy vs. neutral (cells) energy", |
be7b6e63 | 251 | (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5, (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5); |
a487deae | 252 | fHistChVSneCells->GetXaxis()->SetTitle("Energy (GeV)"); |
253 | fHistChVSneCells->GetYaxis()->SetTitle("Momentum (GeV/c)"); | |
6fd5039f | 254 | fOutput->Add(fHistChVSneCells); |
255 | ||
98750b70 | 256 | fHistChVSneClus = new TH2F("fHistChVSneClus","Charged energy vs. neutral (clusters) energy", |
be7b6e63 | 257 | (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5, (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5); |
a487deae | 258 | fHistChVSneClus->GetXaxis()->SetTitle("Energy (GeV)"); |
259 | fHistChVSneClus->GetYaxis()->SetTitle("Momentum (GeV/c)"); | |
6fd5039f | 260 | fOutput->Add(fHistChVSneClus); |
261 | ||
98750b70 | 262 | fHistChVSneCorrCells = new TH2F("fHistChVSneCorrCells","Charged energy vs. neutral (corrected cells) energy", |
be7b6e63 | 263 | (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5, (Int_t)(fNbins * 2.5), fMinBinPt , fMaxBinPt * 2.5); |
a487deae | 264 | fHistChVSneCorrCells->GetXaxis()->SetTitle("Energy (GeV)"); |
265 | fHistChVSneCorrCells->GetYaxis()->SetTitle("Momentum (GeV/c)"); | |
6fd5039f | 266 | fOutput->Add(fHistChVSneCorrCells); |
c3ba2d3d | 267 | } |
a487deae | 268 | |
e44e8726 | 269 | if (!fJetsName.IsNull()) { |
a487deae | 270 | fHistJetsCent = new TH2F("fHistJetsCent","Jets vs. centrality", 100, 0, 100, 150, -0.5, 149.5); |
271 | fHistJetsCent->GetXaxis()->SetTitle("Centrality (%)"); | |
272 | fHistJetsCent->GetYaxis()->SetTitle("No. of jets"); | |
273 | fOutput->Add(fHistJetsCent); | |
274 | ||
275 | fHistJetsParts = new TH2F("fHistJetsParts","Jets vs. centrality", fNbins, 0, 6000, 150, -0.5, 149.5); | |
276 | fHistJetsParts->GetXaxis()->SetTitle("No. of particles"); | |
277 | fHistJetsParts->GetYaxis()->SetTitle("No. of jets"); | |
278 | fOutput->Add(fHistJetsParts); | |
6fd5039f | 279 | |
e44e8726 | 280 | TString histname; |
281 | ||
282 | for (Int_t i = 0; i < 4; i++) { | |
a487deae | 283 | histname = "fHistJetsPhiEtaPt_"; |
e44e8726 | 284 | histname += i; |
a487deae | 285 | fHistJetsPhiEtaPt[i] = new TH3F(histname.Data(), histname.Data(), 100, -1.2, 1.2, 201, 0, TMath::Pi() * 2.01, (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5); |
286 | fHistJetsPhiEtaPt[i]->GetXaxis()->SetTitle("#eta"); | |
287 | fHistJetsPhiEtaPt[i]->GetYaxis()->SetTitle("#phi"); | |
288 | fHistJetsPhiEtaPt[i]->GetZaxis()->SetTitle("p_{T} (GeV/c)"); | |
289 | fOutput->Add(fHistJetsPhiEtaPt[i]); | |
e44e8726 | 290 | |
291 | histname = "fHistJetsPtArea_"; | |
292 | histname += i; | |
a487deae | 293 | fHistJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), (Int_t)(fNbins * 2.5), fMinBinPt, fMaxBinPt * 2.5, 30, 0, fJetRadius * fJetRadius * TMath::Pi() * 3); |
294 | fHistJetsPtArea[i]->GetXaxis()->SetTitle("p_{T} (GeV/c)"); | |
e44e8726 | 295 | fHistJetsPtArea[i]->GetYaxis()->SetTitle("area"); |
296 | fOutput->Add(fHistJetsPtArea[i]); | |
297 | } | |
6fd5039f | 298 | } |
299 | ||
c3ba2d3d | 300 | PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram |
301 | } | |
302 | ||
303 | //________________________________________________________________________ | |
6fd5039f | 304 | Bool_t AliAnalysisTaskSAQA::RetrieveEventObjects() |
c3ba2d3d | 305 | { |
c3604199 | 306 | // Retrieve event objects. |
307 | ||
308 | if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) | |
6fd5039f | 309 | return kFALSE; |
c3ba2d3d | 310 | |
7c1d624c | 311 | fNclusters = 0; |
312 | fNtracks = 0; | |
313 | fNjets = 0; | |
314 | ||
6fd5039f | 315 | return kTRUE; |
c3ba2d3d | 316 | } |
317 | ||
7c1d624c | 318 | |
c3ba2d3d | 319 | //________________________________________________________________________ |
6fd5039f | 320 | Bool_t AliAnalysisTaskSAQA::FillHistograms() |
c3ba2d3d | 321 | { |
c3604199 | 322 | // Fill histograms. |
323 | ||
a487deae | 324 | Float_t clusSum = 0; |
325 | Float_t trackSum = 0; | |
090a0c3e | 326 | |
a487deae | 327 | if (fTracks) { |
328 | trackSum = DoTrackLoop(); | |
c3ba2d3d | 329 | |
a487deae | 330 | fHistTracksCent->Fill(fCent, fNtracks); |
331 | } | |
be7b6e63 | 332 | |
a487deae | 333 | if (fCaloClusters) { |
334 | clusSum = DoClusterLoop(); | |
c3ba2d3d | 335 | |
7c1d624c | 336 | fHistClusCent->Fill(fCent, fNclusters); |
337 | fHistClusTracks->Fill(fNtracks, fNclusters); | |
338 | ||
6fd5039f | 339 | Float_t cellSum = 0, cellCutSum = 0; |
340 | ||
be7b6e63 | 341 | Int_t ncells = DoCellLoop(cellSum, cellCutSum); |
342 | ||
343 | if (fTracks) | |
a487deae | 344 | fHistCellsTracks->Fill(fNtracks, ncells); |
be7b6e63 | 345 | |
346 | fHistCellsCent->Fill(fCent, ncells); | |
6fd5039f | 347 | |
348 | fHistChVSneCells->Fill(cellSum, trackSum); | |
349 | fHistChVSneClus->Fill(clusSum, trackSum); | |
350 | fHistChVSneCorrCells->Fill(cellCutSum, trackSum); | |
a487deae | 351 | } |
c3ba2d3d | 352 | |
a487deae | 353 | if (fJets) { |
354 | DoJetLoop(); | |
6fd5039f | 355 | |
a487deae | 356 | fHistJetsCent->Fill(fCent, fNjets); |
357 | fHistJetsParts->Fill(fNtracks + fNclusters, fNjets); | |
6fd5039f | 358 | } |
c3ba2d3d | 359 | |
6fd5039f | 360 | return kTRUE; |
c3ba2d3d | 361 | } |
362 | ||
363 | //________________________________________________________________________ | |
be7b6e63 | 364 | Int_t AliAnalysisTaskSAQA::DoCellLoop(Float_t &sum, Float_t &sum_cut) |
c3ba2d3d | 365 | { |
c3604199 | 366 | // Do cell loop. |
367 | ||
c3ba2d3d | 368 | AliVCaloCells *cells = InputEvent()->GetEMCALCells(); |
369 | ||
370 | if (!cells) | |
be7b6e63 | 371 | return 0; |
c3ba2d3d | 372 | |
c3604199 | 373 | const Int_t ncells = cells->GetNumberOfCells(); |
c3ba2d3d | 374 | |
375 | for (Int_t pos = 0; pos < ncells; pos++) { | |
f483218e | 376 | Float_t amp = cells->GetAmplitude(pos); |
377 | Int_t absId = cells->GetCellNumber(pos); | |
378 | fHistCellsAbsIdEnergy->Fill(absId,amp); | |
c3ba2d3d | 379 | sum += amp; |
c3ba2d3d | 380 | if (amp < fCellEnergyCut) |
381 | continue; | |
c3ba2d3d | 382 | sum_cut += amp; |
c3ba2d3d | 383 | } |
be7b6e63 | 384 | |
385 | return ncells; | |
c3ba2d3d | 386 | } |
387 | ||
59f16b27 | 388 | //________________________________________________________________________ |
389 | Double_t AliAnalysisTaskSAQA::GetFcross(AliVCluster *cluster, AliVCaloCells *cells) | |
390 | { | |
391 | Int_t AbsIdseed = -1; | |
392 | Double_t Eseed = 0; | |
393 | for (Int_t i = 0; i < cluster->GetNCells(); i++) { | |
394 | if (cells->GetCellAmplitude(cluster->GetCellAbsId(i)) > AbsIdseed) { | |
395 | Eseed = cells->GetCellAmplitude(cluster->GetCellAbsId(i)); | |
396 | AbsIdseed = cluster->GetCellAbsId(i); | |
397 | } | |
398 | } | |
399 | ||
400 | if (Eseed < 1e-9) | |
401 | return 100; | |
402 | ||
403 | Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1; | |
404 | fGeom->GetCellIndex(AbsIdseed,imod,iTower,iIphi,iIeta); | |
405 | fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi,iIeta,iphi,ieta); | |
406 | ||
407 | //Get close cells index and energy, not in corners | |
408 | ||
409 | Int_t absID1 = -1; | |
410 | Int_t absID2 = -1; | |
411 | ||
412 | if (iphi < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta); | |
413 | if (iphi > 0) absID2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta); | |
414 | ||
415 | // In case of cell in eta = 0 border, depending on SM shift the cross cell index | |
416 | ||
417 | Int_t absID3 = -1; | |
418 | Int_t absID4 = -1; | |
419 | ||
420 | if (ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2)) { | |
421 | absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0); | |
422 | absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1); | |
423 | } | |
424 | else if (ieta == 0 && imod%2) { | |
425 | absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1); | |
426 | absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1); | |
427 | } | |
428 | else { | |
429 | if (ieta < AliEMCALGeoParams::fgkEMCALCols-1) | |
430 | absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1); | |
431 | if (ieta > 0) | |
432 | absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1); | |
433 | } | |
434 | ||
435 | Double_t ecell1 = cells->GetCellAmplitude(absID1); | |
436 | Double_t ecell2 = cells->GetCellAmplitude(absID2); | |
437 | Double_t ecell3 = cells->GetCellAmplitude(absID3); | |
438 | Double_t ecell4 = cells->GetCellAmplitude(absID4); | |
439 | ||
440 | Double_t Ecross = ecell1 + ecell2 + ecell3 + ecell4; | |
441 | ||
442 | Double_t Fcross = 1 - Ecross/Eseed; | |
443 | ||
444 | return Fcross; | |
445 | } | |
446 | ||
c3ba2d3d | 447 | //________________________________________________________________________ |
448 | Float_t AliAnalysisTaskSAQA::DoClusterLoop() | |
449 | { | |
c3604199 | 450 | // Do cluster loop. |
451 | ||
c3ba2d3d | 452 | if (!fCaloClusters) |
453 | return 0; | |
454 | ||
59f16b27 | 455 | AliVCaloCells *cells = InputEvent()->GetEMCALCells(); |
456 | ||
c3ba2d3d | 457 | Float_t sum = 0; |
458 | ||
459 | // Cluster loop | |
460 | Int_t nclusters = fCaloClusters->GetEntriesFast(); | |
461 | ||
462 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
e44e8726 | 463 | AliVCluster* cluster = static_cast<AliVCluster*>(fCaloClusters->At(iClusters)); |
c3ba2d3d | 464 | if (!cluster) { |
465 | AliError(Form("Could not receive cluster %d", iClusters)); | |
466 | continue; | |
467 | } | |
c3ba2d3d | 468 | |
e44e8726 | 469 | if (!AcceptCluster(cluster, kTRUE)) |
470 | continue; | |
c3ba2d3d | 471 | |
c3ba2d3d | 472 | sum += cluster->E(); |
473 | ||
7cf4626b | 474 | TLorentzVector nPart; |
475 | cluster->GetMomentum(nPart, fVertex); | |
c3ba2d3d | 476 | |
a487deae | 477 | fHistClusPhiEtaEnergy[fCentBin]->Fill(nPart.Eta(), nPart.Phi(), cluster->E()); |
7cf4626b | 478 | fHistNCellsEnergy->Fill(cluster->E(), cluster->GetNCells()); |
090a0c3e | 479 | |
480 | fHistClusTimeEnergy->Fill(cluster->E(), cluster->GetTOF()); | |
7c1d624c | 481 | |
59f16b27 | 482 | if (cells) |
483 | fHistFcrossEnergy->Fill(cluster->E(), GetFcross(cluster, cells)); | |
484 | ||
7c1d624c | 485 | fNclusters++; |
c3604199 | 486 | } |
c3ba2d3d | 487 | |
488 | return sum; | |
489 | } | |
490 | ||
491 | //________________________________________________________________________ | |
492 | Float_t AliAnalysisTaskSAQA::DoTrackLoop() | |
493 | { | |
c3604199 | 494 | // Do track loop. |
495 | ||
c3ba2d3d | 496 | if (!fTracks) |
497 | return 0; | |
498 | ||
499 | Float_t sum = 0; | |
500 | ||
c3ba2d3d | 501 | Int_t ntracks = fTracks->GetEntriesFast(); |
502 | Int_t nclusters = 0; | |
503 | if (fCaloClusters) | |
504 | nclusters = fCaloClusters->GetEntriesFast(); | |
505 | ||
c3604199 | 506 | for (Int_t i = 0; i < ntracks; i++) { |
c3ba2d3d | 507 | |
e44e8726 | 508 | AliVParticle* track = static_cast<AliVParticle*>(fTracks->At(i)); // pointer to reconstructed to track |
1f6fff78 | 509 | |
c3604199 | 510 | if (!track) { |
c3ba2d3d | 511 | AliError(Form("Could not retrieve track %d",i)); |
512 | continue; | |
513 | } | |
c3ba2d3d | 514 | |
1f6fff78 | 515 | AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track); |
516 | ||
517 | if (vtrack && !AcceptTrack(vtrack, kTRUE)) | |
518 | continue; | |
7c1d624c | 519 | |
520 | fNtracks++; | |
c3ba2d3d | 521 | |
522 | sum += track->P(); | |
a487deae | 523 | |
524 | fHistTrPhiEtaPt[fCentBin]->Fill(track->Eta(), track->Phi(), track->Pt()); | |
c3ba2d3d | 525 | |
526 | Int_t label = track->GetLabel(); | |
c3ba2d3d | 527 | |
528 | if (label >= 0 && label < 4) { | |
529 | fHistTrackEta[label]->Fill(track->Eta()); | |
530 | fHistTrackPhi[label]->Fill(track->Phi()); | |
531 | } | |
532 | ||
a487deae | 533 | fHistTrackEta[4]->Fill(track->Eta()); |
534 | fHistTrackPhi[4]->Fill(track->Phi()); | |
aa4d701c | 535 | |
1f6fff78 | 536 | if (!vtrack) |
c3ba2d3d | 537 | continue; |
538 | ||
079b4732 | 539 | if (vtrack->GetTrackEtaOnEMCal() == -999 || vtrack->GetTrackPhiOnEMCal() == -999) |
540 | fHistTrPhiEtaNonProp->Fill(vtrack->Eta(), vtrack->Phi()); | |
541 | ||
1f6fff78 | 542 | fHistTrEmcPhiEta->Fill(vtrack->GetTrackEtaOnEMCal(), vtrack->GetTrackPhiOnEMCal()); |
3e951e32 | 543 | fHistDeltaEtaPt->Fill(vtrack->Pt(), vtrack->Eta() - vtrack->GetTrackEtaOnEMCal()); |
544 | fHistDeltaPhiPt->Fill(vtrack->Pt(), vtrack->Phi() - vtrack->GetTrackPhiOnEMCal()); | |
c3ba2d3d | 545 | } |
546 | ||
547 | return sum; | |
548 | } | |
549 | ||
550 | //________________________________________________________________________ | |
551 | void AliAnalysisTaskSAQA::DoJetLoop() | |
552 | { | |
c3604199 | 553 | // Do jet loop. |
554 | ||
c3ba2d3d | 555 | if (!fJets) |
556 | return; | |
557 | ||
558 | Int_t njets = fJets->GetEntriesFast(); | |
559 | ||
560 | for (Int_t ij = 0; ij < njets; ij++) { | |
561 | ||
e44e8726 | 562 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(ij)); |
c3ba2d3d | 563 | |
564 | if (!jet) { | |
565 | AliError(Form("Could not receive jet %d", ij)); | |
566 | continue; | |
567 | } | |
568 | ||
a487deae | 569 | if (!AcceptJet(jet)) |
c3ba2d3d | 570 | continue; |
6fd5039f | 571 | |
7c1d624c | 572 | fNjets++; |
573 | ||
a487deae | 574 | fHistJetsPhiEtaPt[fCentBin]->Fill(jet->Eta(), jet->Phi(), jet->Pt()); |
99cfd012 | 575 | fHistJetsPtArea[fCentBin]->Fill(jet->Pt(), jet->Area()); |
c3ba2d3d | 576 | } |
577 | } | |
578 | ||
c3ba2d3d | 579 | |
580 | //________________________________________________________________________ | |
581 | void AliAnalysisTaskSAQA::Terminate(Option_t *) | |
582 | { | |
583 | // Called once at the end of the analysis. | |
584 | } |