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