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