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