]>
Commit | Line | Data |
---|---|---|
8d63376d | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ///////////////////////////////////////////////////////////// | |
17 | // | |
18 | // AliAnalysisTask to extract from ESD tracks the information | |
19 | // on ITS tracking efficiency and resolutions. | |
20 | // | |
21 | // Author: A.Dainese, andrea.dainese@pd.infn.it | |
22 | ///////////////////////////////////////////////////////////// | |
23 | ||
24 | #include <TChain.h> | |
25 | #include <TTree.h> | |
26 | #include <TNtuple.h> | |
27 | #include <TBranch.h> | |
28 | #include <TClonesArray.h> | |
29 | #include <TObjArray.h> | |
30 | #include <TH1F.h> | |
31 | #include <TH2F.h> | |
32 | #include <TCanvas.h> | |
33 | #include <TParticle.h> | |
34 | ||
35 | #include "AliAnalysisTask.h" | |
36 | #include "AliAnalysisManager.h" | |
37 | ||
38 | #include "AliMultiplicity.h" | |
39 | #include "AliVertexerTracks.h" | |
40 | #include "AliESDtrack.h" | |
41 | #include "AliExternalTrackParam.h" | |
42 | #include "AliESDVertex.h" | |
43 | #include "AliESDEvent.h" | |
44 | #include "AliESDfriend.h" | |
45 | #include "AliESDInputHandler.h" | |
46 | #include "AliESDInputHandlerRP.h" | |
47 | #include "AliTrackPointArray.h" | |
2308c814 | 48 | #include "../ITS/AliITSRecPoint.h" |
8d63376d | 49 | |
50 | #include "AliMCEventHandler.h" | |
51 | #include "AliMCEvent.h" | |
52 | #include "AliStack.h" | |
53 | #include "AliLog.h" | |
54 | ||
55 | #include "AliGenEventHeader.h" | |
56 | #include "AliAnalysisTaskITSTrackingCheck.h" | |
57 | ||
58 | ||
59 | ClassImp(AliAnalysisTaskITSTrackingCheck) | |
60 | ||
61 | //________________________________________________________________________ | |
62 | AliAnalysisTaskITSTrackingCheck::AliAnalysisTaskITSTrackingCheck(const char *name) : | |
63 | AliAnalysisTask(name, "ITSTrackingCheckTask"), | |
2308c814 | 64 | fReadMC(kFALSE), |
8d63376d | 65 | fReadRPLabels(kFALSE), |
2308c814 | 66 | fFillNtuples(kFALSE), |
8d63376d | 67 | fESD(0), |
68 | fESDfriend(0), | |
69 | fOutput(0), | |
70 | fHistNtracks(0), | |
71 | fHistNclsITSMI(0), | |
72 | fHistNclsITSSA(0), | |
2308c814 | 73 | fHistNclsITSSAInAcc(0), |
8d63376d | 74 | fHistClusterMapITSMI(0), |
75 | fHistClusterMapITSMIok(0), | |
76 | fHistClusterMapITSMIbad(0), | |
77 | fHistClusterMapITSMIskipped(0), | |
78 | fHistClusterMapITSMIoutinz(0), | |
79 | fHistClusterMapITSMInorefit(0), | |
80 | fHistClusterMapITSMInocls(0), | |
2308c814 | 81 | fHistClusterMapITSMIokoutinzbad(0), |
8d63376d | 82 | fHistClusterMapITSSA(0), |
83 | fHistClusterMapITSSAok(0), | |
84 | fHistClusterMapITSSAbad(0), | |
85 | fHistClusterMapITSSAskipped(0), | |
86 | fHistClusterMapITSSAoutinz(0), | |
87 | fHistClusterMapITSSAnorefit(0), | |
88 | fHistClusterMapITSSAnocls(0), | |
2308c814 | 89 | fHistClusterMapITSSAokoutinzbad(0), |
90 | fHistClusterMapITSSAInAcc(0), | |
91 | fHistClusterMapITSSAokInAcc(0), | |
92 | fHistClusterMapITSSAbadInAcc(0), | |
93 | fHistClusterMapITSSAskippedInAcc(0), | |
94 | fHistClusterMapITSSAoutinzInAcc(0), | |
95 | fHistClusterMapITSSAnorefitInAcc(0), | |
96 | fHistClusterMapITSSAnoclsInAcc(0), | |
97 | fHistClusterMapITSSAokoutinzbadInAcc(0), | |
98 | fHistClusterMapModuleITSSAokInAcc(0), | |
99 | fHistClusterMapModuleITSSAbadInAcc(0), | |
100 | fHistClusterMapModuleITSSAnoclsInAcc(0), | |
8d63376d | 101 | fHistPhiTPC(0), |
102 | fHistPtTPC(0), | |
103 | fHistPtITSMI2(0), | |
104 | fHistPtITSMI3(0), | |
105 | fHistPtITSMI4(0), | |
106 | fHistPtITSMI5(0), | |
107 | fHistPtITSMI6(0), | |
108 | fHistPtITSMISPD(0), | |
109 | fNtupleESDTracks(0), | |
110 | fNtupleITSAlignExtra(0), | |
111 | fNtupleITSAlignSPDTracklets(0) | |
112 | { | |
113 | // Constructor | |
114 | ||
115 | for(Int_t i=0; i<10; i++) fCountsPerPtBin[i]=0; | |
116 | ||
117 | // Define input and output slots here | |
118 | // Input slot #0 works with a TChain | |
119 | DefineInput(0, TChain::Class()); | |
120 | // Output slot #0 writes into a TList container | |
121 | DefineOutput(0, TList::Class()); //My private output | |
122 | } | |
123 | //________________________________________________________________________ | |
124 | AliAnalysisTaskITSTrackingCheck::~AliAnalysisTaskITSTrackingCheck() | |
125 | { | |
126 | // Destructor | |
127 | ||
128 | // histograms are in the output list and deleted when the output | |
129 | // list is deleted by the TSelector dtor | |
130 | ||
131 | if (fOutput) { | |
132 | delete fOutput; | |
133 | fOutput = 0; | |
134 | } | |
135 | } | |
136 | ||
137 | //________________________________________________________________________ | |
138 | void AliAnalysisTaskITSTrackingCheck::ConnectInputData(Option_t *) | |
139 | { | |
140 | // Connect ESD or AOD here | |
141 | // Called once | |
142 | ||
143 | TTree* tree = dynamic_cast<TTree*> (GetInputData(0)); | |
144 | if (!tree) { | |
145 | Printf("ERROR: Could not read chain from input slot 0"); | |
146 | } else { | |
147 | // Disable all branches and enable only the needed ones | |
148 | // The next two lines are different when data produced as AliESDEvent is read | |
149 | ||
150 | tree->SetBranchStatus("ESDfriend*", 1); | |
151 | tree->SetBranchAddress("ESDfriend.",&fESDfriend); | |
152 | ||
153 | AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
154 | ||
155 | ||
156 | if (!esdH) { | |
157 | Printf("ERROR: Could not get ESDInputHandler"); | |
158 | } else { | |
159 | fESD = esdH->GetEvent(); | |
160 | ||
161 | } | |
162 | } | |
163 | ||
164 | return; | |
165 | } | |
166 | ||
167 | //________________________________________________________________________ | |
168 | void AliAnalysisTaskITSTrackingCheck::CreateOutputObjects() | |
169 | { | |
170 | // Create histograms | |
171 | // Called once | |
172 | ||
173 | for(Int_t i=0; i<10; i++) fCountsPerPtBin[i]=0; | |
174 | ||
175 | // Several histograms are more conveniently managed in a TList | |
176 | fOutput = new TList; | |
177 | fOutput->SetOwner(); | |
178 | ||
179 | fHistNtracks = new TH1F("fHistNtracks", "N ESD tracks; N tracks; Events",5000, -0.5, 4999.5); | |
180 | fHistNtracks->Sumw2(); | |
181 | fHistNtracks->SetMinimum(0); | |
182 | fOutput->Add(fHistNtracks); | |
183 | ||
184 | fHistNclsITSMI = new TH1F("fHistNclsITSMI", "N ITS clusters per track (MI); N clusters; Counts",7, -0.5, 6.5); | |
185 | fHistNclsITSMI->Sumw2(); | |
186 | fHistNclsITSMI->SetMinimum(0); | |
187 | fOutput->Add(fHistNclsITSMI); | |
188 | ||
2308c814 | 189 | fHistNclsITSSAInAcc = new TH1F("fHistNclsITSSAInAcc", "N ITS clusters per track (SA); N clusters; Counts",7, -0.5, 6.5); |
190 | fHistNclsITSSAInAcc->Sumw2(); | |
191 | fHistNclsITSSAInAcc->SetMinimum(0); | |
192 | fOutput->Add(fHistNclsITSSAInAcc); | |
193 | ||
8d63376d | 194 | fHistNclsITSSA = new TH1F("fHistNclsITSSA", "N ITS clusters per track (SA); N clusters; Counts",7, -0.5, 6.5); |
195 | fHistNclsITSSA->Sumw2(); | |
196 | fHistNclsITSSA->SetMinimum(0); | |
197 | fOutput->Add(fHistNclsITSSA); | |
198 | ||
199 | fHistClusterMapITSMI = new TH1F("fHistClusterMapITSMI", "N tracks with point on Layer (MI); Layer; N tracks",6, -0.5, 5.5); | |
200 | fHistClusterMapITSMI->Sumw2(); | |
201 | fHistClusterMapITSMI->SetMinimum(0); | |
202 | fOutput->Add(fHistClusterMapITSMI); | |
203 | ||
204 | fHistClusterMapITSSA = new TH1F("fHistClusterMapITSSA", "N tracks with point on Layer (SA); Layer; N tracks",6, -0.5, 5.5); | |
205 | fHistClusterMapITSSA->Sumw2(); | |
206 | fHistClusterMapITSSA->SetMinimum(0); | |
207 | fOutput->Add(fHistClusterMapITSSA); | |
208 | ||
2308c814 | 209 | fHistClusterMapITSSAInAcc = new TH1F("fHistClusterMapITSSAInAcc", "N tracks with point on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
210 | fHistClusterMapITSSAInAcc->Sumw2(); | |
211 | fHistClusterMapITSSAInAcc->SetMinimum(0); | |
212 | fOutput->Add(fHistClusterMapITSSAInAcc); | |
213 | ||
8d63376d | 214 | fHistClusterMapITSMIok = new TH1F("fHistClusterMapITSMIok", "N tracks with ok on Layer (MI); Layer; N tracks",6, -0.5, 5.5); |
215 | fHistClusterMapITSMIok->Sumw2(); | |
216 | fHistClusterMapITSMIok->SetMinimum(0); | |
217 | fOutput->Add(fHistClusterMapITSMIok); | |
218 | ||
2308c814 | 219 | fHistClusterMapITSSAokInAcc = new TH1F("fHistClusterMapITSSAokInAcc", "N tracks with ok on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
220 | fHistClusterMapITSSAokInAcc->Sumw2(); | |
221 | fHistClusterMapITSSAokInAcc->SetMinimum(0); | |
222 | fOutput->Add(fHistClusterMapITSSAokInAcc); | |
223 | ||
224 | fHistClusterMapModuleITSSAokInAcc = new TH1F("fHistClusterMapModuleITSSAokInAcc", "N tracks with ok on Module (SA); Module; N tracks",2198, -0.5, 2197.5); | |
225 | fHistClusterMapModuleITSSAokInAcc->SetMinimum(0); | |
226 | fOutput->Add(fHistClusterMapModuleITSSAokInAcc); | |
227 | ||
8d63376d | 228 | fHistClusterMapITSSAok = new TH1F("fHistClusterMapITSSAok", "N tracks with ok on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
229 | fHistClusterMapITSSAok->Sumw2(); | |
230 | fHistClusterMapITSSAok->SetMinimum(0); | |
231 | fOutput->Add(fHistClusterMapITSSAok); | |
232 | ||
233 | fHistClusterMapITSMIbad = new TH1F("fHistClusterMapITSMIbad", "N tracks with bad on Layer (MI); Layer; N tracks",6, -0.5, 5.5); | |
234 | fHistClusterMapITSMIbad->Sumw2(); | |
235 | fHistClusterMapITSMIbad->SetMinimum(0); | |
236 | fOutput->Add(fHistClusterMapITSMIbad); | |
237 | ||
2308c814 | 238 | fHistClusterMapITSSAbadInAcc = new TH1F("fHistClusterMapITSSAbadInAcc", "N tracks with bad on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
239 | fHistClusterMapITSSAbadInAcc->Sumw2(); | |
240 | fHistClusterMapITSSAbadInAcc->SetMinimum(0); | |
241 | fOutput->Add(fHistClusterMapITSSAbadInAcc); | |
242 | ||
243 | fHistClusterMapModuleITSSAbadInAcc = new TH1F("fHistClusterMapModuleITSSAbadInAcc", "N tracks with bad on Module (SA); Module; N tracks",2198, -0.5, 2197.5); | |
244 | fHistClusterMapModuleITSSAbadInAcc->SetMinimum(0); | |
245 | fOutput->Add(fHistClusterMapModuleITSSAbadInAcc); | |
246 | ||
8d63376d | 247 | fHistClusterMapITSSAbad = new TH1F("fHistClusterMapITSSAbad", "N tracks with bad on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
248 | fHistClusterMapITSSAbad->Sumw2(); | |
249 | fHistClusterMapITSSAbad->SetMinimum(0); | |
250 | fOutput->Add(fHistClusterMapITSSAbad); | |
251 | ||
252 | fHistClusterMapITSMIskipped = new TH1F("fHistClusterMapITSMIskipped", "N tracks with skip on Layer (MI); Layer; N tracks",6, -0.5, 5.5); | |
253 | fHistClusterMapITSMIskipped->Sumw2(); | |
254 | fHistClusterMapITSMIskipped->SetMinimum(0); | |
255 | fOutput->Add(fHistClusterMapITSMIskipped); | |
256 | ||
2308c814 | 257 | fHistClusterMapITSSAskippedInAcc = new TH1F("fHistClusterMapITSSAskippedInAcc", "N tracks with skip on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
258 | fHistClusterMapITSSAskippedInAcc->Sumw2(); | |
259 | fHistClusterMapITSSAskippedInAcc->SetMinimum(0); | |
260 | fOutput->Add(fHistClusterMapITSSAskippedInAcc); | |
261 | ||
8d63376d | 262 | fHistClusterMapITSSAskipped = new TH1F("fHistClusterMapITSSAskipped", "N tracks with skip on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
263 | fHistClusterMapITSSAskipped->Sumw2(); | |
264 | fHistClusterMapITSSAskipped->SetMinimum(0); | |
265 | fOutput->Add(fHistClusterMapITSSAskipped); | |
266 | ||
267 | fHistClusterMapITSMIoutinz = new TH1F("fHistClusterMapITSMIoutinz", "N tracks out in z on Layer (MI); Layer; N tracks",6, -0.5, 5.5); | |
268 | fHistClusterMapITSMIoutinz->Sumw2(); | |
269 | fHistClusterMapITSMIoutinz->SetMinimum(0); | |
270 | fOutput->Add(fHistClusterMapITSMIoutinz); | |
271 | ||
2308c814 | 272 | fHistClusterMapITSSAoutinzInAcc = new TH1F("fHistClusterMapITSSAoutinzInAcc", "N tracks with out in z on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
273 | fHistClusterMapITSSAoutinzInAcc->Sumw2(); | |
274 | fHistClusterMapITSSAoutinzInAcc->SetMinimum(0); | |
275 | fOutput->Add(fHistClusterMapITSSAoutinzInAcc); | |
276 | ||
8d63376d | 277 | fHistClusterMapITSSAoutinz = new TH1F("fHistClusterMapITSSAoutinz", "N tracks with out in z on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
278 | fHistClusterMapITSSAoutinz->Sumw2(); | |
279 | fHistClusterMapITSSAoutinz->SetMinimum(0); | |
280 | fOutput->Add(fHistClusterMapITSSAoutinz); | |
281 | ||
2308c814 | 282 | fHistClusterMapITSSAokoutinzbad = new TH1F("fHistClusterMapITSSAokoutinzbad", "N tracks with cluster or bad zone or out in z (SA); Layer; N tracks",6, -0.5, 5.5); |
283 | fHistClusterMapITSSAokoutinzbad->Sumw2(); | |
284 | fHistClusterMapITSSAokoutinzbad->SetMinimum(0); | |
285 | fOutput->Add(fHistClusterMapITSSAokoutinzbad); | |
286 | ||
287 | fHistClusterMapITSMIokoutinzbad = new TH1F("fHistClusterMapITSMIokoutinzbad", "N tracks with cluster or bad zone or out in z (MI); Layer; N tracks",6, -0.5, 5.5); | |
288 | fHistClusterMapITSMIokoutinzbad->Sumw2(); | |
289 | fHistClusterMapITSMIokoutinzbad->SetMinimum(0); | |
290 | fOutput->Add(fHistClusterMapITSMIokoutinzbad); | |
291 | ||
292 | fHistClusterMapITSSAokoutinzbadInAcc = new TH1F("fHistClusterMapITSSAokoutinzbadInAcc", "N tracks with cluster or bad zone or out in z (SA); Layer; N tracks",6, -0.5, 5.5); | |
293 | fHistClusterMapITSSAokoutinzbadInAcc->Sumw2(); | |
294 | fHistClusterMapITSSAokoutinzbadInAcc->SetMinimum(0); | |
295 | fOutput->Add(fHistClusterMapITSSAokoutinzbadInAcc); | |
296 | ||
8d63376d | 297 | fHistClusterMapITSMInorefit = new TH1F("fHistClusterMapITSMInorefit", "N tracks with norefit on Layer (MI); Layer; N tracks",6, -0.5, 5.5); |
298 | fHistClusterMapITSMInorefit->Sumw2(); | |
299 | fHistClusterMapITSMInorefit->SetMinimum(0); | |
300 | fOutput->Add(fHistClusterMapITSMInorefit); | |
301 | ||
2308c814 | 302 | fHistClusterMapITSSAnorefitInAcc = new TH1F("fHistClusterMapITSSAnorefitInAcc", "N tracks with norefit on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
303 | fHistClusterMapITSSAnorefitInAcc->Sumw2(); | |
304 | fHistClusterMapITSSAnorefitInAcc->SetMinimum(0); | |
305 | fOutput->Add(fHistClusterMapITSSAnorefitInAcc); | |
306 | ||
8d63376d | 307 | fHistClusterMapITSSAnorefit = new TH1F("fHistClusterMapITSSAnorefit", "N tracks with norefit on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
308 | fHistClusterMapITSSAnorefit->Sumw2(); | |
309 | fHistClusterMapITSSAnorefit->SetMinimum(0); | |
310 | fOutput->Add(fHistClusterMapITSSAnorefit); | |
311 | ||
312 | fHistClusterMapITSMInocls = new TH1F("fHistClusterMapITSMInocls", "N tracks with nocls on Layer (MI); Layer; N tracks",6, -0.5, 5.5); | |
313 | fHistClusterMapITSMInocls->Sumw2(); | |
314 | fHistClusterMapITSMInocls->SetMinimum(0); | |
315 | fOutput->Add(fHistClusterMapITSMInocls); | |
316 | ||
2308c814 | 317 | fHistClusterMapITSSAnoclsInAcc = new TH1F("fHistClusterMapITSSAnoclsInAcc", "N tracks with nocls on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
318 | fHistClusterMapITSSAnoclsInAcc->Sumw2(); | |
319 | fHistClusterMapITSSAnoclsInAcc->SetMinimum(0); | |
320 | fOutput->Add(fHistClusterMapITSSAnoclsInAcc); | |
321 | ||
322 | fHistClusterMapModuleITSSAnoclsInAcc = new TH1F("fHistClusterMapModuleITSSAnoclsInAcc", "N tracks with nocls on Module (SA); Module; N tracks",2198, -0.5, 2197.5); | |
323 | fHistClusterMapModuleITSSAnoclsInAcc->SetMinimum(0); | |
324 | fOutput->Add(fHistClusterMapModuleITSSAnoclsInAcc); | |
325 | ||
8d63376d | 326 | fHistClusterMapITSSAnocls = new TH1F("fHistClusterMapITSSAnocls", "N tracks with nocls on Layer (SA); Layer; N tracks",6, -0.5, 5.5); |
327 | fHistClusterMapITSSAnocls->Sumw2(); | |
328 | fHistClusterMapITSSAnocls->SetMinimum(0); | |
329 | fOutput->Add(fHistClusterMapITSSAnocls); | |
330 | ||
331 | fHistPhiTPC = new TH1F("fHistPhiTPC","Azimuthal distribution of TPC tracks; #phi; N tracks",100, -3.1415, 3.1415); | |
332 | fHistPhiTPC->Sumw2(); | |
333 | fHistPhiTPC->SetMinimum(0); | |
334 | fOutput->Add(fHistPhiTPC); | |
335 | ||
336 | fHistPtTPC = new TH1F("fHistPtTPC","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
337 | fHistPtTPC->Sumw2(); | |
338 | fHistPtTPC->SetMinimum(0); | |
339 | fOutput->Add(fHistPtTPC); | |
340 | ||
341 | fHistPtITSMI6 = new TH1F("fHistPtITSMI6","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
342 | fHistPtITSMI6->Sumw2(); | |
343 | fHistPtITSMI6->SetMinimum(0); | |
344 | fOutput->Add(fHistPtITSMI6); | |
345 | ||
346 | fHistPtITSMI5 = new TH1F("fHistPtITSMI5","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
347 | fHistPtITSMI5->Sumw2(); | |
348 | fHistPtITSMI5->SetMinimum(0); | |
349 | fOutput->Add(fHistPtITSMI5); | |
350 | ||
351 | fHistPtITSMI4 = new TH1F("fHistPtITSMI4","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
352 | fHistPtITSMI4->Sumw2(); | |
353 | fHistPtITSMI4->SetMinimum(0); | |
354 | fOutput->Add(fHistPtITSMI4); | |
355 | ||
356 | fHistPtITSMI3 = new TH1F("fHistPtITSMI3","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
357 | fHistPtITSMI3->Sumw2(); | |
358 | fHistPtITSMI3->SetMinimum(0); | |
359 | fOutput->Add(fHistPtITSMI3); | |
360 | ||
361 | fHistPtITSMI2 = new TH1F("fHistPtITSMI2","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
362 | fHistPtITSMI2->Sumw2(); | |
363 | fHistPtITSMI2->SetMinimum(0); | |
364 | fOutput->Add(fHistPtITSMI2); | |
365 | ||
366 | fHistPtITSMISPD = new TH1F("fHistPtITSMISPD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",80, 0, 40); | |
367 | fHistPtITSMISPD->Sumw2(); | |
368 | fHistPtITSMISPD->SetMinimum(0); | |
369 | fOutput->Add(fHistPtITSMISPD); | |
370 | ||
371 | ||
372 | ||
373 | // ntuples | |
374 | // | |
375 | fNtupleESDTracks = new TNtuple("fNtupleESDTracks","tracks","pt:eta:phi:d0:z0:sigmad0:sigmaz0:ptMC:pdgMC:d0MC:d0MCv:z0MCv:sigmad0MCv:sigmaz0MCv:ITSflag"); | |
376 | fOutput->Add(fNtupleESDTracks); | |
377 | ||
378 | fNtupleITSAlignExtra = new TNtuple("fNtupleITSAlignExtra","ITS alignment checks: extra clusters","layer:x:y:z:dxy:dz:xloc:zloc:npoints"); | |
379 | fOutput->Add(fNtupleITSAlignExtra); | |
380 | ||
381 | fNtupleITSAlignSPDTracklets = new TNtuple("fNtupleITSAlignSPDTracklets","ITS alignment checks: SPD tracklets wrt SPD vertex","phi:theta:z:dxy:dz"); | |
382 | fOutput->Add(fNtupleITSAlignSPDTracklets); | |
383 | ||
384 | return; | |
385 | } | |
386 | ||
387 | //________________________________________________________________________ | |
388 | void AliAnalysisTaskITSTrackingCheck::Exec(Option_t *) | |
389 | { | |
390 | // Main loop | |
391 | // Called for each event | |
392 | ||
393 | if (!fESD) { | |
394 | Printf("ERROR: fESD not available"); | |
395 | return; | |
396 | } | |
2308c814 | 397 | //if(fESD->GetEventType()!=7) return; |
8d63376d | 398 | |
399 | const AliESDVertex *vertexESD = fESD->GetPrimaryVertexTracks(); | |
8d63376d | 400 | |
401 | // *********** MC info *************** | |
402 | TArrayF mcVertex(3); | |
403 | mcVertex[0]=9999.; mcVertex[1]=9999.; mcVertex[2]=9999.; | |
404 | Float_t dNchdy=-999.; | |
405 | ||
406 | TParticle *part=0; | |
407 | AliESDVertex *vertexMC=0; | |
408 | AliStack *stack=0; | |
409 | if (fReadMC) { | |
410 | AliMCEventHandler *eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); | |
411 | if (!eventHandler) { | |
412 | Printf("ERROR: Could not retrieve MC event handler"); | |
413 | return; | |
414 | } | |
415 | ||
416 | AliMCEvent* mcEvent = eventHandler->MCEvent(); | |
417 | if (!mcEvent) { | |
418 | Printf("ERROR: Could not retrieve MC event"); | |
419 | return; | |
420 | } | |
421 | ||
422 | stack = mcEvent->Stack(); | |
423 | if (!stack) { | |
424 | AliDebug(AliLog::kError, "Stack not available"); | |
425 | return; | |
426 | } | |
427 | ||
428 | AliHeader* header = mcEvent->Header(); | |
429 | if (!header) { | |
430 | AliDebug(AliLog::kError, "Header not available"); | |
431 | return; | |
432 | } | |
433 | AliGenEventHeader* genHeader = header->GenEventHeader(); | |
434 | genHeader->PrimaryVertex(mcVertex); | |
435 | ||
436 | ||
437 | Int_t ngenpart = (Int_t)stack->GetNtrack(); | |
438 | //printf("# generated particles = %d\n",ngenpart); | |
439 | dNchdy=0; | |
440 | for(Int_t ip=0; ip<ngenpart; ip++) { | |
441 | part = (TParticle*)stack->Particle(ip); | |
442 | // keep only electrons, muons, pions, kaons and protons | |
443 | Int_t apdg = TMath::Abs(part->GetPdgCode()); | |
444 | if(apdg!=11 && apdg!=13 && apdg!=211 && apdg!=321 && apdg!=2212) continue; | |
445 | // reject secondaries | |
446 | if(TMath::Sqrt((part->Vx()-mcVertex[0])*(part->Vx()-mcVertex[0])+(part->Vy()-mcVertex[1])*(part->Vy()-mcVertex[1]))>0.0010) continue; | |
447 | // reject incoming protons | |
448 | Double_t energy = part->Energy(); | |
449 | if(energy>900.) continue; | |
450 | Double_t pz = part->Pz(); | |
451 | Double_t y = 0.5*TMath::Log((energy+pz+1.e-13)/(energy-pz+1.e-13)); | |
452 | if(TMath::Abs(y)<1.0) dNchdy += 0.5; // count 1/2 of particles in |y|<1 | |
453 | } | |
454 | //printf("# primary particles = %7.1f\n",dNchdy); | |
455 | } | |
456 | // *********** MC info *************** | |
457 | Double_t mcVtxPos[3]={mcVertex[0],mcVertex[1],mcVertex[2]},mcVtxSigma[3]={0,0,0}; | |
458 | vertexMC = new AliESDVertex(mcVtxPos,mcVtxSigma); | |
459 | ||
460 | // *********** ESD friends *********** | |
461 | fESD->SetESDfriend(fESDfriend); //Attach the friend to the ESD | |
462 | // *********** ESD friends *********** | |
8d63376d | 463 | if(!fESDfriend) printf("no ESD friend\n"); |
464 | ||
465 | // | |
2308c814 | 466 | |
467 | /* | |
8d63376d | 468 | // ********** Trigger ***************** |
469 | ULong64_t triggerMask; | |
470 | ULong64_t spdFO = (1 << 14); | |
471 | ULong64_t v0left = (1 << 11); | |
472 | ULong64_t v0right = (1 << 12); | |
473 | ||
474 | triggerMask=fESD->GetTriggerMask(); | |
475 | // MB1: SPDFO || V0L || V0R | |
476 | Bool_t eventTriggered = (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right))); | |
477 | //MB2: GFO && V0R | |
478 | //triggerMask & spdFO && ((triggerMask&v0left) || (triggerMask&v0right)) | |
479 | // ************ Trigger ****************** | |
480 | if(!eventTriggered) return; | |
2308c814 | 481 | */ |
8d63376d | 482 | |
483 | // SPD vertex | |
484 | const AliESDVertex *spdv=fESD->GetPrimaryVertexSPD(); | |
485 | ||
486 | ||
487 | Int_t ntracks = fESD->GetNumberOfTracks(); | |
488 | //printf("Tracks # = %d\n",fESD->GetNumberOfTracks()); | |
489 | ||
490 | fHistNtracks->Fill(ntracks); | |
491 | // Post the data already here | |
492 | PostData(0, fOutput); | |
493 | ||
494 | Int_t idet,status; Float_t xloc,zloc; | |
495 | ||
496 | // loop on tracks | |
497 | for(Int_t itr=0; itr<ntracks; itr++) { | |
498 | AliESDtrack *track = fESD->GetTrack(itr); | |
499 | ||
2308c814 | 500 | // remove kink daughters |
8d63376d | 501 | if(track->GetKinkIndex(0)>0) continue; |
502 | ||
8d63376d | 503 | |
8d63376d | 504 | Bool_t itsrefit=kFALSE,tpcin=kFALSE,itsfindableAcc=kFALSE; |
505 | if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE; | |
506 | if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcin=kTRUE; | |
507 | ||
8d63376d | 508 | |
2308c814 | 509 | //if(TMath::Abs(track->GetD(0,0,0))>1) continue; |
510 | ||
511 | Int_t trkLabel = TMath::Abs(track->GetLabel()); | |
512 | Int_t nclsITS = track->GetNcls(0); | |
513 | ||
514 | Bool_t outInZ=kFALSE; | |
8d63376d | 515 | |
516 | for(Int_t layer=0; layer<6; layer++) { | |
8d63376d | 517 | track->GetITSModuleIndexInfo(layer,idet,status,xloc,zloc); |
2308c814 | 518 | if(layer>=2) idet+=240; // add n SPD modules |
519 | if(layer>=4) idet+=260; // add n SPD modules | |
520 | if(status==4) outInZ=kTRUE; | |
8d63376d | 521 | if(tpcin) { |
522 | if(status==1) fHistClusterMapITSMIok->Fill(layer); | |
523 | if(status==2) fHistClusterMapITSMIbad->Fill(layer); | |
524 | if(status==3) fHistClusterMapITSMIskipped->Fill(layer); | |
525 | if(status==4) fHistClusterMapITSMIoutinz->Fill(layer); | |
526 | if(status==5) fHistClusterMapITSMInocls->Fill(layer); | |
527 | if(status==6) fHistClusterMapITSMInorefit->Fill(layer); | |
2308c814 | 528 | if(status==1 || status==2 || status==4) fHistClusterMapITSMIokoutinzbad->Fill(layer); |
8d63376d | 529 | } else { |
530 | if(status==1) fHistClusterMapITSSAok->Fill(layer); | |
531 | if(status==2) fHistClusterMapITSSAbad->Fill(layer); | |
532 | if(status==3) fHistClusterMapITSSAskipped->Fill(layer); | |
533 | if(status==4) fHistClusterMapITSSAoutinz->Fill(layer); | |
534 | if(status==5) fHistClusterMapITSSAnocls->Fill(layer); | |
535 | if(status==6) fHistClusterMapITSSAnorefit->Fill(layer); | |
2308c814 | 536 | if(status==1 || status==2 || status==4) fHistClusterMapITSSAokoutinzbad->Fill(layer); |
537 | if(status==1 && !outInZ) {fHistClusterMapITSSAokInAcc->Fill(layer);fHistClusterMapModuleITSSAokInAcc->Fill(idet);} | |
538 | if(status==2 && !outInZ) {fHistClusterMapITSSAbadInAcc->Fill(layer);fHistClusterMapModuleITSSAbadInAcc->Fill(idet);} | |
539 | if(status==3 && !outInZ) fHistClusterMapITSSAskippedInAcc->Fill(layer); | |
540 | if(status==4 && !outInZ) fHistClusterMapITSSAoutinzInAcc->Fill(layer); | |
541 | if(status==5 && !outInZ) {fHistClusterMapITSSAnoclsInAcc->Fill(layer);fHistClusterMapModuleITSSAnoclsInAcc->Fill(idet);} | |
542 | if(status==6 && !outInZ) fHistClusterMapITSSAnorefitInAcc->Fill(layer); | |
543 | if((status==1 || status==2 || status==4) && !outInZ) fHistClusterMapITSSAokoutinzbadInAcc->Fill(layer); | |
544 | } | |
545 | if(TESTBIT(track->GetITSClusterMap(),layer)) { | |
546 | if(tpcin) { | |
547 | fHistClusterMapITSMI->Fill(layer); | |
548 | } else { | |
549 | fHistClusterMapITSSA->Fill(layer); | |
550 | if(!outInZ) fHistClusterMapITSSAInAcc->Fill(layer); | |
551 | } | |
8d63376d | 552 | } |
553 | } | |
554 | ||
2308c814 | 555 | // TPC track in ITS acceptance |
556 | if(tpcin && TMath::Abs(track->Eta())<0.9 && track->GetNcls(1)>50) { | |
557 | itsfindableAcc=kTRUE; | |
558 | fHistPtTPC->Fill(track->Pt()); | |
559 | fHistPhiTPC->Fill(track->Phi()); | |
560 | } | |
561 | ||
8d63376d | 562 | if(itsfindableAcc) { |
563 | if(nclsITS==6) fHistPtITSMI6->Fill(track->Pt()); | |
564 | if(nclsITS==5) fHistPtITSMI5->Fill(track->Pt()); | |
565 | if(nclsITS==4) fHistPtITSMI4->Fill(track->Pt()); | |
566 | if(nclsITS==3) fHistPtITSMI3->Fill(track->Pt()); | |
567 | if(nclsITS==2) fHistPtITSMI2->Fill(track->Pt()); | |
568 | if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)) | |
569 | fHistPtITSMISPD->Fill(track->Pt()); | |
570 | } | |
571 | ||
572 | ||
2308c814 | 573 | if(tpcin) { |
574 | fHistNclsITSMI->Fill(nclsITS); | |
575 | } else { | |
576 | fHistNclsITSSA->Fill(nclsITS); | |
577 | if(!outInZ) fHistNclsITSSAInAcc->Fill(nclsITS); | |
578 | } | |
579 | ||
580 | ||
8d63376d | 581 | Int_t iITSflag=0; //ITSflag takes the value 0 if the track has no cluster assigned in the SPDs, 1 (2) if one cluster is assigned in SPD1(2), 3 if two clusters are present. Then the same adding 10,20 or 30 for SDD and 100,200 or 300 for SSD |
582 | ||
583 | if(track->HasPointOnITSLayer(0)) iITSflag+=1; | |
584 | if(track->HasPointOnITSLayer(1)) iITSflag+=2; | |
585 | if(track->HasPointOnITSLayer(2)) iITSflag+=10; | |
586 | if(track->HasPointOnITSLayer(3)) iITSflag+=20; | |
587 | if(track->HasPointOnITSLayer(4)) iITSflag+=100; | |
588 | if(track->HasPointOnITSLayer(5)) iITSflag+=200; | |
589 | ||
590 | if(iITSflag==333 && track->GetNcls(0)<6) | |
591 | printf(" ERROR %d %d\n",track->GetNcls(0),track->GetLabel()); | |
592 | ||
593 | // number of associated ITS clusters | |
594 | iITSflag += 1000*track->GetNcls(0); | |
595 | ||
ab846928 | 596 | // number of associated TPC clusters |
597 | iITSflag += 100000*track->GetNcls(1); | |
598 | ||
8d63376d | 599 | // if MC info and is available |
600 | // write the number of ITS clusters produced by this track | |
601 | Int_t nITSclsMC=0; | |
602 | if(fReadMC && fReadRPLabels) { | |
603 | nITSclsMC = NumberOfITSClustersMC(trkLabel); | |
604 | if(nITSclsMC>=0) iITSflag += 10000*nITSclsMC; | |
605 | } | |
606 | ||
2308c814 | 607 | if(!vertexESD) return; |
608 | if(!(vertexESD->GetStatus())) return; | |
609 | ||
8d63376d | 610 | // impact parameter to VertexTracks |
611 | Double_t d0z0[2],covd0z0[3]; | |
612 | track->PropagateToDCA(vertexESD,fESD->GetMagneticField(),100.,d0z0,covd0z0); | |
613 | if(covd0z0[0]<0. || covd0z0[2]<0.) continue; | |
614 | ||
615 | // if MC info is available: get particle properties | |
616 | Float_t ptMC=-999.,pdgMC=-999.,d0MC=-999.; | |
617 | Double_t d0z0MCv[2]={-999.,-999.},covd0z0MCv[3]={1.,1.,1.}; | |
618 | if(fReadMC) { | |
619 | part = (TParticle*)stack->Particle(trkLabel); | |
620 | ptMC=part->Pt(); | |
621 | pdgMC=part->GetPdgCode(); | |
622 | d0MC=ParticleImpParMC(part,vertexMC,0.1*fESD->GetMagneticField()); | |
623 | track->PropagateToDCA(vertexMC,fESD->GetMagneticField(),100.,d0z0MCv,covd0z0MCv); | |
624 | if(covd0z0MCv[0]<0. || covd0z0MCv[2]<0.) continue; | |
ab846928 | 625 | // flag fake tracks |
626 | if(track->GetLabel()<0) iITSflag *= -1; | |
8d63376d | 627 | } |
628 | ||
ab846928 | 629 | Double_t sigmad0MCv=TMath::Sqrt(covd0z0MCv[0]); |
630 | if(!itsrefit) sigmad0MCv *= -1.; | |
631 | ||
8d63376d | 632 | // fill ntuple with track properties |
2308c814 | 633 | if(fFillNtuples && SelectPt(track->Pt())) { |
ab846928 | 634 | Float_t fillArray[19]={track->Pt(),track->Eta(),track->Phi(),d0z0[0],d0z0[1],TMath::Sqrt(covd0z0[0]),TMath::Sqrt(covd0z0[2]),ptMC,pdgMC,d0MC,d0z0MCv[0],d0z0MCv[1],sigmad0MCv,TMath::Sqrt(covd0z0MCv[2]),(Float_t)iITSflag}; |
8d63376d | 635 | fNtupleESDTracks->Fill(fillArray); |
636 | } | |
637 | ||
638 | //--------------------------------------------- | |
639 | // AliTrackPoints: alignment checks | |
640 | // | |
2308c814 | 641 | if(!fFillNtuples) continue; |
ab846928 | 642 | if(!fESDfriend) continue; |
643 | ||
644 | ||
8d63376d | 645 | const AliTrackPointArray *array = track->GetTrackPointArray(); |
2308c814 | 646 | if(!array) continue; |
8d63376d | 647 | AliTrackPoint point; |
648 | Int_t pointOnLayer[6]={0,0,0,0,0,0}; | |
649 | Int_t indexAssociated[6]={-1,-1,-1,-1,-1,-1},indexExtra=-1; | |
650 | Bool_t extra=kFALSE; | |
651 | Int_t layerId,layerExtra=-1; | |
652 | for(Int_t ipt=0; ipt<array->GetNPoints(); ipt++) { | |
653 | array->GetPoint(point,ipt); | |
654 | Float_t r = TMath::Sqrt(point.GetX()*point.GetX()+point.GetY()*point.GetY()); | |
655 | ||
656 | if(r>3 && r<6) { | |
657 | layerId = 0; | |
658 | } else if(r>6 && r<8) { | |
659 | layerId = 1; | |
660 | } else if(r>8 && r<18) { | |
661 | layerId = 2; | |
662 | } else if(r>18 && r<25) { | |
663 | layerId = 3; | |
664 | } else if(r>25 && r<38) { | |
665 | layerId = 4; | |
666 | } else if(r>38 && r<50) { | |
667 | layerId = 5; | |
668 | } else { | |
669 | layerId=100; | |
670 | } | |
671 | ||
672 | // only ITS points | |
673 | if(layerId>5) continue; | |
674 | ||
675 | if(!point.IsExtra()) { | |
676 | pointOnLayer[layerId]++; | |
677 | indexAssociated[layerId]=ipt; | |
678 | } else { | |
679 | // this is an extra cluster | |
680 | extra=kTRUE; | |
681 | layerExtra=layerId; | |
682 | indexExtra=ipt; | |
683 | } | |
684 | } // end loop on AliTrackPoints | |
685 | ||
686 | TString vtitle = spdv->GetTitle(); | |
687 | if(!vtitle.Contains("3D")) continue; | |
688 | ||
689 | // SPD tracklet | |
690 | if(indexAssociated[0]>=0 && indexAssociated[1]>=0) { | |
691 | AliTrackPoint pointSPD1,pointSPD2; | |
692 | array->GetPoint(pointSPD1,indexAssociated[0]); | |
693 | array->GetPoint(pointSPD2,indexAssociated[1]); | |
694 | Float_t phi=TMath::ATan2(pointSPD2.GetY()-pointSPD1.GetY(),pointSPD2.GetX()-pointSPD1.GetX()); | |
695 | Float_t lambda=TMath::ATan((pointSPD2.GetZ()-pointSPD1.GetZ())/TMath::Sqrt((pointSPD2.GetX()-pointSPD1.GetX())*(pointSPD2.GetX()-pointSPD1.GetX())+(pointSPD2.GetY()-pointSPD1.GetY())*(pointSPD2.GetY()-pointSPD1.GetY()))); | |
696 | Float_t theta=0.5*TMath::Pi()-lambda; | |
697 | TParticle particle(211,0,0,0,0,0,TMath::Cos(phi),TMath::Sin(phi),TMath::Tan(lambda),10.,pointSPD1.GetX(),pointSPD1.GetY(),pointSPD1.GetZ(),0); | |
698 | AliESDtrack tracklet(&particle); | |
699 | Float_t dz[2]; | |
700 | // distance to primary SPD (only if 3D and high multiplicity) | |
701 | if(spdv->GetNContributors()>10) { | |
2308c814 | 702 | //tracklet.GetDZ(spdv->GetXv(),spdv->GetYv(),spdv->GetZv(),0,dz); |
703 | tracklet.GetDZ(-0.07,0.25,spdv->GetZv(),0,dz); | |
8d63376d | 704 | fNtupleITSAlignSPDTracklets->Fill(phi,theta,0.5*(pointSPD1.GetZ()+pointSPD2.GetZ()),dz[0],dz[1]); |
705 | } | |
706 | } | |
707 | ||
708 | // distance to extra | |
709 | if(extra && spdv->GetNContributors()>4) { | |
710 | AliTrackPoint pointExtra,pointAssociated; | |
711 | array->GetPoint(pointAssociated,indexAssociated[layerExtra]); | |
712 | array->GetPoint(pointExtra,indexExtra); | |
713 | Float_t phiExtra = TMath::ATan2(pointExtra.GetY()-spdv->GetYv(),pointExtra.GetX()-spdv->GetXv()); | |
714 | Float_t phiAssociated = TMath::ATan2(pointAssociated.GetY()-spdv->GetYv(),pointAssociated.GetX()-spdv->GetXv()); | |
715 | Float_t rExtra = TMath::Sqrt((pointExtra.GetX()-spdv->GetXv())*(pointExtra.GetX()-spdv->GetXv())+(pointExtra.GetY()-spdv->GetYv())*(pointExtra.GetY()-spdv->GetYv())); | |
716 | Float_t rAssociated = TMath::Sqrt((pointAssociated.GetX()-spdv->GetXv())*(pointAssociated.GetX()-spdv->GetXv())+(pointAssociated.GetY()-spdv->GetYv())*(pointAssociated.GetY()-spdv->GetYv())); | |
717 | Float_t dzExtra[2]; | |
718 | dzExtra[0] = (phiExtra-phiAssociated)*0.5*(rExtra+rAssociated); | |
719 | dzExtra[1] = pointExtra.GetZ()-pointAssociated.GetZ()-(rExtra-rAssociated)*(pointAssociated.GetZ()-spdv->GetZv())/rAssociated; | |
720 | Float_t xlocExtra=-100.,zlocExtra=-100.; | |
721 | fNtupleITSAlignExtra->Fill(layerExtra,pointExtra.GetX(),pointExtra.GetY(),pointExtra.GetZ(),xlocExtra,zlocExtra,dzExtra[0],dzExtra[1],nclsITS); | |
722 | } | |
723 | ||
724 | ||
725 | } // end loop on tracks | |
726 | ||
727 | if(vertexMC) { delete vertexMC; vertexMC=0; } | |
728 | ||
729 | return; | |
730 | } | |
731 | ||
732 | //________________________________________________________________________ | |
733 | void AliAnalysisTaskITSTrackingCheck::Terminate(Option_t *) | |
734 | { | |
735 | // Draw result to the screen | |
736 | // Called once at the end of the query | |
737 | fOutput = dynamic_cast<TList*> (GetOutputData(0)); | |
738 | if (!fOutput) { | |
739 | Printf("ERROR: fOutput not available"); | |
740 | return; | |
741 | } | |
742 | ||
743 | fHistNtracks = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNtracks")); | |
744 | fHistNclsITSMI = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNclsITSMI")); | |
745 | fHistNclsITSSA = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNclsITSSA")); | |
746 | fHistClusterMapITSMI = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSMI")); | |
747 | fHistClusterMapITSMIbad = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSMIbad")); | |
748 | fHistClusterMapITSMIskipped = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSMIskipped")); | |
749 | fHistClusterMapITSMIoutinz = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSMIoutinz")); | |
750 | fHistClusterMapITSMInorefit = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSMInorefit")); | |
751 | fHistClusterMapITSMInocls = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSMInocls")); | |
752 | fHistClusterMapITSSA = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSSA")); | |
753 | fHistClusterMapITSSAbad = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSSAbad")); | |
754 | fHistClusterMapITSSAskipped = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSSAskipped")); | |
755 | fHistClusterMapITSSAoutinz = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSSAoutinz")); | |
756 | fHistClusterMapITSSAnorefit = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSSAnorefit")); | |
757 | fHistClusterMapITSSAnocls = dynamic_cast<TH1F*>(fOutput->FindObject("fHistClusterMapITSSAnocls")); | |
758 | fNtupleESDTracks = dynamic_cast<TNtuple*>(fOutput->FindObject("fNtupleESDTracks")); | |
759 | fNtupleITSAlignExtra = dynamic_cast<TNtuple*>(fOutput->FindObject("fNtupleITSAlignExtra")); | |
760 | fNtupleITSAlignSPDTracklets = dynamic_cast<TNtuple*>(fOutput->FindObject("fNtupleITSAlignSPDTracklets")); | |
761 | ||
762 | return; | |
763 | } | |
764 | //--------------------------------------------------------------------------- | |
765 | Int_t AliAnalysisTaskITSTrackingCheck::NumberOfITSClustersMC(Int_t label) const | |
766 | { | |
767 | // | |
768 | // Return number of ITS clusters produced by MC particle with given label | |
769 | // | |
2308c814 | 770 | |
8d63376d | 771 | AliESDInputHandlerRP *esdHRP = dynamic_cast<AliESDInputHandlerRP*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); |
772 | if(!esdHRP) return -1; | |
773 | TTree *cTree = (TTree*)esdHRP->GetTreeR("ITS"); | |
774 | if(!cTree) return -1; | |
775 | TClonesArray *clusters=0; // new TClonesArray("AliITSRecPoint",10000); | |
776 | cTree->SetBranchAddress("ITSRecPoints",&clusters); | |
777 | if(!clusters) return -1; | |
778 | ||
779 | AliITSRecPoint *c=0; | |
780 | Int_t i,n,icl,lay,ilab; | |
781 | Int_t ncls[6]={0,0,0,0,0,0}; | |
782 | Int_t nclstot=0; | |
783 | ||
784 | for(i=0; i<2198; i++) { | |
785 | cTree->GetEvent(i); | |
786 | n=clusters->GetEntriesFast(); | |
787 | for (icl=0; icl<n; icl++) { | |
788 | c=(AliITSRecPoint*)clusters->UncheckedAt(icl); | |
789 | lay=c->GetLayer(); | |
790 | for(ilab=0;ilab<3;ilab++) { | |
791 | if(c->GetLabel(ilab)==label) ncls[lay]++; | |
792 | } | |
793 | } | |
794 | } | |
795 | for(i=0;i<6;i++) { if(ncls[i]) nclstot++; } | |
796 | ||
797 | return nclstot; | |
2308c814 | 798 | //return label*0; |
8d63376d | 799 | } |
800 | //--------------------------------------------------------------------------- | |
801 | Double_t AliAnalysisTaskITSTrackingCheck::ParticleImpParMC(TParticle *part, | |
802 | AliESDVertex *vert, | |
803 | Double_t bzT) const | |
804 | { | |
805 | // | |
806 | // Return the MC value of the impact parameter | |
807 | // | |
808 | ||
809 | Double_t vx=part->Vx()-vert->GetX(); | |
810 | Double_t vy=part->Vy()-vert->GetY(); | |
811 | ||
812 | Double_t pt=part->Pt(); | |
813 | Double_t px=part->Px(); | |
814 | Double_t py=part->Py(); | |
815 | Double_t charge = (part->GetPdgCode()>0. ? 1. : -1.); | |
816 | if(TMath::Abs(part->GetPdgCode())<100) charge*=-1.; | |
817 | ||
818 | if(px<0.000001) px=0.000001; | |
819 | Double_t rAnd=((10./2.99792458)*pt/bzT)*100.; | |
820 | Double_t center[3],d0; | |
821 | center[0]=vx-(1./charge)*rAnd*(py/pt); | |
822 | center[1]=vy+(1./charge)*rAnd*(px/pt); | |
823 | center[2]=TMath::Sqrt(center[0]*center[0]+center[1]*center[1]); | |
824 | d0 = -center[2]+rAnd; | |
825 | ||
826 | return d0; | |
827 | } | |
828 | //--------------------------------------------------------------------------- | |
829 | Bool_t AliAnalysisTaskITSTrackingCheck::SelectPt(Double_t pt) | |
830 | { | |
831 | // | |
832 | // Keep only tracks in given pt bins | |
833 | // | |
ab846928 | 834 | Double_t ptlower[10]={0.29,0.49,0.75,0.9,1.9,3.5,6.5, 9.,19.,27.}; |
8d63376d | 835 | Double_t ptupper[10]={0.31,0.51,0.85,1.1,2.1,4.5,7.5,11.,21.,33.}; |
836 | ||
837 | for(Int_t i=0; i<10; i++) { | |
ab846928 | 838 | if(pt>ptlower[i] && pt<ptupper[i]) { |
8d63376d | 839 | fCountsPerPtBin[i]++; |
840 | return kTRUE; | |
841 | } | |
842 | } | |
843 | return kFALSE; | |
2308c814 | 844 | //return kTRUE; |
8d63376d | 845 | } |
846 | ||
847 | ||
848 | ||
849 |