changes for Vertex and Tracks classes
[u/mrichter/AliRoot.git] / PWGPP / ITS / AliAnalysisTaskITSTrackingCheck.cxx
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 <TStyle.h>
25 #include <TChain.h>
26 #include <TTree.h>
27 #include <TNtuple.h>
28 #include <TBranch.h>
29 #include <TClonesArray.h>
30 #include <TObjArray.h>
31 #include <TH1F.h>
32 #include <TH2F.h>  
33 #include <TCanvas.h>
34 #include <TParticle.h>
35
36 #include "AliAnalysisTask.h"
37 #include "AliAnalysisManager.h"
38
39 #include "AliMultiplicity.h"
40 #include "AliTriggerConfiguration.h"
41 #include "AliCDBManager.h"
42 #include "AliCDBEntry.h"
43 #include "AliVertexerTracks.h"
44 #include "AliESDtrack.h"
45 #include "AliExternalTrackParam.h"
46 #include "AliESDVertex.h"
47 #include "AliESDEvent.h"
48 #include "AliESDfriend.h"
49 #include "AliESDInputHandler.h"
50 #include "AliESDInputHandlerRP.h"
51 #include "AliESDtrackCuts.h"
52 #include "AliTrackPointArray.h"
53 #include "../ITS/AliITSRecPoint.h"
54
55 #include "AliInputEventHandler.h"
56 #include "AliMCEventHandler.h"
57 #include "AliMCEvent.h"
58 #include "AliStack.h"
59 #include "AliLog.h"
60
61 #include "AliGenEventHeader.h" 
62 #include "AliAnalysisTaskITSTrackingCheck.h"
63
64
65 ClassImp(AliAnalysisTaskITSTrackingCheck)
66 AliAnalysisTaskITSTrackingCheck::AliAnalysisTaskITSTrackingCheck() : 
67 AliAnalysisTaskSE(), 
68 fNITSLayers(6),
69 fReadMC(kFALSE),
70 fReadRPLabels(kFALSE),
71 fFillNtuples(kFALSE),
72 fUseITSSAforNtuples(kFALSE),
73 fUsePhysSel(kFALSE),
74 fRequireSPDvtx(kTRUE),
75 fRejPileupSPD(kFALSE),
76 fCheckSDDIsIn(0),
77 fESD(0), 
78 fMinMult(0),
79 fMaxMult(1000000),
80 fTriggerClass(""),
81 fTrigConfig(0),
82 fUsePtBinsForBox(kFALSE),
83 fOCDBPath(""),
84 fOutput(0), 
85 fHistNEvents(0),
86 fHistNEventsFrac(0),
87 fHistNtracks(0),
88 fHistNclsITSMI(0),
89 fHistNclsITSSA(0),
90 fHistNclsITSSAInAcc(0),
91 fHistClusterMapITSMI(0),
92 fHistClusterMapITSMIok(0),
93 fHistClusterMapITSMIbad(0),
94 fHistClusterMapITSMIskipped(0),
95 fHistClusterMapITSMIoutinz(0),
96 fHistClusterMapITSMInorefit(0),
97 fHistClusterMapITSMInocls(0),
98 fHistClusterMapITSMIokoutinzbad(0),
99 fHistClusterMapITSSA(0),
100 fHistClusterMapITSSAok(0),
101 fHistClusterMapITSSAbad(0),
102 fHistClusterMapITSSAskipped(0),
103 fHistClusterMapITSSAoutinz(0),
104 fHistClusterMapITSSAnorefit(0),
105 fHistClusterMapITSSAnocls(0),
106 fHistClusterMapITSSAokoutinzbad(0),
107 fHistClusterMapITSSAInAcc(0),
108 fHistClusterMapITSSAokInAcc(0),
109 fHistClusterMapITSSAbadInAcc(0),
110 fHistClusterMapITSSAskippedInAcc(0),
111 fHistClusterMapITSSAoutinzInAcc(0),
112 fHistClusterMapITSSAnorefitInAcc(0),
113 fHistClusterMapITSSAnoclsInAcc(0),
114 fHistClusterMapITSSAokoutinzbadInAcc(0),
115 fHistClusterMapModuleITSSAokInAcc(0),
116 fHistClusterMapModuleITSSAbadInAcc(0),
117 fHistClusterMapModuleITSSAnoclsInAcc(0),
118 fHistClusterMapModuleITSMIokInAcc(0),
119 fHistClusterMapModuleITSMIbadInAcc(0),
120 fHistClusterMapModuleITSMInoclsInAcc(0),
121 fHistNClustersMapModule(0),
122 fHistZatSPDouter0ok(0),
123 fHistZatSPDouter1ok(0),
124 fHistZatSPDouter2ok(0),
125 fHistZatSPDouter3ok(0),
126 fHistZatSPDouter0notok(0),
127 fHistZatSPDouter1notok(0),
128 fHistZatSPDouter2notok(0),
129 fHistZatSPDouter3notok(0),
130 fHistxlocSDDok(0),
131 fHistzlocSDDok(0),
132 fHistxlocVSmodSDDok(0),
133 fHistxlocSDDall(0),
134 fHistzlocSDDall(0),
135 fHistPhiTPCInAcc(0),
136 fHistEtaTPCInAcc(0),
137 fHistPtTPC(0),
138 fHistPtTPCInAcc(0),
139 fHistPtTPCInAccTOFbc0(0),
140 fHistPtTPCInAccwSDD(0),
141 fHistPtTPCInAccTOFbc0wSDD(0),
142 fHistPtTPCInAccwoSDD(0),
143 fHistPtTPCInAccTOFbc0woSDD(0),
144 fHistPtTPCInAccMCtwoSPD(0),
145 fHistPtTPCInAccMConeSPD(0),
146 fHistdEdxVSPtTPCInAcc(0),
147 fHistdEdxVSPtITSTPCsel(0),
148 fHistTPCclsVSPtTPCInAcc(0),
149 fHistTPCclsVSPtITSMISPDInAcc(0),
150 fHistPtVSphiTPCInAcc(0),
151 fHistPtTPCInAccNoTRDout(0),
152 fHistPtTPCInAccNoTOFout(0),
153 fHistPtTPCInAccWithPtTPCAtInnerWall(0),
154 fHistPtTPCInAccWithPtTPCAtVtx(0),
155 fHistDeltaPtTPC(0),
156 fHistPtTPCInAccP(0),
157 fHistPtTPCInAccS(0),
158 fHistPtTPCInAccPfromStrange(0),
159 fHistPtTPCInAccSfromStrange(0),
160 fHistPtTPCInAccSfromMat(0),
161 fHistPtITSMI2(0),
162 fHistPtITSMI3(0),
163 fHistPtITSMI4(0),
164 fHistPtITSMI5(0),
165 fHistPtITSMI6(0),
166 fHistPtITSMI7(0),
167 fHistPtITSMISPD(0),
168 fHistPtITSMIoneSPD(0),
169 fHistPtITSMItwoSPD(0),
170 fHistPtITSMI2InAcc(0),
171 fHistPtITSMI3InAcc(0),
172 fHistPtITSMI4InAcc(0),
173 fHistPtITSMI5InAcc(0),
174 fHistPtITSMI6InAcc(0),
175 fHistPtITSMI7InAcc(0),
176 fHistPtITSMISPDInAcc(0),
177 fHistPtITSMIoneSPDInAcc(0),
178 fHistPtITSMItwoSPDInAcc(0),
179 fHistPtITSMI2InAccTOFbc0(0),
180 fHistPtITSMI3InAccTOFbc0(0),
181 fHistPtITSMI4InAccTOFbc0(0),
182 fHistPtITSMI5InAccTOFbc0(0),
183 fHistPtITSMI6InAccTOFbc0(0),
184 fHistPtITSMISPDInAccTOFbc0(0),
185 fHistPtITSMIoneSPDInAccTOFbc0(0),
186 fHistPtITSMI2InAccwSDD(0),
187 fHistPtITSMI3InAccwSDD(0),
188 fHistPtITSMI4InAccwSDD(0),
189 fHistPtITSMI5InAccwSDD(0),
190 fHistPtITSMI6InAccwSDD(0),
191 fHistPtITSMISPDInAccwSDD(0),
192 fHistPtITSMIoneSPDInAccwSDD(0),
193 fHistPtITSMI2InAccTOFbc0wSDD(0),
194 fHistPtITSMI3InAccTOFbc0wSDD(0),
195 fHistPtITSMI4InAccTOFbc0wSDD(0),
196 fHistPtITSMI5InAccTOFbc0wSDD(0),
197 fHistPtITSMI6InAccTOFbc0wSDD(0),
198 fHistPtITSMISPDInAccTOFbc0wSDD(0),
199 fHistPtITSMIoneSPDInAccTOFbc0wSDD(0),
200 fHistPtITSMI2InAccwoSDD(0),
201 fHistPtITSMI3InAccwoSDD(0),
202 fHistPtITSMI4InAccwoSDD(0),
203 fHistPtITSMI5InAccwoSDD(0),
204 fHistPtITSMI6InAccwoSDD(0),
205 fHistPtITSMISPDInAccwoSDD(0),
206 fHistPtITSMIoneSPDInAccwoSDD(0),
207 fHistPtITSMI2InAccTOFbc0woSDD(0),
208 fHistPtITSMI3InAccTOFbc0woSDD(0),
209 fHistPtITSMI4InAccTOFbc0woSDD(0),
210 fHistPtITSMI5InAccTOFbc0woSDD(0),
211 fHistPtITSMI6InAccTOFbc0woSDD(0),
212 fHistPtITSMISPDInAccTOFbc0woSDD(0),
213 fHistPtITSMIoneSPDInAccTOFbc0woSDD(0),
214 fHistPtITSMIoneSPDInAccShared(0),
215 fHistPtITSMIoneSPDInAccSharedSPD(0),
216 fHistPtITSMISPD1InAccShared(0),
217 fHistPtITSMISPD2InAccShared(0),
218 fHistPtITSMIoneSPDInAccSharedFake(0),
219 fHistPtITSMIoneSPDInAccSharedSPDFake(0),
220 fHistPhiITSMI2InAcc(0),
221 fHistPhiITSMI3InAcc(0),
222 fHistPhiITSMI4InAcc(0),
223 fHistPhiITSMI5InAcc(0),
224 fHistPhiITSMI6InAcc(0),
225 fHistPhiITSMI7InAcc(0),
226 fHistPhiITSMISPDInAcc(0),
227 fHistPhiITSMIoneSPDInAcc(0),
228 fHistPhiITSMItwoSPDInAcc(0),
229 fHistEtaITSMI2InAcc(0),
230 fHistEtaITSMI3InAcc(0),
231 fHistEtaITSMI4InAcc(0),
232 fHistEtaITSMI5InAcc(0),
233 fHistEtaITSMI6InAcc(0),
234 fHistEtaITSMI7InAcc(0),
235 fHistEtaITSMISPDInAcc(0),
236 fHistEtaITSMIoneSPDInAcc(0),
237 fHistEtaITSMItwoSPDInAcc(0),
238 fHistPtITSMI2InAccFake(0),
239 fHistPtITSMI3InAccFake(0),
240 fHistPtITSMI4InAccFake(0),
241 fHistPtITSMI5InAccFake(0),
242 fHistPtITSMI6InAccFake(0),
243 fHistPtITSMI7InAccFake(0),
244 fHistPtITSMISPDInAccFake(0),
245 fHistPtITSMIoneSPDInAccFake(0),
246 fHistPtITSMItwoSPDInAccFake(0),
247 fHistPtITSMIoneSPDthreeSDDSSDInAcc(0),
248 fHistPtITSTPCsel(0),
249 fHistPtITSTPCselTOFbc0(0),
250 fHistPtITSTPCselwSDD(0),
251 fHistPtITSTPCselTOFbc0wSDD(0),
252 fHistPtITSTPCselwoSDD(0),
253 fHistPtITSTPCselTOFbc0woSDD(0),
254 fHistPtITSTPCselP(0),
255 fHistPtITSTPCselS(0),
256 fHistPtITSTPCselFake(0),
257 fHistPtITSTPCselPfromStrange(0),
258 fHistPtITSTPCselSfromStrange(0),
259 fHistPtITSTPCselSfromMat(0),
260 fHistPtITSMI2InAccP(0),
261 fHistPtITSMI3InAccP(0),
262 fHistPtITSMI4InAccP(0),
263 fHistPtITSMI5InAccP(0),
264 fHistPtITSMI6InAccP(0),
265 fHistPtITSMI7InAccP(0),
266 fHistPtITSMISPDInAccP(0),
267 fHistPtITSMIoneSPDInAccP(0),
268 fHistPtITSMItwoSPDInAccP(0),
269 fHistPtITSMI2InAccS(0),
270 fHistPtITSMI3InAccS(0),
271 fHistPtITSMI4InAccS(0),
272 fHistPtITSMI5InAccS(0),
273 fHistPtITSMI6InAccS(0),
274 fHistPtITSMI7InAccS(0),
275 fHistPtITSMISPDInAccS(0),
276 fHistPtITSMIoneSPDInAccS(0),
277 fHistPtITSMItwoSPDInAccS(0),
278 fHistPtITSMIokbadoutinz6(0),
279 fHistPtITSMIokbadoutinz4InAcc(0),
280 fHistPtITSMIokbadoutinz5InAcc(0),
281 fHistPtITSMIokbadoutinz6InAcc(0),
282 fHistPhiITSMIokbadoutinz6InAcc(0),
283 fHistRProdVtxInAccP(0),
284 fHistRProdVtxInAccS(0),
285 fHistd0rphiTPCInAccP150200(0),
286 fHistd0rphiTPCInAccP500700(0),
287 fHistd0rphiTPCInAccP10001500(0),
288 fHistd0rphiTPCInAccS150200(0),
289 fHistd0rphiTPCInAccS500700(0),
290 fHistd0rphiTPCInAccS10001500(0),
291 fHistd0rphiITSMISPDInAccP150200(0),
292 fHistd0rphiITSMISPDInAccP500700(0),
293 fHistd0rphiITSMISPDInAccP10001500(0),
294 fHistd0rphiITSMISPDInAccS150200(0),
295 fHistd0rphiITSMISPDInAccS500700(0),
296 fHistd0rphiITSMISPDInAccS10001500(0),
297 fHistd0rphiITSMIoneSPDInAccP150200(0),
298 fHistd0rphiITSMIoneSPDInAccP350450(0),
299 fHistd0rphiITSMIoneSPDInAccP500700(0),
300 fHistd0rphiITSMIoneSPDInAccP10001500(0),
301 fHistd0rphiITSMIoneSPDInAccP25004000(0),
302 fHistd0rphiITSMIoneSPDInAccP40008000(0),
303 fHistd0zITSMIoneSPDInAccP150200(0),
304 fHistd0zITSMIoneSPDInAccP500700(0),
305 fHistd0zITSMIoneSPDInAccP10001500(0),
306 fHistd0zVSetaTPCInAccP10001500(0),
307 fHistd0rphiVSphiITSMIoneSPDInAccP10001500(0),
308 fHistd0rphiVSetaITSMIoneSPDInAccP10001500(0),
309 fHistd0rphiITSMIoneSPDInAccS150200(0),
310 fHistd0rphiITSMIoneSPDInAccS350450(0),
311 fHistd0rphiITSMIoneSPDInAccS500700(0),
312 fHistd0rphiITSMIoneSPDInAccS500700from22(0),
313 fHistd0rphiITSMIoneSPDInAccS500700from211(0),
314 fHistd0rphiITSMIoneSPDInAccS500700from310(0),
315 fHistd0rphiITSMIoneSPDInAccS500700from321(0),
316 fHistd0rphiITSMIoneSPDInAccS500700from3122(0),
317 fHistd0rphiITSMIoneSPDInAccS10001500(0),
318 fHistd0rphiITSMIoneSPDInAccS25004000(0),
319 fHistd0rphiITSMIoneSPDInAccS40008000(0),
320 fHistd0rphiITSMIoneSPDInAccS150200fromStrange(0),
321 fHistd0rphiITSMIoneSPDInAccS150200fromMat(0),
322 fHistd0rphiITSMIoneSPDInAccS350450fromStrange(0),
323 fHistd0rphiITSMIoneSPDInAccS350450fromMat(0),
324 fHistd0rphiITSMIoneSPDInAccS500700fromStrange(0),
325 fHistd0rphiITSMIoneSPDInAccS500700fromMat(0),
326 fHistd0rphiITSMIoneSPDInAccS10001500fromStrange(0),
327 fHistd0rphiITSMIoneSPDInAccS10001500fromMat(0),
328 fHistd0rphiITSMIoneSPDInAccS25004000fromStrange(0),
329 fHistd0rphiITSMIoneSPDInAccS25004000fromMat(0),
330 fHistd0rphiITSMIoneSPDInAccS40008000fromStrange(0),
331 fHistd0rphiITSMIoneSPDInAccS40008000fromMat(0),
332 fHistd0zITSMIoneSPDInAccS150200(0),
333 fHistd0zITSMIoneSPDInAccS500700(0),
334 fHistd0zITSMIoneSPDInAccS10001500(0),
335 fHistPDGMoth(0),
336 fHistPDGMoth150200(0),
337 fHistPDGMoth500700(0),
338 fHistPDGMoth10001500(0),
339 fHistPDGTrk(0),
340 fHistITSRedChi2NonFakePt02(0),
341 fHistITSRedChi2FakePt02(0),
342 fHistITSRedChi2NonFakePt05(0),
343 fHistITSRedChi2FakePt05(0),
344 fHistITSRedChi2NonFakePt1(0),
345 fHistITSRedChi2FakePt1(0),
346 fNtupleESDTracks(0),
347 fNtupleITSAlignExtra(0),
348 fNtupleITSAlignSPDTracklets(0),
349 fESDtrackCutsTPC(0),
350 fESDtrackCutsITSTPC(0)
351 {
352   // Constructor
353   for(Int_t i=0; i<11; i++) fCountsPerPtBin[i]=0;
354
355 }
356
357 //________________________________________________________________________
358 AliAnalysisTaskITSTrackingCheck::AliAnalysisTaskITSTrackingCheck(const char *name) : 
359 AliAnalysisTaskSE(name), 
360 fNITSLayers(6),
361 fReadMC(kFALSE),
362 fReadRPLabels(kFALSE),
363 fFillNtuples(kFALSE),
364 fUseITSSAforNtuples(kFALSE),
365 fUsePhysSel(kFALSE),
366 fRequireSPDvtx(kTRUE),
367 fRejPileupSPD(kFALSE),
368 fCheckSDDIsIn(0),
369 fESD(0), 
370 fMinMult(0),
371 fMaxMult(1000000),
372 fTriggerClass(""),
373 fTrigConfig(0),
374 fUsePtBinsForBox(kFALSE),
375 fOCDBPath(""),
376 fOutput(0), 
377 fHistNEvents(0),
378 fHistNEventsFrac(0),
379 fHistNtracks(0),
380 fHistNclsITSMI(0),
381 fHistNclsITSSA(0),
382 fHistNclsITSSAInAcc(0),
383 fHistClusterMapITSMI(0),
384 fHistClusterMapITSMIok(0),
385 fHistClusterMapITSMIbad(0),
386 fHistClusterMapITSMIskipped(0),
387 fHistClusterMapITSMIoutinz(0),
388 fHistClusterMapITSMInorefit(0),
389 fHistClusterMapITSMInocls(0),
390 fHistClusterMapITSMIokoutinzbad(0),
391 fHistClusterMapITSSA(0),
392 fHistClusterMapITSSAok(0),
393 fHistClusterMapITSSAbad(0),
394 fHistClusterMapITSSAskipped(0),
395 fHistClusterMapITSSAoutinz(0),
396 fHistClusterMapITSSAnorefit(0),
397 fHistClusterMapITSSAnocls(0),
398 fHistClusterMapITSSAokoutinzbad(0),
399 fHistClusterMapITSSAInAcc(0),
400 fHistClusterMapITSSAokInAcc(0),
401 fHistClusterMapITSSAbadInAcc(0),
402 fHistClusterMapITSSAskippedInAcc(0),
403 fHistClusterMapITSSAoutinzInAcc(0),
404 fHistClusterMapITSSAnorefitInAcc(0),
405 fHistClusterMapITSSAnoclsInAcc(0),
406 fHistClusterMapITSSAokoutinzbadInAcc(0),
407 fHistClusterMapModuleITSSAokInAcc(0),
408 fHistClusterMapModuleITSSAbadInAcc(0),
409 fHistClusterMapModuleITSSAnoclsInAcc(0),
410 fHistClusterMapModuleITSMIokInAcc(0),
411 fHistClusterMapModuleITSMIbadInAcc(0),
412 fHistClusterMapModuleITSMInoclsInAcc(0),
413 fHistNClustersMapModule(0),
414 fHistZatSPDouter0ok(0),
415 fHistZatSPDouter1ok(0),
416 fHistZatSPDouter2ok(0),
417 fHistZatSPDouter3ok(0),
418 fHistZatSPDouter0notok(0),
419 fHistZatSPDouter1notok(0),
420 fHistZatSPDouter2notok(0),
421 fHistZatSPDouter3notok(0),
422 fHistxlocSDDok(0),
423 fHistzlocSDDok(0),
424 fHistxlocVSmodSDDok(0),
425 fHistxlocSDDall(0),
426 fHistzlocSDDall(0),
427 fHistPhiTPCInAcc(0),
428 fHistEtaTPCInAcc(0),
429 fHistPtTPC(0),
430 fHistPtTPCInAcc(0),
431 fHistPtTPCInAccTOFbc0(0),
432 fHistPtTPCInAccwSDD(0),
433 fHistPtTPCInAccTOFbc0wSDD(0),
434 fHistPtTPCInAccwoSDD(0),
435 fHistPtTPCInAccTOFbc0woSDD(0),
436 fHistPtTPCInAccMCtwoSPD(0),
437 fHistPtTPCInAccMConeSPD(0),
438 fHistdEdxVSPtTPCInAcc(0),
439 fHistdEdxVSPtITSTPCsel(0),
440 fHistTPCclsVSPtTPCInAcc(0),
441 fHistTPCclsVSPtITSMISPDInAcc(0),
442 fHistPtVSphiTPCInAcc(0),
443 fHistPtTPCInAccNoTRDout(0),
444 fHistPtTPCInAccNoTOFout(0),
445 fHistPtTPCInAccWithPtTPCAtInnerWall(0),
446 fHistPtTPCInAccWithPtTPCAtVtx(0),
447 fHistDeltaPtTPC(0),
448 fHistPtTPCInAccP(0),
449 fHistPtTPCInAccS(0),
450 fHistPtTPCInAccPfromStrange(0),
451 fHistPtTPCInAccSfromStrange(0),
452 fHistPtTPCInAccSfromMat(0),
453 fHistPtITSMI2(0),
454 fHistPtITSMI3(0),
455 fHistPtITSMI4(0),
456 fHistPtITSMI5(0),
457 fHistPtITSMI6(0),
458 fHistPtITSMI7(0),
459 fHistPtITSMISPD(0),
460 fHistPtITSMIoneSPD(0),
461 fHistPtITSMItwoSPD(0),
462 fHistPtITSMI2InAcc(0),
463 fHistPtITSMI3InAcc(0),
464 fHistPtITSMI4InAcc(0),
465 fHistPtITSMI5InAcc(0),
466 fHistPtITSMI6InAcc(0),
467 fHistPtITSMI7InAcc(0),
468 fHistPtITSMISPDInAcc(0),
469 fHistPtITSMIoneSPDInAcc(0),
470 fHistPtITSMItwoSPDInAcc(0),
471 fHistPtITSMI2InAccTOFbc0(0),
472 fHistPtITSMI3InAccTOFbc0(0),
473 fHistPtITSMI4InAccTOFbc0(0),
474 fHistPtITSMI5InAccTOFbc0(0),
475 fHistPtITSMI6InAccTOFbc0(0),
476 fHistPtITSMISPDInAccTOFbc0(0),
477 fHistPtITSMIoneSPDInAccTOFbc0(0),
478 fHistPtITSMI2InAccwSDD(0),
479 fHistPtITSMI3InAccwSDD(0),
480 fHistPtITSMI4InAccwSDD(0),
481 fHistPtITSMI5InAccwSDD(0),
482 fHistPtITSMI6InAccwSDD(0),
483 fHistPtITSMISPDInAccwSDD(0),
484 fHistPtITSMIoneSPDInAccwSDD(0),
485 fHistPtITSMI2InAccTOFbc0wSDD(0),
486 fHistPtITSMI3InAccTOFbc0wSDD(0),
487 fHistPtITSMI4InAccTOFbc0wSDD(0),
488 fHistPtITSMI5InAccTOFbc0wSDD(0),
489 fHistPtITSMI6InAccTOFbc0wSDD(0),
490 fHistPtITSMISPDInAccTOFbc0wSDD(0),
491 fHistPtITSMIoneSPDInAccTOFbc0wSDD(0),
492 fHistPtITSMI2InAccwoSDD(0),
493 fHistPtITSMI3InAccwoSDD(0),
494 fHistPtITSMI4InAccwoSDD(0),
495 fHistPtITSMI5InAccwoSDD(0),
496 fHistPtITSMI6InAccwoSDD(0),
497 fHistPtITSMISPDInAccwoSDD(0),
498 fHistPtITSMIoneSPDInAccwoSDD(0),
499 fHistPtITSMI2InAccTOFbc0woSDD(0),
500 fHistPtITSMI3InAccTOFbc0woSDD(0),
501 fHistPtITSMI4InAccTOFbc0woSDD(0),
502 fHistPtITSMI5InAccTOFbc0woSDD(0),
503 fHistPtITSMI6InAccTOFbc0woSDD(0),
504 fHistPtITSMISPDInAccTOFbc0woSDD(0),
505 fHistPtITSMIoneSPDInAccTOFbc0woSDD(0),
506 fHistPtITSMIoneSPDInAccShared(0),
507 fHistPtITSMIoneSPDInAccSharedSPD(0),
508 fHistPtITSMISPD1InAccShared(0),
509 fHistPtITSMISPD2InAccShared(0),
510 fHistPtITSMIoneSPDInAccSharedFake(0),
511 fHistPtITSMIoneSPDInAccSharedSPDFake(0),
512 fHistPhiITSMI2InAcc(0),
513 fHistPhiITSMI3InAcc(0),
514 fHistPhiITSMI4InAcc(0),
515 fHistPhiITSMI5InAcc(0),
516 fHistPhiITSMI6InAcc(0),
517 fHistPhiITSMI7InAcc(0),
518 fHistPhiITSMISPDInAcc(0),
519 fHistPhiITSMIoneSPDInAcc(0),
520 fHistPhiITSMItwoSPDInAcc(0),
521 fHistEtaITSMI2InAcc(0),
522 fHistEtaITSMI3InAcc(0),
523 fHistEtaITSMI4InAcc(0),
524 fHistEtaITSMI5InAcc(0),
525 fHistEtaITSMI6InAcc(0),
526 fHistEtaITSMI7InAcc(0),
527 fHistEtaITSMISPDInAcc(0),
528 fHistEtaITSMIoneSPDInAcc(0),
529 fHistEtaITSMItwoSPDInAcc(0),
530 fHistPtITSMI2InAccFake(0),
531 fHistPtITSMI3InAccFake(0),
532 fHistPtITSMI4InAccFake(0),
533 fHistPtITSMI5InAccFake(0),
534 fHistPtITSMI6InAccFake(0),
535 fHistPtITSMI7InAccFake(0),
536 fHistPtITSMISPDInAccFake(0),
537 fHistPtITSMIoneSPDInAccFake(0),
538 fHistPtITSMItwoSPDInAccFake(0),
539 fHistPtITSMIoneSPDthreeSDDSSDInAcc(0),
540 fHistPtITSTPCsel(0),
541 fHistPtITSTPCselTOFbc0(0),
542 fHistPtITSTPCselwSDD(0),
543 fHistPtITSTPCselTOFbc0wSDD(0),
544 fHistPtITSTPCselwoSDD(0),
545 fHistPtITSTPCselTOFbc0woSDD(0),
546 fHistPtITSTPCselP(0),
547 fHistPtITSTPCselS(0),
548 fHistPtITSTPCselFake(0),
549 fHistPtITSTPCselPfromStrange(0),
550 fHistPtITSTPCselSfromStrange(0),
551 fHistPtITSTPCselSfromMat(0),
552 fHistPtITSMI2InAccP(0),
553 fHistPtITSMI3InAccP(0),
554 fHistPtITSMI4InAccP(0),
555 fHistPtITSMI5InAccP(0),
556 fHistPtITSMI6InAccP(0),
557 fHistPtITSMI7InAccP(0),
558 fHistPtITSMISPDInAccP(0),
559 fHistPtITSMIoneSPDInAccP(0),
560 fHistPtITSMItwoSPDInAccP(0),
561 fHistPtITSMI2InAccS(0),
562 fHistPtITSMI3InAccS(0),
563 fHistPtITSMI4InAccS(0),
564 fHistPtITSMI5InAccS(0),
565 fHistPtITSMI6InAccS(0),
566 fHistPtITSMI7InAccS(0),
567 fHistPtITSMISPDInAccS(0),
568 fHistPtITSMIoneSPDInAccS(0),
569 fHistPtITSMItwoSPDInAccS(0),
570 fHistPtITSMIokbadoutinz6(0),
571 fHistPtITSMIokbadoutinz4InAcc(0),
572 fHistPtITSMIokbadoutinz5InAcc(0),
573 fHistPtITSMIokbadoutinz6InAcc(0),
574 fHistPhiITSMIokbadoutinz6InAcc(0),
575 fHistRProdVtxInAccP(0),
576 fHistRProdVtxInAccS(0),
577 fHistd0rphiTPCInAccP150200(0),
578 fHistd0rphiTPCInAccP500700(0),
579 fHistd0rphiTPCInAccP10001500(0),
580 fHistd0rphiTPCInAccS150200(0),
581 fHistd0rphiTPCInAccS500700(0),
582 fHistd0rphiTPCInAccS10001500(0),
583 fHistd0rphiITSMISPDInAccP150200(0),
584 fHistd0rphiITSMISPDInAccP500700(0),
585 fHistd0rphiITSMISPDInAccP10001500(0),
586 fHistd0rphiITSMISPDInAccS150200(0),
587 fHistd0rphiITSMISPDInAccS500700(0),
588 fHistd0rphiITSMISPDInAccS10001500(0),
589 fHistd0rphiITSMIoneSPDInAccP150200(0),
590 fHistd0rphiITSMIoneSPDInAccP350450(0),
591 fHistd0rphiITSMIoneSPDInAccP500700(0),
592 fHistd0rphiITSMIoneSPDInAccP10001500(0),
593 fHistd0rphiITSMIoneSPDInAccP25004000(0),
594 fHistd0rphiITSMIoneSPDInAccP40008000(0),
595 fHistd0zITSMIoneSPDInAccP150200(0),
596 fHistd0zITSMIoneSPDInAccP500700(0),
597 fHistd0zITSMIoneSPDInAccP10001500(0),
598 fHistd0zVSetaTPCInAccP10001500(0),
599 fHistd0rphiVSphiITSMIoneSPDInAccP10001500(0),
600 fHistd0rphiVSetaITSMIoneSPDInAccP10001500(0),
601 fHistd0rphiITSMIoneSPDInAccS150200(0),
602 fHistd0rphiITSMIoneSPDInAccS350450(0),
603 fHistd0rphiITSMIoneSPDInAccS500700(0),
604 fHistd0rphiITSMIoneSPDInAccS500700from22(0),
605 fHistd0rphiITSMIoneSPDInAccS500700from211(0),
606 fHistd0rphiITSMIoneSPDInAccS500700from310(0),
607 fHistd0rphiITSMIoneSPDInAccS500700from321(0),
608 fHistd0rphiITSMIoneSPDInAccS500700from3122(0),
609 fHistd0rphiITSMIoneSPDInAccS10001500(0),
610 fHistd0rphiITSMIoneSPDInAccS25004000(0),
611 fHistd0rphiITSMIoneSPDInAccS40008000(0),
612 fHistd0rphiITSMIoneSPDInAccS150200fromStrange(0),
613 fHistd0rphiITSMIoneSPDInAccS150200fromMat(0),
614 fHistd0rphiITSMIoneSPDInAccS350450fromStrange(0),
615 fHistd0rphiITSMIoneSPDInAccS350450fromMat(0),
616 fHistd0rphiITSMIoneSPDInAccS500700fromStrange(0),
617 fHistd0rphiITSMIoneSPDInAccS500700fromMat(0),
618 fHistd0rphiITSMIoneSPDInAccS10001500fromStrange(0),
619 fHistd0rphiITSMIoneSPDInAccS10001500fromMat(0),
620 fHistd0rphiITSMIoneSPDInAccS25004000fromStrange(0),
621 fHistd0rphiITSMIoneSPDInAccS25004000fromMat(0),
622 fHistd0rphiITSMIoneSPDInAccS40008000fromStrange(0),
623 fHistd0rphiITSMIoneSPDInAccS40008000fromMat(0),
624 fHistd0zITSMIoneSPDInAccS150200(0),
625 fHistd0zITSMIoneSPDInAccS500700(0),
626 fHistd0zITSMIoneSPDInAccS10001500(0),
627 fHistPDGMoth(0),
628 fHistPDGMoth150200(0),
629 fHistPDGMoth500700(0),
630 fHistPDGMoth10001500(0),
631 fHistPDGTrk(0),
632 fHistITSRedChi2NonFakePt02(0),
633 fHistITSRedChi2FakePt02(0),
634 fHistITSRedChi2NonFakePt05(0),
635 fHistITSRedChi2FakePt05(0),
636 fHistITSRedChi2NonFakePt1(0),
637 fHistITSRedChi2FakePt1(0),
638 fNtupleESDTracks(0),
639 fNtupleITSAlignExtra(0),
640 fNtupleITSAlignSPDTracklets(0),
641 fESDtrackCutsTPC(0),
642 fESDtrackCutsITSTPC(0)
643 {
644   // Constructor
645
646   for(Int_t i=0; i<11; i++) fCountsPerPtBin[i]=0;
647
648   // Define input and output slots here
649   // Output slot #0 writes into a TList container
650   DefineOutput(1, TList::Class());  //My private output
651 }
652 //________________________________________________________________________
653 AliAnalysisTaskITSTrackingCheck::~AliAnalysisTaskITSTrackingCheck()
654 {
655   // Destructor
656
657   // histograms are in the output list and deleted when the output
658   // list is deleted by the TSelector dtor
659
660   if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
661     delete fOutput;
662     fOutput = 0;
663   }
664 }
665 //________________________________________________________________________
666 void AliAnalysisTaskITSTrackingCheck::UserCreateOutputObjects()
667 {
668   // Create histograms
669   // Called once
670
671   gStyle->SetHistLineWidth(2);
672
673   Int_t nPtBins=34;
674   Float_t xPtBinsDefault[35]={0,0.025,0.05,0.075,0.1,0.125,0.15,0.175,0.2,0.225,0.25,0.275,0.3,0.325,0.35,0.375,0.4,0.5,0.6,0.7,0.8,1.0,1.5,2.,2.5,3,4,5,6,8,10,15,20,25,30};
675   Float_t xPtBinsForBox[35]={0,0.025,0.05,0.075,0.08,0.125,0.15,0.175,0.2,0.225,0.25,0.275,0.280,0.325,0.35,0.375,0.4,0.45,0.55,0.7,0.75,0.9,1.2,1.7,2.5,3.5,4.5,5,6,8,13,15,23,28,35};
676   Float_t xPtBins[35];
677   for(Int_t ib=0; ib<=nPtBins; ib++) {
678     if(fUsePtBinsForBox) {
679       xPtBins[ib]=xPtBinsForBox[ib];
680     } else {
681       xPtBins[ib]=xPtBinsDefault[ib];
682     }
683   }
684
685
686   for(Int_t i=0; i<11; i++) fCountsPerPtBin[i]=0;
687
688   // Several histograms are more conveniently managed in a TList
689   fOutput = new TList;
690   fOutput->SetOwner();
691
692   fHistPDGMoth = new TH1F("fHistPDGMoth","",4000,0,4000);
693   fOutput->Add(fHistPDGMoth);
694   fHistPDGMoth150200 = new TH1F("fHistPDGMoth150200","",4000,0,4000);
695   fOutput->Add(fHistPDGMoth150200);
696   fHistPDGMoth500700 = new TH1F("fHistPDGMoth500700","",4000,0,4000);
697   fOutput->Add(fHistPDGMoth500700);
698   fHistPDGMoth10001500 = new TH1F("fHistPDGMoth10001500","",4000,0,4000);
699   fOutput->Add(fHistPDGMoth10001500);
700   fHistPDGTrk = new TH1F("fHistPDGTrk","",4000,0,4000);
701   fOutput->Add(fHistPDGTrk);
702
703   fHistNEvents = new TH1F("fHistNEvents", "Events: -1 tot, 0 sel, 1 vSPD3D, 2 vSPDZ, 3 vSPD, 4 vTRK; Type; N Events",12, -1.5, 10.5);
704   fHistNEvents->SetMinimum(0);
705   fOutput->Add(fHistNEvents);
706
707   fHistNEventsFrac = (TH1F*)fHistNEvents->Clone("fHistNEventsFrac");
708   fOutput->Add(fHistNEventsFrac);
709
710   fHistNtracks = new TH1F("fHistNtracks", "N ESD tracks; N tracks; Events",5000, -0.5, 4999.5);
711   fHistNtracks->Sumw2();
712   fHistNtracks->SetMinimum(0);
713   fOutput->Add(fHistNtracks);
714
715   fHistNclsITSMI = new TH1F("fHistNclsITSMI", "N ITS clusters per track (MI); N clusters; Counts",8, -0.5, 7.5);
716   fHistNclsITSMI->Sumw2();
717   fHistNclsITSMI->SetMinimum(0);
718   fOutput->Add(fHistNclsITSMI);
719
720   fHistNclsITSSAInAcc = new TH1F("fHistNclsITSSAInAcc", "N ITS clusters per track (SA); N clusters; Counts",7, -0.5, 6.5);
721   fHistNclsITSSAInAcc->Sumw2();
722   fHistNclsITSSAInAcc->SetMinimum(0);
723   fOutput->Add(fHistNclsITSSAInAcc);  
724
725   fHistNclsITSSA = new TH1F("fHistNclsITSSA", "N ITS clusters per track (SA); N clusters; Counts",8, -0.5, 7.5);
726   fHistNclsITSSA->Sumw2();
727   fHistNclsITSSA->SetMinimum(0);
728   fOutput->Add(fHistNclsITSSA);  
729
730   fHistClusterMapITSMI = new TH1F("fHistClusterMapITSMI", "N tracks with point on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
731   fHistClusterMapITSMI->Sumw2();
732   fHistClusterMapITSMI->SetMinimum(0);
733   fOutput->Add(fHistClusterMapITSMI);
734   
735   fHistClusterMapITSSA = new TH1F("fHistClusterMapITSSA", "N tracks with point on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
736   fHistClusterMapITSSA->Sumw2();
737   fHistClusterMapITSSA->SetMinimum(0);
738   fOutput->Add(fHistClusterMapITSSA);
739
740   fHistClusterMapITSSAInAcc = new TH1F("fHistClusterMapITSSAInAcc", "N tracks with point on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
741   fHistClusterMapITSSAInAcc->Sumw2();
742   fHistClusterMapITSSAInAcc->SetMinimum(0);
743   fOutput->Add(fHistClusterMapITSSAInAcc);
744
745   fHistClusterMapITSMIok = new TH1F("fHistClusterMapITSMIok", "N tracks with ok on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
746   fHistClusterMapITSMIok->Sumw2();
747   fHistClusterMapITSMIok->SetMinimum(0);
748   fOutput->Add(fHistClusterMapITSMIok);
749   
750   
751
752   fHistClusterMapITSSAokInAcc = new TH1F("fHistClusterMapITSSAokInAcc", "N tracks with ok on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
753   fHistClusterMapITSSAokInAcc->Sumw2();
754   fHistClusterMapITSSAokInAcc->SetMinimum(0);
755   fOutput->Add(fHistClusterMapITSSAokInAcc);
756
757   fHistClusterMapModuleITSSAokInAcc = new TH1F("fHistClusterMapModuleITSSAokInAcc", "N tracks with ok on Module (SA); Module; N tracks",2198, -0.5, 2197.5);
758   fHistClusterMapModuleITSSAokInAcc->SetMinimum(0);
759   fOutput->Add(fHistClusterMapModuleITSSAokInAcc);
760
761   fHistClusterMapModuleITSMIokInAcc = new TH1F("fHistClusterMapModuleITSMIokInAcc", "N tracks with ok on Module (MI); Module; N tracks",2198, -0.5, 2197.5);
762   fHistClusterMapModuleITSMIokInAcc->SetMinimum(0);
763   fOutput->Add(fHistClusterMapModuleITSMIokInAcc);
764
765   fHistNClustersMapModule = new TH1F("fHistNClustersMapModule", "N clusters; Module; N tracks",2198, -0.5, 2197.5);
766   fHistNClustersMapModule->SetMinimum(0);
767   fOutput->Add(fHistNClustersMapModule);
768
769   fHistClusterMapITSSAok = new TH1F("fHistClusterMapITSSAok", "N tracks with ok on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
770   fHistClusterMapITSSAok->Sumw2();
771   fHistClusterMapITSSAok->SetMinimum(0);
772   fOutput->Add(fHistClusterMapITSSAok);
773
774   fHistClusterMapITSMIbad = new TH1F("fHistClusterMapITSMIbad", "N tracks with bad on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
775   fHistClusterMapITSMIbad->Sumw2();
776   fHistClusterMapITSMIbad->SetMinimum(0);
777   fOutput->Add(fHistClusterMapITSMIbad);
778   
779   fHistClusterMapITSSAbadInAcc = new TH1F("fHistClusterMapITSSAbadInAcc", "N tracks with bad on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
780   fHistClusterMapITSSAbadInAcc->Sumw2();
781   fHistClusterMapITSSAbadInAcc->SetMinimum(0);
782   fOutput->Add(fHistClusterMapITSSAbadInAcc);
783
784   fHistClusterMapModuleITSSAbadInAcc = new TH1F("fHistClusterMapModuleITSSAbadInAcc", "N tracks with bad on Module (SA); Module; N tracks",2198, -0.5, 2197.5);
785   fHistClusterMapModuleITSSAbadInAcc->SetMinimum(0);
786   fOutput->Add(fHistClusterMapModuleITSSAbadInAcc);
787
788   fHistClusterMapModuleITSMIbadInAcc = new TH1F("fHistClusterMapModuleITSMIbadInAcc", "N tracks with bad on Module (MI); Module; N tracks",2198, -0.5, 2197.5);
789   fHistClusterMapModuleITSMIbadInAcc->SetMinimum(0);
790   fOutput->Add(fHistClusterMapModuleITSMIbadInAcc);
791
792   fHistClusterMapITSSAbad = new TH1F("fHistClusterMapITSSAbad", "N tracks with bad on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
793   fHistClusterMapITSSAbad->Sumw2();
794   fHistClusterMapITSSAbad->SetMinimum(0);
795   fOutput->Add(fHistClusterMapITSSAbad);
796
797   fHistClusterMapITSMIskipped = new TH1F("fHistClusterMapITSMIskipped", "N tracks with skip on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
798   fHistClusterMapITSMIskipped->Sumw2();
799   fHistClusterMapITSMIskipped->SetMinimum(0);
800   fOutput->Add(fHistClusterMapITSMIskipped);
801   
802   fHistClusterMapITSSAskippedInAcc = new TH1F("fHistClusterMapITSSAskippedInAcc", "N tracks with skip on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
803   fHistClusterMapITSSAskippedInAcc->Sumw2();
804   fHistClusterMapITSSAskippedInAcc->SetMinimum(0);
805   fOutput->Add(fHistClusterMapITSSAskippedInAcc);
806
807   fHistClusterMapITSSAskipped = new TH1F("fHistClusterMapITSSAskipped", "N tracks with skip on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
808   fHistClusterMapITSSAskipped->Sumw2();
809   fHistClusterMapITSSAskipped->SetMinimum(0);
810   fOutput->Add(fHistClusterMapITSSAskipped);
811
812   fHistClusterMapITSMIoutinz = new TH1F("fHistClusterMapITSMIoutinz", "N tracks out in z on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
813   fHistClusterMapITSMIoutinz->Sumw2();
814   fHistClusterMapITSMIoutinz->SetMinimum(0);
815   fOutput->Add(fHistClusterMapITSMIoutinz);
816   
817   fHistClusterMapITSSAoutinzInAcc = new TH1F("fHistClusterMapITSSAoutinzInAcc", "N tracks with out in z on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
818   fHistClusterMapITSSAoutinzInAcc->Sumw2();
819   fHistClusterMapITSSAoutinzInAcc->SetMinimum(0);
820   fOutput->Add(fHistClusterMapITSSAoutinzInAcc);
821
822   fHistClusterMapITSSAoutinz = new TH1F("fHistClusterMapITSSAoutinz", "N tracks with out in z on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
823   fHistClusterMapITSSAoutinz->Sumw2();
824   fHistClusterMapITSSAoutinz->SetMinimum(0);
825   fOutput->Add(fHistClusterMapITSSAoutinz);
826
827   fHistClusterMapITSSAokoutinzbad = new TH1F("fHistClusterMapITSSAokoutinzbad", "N tracks with cluster or bad zone or out in z (SA); Layer; N tracks",7, -0.5, 6.5);
828   fHistClusterMapITSSAokoutinzbad->Sumw2();
829   fHistClusterMapITSSAokoutinzbad->SetMinimum(0);
830   fOutput->Add(fHistClusterMapITSSAokoutinzbad);
831
832   fHistClusterMapITSMIokoutinzbad = new TH1F("fHistClusterMapITSMIokoutinzbad", "N tracks with cluster or bad zone or out in z (MI); Layer; N tracks",7, -0.5, 6.5);
833   fHistClusterMapITSMIokoutinzbad->Sumw2();
834   fHistClusterMapITSMIokoutinzbad->SetMinimum(0);
835   fOutput->Add(fHistClusterMapITSMIokoutinzbad);
836
837   fHistClusterMapITSSAokoutinzbadInAcc = new TH1F("fHistClusterMapITSSAokoutinzbadInAcc", "N tracks with cluster or bad zone or out in z (SA); Layer; N tracks",7, -0.5, 6.5);
838   fHistClusterMapITSSAokoutinzbadInAcc->Sumw2();
839   fHistClusterMapITSSAokoutinzbadInAcc->SetMinimum(0);
840   fOutput->Add(fHistClusterMapITSSAokoutinzbadInAcc);
841
842   fHistClusterMapITSMInorefit = new TH1F("fHistClusterMapITSMInorefit", "N tracks with norefit on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
843   fHistClusterMapITSMInorefit->Sumw2();
844   fHistClusterMapITSMInorefit->SetMinimum(0);
845   fOutput->Add(fHistClusterMapITSMInorefit);
846   
847   fHistClusterMapITSSAnorefitInAcc = new TH1F("fHistClusterMapITSSAnorefitInAcc", "N tracks with norefit on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
848   fHistClusterMapITSSAnorefitInAcc->Sumw2();
849   fHistClusterMapITSSAnorefitInAcc->SetMinimum(0);
850   fOutput->Add(fHistClusterMapITSSAnorefitInAcc);
851
852   fHistClusterMapITSSAnorefit = new TH1F("fHistClusterMapITSSAnorefit", "N tracks with norefit on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
853   fHistClusterMapITSSAnorefit->Sumw2();
854   fHistClusterMapITSSAnorefit->SetMinimum(0);
855   fOutput->Add(fHistClusterMapITSSAnorefit);
856
857   fHistClusterMapITSMInocls = new TH1F("fHistClusterMapITSMInocls", "N tracks with nocls on Layer (MI); Layer; N tracks",7, -0.5, 6.5);
858   fHistClusterMapITSMInocls->Sumw2();
859   fHistClusterMapITSMInocls->SetMinimum(0);
860   fOutput->Add(fHistClusterMapITSMInocls);
861   
862   fHistClusterMapITSSAnoclsInAcc = new TH1F("fHistClusterMapITSSAnoclsInAcc", "N tracks with nocls on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
863   fHistClusterMapITSSAnoclsInAcc->Sumw2();
864   fHistClusterMapITSSAnoclsInAcc->SetMinimum(0);
865   fOutput->Add(fHistClusterMapITSSAnoclsInAcc);
866   
867   fHistClusterMapModuleITSSAnoclsInAcc = new TH1F("fHistClusterMapModuleITSSAnoclsInAcc", "N tracks with nocls on Module (SA); Module; N tracks",2198, -0.5, 2197.5);
868   fHistClusterMapModuleITSSAnoclsInAcc->SetMinimum(0);
869   fOutput->Add(fHistClusterMapModuleITSSAnoclsInAcc);
870
871   fHistClusterMapModuleITSMInoclsInAcc = new TH1F("fHistClusterMapModuleITSMInoclsInAcc", "N tracks with nocls on Module (MI); Module; N tracks",2198, -0.5, 2197.5);
872   fHistClusterMapModuleITSMInoclsInAcc->SetMinimum(0);
873   fOutput->Add(fHistClusterMapModuleITSMInoclsInAcc);
874
875   fHistClusterMapITSSAnocls = new TH1F("fHistClusterMapITSSAnocls", "N tracks with nocls on Layer (SA); Layer; N tracks",7, -0.5, 6.5);
876   fHistClusterMapITSSAnocls->Sumw2();
877   fHistClusterMapITSSAnocls->SetMinimum(0);
878   fOutput->Add(fHistClusterMapITSSAnocls);
879   
880   
881   fHistZatSPDouter0ok = new TH1F("fHistZatSPDouter0ok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
882   fHistZatSPDouter0ok->Sumw2();
883   fHistZatSPDouter0ok->SetMinimum(0);
884   fOutput->Add(fHistZatSPDouter0ok);
885   fHistZatSPDouter1ok = new TH1F("fHistZatSPDouter1ok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
886   fHistZatSPDouter1ok->Sumw2();
887   fHistZatSPDouter1ok->SetMinimum(0);
888   fOutput->Add(fHistZatSPDouter1ok);
889   fHistZatSPDouter2ok = new TH1F("fHistZatSPDouter2ok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
890   fHistZatSPDouter2ok->Sumw2();
891   fHistZatSPDouter2ok->SetMinimum(0);
892   fOutput->Add(fHistZatSPDouter2ok);
893   fHistZatSPDouter3ok = new TH1F("fHistZatSPDouter3ok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
894   fHistZatSPDouter3ok->Sumw2();
895   fHistZatSPDouter3ok->SetMinimum(0);
896   fOutput->Add(fHistZatSPDouter3ok);
897   fHistZatSPDouter0notok = new TH1F("fHistZatSPDouter0notok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
898   fHistZatSPDouter0notok->Sumw2();
899   fHistZatSPDouter0notok->SetMinimum(0);
900   fOutput->Add(fHistZatSPDouter0notok);
901   fHistZatSPDouter1notok = new TH1F("fHistZatSPDouter1notok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
902   fHistZatSPDouter1notok->Sumw2();
903   fHistZatSPDouter1notok->SetMinimum(0);
904   fOutput->Add(fHistZatSPDouter1notok);
905   fHistZatSPDouter2notok = new TH1F("fHistZatSPDouter2notok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
906   fHistZatSPDouter2notok->Sumw2();
907   fHistZatSPDouter2notok->SetMinimum(0);
908   fOutput->Add(fHistZatSPDouter2notok);
909   fHistZatSPDouter3notok = new TH1F("fHistZatSPDouter3notok", "Track z at SPDouter radius; z [cm]; N tracks",3200,-16,16);
910   fHistZatSPDouter3notok->Sumw2();
911   fHistZatSPDouter3notok->SetMinimum(0);
912   fOutput->Add(fHistZatSPDouter3notok);
913   
914   fHistxlocSDDok = new TH1F("fHistxlocSDDok", "SDD points; xloc [cm]; N tracks",75, -3.75, 3.75);
915   fHistxlocSDDok->Sumw2();
916   fHistxlocSDDok->SetMinimum(0);
917   fOutput->Add(fHistxlocSDDok);
918
919   fHistxlocVSmodSDDok = new TH2F("fHistxlocVSmodSDDok", "SDD points; module; xloc [cm]",260,239.5,499.5,25, -3.75, 3.75);
920   fOutput->Add(fHistxlocVSmodSDDok);
921
922   fHistzlocSDDok = new TH1F("fHistzlocSDDok", "SDD points; zloc [cm]; N tracks",77, -3.85, 3.85);
923   fHistzlocSDDok->Sumw2();
924   fHistzlocSDDok->SetMinimum(0);
925   fOutput->Add(fHistzlocSDDok);
926   
927   fHistxlocSDDall = new TH1F("fHistxlocSDDall", "SDD points; xloc [cm]; N tracks",75, -3.75, 3.75);
928   fHistxlocSDDall->Sumw2();
929   fHistxlocSDDall->SetMinimum(0);
930   fOutput->Add(fHistxlocSDDall);
931
932   fHistzlocSDDall = new TH1F("fHistzlocSDDall", "SDD points; zloc [cm]; N tracks",77, -3.85, 3.85);
933   fHistzlocSDDall->Sumw2();
934   fHistzlocSDDall->SetMinimum(0);
935   fOutput->Add(fHistzlocSDDall);
936
937
938   fHistPhiTPCInAcc = new TH1F("fHistPhiTPCInAcc","Azimuthal distribution of TPC tracks; #phi; N tracks",100, 0, 2.*3.1415);
939   fHistPhiTPCInAcc->Sumw2();
940   fHistPhiTPCInAcc->SetMinimum(0);
941   fOutput->Add(fHistPhiTPCInAcc);
942
943   fHistEtaTPCInAcc = new TH1F("fHistEtaTPCInAcc","Eta distribution of TPC tracks; #eta; N tracks",100, -1.5, +1.5);
944   fHistEtaTPCInAcc->Sumw2();
945   fHistEtaTPCInAcc->SetMinimum(0);
946   fOutput->Add(fHistEtaTPCInAcc);
947
948
949   fHistPhiITSMIokbadoutinz6InAcc = new TH1F("fHistPhiITSMIokbadoutinz6InAcc","Azimuthal distribution of ITSMI tracks with 6 layers OK; #phi; N tracks",100,0,2.*3.1415);
950   fHistPhiITSMIokbadoutinz6InAcc->Sumw2();
951   fHistPhiITSMIokbadoutinz6InAcc->SetMinimum(0);
952   fOutput->Add(fHistPhiITSMIokbadoutinz6InAcc);
953   
954   fHistPtTPC = new TH1F("fHistPtTPC","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
955   fHistPtTPC->Sumw2();
956   fHistPtTPC->SetMinimum(0);
957   fOutput->Add(fHistPtTPC);
958   
959   fHistPtITSMI7 = new TH1F("fHistPtITSMI7","pt distribution of ITSMI7 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
960   fHistPtITSMI7->Sumw2();
961   fHistPtITSMI7->SetMinimum(0);
962   fOutput->Add(fHistPtITSMI7);
963   
964   fHistPtITSMI6 = new TH1F("fHistPtITSMI6","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
965   fHistPtITSMI6->Sumw2();
966   fHistPtITSMI6->SetMinimum(0);
967   fOutput->Add(fHistPtITSMI6);
968   
969   fHistPtITSMI5 = new TH1F("fHistPtITSMI5","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
970   fHistPtITSMI5->Sumw2();
971   fHistPtITSMI5->SetMinimum(0);
972   fOutput->Add(fHistPtITSMI5);
973   
974   fHistPtITSMI4 = new TH1F("fHistPtITSMI4","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
975   fHistPtITSMI4->Sumw2();
976   fHistPtITSMI4->SetMinimum(0);
977   fOutput->Add(fHistPtITSMI4);
978   
979   fHistPtITSMI3 = new TH1F("fHistPtITSMI3","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
980   fHistPtITSMI3->Sumw2();
981   fHistPtITSMI3->SetMinimum(0);
982   fOutput->Add(fHistPtITSMI3);
983   
984   fHistPtITSMI2 = new TH1F("fHistPtITSMI2","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
985   fHistPtITSMI2->Sumw2();
986   fHistPtITSMI2->SetMinimum(0);
987   fOutput->Add(fHistPtITSMI2);
988   
989   fHistPtITSMISPD = new TH1F("fHistPtITSMISPD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
990   fHistPtITSMISPD->Sumw2();
991   fHistPtITSMISPD->SetMinimum(0);
992   fOutput->Add(fHistPtITSMISPD);
993
994   fHistPtITSMIoneSPD = new TH1F("fHistPtITSMIoneSPD","pt distribution of ITSMIoneSPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
995   fHistPtITSMIoneSPD->Sumw2();
996   fHistPtITSMIoneSPD->SetMinimum(0);
997   fOutput->Add(fHistPtITSMIoneSPD);
998
999   fHistPtITSMItwoSPD = new TH1F("fHistPtITSMItwoSPD","pt distribution of ITSMItwoSPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1000   fHistPtITSMItwoSPD->Sumw2();
1001   fHistPtITSMItwoSPD->SetMinimum(0);
1002   fOutput->Add(fHistPtITSMItwoSPD);
1003
1004   fHistPtTPCInAcc = new TH1F("fHistPtTPCInAcc","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1005   fHistPtTPCInAcc->Sumw2();
1006   fHistPtTPCInAcc->SetMinimum(0);
1007   fOutput->Add(fHistPtTPCInAcc);
1008
1009   fHistPtTPCInAccTOFbc0 = new TH1F("fHistPtTPCInAccTOFbc0","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1010   fHistPtTPCInAccTOFbc0->Sumw2();
1011   fHistPtTPCInAccTOFbc0->SetMinimum(0);
1012   fOutput->Add(fHistPtTPCInAccTOFbc0);
1013
1014   fHistPtTPCInAccwSDD = new TH1F("fHistPtTPCInAccwSDD","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1015   fHistPtTPCInAccwSDD->Sumw2();
1016   fHistPtTPCInAccwSDD->SetMinimum(0);
1017   fOutput->Add(fHistPtTPCInAccwSDD);
1018
1019   fHistPtTPCInAccTOFbc0wSDD = new TH1F("fHistPtTPCInAccTOFbc0wSDD","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1020   fHistPtTPCInAccTOFbc0wSDD->Sumw2();
1021   fHistPtTPCInAccTOFbc0wSDD->SetMinimum(0);
1022   fOutput->Add(fHistPtTPCInAccTOFbc0wSDD);
1023   
1024   fHistPtTPCInAccwoSDD = new TH1F("fHistPtTPCInAccwoSDD","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1025   fHistPtTPCInAccwoSDD->Sumw2();
1026   fHistPtTPCInAccwoSDD->SetMinimum(0);
1027   fOutput->Add(fHistPtTPCInAccwoSDD);
1028
1029   fHistPtTPCInAccTOFbc0woSDD = new TH1F("fHistPtTPCInAccTOFbc0woSDD","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1030   fHistPtTPCInAccTOFbc0woSDD->Sumw2();
1031   fHistPtTPCInAccTOFbc0woSDD->SetMinimum(0);
1032   fOutput->Add(fHistPtTPCInAccTOFbc0woSDD);
1033   
1034   fHistPtTPCInAccMCtwoSPD = new TH1F("fHistPtTPCInAccMCtwoSPD","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1035   fHistPtTPCInAccMCtwoSPD->Sumw2();
1036   fHistPtTPCInAccMCtwoSPD->SetMinimum(0);
1037   fOutput->Add(fHistPtTPCInAccMCtwoSPD);
1038   
1039   fHistPtTPCInAccMConeSPD = new TH1F("fHistPtTPCInAccMConeSPD","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1040   fHistPtTPCInAccMConeSPD->Sumw2();
1041   fHistPtTPCInAccMConeSPD->SetMinimum(0);
1042   fOutput->Add(fHistPtTPCInAccMConeSPD);
1043   
1044   fHistdEdxVSPtTPCInAcc = new TH2F("fHistdEdxVSPtTPCInAcc","dE/dx distribution of TPC tracks; p_{t} [GeV/c]; TPC dE/dx",100,0,1,50,0,500);
1045   fOutput->Add(fHistdEdxVSPtTPCInAcc);
1046   
1047   fHistdEdxVSPtITSTPCsel = new TH2F("fHistdEdxVSPtITSTPCsel","dE/dx distribution of TPC tracks; p_{t} [GeV/c]; ITS dE/dx",100,0,1,50,0,500);
1048   fOutput->Add(fHistdEdxVSPtITSTPCsel);
1049   
1050   fHistTPCclsVSPtTPCInAcc = new TH2F("fHistTPCclsVSPtTPCInAcc","TPC ncls; p_{t} [GeV/c]; nclsTPC",50,0,10,80,0,160);
1051   fOutput->Add(fHistTPCclsVSPtTPCInAcc);
1052   fHistTPCclsVSPtITSMISPDInAcc = new TH2F("fHistTPCclsVSPtITSMISPDInAcc","TPC ncls; p_{t} [GeV/c]; nclsTPC",50,0,10,80,0,160);
1053   fOutput->Add(fHistTPCclsVSPtITSMISPDInAcc);
1054
1055   fHistPtVSphiTPCInAcc = new TH2F("fHistPtVSphiTPCInAcc","pt distribution of TPC tracks; phi; p_{t} [GeV/c]",18,0,6.28,20,0,0.5);
1056   fHistPtVSphiTPCInAcc->SetMinimum(0);
1057   fOutput->Add(fHistPtVSphiTPCInAcc);
1058   
1059   fHistPtTPCInAccNoTRDout = new TH1F("fHistPtTPCInAccNoTRDout","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1060   fHistPtTPCInAccNoTRDout->Sumw2();
1061   fHistPtTPCInAccNoTRDout->SetMinimum(0);
1062   fOutput->Add(fHistPtTPCInAccNoTRDout);
1063   
1064   fHistPtTPCInAccNoTOFout = new TH1F("fHistPtTPCInAccNoTOFout","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1065   fHistPtTPCInAccNoTOFout->Sumw2();
1066   fHistPtTPCInAccNoTOFout->SetMinimum(0);
1067   fOutput->Add(fHistPtTPCInAccNoTOFout);
1068   
1069   fHistPtTPCInAccWithPtTPCAtVtx = new TH1F("fHistPtTPCInAccWithPtTPCAtVtx","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1070   fHistPtTPCInAccWithPtTPCAtVtx->Sumw2();
1071   fHistPtTPCInAccWithPtTPCAtVtx->SetMinimum(0);
1072   fOutput->Add(fHistPtTPCInAccWithPtTPCAtVtx);
1073   
1074   fHistPtTPCInAccWithPtTPCAtInnerWall = new TH1F("fHistPtTPCInAccWithPtTPCAtInnerWall","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1075   fHistPtTPCInAccWithPtTPCAtInnerWall->Sumw2();
1076   fHistPtTPCInAccWithPtTPCAtInnerWall->SetMinimum(0);
1077   fOutput->Add(fHistPtTPCInAccWithPtTPCAtInnerWall);
1078   
1079   fHistDeltaPtTPC = new TH2F("fHistDeltaPtTPC","pt distribution of TPC tracks; p_{t} [GeV/c]; p_{t} TPC at vtx - p_{t} at inner wall [GeV/c]",100,0,1,50,-0.2,0.2);
1080   fHistDeltaPtTPC->SetMinimum(0);
1081   fOutput->Add(fHistDeltaPtTPC);
1082   
1083   fHistPtITSMI7InAcc = new TH1F("fHistPtITSMI7InAcc","pt distribution of ITSMI7 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1084   fHistPtITSMI7InAcc->Sumw2();
1085   fHistPtITSMI7InAcc->SetMinimum(0);
1086   fOutput->Add(fHistPtITSMI7InAcc);
1087   
1088   fHistPtITSMI6InAcc = new TH1F("fHistPtITSMI6InAcc","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1089   fHistPtITSMI6InAcc->Sumw2();
1090   fHistPtITSMI6InAcc->SetMinimum(0);
1091   fOutput->Add(fHistPtITSMI6InAcc);
1092   
1093   fHistPtITSMI5InAcc = new TH1F("fHistPtITSMI5InAcc","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1094   fHistPtITSMI5InAcc->Sumw2();
1095   fHistPtITSMI5InAcc->SetMinimum(0);
1096   fOutput->Add(fHistPtITSMI5InAcc);
1097   
1098   fHistPtITSMI4InAcc = new TH1F("fHistPtITSMI4InAcc","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1099   fHistPtITSMI4InAcc->Sumw2();
1100   fHistPtITSMI4InAcc->SetMinimum(0);
1101   fOutput->Add(fHistPtITSMI4InAcc);
1102   
1103   fHistPtITSMI3InAcc = new TH1F("fHistPtITSMI3InAcc","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1104   fHistPtITSMI3InAcc->Sumw2();
1105   fHistPtITSMI3InAcc->SetMinimum(0);
1106   fOutput->Add(fHistPtITSMI3InAcc);
1107   
1108   fHistPtITSMI2InAcc = new TH1F("fHistPtITSMI2InAcc","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1109   fHistPtITSMI2InAcc->Sumw2();
1110   fHistPtITSMI2InAcc->SetMinimum(0);
1111   fOutput->Add(fHistPtITSMI2InAcc);
1112   
1113   fHistPtITSMISPDInAcc = new TH1F("fHistPtITSMISPDInAcc","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1114   fHistPtITSMISPDInAcc->Sumw2();
1115   fHistPtITSMISPDInAcc->SetMinimum(0);
1116   fOutput->Add(fHistPtITSMISPDInAcc);
1117   
1118   fHistPtITSMIoneSPDInAcc = new TH1F("fHistPtITSMIoneSPDInAcc","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1119   fHistPtITSMIoneSPDInAcc->Sumw2();
1120   fHistPtITSMIoneSPDInAcc->SetMinimum(0);
1121   fOutput->Add(fHistPtITSMIoneSPDInAcc);
1122
1123   fHistPtITSMItwoSPDInAcc = new TH1F("fHistPtITSMItwoSPDInAcc","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1124   fHistPtITSMItwoSPDInAcc->Sumw2();
1125   fHistPtITSMItwoSPDInAcc->SetMinimum(0);
1126   fOutput->Add(fHistPtITSMItwoSPDInAcc);
1127
1128   fHistPtITSMI6InAccTOFbc0 = new TH1F("fHistPtITSMI6InAccTOFbc0","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1129   fHistPtITSMI6InAccTOFbc0->Sumw2();
1130   fHistPtITSMI6InAccTOFbc0->SetMinimum(0);
1131   fOutput->Add(fHistPtITSMI6InAccTOFbc0);
1132   
1133   fHistPtITSMI5InAccTOFbc0 = new TH1F("fHistPtITSMI5InAccTOFbc0","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1134   fHistPtITSMI5InAccTOFbc0->Sumw2();
1135   fHistPtITSMI5InAccTOFbc0->SetMinimum(0);
1136   fOutput->Add(fHistPtITSMI5InAccTOFbc0);
1137   
1138   fHistPtITSMI4InAccTOFbc0 = new TH1F("fHistPtITSMI4InAccTOFbc0","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1139   fHistPtITSMI4InAccTOFbc0->Sumw2();
1140   fHistPtITSMI4InAccTOFbc0->SetMinimum(0);
1141   fOutput->Add(fHistPtITSMI4InAccTOFbc0);
1142   
1143   fHistPtITSMI3InAccTOFbc0 = new TH1F("fHistPtITSMI3InAccTOFbc0","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1144   fHistPtITSMI3InAccTOFbc0->Sumw2();
1145   fHistPtITSMI3InAccTOFbc0->SetMinimum(0);
1146   fOutput->Add(fHistPtITSMI3InAccTOFbc0);
1147   
1148   fHistPtITSMI2InAccTOFbc0 = new TH1F("fHistPtITSMI2InAccTOFbc0","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1149   fHistPtITSMI2InAccTOFbc0->Sumw2();
1150   fHistPtITSMI2InAccTOFbc0->SetMinimum(0);
1151   fOutput->Add(fHistPtITSMI2InAccTOFbc0);
1152   
1153   fHistPtITSMISPDInAccTOFbc0 = new TH1F("fHistPtITSMISPDInAccTOFbc0","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1154   fHistPtITSMISPDInAccTOFbc0->Sumw2();
1155   fHistPtITSMISPDInAccTOFbc0->SetMinimum(0);
1156   fOutput->Add(fHistPtITSMISPDInAccTOFbc0);
1157   
1158   fHistPtITSMIoneSPDInAccTOFbc0 = new TH1F("fHistPtITSMIoneSPDInAccTOFbc0","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1159   fHistPtITSMIoneSPDInAccTOFbc0->Sumw2();
1160   fHistPtITSMIoneSPDInAccTOFbc0->SetMinimum(0);
1161   fOutput->Add(fHistPtITSMIoneSPDInAccTOFbc0);
1162
1163   fHistPtITSMI6InAccwSDD = new TH1F("fHistPtITSMI6InAccwSDD","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1164   fHistPtITSMI6InAccwSDD->Sumw2();
1165   fHistPtITSMI6InAccwSDD->SetMinimum(0);
1166   fOutput->Add(fHistPtITSMI6InAccwSDD);
1167   
1168   fHistPtITSMI5InAccwSDD = new TH1F("fHistPtITSMI5InAccwSDD","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1169   fHistPtITSMI5InAccwSDD->Sumw2();
1170   fHistPtITSMI5InAccwSDD->SetMinimum(0);
1171   fOutput->Add(fHistPtITSMI5InAccwSDD);
1172   
1173   fHistPtITSMI4InAccwSDD = new TH1F("fHistPtITSMI4InAccwSDD","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1174   fHistPtITSMI4InAccwSDD->Sumw2();
1175   fHistPtITSMI4InAccwSDD->SetMinimum(0);
1176   fOutput->Add(fHistPtITSMI4InAccwSDD);
1177   
1178   fHistPtITSMI3InAccwSDD = new TH1F("fHistPtITSMI3InAccwSDD","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1179   fHistPtITSMI3InAccwSDD->Sumw2();
1180   fHistPtITSMI3InAccwSDD->SetMinimum(0);
1181   fOutput->Add(fHistPtITSMI3InAccwSDD);
1182   
1183   fHistPtITSMI2InAccwSDD = new TH1F("fHistPtITSMI2InAccwSDD","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1184   fHistPtITSMI2InAccwSDD->Sumw2();
1185   fHistPtITSMI2InAccwSDD->SetMinimum(0);
1186   fOutput->Add(fHistPtITSMI2InAccwSDD);
1187   
1188   fHistPtITSMISPDInAccwSDD = new TH1F("fHistPtITSMISPDInAccwSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1189   fHistPtITSMISPDInAccwSDD->Sumw2();
1190   fHistPtITSMISPDInAccwSDD->SetMinimum(0);
1191   fOutput->Add(fHistPtITSMISPDInAccwSDD);
1192   
1193   fHistPtITSMIoneSPDInAccwSDD = new TH1F("fHistPtITSMIoneSPDInAccwSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1194   fHistPtITSMIoneSPDInAccwSDD->Sumw2();
1195   fHistPtITSMIoneSPDInAccwSDD->SetMinimum(0);
1196   fOutput->Add(fHistPtITSMIoneSPDInAccwSDD);
1197
1198   fHistPtITSMI6InAccTOFbc0wSDD = new TH1F("fHistPtITSMI6InAccTOFbc0wSDD","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1199   fHistPtITSMI6InAccTOFbc0wSDD->Sumw2();
1200   fHistPtITSMI6InAccTOFbc0wSDD->SetMinimum(0);
1201   fOutput->Add(fHistPtITSMI6InAccTOFbc0wSDD);
1202   
1203   fHistPtITSMI5InAccTOFbc0wSDD = new TH1F("fHistPtITSMI5InAccTOFbc0wSDD","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1204   fHistPtITSMI5InAccTOFbc0wSDD->Sumw2();
1205   fHistPtITSMI5InAccTOFbc0wSDD->SetMinimum(0);
1206   fOutput->Add(fHistPtITSMI5InAccTOFbc0wSDD);
1207   
1208   fHistPtITSMI4InAccTOFbc0wSDD = new TH1F("fHistPtITSMI4InAccTOFbc0wSDD","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1209   fHistPtITSMI4InAccTOFbc0wSDD->Sumw2();
1210   fHistPtITSMI4InAccTOFbc0wSDD->SetMinimum(0);
1211   fOutput->Add(fHistPtITSMI4InAccTOFbc0wSDD);
1212   
1213   fHistPtITSMI3InAccTOFbc0wSDD = new TH1F("fHistPtITSMI3InAccTOFbc0wSDD","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1214   fHistPtITSMI3InAccTOFbc0wSDD->Sumw2();
1215   fHistPtITSMI3InAccTOFbc0wSDD->SetMinimum(0);
1216   fOutput->Add(fHistPtITSMI3InAccTOFbc0wSDD);
1217   
1218   fHistPtITSMI2InAccTOFbc0wSDD = new TH1F("fHistPtITSMI2InAccTOFbc0wSDD","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1219   fHistPtITSMI2InAccTOFbc0wSDD->Sumw2();
1220   fHistPtITSMI2InAccTOFbc0wSDD->SetMinimum(0);
1221   fOutput->Add(fHistPtITSMI2InAccTOFbc0wSDD);
1222   
1223   fHistPtITSMISPDInAccTOFbc0wSDD = new TH1F("fHistPtITSMISPDInAccTOFbc0wSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1224   fHistPtITSMISPDInAccTOFbc0wSDD->Sumw2();
1225   fHistPtITSMISPDInAccTOFbc0wSDD->SetMinimum(0);
1226   fOutput->Add(fHistPtITSMISPDInAccTOFbc0wSDD);
1227   
1228   fHistPtITSMIoneSPDInAccTOFbc0wSDD = new TH1F("fHistPtITSMIoneSPDInAccTOFbc0wSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1229   fHistPtITSMIoneSPDInAccTOFbc0wSDD->Sumw2();
1230   fHistPtITSMIoneSPDInAccTOFbc0wSDD->SetMinimum(0);
1231   fOutput->Add(fHistPtITSMIoneSPDInAccTOFbc0wSDD);
1232
1233   fHistPtITSMI6InAccwoSDD = new TH1F("fHistPtITSMI6InAccwoSDD","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1234   fHistPtITSMI6InAccwoSDD->Sumw2();
1235   fHistPtITSMI6InAccwoSDD->SetMinimum(0);
1236   fOutput->Add(fHistPtITSMI6InAccwoSDD);
1237   
1238   fHistPtITSMI5InAccwoSDD = new TH1F("fHistPtITSMI5InAccwoSDD","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1239   fHistPtITSMI5InAccwoSDD->Sumw2();
1240   fHistPtITSMI5InAccwoSDD->SetMinimum(0);
1241   fOutput->Add(fHistPtITSMI5InAccwoSDD);
1242   
1243   fHistPtITSMI4InAccwoSDD = new TH1F("fHistPtITSMI4InAccwoSDD","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1244   fHistPtITSMI4InAccwoSDD->Sumw2();
1245   fHistPtITSMI4InAccwoSDD->SetMinimum(0);
1246   fOutput->Add(fHistPtITSMI4InAccwoSDD);
1247   
1248   fHistPtITSMI3InAccwoSDD = new TH1F("fHistPtITSMI3InAccwoSDD","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1249   fHistPtITSMI3InAccwoSDD->Sumw2();
1250   fHistPtITSMI3InAccwoSDD->SetMinimum(0);
1251   fOutput->Add(fHistPtITSMI3InAccwoSDD);
1252   
1253   fHistPtITSMI2InAccwoSDD = new TH1F("fHistPtITSMI2InAccwoSDD","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1254   fHistPtITSMI2InAccwoSDD->Sumw2();
1255   fHistPtITSMI2InAccwoSDD->SetMinimum(0);
1256   fOutput->Add(fHistPtITSMI2InAccwoSDD);
1257   
1258   fHistPtITSMISPDInAccwoSDD = new TH1F("fHistPtITSMISPDInAccwoSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1259   fHistPtITSMISPDInAccwoSDD->Sumw2();
1260   fHistPtITSMISPDInAccwoSDD->SetMinimum(0);
1261   fOutput->Add(fHistPtITSMISPDInAccwoSDD);
1262   
1263   fHistPtITSMIoneSPDInAccwoSDD = new TH1F("fHistPtITSMIoneSPDInAccwoSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1264   fHistPtITSMIoneSPDInAccwoSDD->Sumw2();
1265   fHistPtITSMIoneSPDInAccwoSDD->SetMinimum(0);
1266   fOutput->Add(fHistPtITSMIoneSPDInAccwoSDD);
1267
1268   fHistPtITSMI6InAccTOFbc0woSDD = new TH1F("fHistPtITSMI6InAccTOFbc0woSDD","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1269   fHistPtITSMI6InAccTOFbc0woSDD->Sumw2();
1270   fHistPtITSMI6InAccTOFbc0woSDD->SetMinimum(0);
1271   fOutput->Add(fHistPtITSMI6InAccTOFbc0woSDD);
1272   
1273   fHistPtITSMI5InAccTOFbc0woSDD = new TH1F("fHistPtITSMI5InAccTOFbc0woSDD","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1274   fHistPtITSMI5InAccTOFbc0woSDD->Sumw2();
1275   fHistPtITSMI5InAccTOFbc0woSDD->SetMinimum(0);
1276   fOutput->Add(fHistPtITSMI5InAccTOFbc0woSDD);
1277   
1278   fHistPtITSMI4InAccTOFbc0woSDD = new TH1F("fHistPtITSMI4InAccTOFbc0woSDD","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1279   fHistPtITSMI4InAccTOFbc0woSDD->Sumw2();
1280   fHistPtITSMI4InAccTOFbc0woSDD->SetMinimum(0);
1281   fOutput->Add(fHistPtITSMI4InAccTOFbc0woSDD);
1282   
1283   fHistPtITSMI3InAccTOFbc0woSDD = new TH1F("fHistPtITSMI3InAccTOFbc0woSDD","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1284   fHistPtITSMI3InAccTOFbc0woSDD->Sumw2();
1285   fHistPtITSMI3InAccTOFbc0woSDD->SetMinimum(0);
1286   fOutput->Add(fHistPtITSMI3InAccTOFbc0woSDD);
1287   
1288   fHistPtITSMI2InAccTOFbc0woSDD = new TH1F("fHistPtITSMI2InAccTOFbc0woSDD","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1289   fHistPtITSMI2InAccTOFbc0woSDD->Sumw2();
1290   fHistPtITSMI2InAccTOFbc0woSDD->SetMinimum(0);
1291   fOutput->Add(fHistPtITSMI2InAccTOFbc0woSDD);
1292   
1293   fHistPtITSMISPDInAccTOFbc0woSDD = new TH1F("fHistPtITSMISPDInAccTOFbc0woSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1294   fHistPtITSMISPDInAccTOFbc0woSDD->Sumw2();
1295   fHistPtITSMISPDInAccTOFbc0woSDD->SetMinimum(0);
1296   fOutput->Add(fHistPtITSMISPDInAccTOFbc0woSDD);
1297   
1298   fHistPtITSMIoneSPDInAccTOFbc0woSDD = new TH1F("fHistPtITSMIoneSPDInAccTOFbc0woSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1299   fHistPtITSMIoneSPDInAccTOFbc0woSDD->Sumw2();
1300   fHistPtITSMIoneSPDInAccTOFbc0woSDD->SetMinimum(0);
1301   fOutput->Add(fHistPtITSMIoneSPDInAccTOFbc0woSDD);
1302
1303   fHistPtITSMIoneSPDInAccShared = new TH1F("fHistPtITSMIoneSPDInAccShared","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1304   fHistPtITSMIoneSPDInAccShared->Sumw2();
1305   fHistPtITSMIoneSPDInAccShared->SetMinimum(0);
1306   fOutput->Add(fHistPtITSMIoneSPDInAccShared);
1307
1308   fHistPtITSMIoneSPDInAccSharedSPD = new TH1F("fHistPtITSMIoneSPDInAccSharedSPD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1309   fHistPtITSMIoneSPDInAccSharedSPD->Sumw2();
1310   fHistPtITSMIoneSPDInAccSharedSPD->SetMinimum(0);
1311   fOutput->Add(fHistPtITSMIoneSPDInAccSharedSPD);
1312
1313   fHistPtITSMISPD1InAccShared = new TH1F("fHistPtITSMISPD1InAccShared","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1314   fHistPtITSMISPD1InAccShared->Sumw2();
1315   fHistPtITSMISPD1InAccShared->SetMinimum(0);
1316   fOutput->Add(fHistPtITSMISPD1InAccShared);
1317
1318   fHistPtITSMISPD2InAccShared = new TH1F("fHistPtITSMISPD2InAccShared","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1319   fHistPtITSMISPD2InAccShared->Sumw2();
1320   fHistPtITSMISPD2InAccShared->SetMinimum(0);
1321   fOutput->Add(fHistPtITSMISPD2InAccShared);
1322
1323   fHistPtITSMIoneSPDInAccSharedFake = new TH1F("fHistPtITSMIoneSPDInAccSharedFake","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1324   fHistPtITSMIoneSPDInAccSharedFake->Sumw2();
1325   fHistPtITSMIoneSPDInAccSharedFake->SetMinimum(0);
1326   fOutput->Add(fHistPtITSMIoneSPDInAccSharedFake);
1327
1328   fHistPtITSMIoneSPDInAccSharedSPDFake = new TH1F("fHistPtITSMIoneSPDInAccSharedSPDFake","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1329   fHistPtITSMIoneSPDInAccSharedSPDFake->Sumw2();
1330   fHistPtITSMIoneSPDInAccSharedSPDFake->SetMinimum(0);
1331   fOutput->Add(fHistPtITSMIoneSPDInAccSharedSPDFake);
1332
1333   fHistPhiITSMI7InAcc = new TH1F("fHistPhiITSMI7InAcc","phi distribution of ITSMI7 tracks; #phi; N tracks",100,0,2*3.1415);
1334   fHistPhiITSMI7InAcc->Sumw2();
1335   fHistPhiITSMI7InAcc->SetMinimum(0);
1336   fOutput->Add(fHistPhiITSMI7InAcc);
1337
1338   fHistPhiITSMI6InAcc = new TH1F("fHistPhiITSMI6InAcc","phi distribution of ITSMI6 tracks; #phi; N tracks",100,0,2*3.1415);
1339   fHistPhiITSMI6InAcc->Sumw2();
1340   fHistPhiITSMI6InAcc->SetMinimum(0);
1341   fOutput->Add(fHistPhiITSMI6InAcc);
1342   
1343   fHistPhiITSMI5InAcc = new TH1F("fHistPhiITSMI5InAcc","phi distribution of ITSMI5 tracks; #phi; N tracks",100,0,2*3.1415);
1344   fHistPhiITSMI5InAcc->Sumw2();
1345   fHistPhiITSMI5InAcc->SetMinimum(0);
1346   fOutput->Add(fHistPhiITSMI5InAcc);
1347   
1348   fHistPhiITSMI4InAcc = new TH1F("fHistPhiITSMI4InAcc","phi distribution of ITSMI4 tracks; #phi; N tracks",100,0,2*3.1415);
1349   fHistPhiITSMI4InAcc->Sumw2();
1350   fHistPhiITSMI4InAcc->SetMinimum(0);
1351   fOutput->Add(fHistPhiITSMI4InAcc);
1352   
1353   fHistPhiITSMI3InAcc = new TH1F("fHistPhiITSMI3InAcc","phi distribution of ITSMI3 tracks; #phi; N tracks",100,0,2*3.1415);
1354   fHistPhiITSMI3InAcc->Sumw2();
1355   fHistPhiITSMI3InAcc->SetMinimum(0);
1356   fOutput->Add(fHistPhiITSMI3InAcc);
1357   
1358   fHistPhiITSMI2InAcc = new TH1F("fHistPhiITSMI2InAcc","phi distribution of ITSMI2 tracks; #phi; N tracks",100,0,2*3.1415);
1359   fHistPhiITSMI2InAcc->Sumw2();
1360   fHistPhiITSMI2InAcc->SetMinimum(0);
1361   fOutput->Add(fHistPhiITSMI2InAcc);
1362   
1363   fHistPhiITSMISPDInAcc = new TH1F("fHistPhiITSMISPDInAcc","phi distribution of ITSMISPD tracks; #phi; N tracks",100,0,2*3.1415);
1364   fHistPhiITSMISPDInAcc->Sumw2();
1365   fHistPhiITSMISPDInAcc->SetMinimum(0);
1366   fOutput->Add(fHistPhiITSMISPDInAcc);
1367   
1368   fHistPhiITSMIoneSPDInAcc = new TH1F("fHistPhiITSMIoneSPDInAcc","phi distribution of ITSMISPD tracks; #phi; N tracks",100,0,2*3.1415);
1369   fHistPhiITSMIoneSPDInAcc->Sumw2();
1370   fHistPhiITSMIoneSPDInAcc->SetMinimum(0);
1371   fOutput->Add(fHistPhiITSMIoneSPDInAcc);
1372
1373   fHistPhiITSMItwoSPDInAcc = new TH1F("fHistPhiITSMItwoSPDInAcc","phi distribution of ITSMISPD tracks; #phi; N tracks",100,0,2*3.1415);
1374   fHistPhiITSMItwoSPDInAcc->Sumw2();
1375   fHistPhiITSMItwoSPDInAcc->SetMinimum(0);
1376   fOutput->Add(fHistPhiITSMItwoSPDInAcc);
1377
1378   fHistEtaITSMI6InAcc = new TH1F("fHistEtaITSMI6InAcc","eta distribution of ITSMI6 tracks; #eta; N tracks",100,-1.5,+1.5);
1379   fHistEtaITSMI6InAcc->Sumw2();
1380   fHistEtaITSMI6InAcc->SetMinimum(0);
1381   fOutput->Add(fHistEtaITSMI6InAcc);
1382
1383   fHistEtaITSMI7InAcc = new TH1F("fHistEtaITSMI7InAcc","eta distribution of ITSMI7 tracks; #eta; N tracks",100,-1.5,+1.5);
1384   fHistEtaITSMI7InAcc->Sumw2();
1385   fHistEtaITSMI7InAcc->SetMinimum(0);
1386   fOutput->Add(fHistEtaITSMI7InAcc);
1387   
1388   fHistEtaITSMI5InAcc = new TH1F("fHistEtaITSMI5InAcc","eta distribution of ITSMI5 tracks; #eta; N tracks",100,-1.5,+1.5);
1389   fHistEtaITSMI5InAcc->Sumw2();
1390   fHistEtaITSMI5InAcc->SetMinimum(0);
1391   fOutput->Add(fHistEtaITSMI5InAcc);
1392   
1393   fHistEtaITSMI4InAcc = new TH1F("fHistEtaITSMI4InAcc","eta distribution of ITSMI4 tracks; #eta; N tracks",100,-1.5,+1.5);
1394   fHistEtaITSMI4InAcc->Sumw2();
1395   fHistEtaITSMI4InAcc->SetMinimum(0);
1396   fOutput->Add(fHistEtaITSMI4InAcc);
1397   
1398   fHistEtaITSMI3InAcc = new TH1F("fHistEtaITSMI3InAcc","eta distribution of ITSMI3 tracks; #eta; N tracks",100,-1.5,+1.5);
1399   fHistEtaITSMI3InAcc->Sumw2();
1400   fHistEtaITSMI3InAcc->SetMinimum(0);
1401   fOutput->Add(fHistEtaITSMI3InAcc);
1402   
1403   fHistEtaITSMI2InAcc = new TH1F("fHistEtaITSMI2InAcc","eta distribution of ITSMI2 tracks; #eta; N tracks",100,-1.5,+1.5);
1404   fHistEtaITSMI2InAcc->Sumw2();
1405   fHistEtaITSMI2InAcc->SetMinimum(0);
1406   fOutput->Add(fHistEtaITSMI2InAcc);
1407   
1408   fHistEtaITSMISPDInAcc = new TH1F("fHistEtaITSMISPDInAcc","eta distribution of ITSMISPD tracks; #eta; N tracks",100,-1.5,+1.5);
1409   fHistEtaITSMISPDInAcc->Sumw2();
1410   fHistEtaITSMISPDInAcc->SetMinimum(0);
1411   fOutput->Add(fHistEtaITSMISPDInAcc);
1412   
1413   fHistEtaITSMIoneSPDInAcc = new TH1F("fHistEtaITSMIoneSPDInAcc","eta distribution of ITSMISPD tracks; #eta; N tracks",100,-1.5,+1.5);
1414   fHistEtaITSMIoneSPDInAcc->Sumw2();
1415   fHistEtaITSMIoneSPDInAcc->SetMinimum(0);
1416   fOutput->Add(fHistEtaITSMIoneSPDInAcc);
1417
1418   fHistEtaITSMItwoSPDInAcc = new TH1F("fHistEtaITSMItwoSPDInAcc","eta distribution of ITSMISPD tracks; #eta; N tracks",100,-1.5,+1.5);
1419   fHistEtaITSMItwoSPDInAcc->Sumw2();
1420   fHistEtaITSMItwoSPDInAcc->SetMinimum(0);
1421   fOutput->Add(fHistEtaITSMItwoSPDInAcc);
1422
1423
1424   fHistPtITSMI7InAccFake = new TH1F("fHistPtITSMI7InAccFake","pt distribution of ITSMI7 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1425   fHistPtITSMI7InAccFake->Sumw2();
1426   fHistPtITSMI7InAccFake->SetMinimum(0);
1427   fOutput->Add(fHistPtITSMI7InAccFake);
1428   
1429   fHistPtITSMI6InAccFake = new TH1F("fHistPtITSMI6InAccFake","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1430   fHistPtITSMI6InAccFake->Sumw2();
1431   fHistPtITSMI6InAccFake->SetMinimum(0);
1432   fOutput->Add(fHistPtITSMI6InAccFake);
1433   
1434   fHistPtITSMI5InAccFake = new TH1F("fHistPtITSMI5InAccFake","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1435   fHistPtITSMI5InAccFake->Sumw2();
1436   fHistPtITSMI5InAccFake->SetMinimum(0);
1437   fOutput->Add(fHistPtITSMI5InAccFake);
1438   
1439   fHistPtITSMI4InAccFake = new TH1F("fHistPtITSMI4InAccFake","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1440   fHistPtITSMI4InAccFake->Sumw2();
1441   fHistPtITSMI4InAccFake->SetMinimum(0);
1442   fOutput->Add(fHistPtITSMI4InAccFake);
1443   
1444   fHistPtITSMI3InAccFake = new TH1F("fHistPtITSMI3InAccFake","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1445   fHistPtITSMI3InAccFake->Sumw2();
1446   fHistPtITSMI3InAccFake->SetMinimum(0);
1447   fOutput->Add(fHistPtITSMI3InAccFake);
1448   
1449   fHistPtITSMI2InAccFake = new TH1F("fHistPtITSMI2InAccFake","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1450   fHistPtITSMI2InAccFake->Sumw2();
1451   fHistPtITSMI2InAccFake->SetMinimum(0);
1452   fOutput->Add(fHistPtITSMI2InAccFake);
1453   
1454   fHistPtITSMISPDInAccFake = new TH1F("fHistPtITSMISPDInAccFake","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1455   fHistPtITSMISPDInAccFake->Sumw2();
1456   fHistPtITSMISPDInAccFake->SetMinimum(0);
1457   fOutput->Add(fHistPtITSMISPDInAccFake);
1458   
1459   fHistPtITSMIoneSPDInAccFake = new TH1F("fHistPtITSMIoneSPDInAccFake","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1460   fHistPtITSMIoneSPDInAccFake->Sumw2();
1461   fHistPtITSMIoneSPDInAccFake->SetMinimum(0);
1462   fOutput->Add(fHistPtITSMIoneSPDInAccFake);
1463
1464   fHistPtITSMItwoSPDInAccFake = new TH1F("fHistPtITSMItwoSPDInAccFake","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1465   fHistPtITSMItwoSPDInAccFake->Sumw2();
1466   fHistPtITSMItwoSPDInAccFake->SetMinimum(0);
1467   fOutput->Add(fHistPtITSMItwoSPDInAccFake);
1468
1469   fHistPtITSMIoneSPDthreeSDDSSDInAcc = new TH1F("fHistPtITSMIoneSPDthreeSDDSSDInAcc","pt distribution of ITSMI tracks (>0 in SPD, >2 in SDD+SSD); p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1470   fHistPtITSMIoneSPDthreeSDDSSDInAcc->Sumw2();
1471   fHistPtITSMIoneSPDthreeSDDSSDInAcc->SetMinimum(0);
1472   fOutput->Add(fHistPtITSMIoneSPDthreeSDDSSDInAcc);
1473
1474   fHistPtITSTPCsel = new TH1F("fHistPtITSTPCsel","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1475   fHistPtITSTPCsel->Sumw2();
1476   fHistPtITSTPCsel->SetMinimum(0);
1477   fOutput->Add(fHistPtITSTPCsel);
1478
1479   fHistPtITSTPCselTOFbc0 = new TH1F("fHistPtITSTPCselTOFbc0","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1480   fHistPtITSTPCselTOFbc0->Sumw2();
1481   fHistPtITSTPCselTOFbc0->SetMinimum(0);
1482   fOutput->Add(fHistPtITSTPCselTOFbc0);
1483
1484   fHistPtITSTPCselwSDD = new TH1F("fHistPtITSTPCselwSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1485   fHistPtITSTPCselwSDD->Sumw2();
1486   fHistPtITSTPCselwSDD->SetMinimum(0);
1487   fOutput->Add(fHistPtITSTPCselwSDD);
1488
1489   fHistPtITSTPCselTOFbc0wSDD = new TH1F("fHistPtITSTPCselTOFbc0wSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1490   fHistPtITSTPCselTOFbc0wSDD->Sumw2();
1491   fHistPtITSTPCselTOFbc0wSDD->SetMinimum(0);
1492   fOutput->Add(fHistPtITSTPCselTOFbc0wSDD);
1493
1494   fHistPtITSTPCselwoSDD = new TH1F("fHistPtITSTPCselwoSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1495   fHistPtITSTPCselwoSDD->Sumw2();
1496   fHistPtITSTPCselwoSDD->SetMinimum(0);
1497   fOutput->Add(fHistPtITSTPCselwoSDD);
1498
1499   fHistPtITSTPCselTOFbc0woSDD = new TH1F("fHistPtITSTPCselTOFbc0woSDD","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1500   fHistPtITSTPCselTOFbc0woSDD->Sumw2();
1501   fHistPtITSTPCselTOFbc0woSDD->SetMinimum(0);
1502   fOutput->Add(fHistPtITSTPCselTOFbc0woSDD);
1503
1504   fHistPtITSTPCselP = new TH1F("fHistPtITSTPCselP","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1505   fHistPtITSTPCselP->Sumw2();
1506   fHistPtITSTPCselP->SetMinimum(0);
1507   fOutput->Add(fHistPtITSTPCselP);
1508
1509   fHistPtITSTPCselS = new TH1F("fHistPtITSTPCselS","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1510   fHistPtITSTPCselS->Sumw2();
1511   fHistPtITSTPCselS->SetMinimum(0);
1512   fOutput->Add(fHistPtITSTPCselS);
1513
1514   fHistPtITSTPCselFake = new TH1F("fHistPtITSTPCselFake","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1515   fHistPtITSTPCselFake->Sumw2();
1516   fHistPtITSTPCselFake->SetMinimum(0);
1517   fOutput->Add(fHistPtITSTPCselFake);
1518
1519   fHistPtITSTPCselSfromStrange = new TH1F("fHistPtITSTPCselSfromStrange","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1520   fHistPtITSTPCselSfromStrange->Sumw2();
1521   fHistPtITSTPCselSfromStrange->SetMinimum(0);
1522   fOutput->Add(fHistPtITSTPCselSfromStrange);
1523
1524   fHistPtITSTPCselPfromStrange = new TH1F("fHistPtITSTPCselPfromStrange","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1525   fHistPtITSTPCselPfromStrange->Sumw2();
1526   fHistPtITSTPCselPfromStrange->SetMinimum(0);
1527   fOutput->Add(fHistPtITSTPCselPfromStrange);
1528
1529   fHistPtITSTPCselSfromMat = new TH1F("fHistPtITSTPCselSfromMat","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1530   fHistPtITSTPCselSfromMat->Sumw2();
1531   fHistPtITSTPCselSfromMat->SetMinimum(0);
1532   fOutput->Add(fHistPtITSTPCselSfromMat);
1533
1534   fHistPtTPCInAccP = new TH1F("fHistPtTPCInAccP","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1535   fHistPtTPCInAccP->Sumw2();
1536   fHistPtTPCInAccP->SetMinimum(0);
1537   fOutput->Add(fHistPtTPCInAccP);
1538
1539   fHistPtTPCInAccPfromStrange = new TH1F("fHistPtTPCInAccPfromStrange","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1540   fHistPtTPCInAccPfromStrange->Sumw2();
1541   fHistPtTPCInAccPfromStrange->SetMinimum(0);
1542   fOutput->Add(fHistPtTPCInAccPfromStrange);
1543   
1544   fHistPtITSMI7InAccP = new TH1F("fHistPtITSMI7InAccP","pt distribution of ITSMI7 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1545   fHistPtITSMI7InAccP->Sumw2();
1546   fHistPtITSMI7InAccP->SetMinimum(0);
1547   fOutput->Add(fHistPtITSMI7InAccP);
1548   
1549   fHistPtITSMI6InAccP = new TH1F("fHistPtITSMI6InAccP","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1550   fHistPtITSMI6InAccP->Sumw2();
1551   fHistPtITSMI6InAccP->SetMinimum(0);
1552   fOutput->Add(fHistPtITSMI6InAccP);
1553   
1554   fHistPtITSMI5InAccP = new TH1F("fHistPtITSMI5InAccP","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1555   fHistPtITSMI5InAccP->Sumw2();
1556   fHistPtITSMI5InAccP->SetMinimum(0);
1557   fOutput->Add(fHistPtITSMI5InAccP);
1558   
1559   fHistPtITSMI4InAccP = new TH1F("fHistPtITSMI4InAccP","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1560   fHistPtITSMI4InAccP->Sumw2();
1561   fHistPtITSMI4InAccP->SetMinimum(0);
1562   fOutput->Add(fHistPtITSMI4InAccP);
1563   
1564   fHistPtITSMI3InAccP = new TH1F("fHistPtITSMI3InAccP","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1565   fHistPtITSMI3InAccP->Sumw2();
1566   fHistPtITSMI3InAccP->SetMinimum(0);
1567   fOutput->Add(fHistPtITSMI3InAccP);
1568   
1569   fHistPtITSMI2InAccP = new TH1F("fHistPtITSMI2InAccP","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1570   fHistPtITSMI2InAccP->Sumw2();
1571   fHistPtITSMI2InAccP->SetMinimum(0);
1572   fOutput->Add(fHistPtITSMI2InAccP);
1573   
1574   fHistPtITSMISPDInAccP = new TH1F("fHistPtITSMISPDInAccP","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1575   fHistPtITSMISPDInAccP->Sumw2();
1576   fHistPtITSMISPDInAccP->SetMinimum(0);
1577   fOutput->Add(fHistPtITSMISPDInAccP);
1578   
1579   fHistPtITSMIoneSPDInAccP = new TH1F("fHistPtITSMIoneSPDInAccP","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1580   fHistPtITSMIoneSPDInAccP->Sumw2();
1581   fHistPtITSMIoneSPDInAccP->SetMinimum(0);
1582   fOutput->Add(fHistPtITSMIoneSPDInAccP);
1583
1584   fHistPtITSMItwoSPDInAccP = new TH1F("fHistPtITSMItwoSPDInAccP","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1585   fHistPtITSMItwoSPDInAccP->Sumw2();
1586   fHistPtITSMItwoSPDInAccP->SetMinimum(0);
1587   fOutput->Add(fHistPtITSMItwoSPDInAccP);
1588
1589   fHistPtTPCInAccS = new TH1F("fHistPtTPCInAccS","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1590   fHistPtTPCInAccS->Sumw2();
1591   fHistPtTPCInAccS->SetMinimum(0);
1592   fOutput->Add(fHistPtTPCInAccS);
1593   
1594   fHistPtTPCInAccSfromStrange = new TH1F("fHistPtTPCInAccSfromStrange","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1595   fHistPtTPCInAccSfromStrange->Sumw2();
1596   fHistPtTPCInAccSfromStrange->SetMinimum(0);
1597   fOutput->Add(fHistPtTPCInAccSfromStrange);
1598   
1599   fHistPtTPCInAccSfromMat = new TH1F("fHistPtTPCInAccSfromMat","pt distribution of TPC tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1600   fHistPtTPCInAccSfromMat->Sumw2();
1601   fHistPtTPCInAccSfromMat->SetMinimum(0);
1602   fOutput->Add(fHistPtTPCInAccSfromMat);
1603   
1604   fHistPtITSMI7InAccS = new TH1F("fHistPtITSMI7InAccS","pt distribution of ITSMI7 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1605   fHistPtITSMI7InAccS->Sumw2();
1606   fHistPtITSMI7InAccS->SetMinimum(0);
1607   fOutput->Add(fHistPtITSMI7InAccS);
1608   
1609   fHistPtITSMI6InAccS = new TH1F("fHistPtITSMI6InAccS","pt distribution of ITSMI6 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1610   fHistPtITSMI6InAccS->Sumw2();
1611   fHistPtITSMI6InAccS->SetMinimum(0);
1612   fOutput->Add(fHistPtITSMI6InAccS);
1613   
1614   fHistPtITSMI5InAccS = new TH1F("fHistPtITSMI5InAccS","pt distribution of ITSMI5 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1615   fHistPtITSMI5InAccS->Sumw2();
1616   fHistPtITSMI5InAccS->SetMinimum(0);
1617   fOutput->Add(fHistPtITSMI5InAccS);
1618   
1619   fHistPtITSMI4InAccS = new TH1F("fHistPtITSMI4InAccS","pt distribution of ITSMI4 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1620   fHistPtITSMI4InAccS->Sumw2();
1621   fHistPtITSMI4InAccS->SetMinimum(0);
1622   fOutput->Add(fHistPtITSMI4InAccS);
1623   
1624   fHistPtITSMI3InAccS = new TH1F("fHistPtITSMI3InAccS","pt distribution of ITSMI3 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1625   fHistPtITSMI3InAccS->Sumw2();
1626   fHistPtITSMI3InAccS->SetMinimum(0);
1627   fOutput->Add(fHistPtITSMI3InAccS);
1628   
1629   fHistPtITSMI2InAccS = new TH1F("fHistPtITSMI2InAccS","pt distribution of ITSMI2 tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1630   fHistPtITSMI2InAccS->Sumw2();
1631   fHistPtITSMI2InAccS->SetMinimum(0);
1632   fOutput->Add(fHistPtITSMI2InAccS);
1633   
1634   fHistPtITSMISPDInAccS = new TH1F("fHistPtITSMISPDInAccS","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1635   fHistPtITSMISPDInAccS->Sumw2();
1636   fHistPtITSMISPDInAccS->SetMinimum(0);
1637   fOutput->Add(fHistPtITSMISPDInAccS);
1638   
1639   fHistPtITSMIoneSPDInAccS = new TH1F("fHistPtITSMIoneSPDInAccS","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1640   fHistPtITSMIoneSPDInAccS->Sumw2();
1641   fHistPtITSMIoneSPDInAccS->SetMinimum(0);
1642   fOutput->Add(fHistPtITSMIoneSPDInAccS);
1643
1644   fHistPtITSMItwoSPDInAccS = new TH1F("fHistPtITSMItwoSPDInAccS","pt distribution of ITSMISPD tracks; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1645   fHistPtITSMItwoSPDInAccS->Sumw2();
1646   fHistPtITSMItwoSPDInAccS->SetMinimum(0);
1647   fOutput->Add(fHistPtITSMItwoSPDInAccS);
1648   
1649   fHistPtITSMIokbadoutinz6 = new TH1F("fHistPtITSMIokbadoutinz6","pt distribution of ITSMI tracks with 6 layers OK; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1650   fHistPtITSMIokbadoutinz6->Sumw2();
1651   fHistPtITSMIokbadoutinz6->SetMinimum(0);
1652   fOutput->Add(fHistPtITSMIokbadoutinz6);
1653
1654   fHistPtITSMIokbadoutinz4InAcc = new TH1F("fHistPtITSMIokbadoutinz4InAcc","pt distribution of ITSMI tracks with 4 layers OK; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1655   fHistPtITSMIokbadoutinz4InAcc->Sumw2();
1656   fHistPtITSMIokbadoutinz4InAcc->SetMinimum(0);
1657   fOutput->Add(fHistPtITSMIokbadoutinz4InAcc);
1658
1659   fHistPtITSMIokbadoutinz5InAcc = new TH1F("fHistPtITSMIokbadoutinz5InAcc","pt distribution of ITSMI tracks with 5 layers OK; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1660   fHistPtITSMIokbadoutinz5InAcc->Sumw2();
1661   fHistPtITSMIokbadoutinz5InAcc->SetMinimum(0);
1662   fOutput->Add(fHistPtITSMIokbadoutinz5InAcc);
1663
1664   fHistPtITSMIokbadoutinz6InAcc = new TH1F("fHistPtITSMIokbadoutinz6InAcc","pt distribution of ITSMI tracks with 6 layers OK; p_{t} [GeV/c]; N tracks",nPtBins,xPtBins);
1665   fHistPtITSMIokbadoutinz6InAcc->Sumw2();
1666   fHistPtITSMIokbadoutinz6InAcc->SetMinimum(0);
1667   fOutput->Add(fHistPtITSMIokbadoutinz6InAcc);
1668
1669   fHistRProdVtxInAccP = new TH1F("fHistRProdVtxInAccP","Radius of production vertex for primaries; r [cm]; N tracks",100,0,10);
1670   fHistRProdVtxInAccP->Sumw2();
1671   fHistRProdVtxInAccP->SetMinimum(0);
1672   fOutput->Add(fHistRProdVtxInAccP);
1673
1674   fHistRProdVtxInAccS = new TH1F("fHistRProdVtxInAccS","Radius of production vertex for secondaries; r [cm]; N tracks",100,0,10);
1675   fHistRProdVtxInAccS->Sumw2();
1676   fHistRProdVtxInAccS->SetMinimum(0);
1677   fOutput->Add(fHistRProdVtxInAccS);
1678   
1679
1680   fHistd0rphiTPCInAccP150200 = new TH1F("fHistd0rphiTPCInAccP150200","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-5,5);
1681   fHistd0rphiTPCInAccP150200->Sumw2();
1682   fHistd0rphiTPCInAccP150200->SetMinimum(0);
1683   fOutput->Add(fHistd0rphiTPCInAccP150200);
1684
1685   fHistd0rphiTPCInAccP500700 = new TH1F("fHistd0rphiTPCInAccP500700","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-5,5);
1686   fHistd0rphiTPCInAccP500700->Sumw2();
1687   fHistd0rphiTPCInAccP500700->SetMinimum(0);
1688   fOutput->Add(fHistd0rphiTPCInAccP500700);
1689
1690   fHistd0rphiTPCInAccP10001500 = new TH1F("fHistd0rphiTPCInAccP10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-5,5);
1691   fHistd0rphiTPCInAccP10001500->Sumw2();
1692   fHistd0rphiTPCInAccP10001500->SetMinimum(0);
1693   fOutput->Add(fHistd0rphiTPCInAccP10001500);
1694
1695   fHistd0rphiTPCInAccS150200 = new TH1F("fHistd0rphiTPCInAccS150200","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-5,5);
1696   fHistd0rphiTPCInAccS150200->Sumw2();
1697   fHistd0rphiTPCInAccS150200->SetMinimum(0);
1698   fOutput->Add(fHistd0rphiTPCInAccS150200);
1699
1700   fHistd0rphiTPCInAccS500700 = new TH1F("fHistd0rphiTPCInAccS500700","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-5,5);
1701   fHistd0rphiTPCInAccS500700->Sumw2();
1702   fHistd0rphiTPCInAccS500700->SetMinimum(0);
1703   fOutput->Add(fHistd0rphiTPCInAccS500700);
1704
1705   fHistd0rphiTPCInAccS10001500 = new TH1F("fHistd0rphiTPCInAccS10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-5,5);
1706   fHistd0rphiTPCInAccS10001500->Sumw2();
1707   fHistd0rphiTPCInAccS10001500->SetMinimum(0);
1708   fOutput->Add(fHistd0rphiTPCInAccS10001500);
1709
1710   fHistd0rphiITSMISPDInAccP150200 = new TH1F("fHistd0rphiITSMISPDInAccP150200","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1711   fHistd0rphiITSMISPDInAccP150200->Sumw2();
1712   fHistd0rphiITSMISPDInAccP150200->SetMinimum(0);
1713   fOutput->Add(fHistd0rphiITSMISPDInAccP150200);
1714
1715   fHistd0rphiITSMISPDInAccP500700 = new TH1F("fHistd0rphiITSMISPDInAccP500700","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1716   fHistd0rphiITSMISPDInAccP500700->Sumw2();
1717   fHistd0rphiITSMISPDInAccP500700->SetMinimum(0);
1718   fOutput->Add(fHistd0rphiITSMISPDInAccP500700);
1719
1720   fHistd0rphiITSMISPDInAccP10001500 = new TH1F("fHistd0rphiITSMISPDInAccP10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1721   fHistd0rphiITSMISPDInAccP10001500->Sumw2();
1722   fHistd0rphiITSMISPDInAccP10001500->SetMinimum(0);
1723   fOutput->Add(fHistd0rphiITSMISPDInAccP10001500);
1724
1725   fHistd0rphiITSMISPDInAccS150200 = new TH1F("fHistd0rphiITSMISPDInAccS150200","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1726   fHistd0rphiITSMISPDInAccS150200->Sumw2();
1727   fHistd0rphiITSMISPDInAccS150200->SetMinimum(0);
1728   fOutput->Add(fHistd0rphiITSMISPDInAccS150200);
1729
1730   fHistd0rphiITSMISPDInAccS500700 = new TH1F("fHistd0rphiITSMISPDInAccS500700","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1731   fHistd0rphiITSMISPDInAccS500700->Sumw2();
1732   fHistd0rphiITSMISPDInAccS500700->SetMinimum(0);
1733   fOutput->Add(fHistd0rphiITSMISPDInAccS500700);
1734
1735   fHistd0rphiITSMISPDInAccS10001500 = new TH1F("fHistd0rphiITSMISPDInAccS10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1736   fHistd0rphiITSMISPDInAccS10001500->Sumw2();
1737   fHistd0rphiITSMISPDInAccS10001500->SetMinimum(0);
1738   fOutput->Add(fHistd0rphiITSMISPDInAccS10001500);
1739
1740   fHistd0rphiITSMIoneSPDInAccP150200 = new TH1F("fHistd0rphiITSMIoneSPDInAccP150200","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1741   fHistd0rphiITSMIoneSPDInAccP150200->Sumw2();
1742   fHistd0rphiITSMIoneSPDInAccP150200->SetMinimum(0);
1743   fOutput->Add(fHistd0rphiITSMIoneSPDInAccP150200);
1744
1745   fHistd0rphiITSMIoneSPDInAccP350450 = new TH1F("fHistd0rphiITSMIoneSPDInAccP350450","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1746   fHistd0rphiITSMIoneSPDInAccP350450->Sumw2();
1747   fHistd0rphiITSMIoneSPDInAccP350450->SetMinimum(0);
1748   fOutput->Add(fHistd0rphiITSMIoneSPDInAccP350450);
1749
1750   fHistd0rphiITSMIoneSPDInAccP500700 = new TH1F("fHistd0rphiITSMIoneSPDInAccP500700","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1751   fHistd0rphiITSMIoneSPDInAccP500700->Sumw2();
1752   fHistd0rphiITSMIoneSPDInAccP500700->SetMinimum(0);
1753   fOutput->Add(fHistd0rphiITSMIoneSPDInAccP500700);
1754
1755   fHistd0rphiITSMIoneSPDInAccP10001500 = new TH1F("fHistd0rphiITSMIoneSPDInAccP10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1756   fHistd0rphiITSMIoneSPDInAccP10001500->Sumw2();
1757   fHistd0rphiITSMIoneSPDInAccP10001500->SetMinimum(0);
1758   fOutput->Add(fHistd0rphiITSMIoneSPDInAccP10001500);
1759
1760   fHistd0rphiITSMIoneSPDInAccP25004000 = new TH1F("fHistd0rphiITSMIoneSPDInAccP25004000","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1761   fHistd0rphiITSMIoneSPDInAccP25004000->Sumw2();
1762   fHistd0rphiITSMIoneSPDInAccP25004000->SetMinimum(0);
1763   fOutput->Add(fHistd0rphiITSMIoneSPDInAccP25004000);
1764
1765   fHistd0rphiITSMIoneSPDInAccP40008000 = new TH1F("fHistd0rphiITSMIoneSPDInAccP40008000","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1766   fHistd0rphiITSMIoneSPDInAccP40008000->Sumw2();
1767   fHistd0rphiITSMIoneSPDInAccP40008000->SetMinimum(0);
1768   fOutput->Add(fHistd0rphiITSMIoneSPDInAccP40008000);
1769
1770   fHistd0zITSMIoneSPDInAccP150200 = new TH1F("fHistd0zITSMIoneSPDInAccP150200","Longitudinal imp. par. to VertexTracks for primaries; d_{0} z [cm]; N tracks",300,-1.5,1.5);
1771   fHistd0zITSMIoneSPDInAccP150200->Sumw2();
1772   fHistd0zITSMIoneSPDInAccP150200->SetMinimum(0);
1773   fOutput->Add(fHistd0zITSMIoneSPDInAccP150200);
1774
1775   fHistd0zITSMIoneSPDInAccP500700 = new TH1F("fHistd0zITSMIoneSPDInAccP500700","Longitudinal imp. par. to VertexTracks for primaries; d_{0} z [cm]; N tracks",300,-1.5,1.5);
1776   fHistd0zITSMIoneSPDInAccP500700->Sumw2();
1777   fHistd0zITSMIoneSPDInAccP500700->SetMinimum(0);
1778   fOutput->Add(fHistd0zITSMIoneSPDInAccP500700);
1779
1780   fHistd0zITSMIoneSPDInAccP10001500 = new TH1F("fHistd0zITSMIoneSPDInAccP10001500","Longitudinal imp. par. to VertexTracks for primaries; d_{0} z [cm]; N tracks",300,-1.5,1.5);
1781   fHistd0zITSMIoneSPDInAccP10001500->Sumw2();
1782   fHistd0zITSMIoneSPDInAccP10001500->SetMinimum(0);
1783   fOutput->Add(fHistd0zITSMIoneSPDInAccP10001500);
1784
1785   fHistd0zVSetaTPCInAccP10001500 = new TH2F("fHistd0zVSetaTPCInAccP10001500","Long. imp. par. to VertexSPD for TPC tracks; d_{0} z [cm]; eta",100,-4,4,10,-1,1);
1786   fOutput->Add(fHistd0zVSetaTPCInAccP10001500);
1787
1788   fHistd0rphiVSphiITSMIoneSPDInAccP10001500 = new TH2F("fHistd0rphiVSphiITSMIoneSPDInAccP10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; phi",30,-0.3,0.3,40,0,2*3.1415);
1789   fOutput->Add(fHistd0rphiVSphiITSMIoneSPDInAccP10001500);
1790
1791   fHistd0rphiVSetaITSMIoneSPDInAccP10001500 = new TH2F("fHistd0rphiVSetaITSMIoneSPDInAccP10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; eta",30,-0.3,0.3,10,-1,1);
1792   fOutput->Add(fHistd0rphiVSetaITSMIoneSPDInAccP10001500);
1793
1794   fHistd0rphiITSMIoneSPDInAccS150200 = new TH1F("fHistd0rphiITSMIoneSPDInAccS150200","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1795   fHistd0rphiITSMIoneSPDInAccS150200->Sumw2();
1796   fHistd0rphiITSMIoneSPDInAccS150200->SetMinimum(0);
1797   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS150200);
1798
1799   fHistd0rphiITSMIoneSPDInAccS350450 = new TH1F("fHistd0rphiITSMIoneSPDInAccS350450","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1800   fHistd0rphiITSMIoneSPDInAccS350450->Sumw2();
1801   fHistd0rphiITSMIoneSPDInAccS350450->SetMinimum(0);
1802   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS350450);
1803
1804   fHistd0rphiITSMIoneSPDInAccS500700 = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1805   fHistd0rphiITSMIoneSPDInAccS500700->Sumw2();
1806   fHistd0rphiITSMIoneSPDInAccS500700->SetMinimum(0);
1807   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700);
1808
1809   fHistd0rphiITSMIoneSPDInAccS500700from22 = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700from22","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1810   fHistd0rphiITSMIoneSPDInAccS500700from22->Sumw2();
1811   fHistd0rphiITSMIoneSPDInAccS500700from22->SetMinimum(0);
1812   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700from22);
1813
1814   fHistd0rphiITSMIoneSPDInAccS500700from211 = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700from211","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1815   fHistd0rphiITSMIoneSPDInAccS500700from211->Sumw2();
1816   fHistd0rphiITSMIoneSPDInAccS500700from211->SetMinimum(0);
1817   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700from211);
1818
1819   fHistd0rphiITSMIoneSPDInAccS500700from310 = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700from310","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1820   fHistd0rphiITSMIoneSPDInAccS500700from310->Sumw2();
1821   fHistd0rphiITSMIoneSPDInAccS500700from310->SetMinimum(0);
1822   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700from310);
1823
1824   fHistd0rphiITSMIoneSPDInAccS500700from321 = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700from321","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1825   fHistd0rphiITSMIoneSPDInAccS500700from321->Sumw2();
1826   fHistd0rphiITSMIoneSPDInAccS500700from321->SetMinimum(0);
1827   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700from321);
1828
1829   fHistd0rphiITSMIoneSPDInAccS500700from3122 = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700from3122","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1830   fHistd0rphiITSMIoneSPDInAccS500700from3122->Sumw2();
1831   fHistd0rphiITSMIoneSPDInAccS500700from3122->SetMinimum(0);
1832   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700from3122);
1833
1834   fHistd0rphiITSMIoneSPDInAccS10001500 = new TH1F("fHistd0rphiITSMIoneSPDInAccS10001500","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1835   fHistd0rphiITSMIoneSPDInAccS10001500->Sumw2();
1836   fHistd0rphiITSMIoneSPDInAccS10001500->SetMinimum(0);
1837   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS10001500);
1838
1839   fHistd0rphiITSMIoneSPDInAccS25004000 = new TH1F("fHistd0rphiITSMIoneSPDInAccS25004000","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1840   fHistd0rphiITSMIoneSPDInAccS25004000->Sumw2();
1841   fHistd0rphiITSMIoneSPDInAccS25004000->SetMinimum(0);
1842   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS25004000);
1843
1844   fHistd0rphiITSMIoneSPDInAccS40008000 = new TH1F("fHistd0rphiITSMIoneSPDInAccS40008000","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1845   fHistd0rphiITSMIoneSPDInAccS40008000->Sumw2();
1846   fHistd0rphiITSMIoneSPDInAccS40008000->SetMinimum(0);
1847   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS40008000);
1848
1849   fHistd0rphiITSMIoneSPDInAccS150200fromStrange = new TH1F("fHistd0rphiITSMIoneSPDInAccS150200fromStrange","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1850   fHistd0rphiITSMIoneSPDInAccS150200fromStrange->Sumw2();
1851   fHistd0rphiITSMIoneSPDInAccS150200fromStrange->SetMinimum(0);
1852   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS150200fromStrange);
1853
1854   fHistd0rphiITSMIoneSPDInAccS150200fromMat = new TH1F("fHistd0rphiITSMIoneSPDInAccS150200fromMat","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1855   fHistd0rphiITSMIoneSPDInAccS150200fromMat->Sumw2();
1856   fHistd0rphiITSMIoneSPDInAccS150200fromMat->SetMinimum(0);
1857   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS150200fromMat);
1858
1859   fHistd0rphiITSMIoneSPDInAccS350450fromStrange = new TH1F("fHistd0rphiITSMIoneSPDInAccS350450fromStrange","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1860   fHistd0rphiITSMIoneSPDInAccS350450fromStrange->Sumw2();
1861   fHistd0rphiITSMIoneSPDInAccS350450fromStrange->SetMinimum(0);
1862   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS350450fromStrange);
1863
1864   fHistd0rphiITSMIoneSPDInAccS350450fromMat = new TH1F("fHistd0rphiITSMIoneSPDInAccS350450fromMat","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1865   fHistd0rphiITSMIoneSPDInAccS350450fromMat->Sumw2();
1866   fHistd0rphiITSMIoneSPDInAccS350450fromMat->SetMinimum(0);
1867   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS350450fromMat);
1868
1869   fHistd0rphiITSMIoneSPDInAccS500700fromStrange = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700fromStrange","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1870   fHistd0rphiITSMIoneSPDInAccS500700fromStrange->Sumw2();
1871   fHistd0rphiITSMIoneSPDInAccS500700fromStrange->SetMinimum(0);
1872   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700fromStrange);
1873
1874   fHistd0rphiITSMIoneSPDInAccS500700fromMat = new TH1F("fHistd0rphiITSMIoneSPDInAccS500700fromMat","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1875   fHistd0rphiITSMIoneSPDInAccS500700fromMat->Sumw2();
1876   fHistd0rphiITSMIoneSPDInAccS500700fromMat->SetMinimum(0);
1877   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS500700fromMat);
1878
1879   fHistd0rphiITSMIoneSPDInAccS10001500fromStrange = new TH1F("fHistd0rphiITSMIoneSPDInAccS10001500fromStrange","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1880   fHistd0rphiITSMIoneSPDInAccS10001500fromStrange->Sumw2();
1881   fHistd0rphiITSMIoneSPDInAccS10001500fromStrange->SetMinimum(0);
1882   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS10001500fromStrange);
1883
1884   fHistd0rphiITSMIoneSPDInAccS10001500fromMat = new TH1F("fHistd0rphiITSMIoneSPDInAccS10001500fromMat","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1885   fHistd0rphiITSMIoneSPDInAccS10001500fromMat->Sumw2();
1886   fHistd0rphiITSMIoneSPDInAccS10001500fromMat->SetMinimum(0);
1887   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS10001500fromMat);
1888
1889   fHistd0rphiITSMIoneSPDInAccS25004000fromStrange = new TH1F("fHistd0rphiITSMIoneSPDInAccS25004000fromStrange","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1890   fHistd0rphiITSMIoneSPDInAccS25004000fromStrange->Sumw2();
1891   fHistd0rphiITSMIoneSPDInAccS25004000fromStrange->SetMinimum(0);
1892   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS25004000fromStrange);
1893
1894   fHistd0rphiITSMIoneSPDInAccS25004000fromMat = new TH1F("fHistd0rphiITSMIoneSPDInAccS25004000fromMat","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1895   fHistd0rphiITSMIoneSPDInAccS25004000fromMat->Sumw2();
1896   fHistd0rphiITSMIoneSPDInAccS25004000fromMat->SetMinimum(0);
1897   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS25004000fromMat);
1898
1899   fHistd0rphiITSMIoneSPDInAccS40008000fromStrange = new TH1F("fHistd0rphiITSMIoneSPDInAccS40008000fromStrange","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1900   fHistd0rphiITSMIoneSPDInAccS40008000fromStrange->Sumw2();
1901   fHistd0rphiITSMIoneSPDInAccS40008000fromStrange->SetMinimum(0);
1902   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS40008000fromStrange);
1903
1904   fHistd0rphiITSMIoneSPDInAccS40008000fromMat = new TH1F("fHistd0rphiITSMIoneSPDInAccS40008000fromMat","Transverse imp. par. to VertexTracks for primaries; d_{0} rphi [cm]; N tracks",300,-1.5,1.5);
1905   fHistd0rphiITSMIoneSPDInAccS40008000fromMat->Sumw2();
1906   fHistd0rphiITSMIoneSPDInAccS40008000fromMat->SetMinimum(0);
1907   fOutput->Add(fHistd0rphiITSMIoneSPDInAccS40008000fromMat);
1908
1909   
1910   fHistd0zITSMIoneSPDInAccS150200 = new TH1F("fHistd0zITSMIoneSPDInAccS150200","Longitudinal imp. par. to VertexTracks for secondaries; d_{0} z [cm]; N tracks",300,-1.5,1.5);
1911   fHistd0zITSMIoneSPDInAccS150200->Sumw2();
1912   fHistd0zITSMIoneSPDInAccS150200->SetMinimum(0);
1913   fOutput->Add(fHistd0zITSMIoneSPDInAccS150200);
1914
1915   fHistd0zITSMIoneSPDInAccS500700 = new TH1F("fHistd0zITSMIoneSPDInAccS500700","Longitudinal imp. par. to VertexTracks for secondaries; d_{0} z [cm]; N tracks",300,-1.5,1.5);
1916   fHistd0zITSMIoneSPDInAccS500700->Sumw2();
1917   fHistd0zITSMIoneSPDInAccS500700->SetMinimum(0);
1918   fOutput->Add(fHistd0zITSMIoneSPDInAccS500700);
1919
1920   fHistd0zITSMIoneSPDInAccS10001500 = new TH1F("fHistd0zITSMIoneSPDInAccS10001500","Longitudinal imp. par. to VertexTracks for secondaries; d_{0} z [cm]; N tracks",300,-1.5,1.5);
1921   fHistd0zITSMIoneSPDInAccS10001500->Sumw2();
1922   fHistd0zITSMIoneSPDInAccS10001500->SetMinimum(0);
1923   fOutput->Add(fHistd0zITSMIoneSPDInAccS10001500);
1924
1925   fHistITSRedChi2NonFakePt02 = new TH1F("fHistITSRedChi2NonFakePt02","ITS chi2/cluster; ITS #chi^{2}/nclusters; tracks",500,0,100);
1926   fOutput->Add(fHistITSRedChi2NonFakePt02);
1927   fHistITSRedChi2FakePt02 = new TH1F("fHistITSRedChi2FakePt02","ITS chi2/cluster; ITS #chi^{2}/nclusters; tracks",500,0,100);
1928   fOutput->Add(fHistITSRedChi2FakePt02);
1929   fHistITSRedChi2NonFakePt05 = new TH1F("fHistITSRedChi2NonFakePt05","ITS chi2/cluster; ITS #chi^{2}/nclusters; tracks",500,0,100);
1930   fOutput->Add(fHistITSRedChi2NonFakePt05);
1931   fHistITSRedChi2FakePt05 = new TH1F("fHistITSRedChi2FakePt05","ITS chi2/cluster; ITS #chi^{2}/nclusters; tracks",500,0,100);
1932   fOutput->Add(fHistITSRedChi2FakePt05);
1933   fHistITSRedChi2NonFakePt1 = new TH1F("fHistITSRedChi2NonFakePt1","ITS chi2/cluster; ITS #chi^{2}/nclusters; tracks",500,0,100);
1934   fOutput->Add(fHistITSRedChi2NonFakePt1);
1935   fHistITSRedChi2FakePt1 = new TH1F("fHistITSRedChi2FakePt1","ITS chi2/cluster; ITS #chi^{2}/nclusters; tracks",500,0,100);
1936   fOutput->Add(fHistITSRedChi2FakePt1);
1937
1938
1939   // ntuples
1940   //
1941   fNtupleESDTracks = new TNtuple("fNtupleESDTracks","tracks","pt:eta:phi:d0:z0:sigmad0:sigmaz0:ptMC:pdgMC:pdgMCMoth:d0MC:d0MCv:z0MCv:sigmad0MCv:sigmaz0MCv:ITSflag:isPrimary:isTPCSel");  
1942   fOutput->Add(fNtupleESDTracks);
1943
1944   fNtupleITSAlignExtra = new TNtuple("fNtupleITSAlignExtra","ITS alignment checks: extra clusters","layer:x:y:z:dxy:dz:xloc:zloc:npoints:pt");  
1945   fOutput->Add(fNtupleITSAlignExtra);
1946
1947   fNtupleITSAlignSPDTracklets = new TNtuple("fNtupleITSAlignSPDTracklets","ITS alignment checks: SPD tracklets wrt SPD vertex","phi:theta:z:dxy:dz:pt");  
1948   fOutput->Add(fNtupleITSAlignSPDTracklets);
1949
1950   PostData(1, fOutput);
1951   return;
1952 }
1953
1954 //________________________________________________________________________
1955 void AliAnalysisTaskITSTrackingCheck::UserExec(Option_t *) 
1956 {
1957   // Main loop
1958   // Called for each event
1959
1960
1961   fESD = dynamic_cast<AliESDEvent*>(InputEvent());
1962
1963   if (!fESD) {
1964     Printf("ERROR: fESD not available");
1965     return;
1966   }
1967
1968   //if(fESD->GetEventNumberInFile()<7) return;
1969
1970   // only events in the requested multiplicity range
1971   if(!IsSelectedCentrality()) return;
1972
1973   fHistNEvents->Fill(-1);
1974
1975
1976   Bool_t isSelected = kTRUE;
1977   if(fUsePhysSel) {
1978     isSelected = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
1979   }
1980   if(!isSelected) return;
1981
1982   TString firedTriggerClasses=fESD->GetFiredTriggerClasses();  
1983   if(!firedTriggerClasses.Contains(fTriggerClass.Data())) return;
1984   
1985
1986   Bool_t sddIsIn=kTRUE;
1987   if(fCheckSDDIsIn) {
1988
1989     if(!fTrigConfig) {    
1990       AliCDBManager* man = AliCDBManager::Instance();
1991       if(fOCDBPath.Contains("OCDB")) { // when running in the QAtrain this is not called (OCBD is already set)
1992         man->SetDefaultStorage(fOCDBPath.Data());
1993         man->SetRun(fESD->GetRunNumber());
1994       }
1995       if(!man) {       
1996         AliFatal("CDB not set but needed by AliAnalysisTaskITSTrackingCheck");
1997         return;    
1998       }   
1999       AliCDBEntry* eT=(AliCDBEntry*)man->Get("GRP/CTP/Config");    
2000       if(eT) {      
2001         fTrigConfig=(AliTriggerConfiguration*)eT->GetObject();    
2002       }    
2003       if(!eT || !fTrigConfig) {      
2004         AliError("Cannot retrieve CDB entry for GRP/CTP/Config");      
2005         return;     
2006       }
2007     }
2008
2009     sddIsIn=fESD->IsDetectorInTriggerCluster("ITSSDD",fTrigConfig);
2010   }
2011
2012
2013   //if(fESD->GetEventType()!=7) return;
2014
2015   // ***********  MC info ***************
2016   TArrayF mcVertex(3);
2017   mcVertex[0]=9999.; mcVertex[1]=9999.; mcVertex[2]=9999.;
2018   Float_t dNchdy=-999.;
2019
2020   TParticle *part=0;
2021   AliESDVertex *vertexMC=0;
2022   AliStack *stack=0;
2023   if (fReadMC) {
2024     AliMCEventHandler *eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
2025     if (!eventHandler) {
2026       Printf("ERROR: Could not retrieve MC event handler");
2027       return;
2028     }
2029     
2030     AliMCEvent* mcEvent = eventHandler->MCEvent();
2031     if (!mcEvent) {
2032       Printf("ERROR: Could not retrieve MC event");
2033       return;
2034     }
2035     
2036     stack = mcEvent->Stack();
2037     if (!stack) {
2038       AliDebug(AliLog::kError, "Stack not available");
2039       return;
2040     }
2041     
2042     AliHeader* header = mcEvent->Header();
2043     if (!header) {
2044       AliDebug(AliLog::kError, "Header not available");
2045       return;
2046     }
2047     AliGenEventHeader* genHeader = header->GenEventHeader();
2048     genHeader->PrimaryVertex(mcVertex);
2049     //printf("MC vertex: %f %f %f\n",mcVertex[0],mcVertex[1],mcVertex[2]);
2050
2051     Int_t ngenpart = (Int_t)stack->GetNtrack();
2052     //printf("# generated particles = %d\n",ngenpart);
2053     dNchdy=0;
2054     for(Int_t ip=0; ip<ngenpart; ip++) {
2055       part = (TParticle*)stack->Particle(ip);
2056       // keep only electrons, muons, pions, kaons and protons
2057       Int_t apdg = TMath::Abs(part->GetPdgCode());
2058       if(apdg!=11 && apdg!=13 && apdg!=211 && apdg!=321 && apdg!=2212) continue;      
2059       // reject secondaries
2060       //if(TMath::Sqrt((part->Vx()-mcVertex[0])*(part->Vx()-mcVertex[0])+(part->Vy()-mcVertex[1])*(part->Vy()-mcVertex[1]))<.01) printf("%f\n",TMath::Sqrt((part->Vx()-mcVertex[0])*(part->Vx()-mcVertex[0])+(part->Vy()-mcVertex[1])*(part->Vy()-mcVertex[1])));
2061       if(TMath::Sqrt((part->Vx()-mcVertex[0])*(part->Vx()-mcVertex[0])+(part->Vy()-mcVertex[1])*(part->Vy()-mcVertex[1]))>0.0010) continue;
2062       // reject incoming protons
2063       Double_t energy  = part->Energy();
2064       if(energy>900.) continue;
2065       Double_t pz = part->Pz();
2066       Double_t y = 100.;
2067       if(energy-pz+1.e-13 > 0.) y = 0.5*TMath::Log((energy+pz+1.e-13)/(energy-pz+1.e-13));
2068       if(TMath::Abs(y)<1.0) dNchdy += 0.5; // count 1/2 of particles in |y|<1
2069     }
2070     //printf("# primary particles = %7.1f\n",dNchdy);
2071   } 
2072   // ***********  MC info ***************
2073   Double_t mcVtxPos[3]={mcVertex[0],mcVertex[1],mcVertex[2]},mcVtxSigma[3]={0,0,0};
2074   vertexMC = new AliESDVertex(mcVtxPos,mcVtxSigma);
2075
2076
2077
2078   //------- event selection --------
2079   Int_t   mincontrSPDvtx=1;
2080   Double_t maxzSPDvtx=5.;
2081   Double_t maxrSPDvtx=0.5;
2082   Bool_t useTRKvtx=kTRUE;
2083   Bool_t useSPDvtxifNotTRK=kTRUE;
2084   Int_t   mincontrTRKvtx=1;
2085   //Double_t maxzTRKvtx=20.;
2086   //Double_t maxrTRKvtx=1.;
2087   //------- TPC track selection --------
2088   Int_t    minclsTPC=70;
2089   Double_t maxchi2perTPCcl=4.;
2090   Double_t minEtaInAcc=-0.8; // -0.8
2091   Double_t maxEtaInAcc=0.8; // 0.8
2092   Double_t maxdcaxy=2.4;//2.4;
2093   Double_t maxdcaz=3.2;//3.2;
2094   AliESDtrackCuts* esdtrackCutsTPC = new AliESDtrackCuts("esdtrackCutsTPC");
2095   esdtrackCutsTPC->SetMaxDCAToVertexXY(maxdcaxy);
2096   esdtrackCutsTPC->SetMaxDCAToVertexZ(maxdcaz);
2097   esdtrackCutsTPC->SetDCAToVertex2D(kTRUE);
2098   esdtrackCutsTPC->SetRequireSigmaToVertex(kFALSE);
2099   esdtrackCutsTPC->SetRequireTPCRefit(kFALSE);// cannot do it because status not copied in AliESDtrack::FillTPCOnlyTrack
2100   esdtrackCutsTPC->SetAcceptKinkDaughters(kFALSE);
2101   esdtrackCutsTPC->SetMinNClustersTPC(minclsTPC);
2102   esdtrackCutsTPC->SetMaxChi2PerClusterTPC(maxchi2perTPCcl);
2103   esdtrackCutsTPC->SetEtaRange(minEtaInAcc,maxEtaInAcc);
2104   SetESDtrackCutsTPC(esdtrackCutsTPC);
2105   //------- ITS+TPC track selection --------
2106   Double_t maxdcaxyITSTPC=0.2;
2107   Double_t maxdcazITSTPC=1.e6;
2108   AliESDtrackCuts* esdtrackCutsITSTPC = new AliESDtrackCuts("esdtrackCutsITSTPC");
2109   esdtrackCutsITSTPC->SetMaxDCAToVertexXY(maxdcaxyITSTPC);
2110   esdtrackCutsITSTPC->SetMaxDCAToVertexZ(maxdcazITSTPC);
2111   esdtrackCutsITSTPC->SetDCAToVertex2D(kFALSE);
2112   esdtrackCutsITSTPC->SetRequireSigmaToVertex(kFALSE);
2113   esdtrackCutsITSTPC->SetRequireITSRefit(kTRUE);
2114   esdtrackCutsITSTPC->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
2115                                                AliESDtrackCuts::kAny);
2116   esdtrackCutsITSTPC->SetAcceptKinkDaughters(kFALSE);
2117   esdtrackCutsITSTPC->SetMinNClustersTPC(minclsTPC);
2118   esdtrackCutsITSTPC->SetMaxChi2PerClusterTPC(maxchi2perTPCcl);
2119   esdtrackCutsITSTPC->SetEtaRange(minEtaInAcc,maxEtaInAcc);
2120   SetESDtrackCutsITSTPC(esdtrackCutsITSTPC);
2121   //---------------------------------------
2122   
2123
2124   //
2125   
2126   /*  
2127   // **********  Trigger *****************
2128   ULong64_t triggerMask;
2129   ULong64_t spdFO = (1 << 14);
2130   ULong64_t v0left = (1 << 11);
2131   ULong64_t v0right = (1 << 12);
2132   
2133   triggerMask=fESD->GetTriggerMask();
2134   // MB1: SPDFO || V0L || V0R
2135   Bool_t eventTriggered = (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right))); 
2136   //MB2: GFO && V0R
2137   //triggerMask & spdFO && ((triggerMask&v0left) || (triggerMask&v0right))
2138   // ************ Trigger ******************
2139   if(!eventTriggered) return;
2140   */
2141
2142
2143   fHistNEvents->Fill(0);
2144
2145   // SPD vertex
2146   const AliESDVertex *spdv=fESD->GetPrimaryVertexSPD();
2147   // Select good SPD vertices
2148   TString spdvtitle=spdv->GetTitle();
2149   //if(!spdvtitle.Contains("3D")) return;
2150   if(fRequireSPDvtx) {
2151     if(spdv->GetNContributors()<mincontrSPDvtx ||
2152        TMath::Abs(spdv->GetZ())>maxzSPDvtx ||  
2153        spdv->GetX()*spdv->GetX()+spdv->GetY()*spdv->GetY()>maxrSPDvtx) {
2154       delete esdtrackCutsTPC; esdtrackCutsTPC=0;
2155       delete esdtrackCutsITSTPC; esdtrackCutsITSTPC=0;
2156       return;
2157     }
2158   }
2159   //spdv->Print();
2160
2161   if(fRejPileupSPD) if(fESD->IsPileupFromSPD()) return;
2162
2163   //
2164   // Tracks vertex
2165   const AliESDVertex *vertexESD = fESD->GetPrimaryVertexTracks();
2166   //vertexESD->Print();
2167
2168   if(spdvtitle.Contains("3D")) {
2169     fHistNEvents->Fill(1);
2170     fHistNEvents->Fill(3);
2171   } else {
2172     fHistNEvents->Fill(2);
2173     fHistNEvents->Fill(3);
2174   }
2175   if(vertexESD) {
2176     if(vertexESD->GetStatus()) fHistNEvents->Fill(4);
2177   }
2178
2179   Int_t ntracks = fESD->GetNumberOfTracks();
2180   //printf("Tracks # = %d\n",fESD->GetNumberOfTracks());
2181
2182   fHistNtracks->Fill(ntracks);
2183   // Post the data already here
2184   PostData(1, fOutput);
2185
2186   FillNClustersModuleMap();
2187
2188   Int_t idet,status; Float_t xloc,zloc;
2189   Double_t rSPDouter=7.6,rSDDouter=23.9,rSSDouter=43.1;  
2190   Double_t zSPDouter=14.1,zSDDouter=29.7,zSSDouter=48.9;  
2191
2192
2193   // loop on tracks to check if there are 7 ITS layers (upgrade)
2194   for(Int_t itr=0; itr<ntracks; itr++) {
2195     AliESDtrack *track = fESD->GetTrack(itr);
2196     if(track->HasPointOnITSLayer(6)) {
2197       fNITSLayers=7;
2198       break;
2199     }
2200   }
2201
2202   // loop on tracks
2203   for(Int_t itr=0; itr<ntracks; itr++) {
2204     AliESDtrack *track = fESD->GetTrack(itr);
2205     //if(track->Charge()>0) continue;
2206     // remove kink daughters
2207     if(track->GetKinkIndex(0)>0) continue;
2208
2209
2210     // remove tracks not reco in ITS or TPC
2211     if (!(track->GetStatus() & AliESDtrack::kITSin) &&
2212         !(track->GetStatus() & AliESDtrack::kTPCin)) continue;
2213
2214     // check if tracks if flagged as from bc0 by TOF
2215     Bool_t isTOFbc0 = kFALSE;
2216     if(track->GetTOFBunchCrossing(fESD->GetMagneticField())/2==0) isTOFbc0=kTRUE;
2217
2218     //
2219     Bool_t isPrimary=kTRUE,isFromMat=kFALSE,isFromStrange=kFALSE;
2220     Double_t rProdVtx=0,zProdVtx=0;
2221     Int_t pdgTrk=0,pdgMoth=0;
2222     Int_t nClsMCSPD=0;
2223   
2224     Int_t trkLabel = TMath::Abs(track->GetLabel());
2225     Bool_t isFake=(track->GetLabel()>=0 ? kFALSE : kTRUE);
2226     Bool_t hasShared=kFALSE,hasSharedSPD=kFALSE;
2227     for(Int_t i=0;i<fNITSLayers;i++) {
2228       if(track->HasSharedPointOnITSLayer(i)) {
2229         hasShared=kTRUE;
2230         if(i<(fNITSLayers-4)) hasSharedSPD=kTRUE;
2231       }
2232     }
2233
2234     // check if it is primary
2235     if(fReadMC && stack) {
2236       isPrimary = stack->IsPhysicalPrimary(trkLabel);
2237       part = (TParticle*)stack->Particle(trkLabel);
2238       rProdVtx = TMath::Sqrt((part->Vx()-mcVertex[0])*(part->Vx()-mcVertex[0])+(part->Vy()-mcVertex[1])*(part->Vy()-mcVertex[1]));
2239       zProdVtx = TMath::Abs(part->Vz()-mcVertex[2]);
2240       //if(rProdVtx<2.8) isPrimary=kTRUE; // this could be tried
2241       pdgTrk = TMath::Abs(part->GetPdgCode());
2242       if(part->GetFirstMother()>=0) {
2243         TParticle* mm=stack->Particle(part->GetFirstMother());
2244         if(mm) pdgMoth = TMath::Abs(mm->GetPdgCode());
2245       }
2246       if(pdgMoth==310 || pdgMoth==321 || pdgMoth==3122 || pdgMoth==3312) isFromStrange=kTRUE;
2247       if(pdgMoth==211 || pdgMoth==22 || pdgMoth==2112 || pdgMoth==2212) isFromMat=kTRUE;
2248       nClsMCSPD = NumberOfITSClustersMC(trkLabel,240);
2249     }
2250
2251     Bool_t itsrefit=kFALSE,tpcrefit=kFALSE,itsfindable=kFALSE,itsfindableAcc=kFALSE;
2252     if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE;
2253     if ((track->GetStatus() & AliESDtrack::kTPCrefit)) tpcrefit=kTRUE;
2254     //if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcrefit=kTRUE;
2255
2256
2257
2258     // remove tracks with kTPCin and not kTPCrefit 
2259     if ((track->GetStatus() & AliESDtrack::kTPCin) && !tpcrefit) continue;
2260
2261     AliESDtrack *trackTPC = 0;
2262     if(tpcrefit) trackTPC = AliESDtrackCuts::GetTPCOnlyTrack(fESD,itr);
2263     //    if(trackTPC) trackTPC->RelateToVertex(spdv,fESD->GetMagneticField(),100.); // relate it to the SPD vertex
2264    
2265
2266     Int_t nclsITS = track->GetNcls(0);
2267     Int_t nclsSDDSSD = 0;
2268     Int_t nclsokbadoutinzITS = 0;
2269     Bool_t outInZ=kFALSE;
2270
2271     for(Int_t layer=0; layer<fNITSLayers; layer++) {
2272       if(layer>=(fNITSLayers-4) && track->HasPointOnITSLayer(layer)) nclsSDDSSD++;
2273       if(layer==0 && !track->HasPointOnITSLayer(1)) continue;
2274       if(layer==1 && !track->HasPointOnITSLayer(0)) continue;
2275       track->GetITSModuleIndexInfo(layer,idet,status,xloc,zloc);
2276       if(status<0) continue;
2277       if(layer>=2) idet+=240; // add n SPD modules
2278       if(layer>=4) idet+=260; // add n SDD modules
2279       if(status==4) outInZ=kTRUE;
2280       
2281       if(layer==1 && tpcrefit && itsrefit) {
2282         Double_t xyz[3];
2283         track->GetXYZAt(rSPDouter,fESD->GetMagneticField(),xyz);
2284         if(status==1) {
2285           if(idet%4==0) fHistZatSPDouter0ok->Fill(xyz[2]);
2286           if(idet%4==1) fHistZatSPDouter1ok->Fill(xyz[2]);
2287           if(idet%4==2) fHistZatSPDouter2ok->Fill(xyz[2]);
2288           if(idet%4==3) fHistZatSPDouter3ok->Fill(xyz[2]);
2289         }
2290         if(status==2 || status==5) {
2291           if(idet%4==0) fHistZatSPDouter0notok->Fill(xyz[2]);
2292           if(idet%4==1) fHistZatSPDouter1notok->Fill(xyz[2]);
2293           if(idet%4==2) fHistZatSPDouter2notok->Fill(xyz[2]);
2294           if(idet%4==3) fHistZatSPDouter3notok->Fill(xyz[2]);
2295         }
2296       }
2297       // kill SDD clusters in MC
2298       if(fReadMC && (layer==2 || layer==3)) {
2299         Double_t qITS[4]; track->GetITSdEdxSamples(qITS);
2300         Double_t conv=3.34/5.43; 
2301         if(layer==2 && status==1 && qITS[0]*conv < 30.) status=5;
2302         if(layer==3 && status==1 && qITS[1]*conv < 30.) status=5;
2303       }
2304       if(tpcrefit) {
2305         if(trackTPC) if(!fESDtrackCutsTPC->AcceptTrack(trackTPC)) continue;
2306         if(track->Pt()>0.7 && track->Pt()<2.0) {
2307           if(status==1) {
2308             fHistClusterMapITSMIok->Fill(layer);
2309           }
2310           if(status==2) fHistClusterMapITSMIbad->Fill(layer);
2311           if(status==3) fHistClusterMapITSMIskipped->Fill(layer);
2312           if(status==4) fHistClusterMapITSMIoutinz->Fill(layer);
2313           if(status==5) fHistClusterMapITSMInocls->Fill(layer);
2314           if(status==6) fHistClusterMapITSMInorefit->Fill(layer);
2315           if(status==1 && !outInZ) fHistClusterMapModuleITSMIokInAcc->Fill(idet);
2316           if((status==2 || status==7) && !outInZ) fHistClusterMapModuleITSMIbadInAcc->Fill(idet);
2317           if(status==5 && !outInZ) fHistClusterMapModuleITSMInoclsInAcc->Fill(idet);
2318
2319
2320         }
2321         if(status==1 || status==2 || status==4) {
2322           fHistClusterMapITSMIokoutinzbad->Fill(layer);
2323           nclsokbadoutinzITS++;
2324         }
2325         /*if(idet>=80 && idet<120) {
2326           Double_t xyz[3];
2327           track->GetXYZAt(6.8,fESD->GetMagneticField(),xyz);
2328           printf("det %d status %d phi %f z %f zloc %f xloc %f\n",idet,status,TMath::ATan2(xyz[1],xyz[0]),xyz[2],zloc,xloc);
2329           }*/
2330         if((layer==2 || layer==3) && status!=2 && status!=4) {
2331           //Float_t xlocCls;
2332           //Int_t nClsInMod = NumberOfITSClusters(idet,xlocCls);
2333           fHistxlocSDDall->Fill(xloc);
2334           fHistzlocSDDall->Fill(zloc);
2335           if(status==1  /*nClsInMod>0*/) {
2336             fHistxlocSDDok->Fill(xloc);
2337             fHistxlocVSmodSDDok->Fill(idet,xloc);
2338             fHistzlocSDDok->Fill(zloc);
2339
2340           }     
2341         }
2342       }
2343       if(TESTBIT(track->GetITSClusterMap(),layer)) {
2344         if(tpcrefit) {
2345           fHistClusterMapITSMI->Fill(layer);
2346         } else {
2347           fHistClusterMapITSSA->Fill(layer);
2348           if(!outInZ) fHistClusterMapITSSAInAcc->Fill(layer);
2349         }
2350       }
2351     }  
2352
2353     // TPC track findable in ITS
2354     if(tpcrefit && trackTPC) { 
2355       if(fESDtrackCutsTPC->AcceptTrack(trackTPC)) {
2356         itsfindable=kTRUE;
2357         Double_t zAtSSDouter=100,zAtSDDouter=100,zAtSPDouter=100;
2358         track->GetZAt(rSSDouter,fESD->GetMagneticField(),zAtSSDouter);
2359         track->GetZAt(rSDDouter,fESD->GetMagneticField(),zAtSDDouter);
2360         track->GetZAt(rSPDouter,fESD->GetMagneticField(),zAtSPDouter);
2361         fHistPtTPC->Fill(track->Pt());  
2362         if(TMath::Abs(zAtSSDouter)<1.*zSSDouter &&
2363            TMath::Abs(zAtSDDouter)<1.*zSDDouter &&
2364            TMath::Abs(zAtSPDouter)<1.*zSPDouter) {
2365           itsfindableAcc=kTRUE; 
2366           fHistdEdxVSPtTPCInAcc->Fill(track->Pt(),track->GetTPCsignal());
2367           fHistPtTPCInAcc->Fill(track->Pt());
2368           if(fCheckSDDIsIn && sddIsIn) fHistPtTPCInAccwSDD->Fill(track->Pt());
2369           if(fCheckSDDIsIn && !sddIsIn) fHistPtTPCInAccwoSDD->Fill(track->Pt());
2370           if(isTOFbc0) {
2371             fHistPtTPCInAccTOFbc0->Fill(track->Pt());
2372             if(fCheckSDDIsIn && sddIsIn) fHistPtTPCInAccTOFbc0wSDD->Fill(track->Pt());
2373             if(fCheckSDDIsIn && !sddIsIn) fHistPtTPCInAccTOFbc0woSDD->Fill(track->Pt());
2374           }
2375           fHistTPCclsVSPtTPCInAcc->Fill(trackTPC->Pt(),trackTPC->GetNcls(1));
2376           fHistPtVSphiTPCInAcc->Fill(track->Phi(),track->Pt());
2377           if(!(track->GetStatus()&AliESDtrack::kTRDout)) fHistPtTPCInAccNoTRDout->Fill(track->Pt()); 
2378           if(!(track->GetStatus()&AliESDtrack::kTOFout)) fHistPtTPCInAccNoTOFout->Fill(track->Pt()); 
2379           fHistPtTPCInAccWithPtTPCAtVtx->Fill(trackTPC->Pt());
2380           Double_t pTPCinnerwall[3];
2381           track->GetInnerPxPyPz(pTPCinnerwall);
2382           Double_t ptTPCinnerwall=TMath::Sqrt(pTPCinnerwall[0]*pTPCinnerwall[0]+pTPCinnerwall[1]*pTPCinnerwall[1]);
2383           fHistPtTPCInAccWithPtTPCAtInnerWall->Fill(ptTPCinnerwall);
2384           if(track->GetStatus()&AliESDtrack::kITSrefit && !(track->GetStatus()&AliESDtrack::kTOFout)) fHistDeltaPtTPC->Fill(trackTPC->P(),track->P()-trackTPC->P());
2385           if(track->Pt()>1) {
2386             fHistPhiTPCInAcc->Fill(track->Phi());  
2387             fHistEtaTPCInAcc->Fill(track->Eta());
2388           }  
2389           if(isPrimary) {
2390             fHistPtTPCInAccP->Fill(track->Pt());
2391             if(pdgTrk==321) fHistPtTPCInAccPfromStrange->Fill(track->Pt());
2392           } else {
2393             fHistPtTPCInAccS->Fill(track->Pt());
2394             if(isFromMat) fHistPtTPCInAccSfromMat->Fill(track->Pt());
2395             if(isFromStrange) fHistPtTPCInAccSfromStrange->Fill(track->Pt());
2396           }  
2397           if(nClsMCSPD==2) fHistPtTPCInAccMCtwoSPD->Fill(track->Pt());
2398           if(nClsMCSPD>=1) fHistPtTPCInAccMConeSPD->Fill(track->Pt());
2399
2400           //if(isPrimary) {fHistRProdVtxInAccP->Fill(rProdVtx);} else {fHistRProdVtxInAccS->Fill(rProdVtx);}
2401         }
2402       }
2403     }
2404
2405
2406     if(useTRKvtx) {
2407       // we need the vertex to compute the impact parameters
2408       if(!vertexESD) {delete trackTPC; trackTPC=0; continue;}
2409       if(!(vertexESD->GetStatus()) || vertexESD->GetNContributors()<mincontrTRKvtx) {
2410         if(useSPDvtxifNotTRK) {
2411           vertexESD = fESD->GetPrimaryVertexSPD();
2412         } else {
2413           delete trackTPC; trackTPC=0; continue;
2414         }
2415       }
2416     }
2417
2418     //if(hasSharedSPD) continue;
2419     //if(track->GetITSFakeFlag()) continue;
2420
2421     // track prolonged in ITS with different conditions
2422     if(itsrefit) {
2423       if(itsfindable) {
2424         if(nclsITS==7) fHistPtITSMI7->Fill(track->Pt());
2425         if(nclsITS==6) fHistPtITSMI6->Fill(track->Pt());
2426         if(nclsITS==5) fHistPtITSMI5->Fill(track->Pt());
2427         if(nclsITS==4) fHistPtITSMI4->Fill(track->Pt());
2428         if(nclsITS==3) fHistPtITSMI3->Fill(track->Pt());
2429         if(nclsITS==2) fHistPtITSMI2->Fill(track->Pt());
2430         if(ConditionSPD(track)) {
2431           fHistPtITSMISPD->Fill(track->Pt());
2432           fHistTPCclsVSPtITSMISPDInAcc->Fill(track->Pt(),track->GetNcls(1));
2433         }
2434         if(ConditionSPDone(track)) {
2435           fHistPtITSMIoneSPD->Fill(track->Pt());
2436         }
2437         if(ConditionSPDtwo(track)) {
2438           fHistPtITSMItwoSPD->Fill(track->Pt());
2439         }
2440         if(nclsokbadoutinzITS==6) fHistPtITSMIokbadoutinz6->Fill(track->Pt());
2441       }
2442       if(itsfindableAcc) {
2443         if(nclsITS==7) {
2444           fHistPtITSMI7InAcc->Fill(track->Pt());
2445           if(track->Pt()>1) {
2446             fHistPhiITSMI7InAcc->Fill(track->Phi());
2447             fHistEtaITSMI7InAcc->Fill(track->Eta());
2448           }
2449           if(isFake) fHistPtITSMI7InAccFake->Fill(track->Pt());
2450           if(isPrimary) {fHistPtITSMI7InAccP->Fill(track->Pt());} else {fHistPtITSMI7InAccS->Fill(track->Pt());}  
2451         }
2452         if(nclsITS==6) {
2453           fHistPtITSMI6InAcc->Fill(track->Pt());
2454           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI6InAccwSDD->Fill(track->Pt());
2455           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI6InAccwoSDD->Fill(track->Pt());
2456           if(isTOFbc0) {
2457             fHistPtITSMI6InAccTOFbc0->Fill(track->Pt());
2458             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI6InAccTOFbc0wSDD->Fill(track->Pt());
2459             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI6InAccTOFbc0woSDD->Fill(track->Pt());
2460           }
2461           if(track->Pt()>1) {
2462             fHistPhiITSMI6InAcc->Fill(track->Phi());
2463             fHistEtaITSMI6InAcc->Fill(track->Eta());
2464           }
2465           if(isFake) fHistPtITSMI6InAccFake->Fill(track->Pt());
2466           if(isPrimary) {fHistPtITSMI6InAccP->Fill(track->Pt());} else {fHistPtITSMI6InAccS->Fill(track->Pt());}  
2467         }
2468         if(nclsITS==5) {
2469           fHistPtITSMI5InAcc->Fill(track->Pt());
2470           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI5InAccwSDD->Fill(track->Pt());
2471           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI5InAccwoSDD->Fill(track->Pt());
2472           if(isTOFbc0) {
2473             fHistPtITSMI5InAccTOFbc0->Fill(track->Pt());
2474             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI5InAccTOFbc0wSDD->Fill(track->Pt());
2475             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI5InAccTOFbc0woSDD->Fill(track->Pt());
2476           }
2477           if(track->Pt()>1) {
2478             fHistPhiITSMI5InAcc->Fill(track->Phi());
2479             fHistEtaITSMI5InAcc->Fill(track->Eta());
2480           }
2481           if(isFake) fHistPtITSMI5InAccFake->Fill(track->Pt());
2482           if(isPrimary) {fHistPtITSMI5InAccP->Fill(track->Pt());} else {fHistPtITSMI5InAccS->Fill(track->Pt());}  
2483         }
2484         if(nclsITS==4) {
2485           fHistPtITSMI4InAcc->Fill(track->Pt());
2486           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI4InAccwSDD->Fill(track->Pt());
2487           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI4InAccwoSDD->Fill(track->Pt());
2488           if(isTOFbc0) {
2489             fHistPtITSMI4InAccTOFbc0->Fill(track->Pt());
2490             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI4InAccTOFbc0wSDD->Fill(track->Pt());
2491             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI4InAccTOFbc0woSDD->Fill(track->Pt());
2492           }
2493           if(track->Pt()>1) {
2494             fHistPhiITSMI4InAcc->Fill(track->Phi());
2495             fHistEtaITSMI4InAcc->Fill(track->Eta());
2496           }
2497           if(isFake) fHistPtITSMI4InAccFake->Fill(track->Pt());
2498           if(isPrimary) {fHistPtITSMI4InAccP->Fill(track->Pt());} else {fHistPtITSMI4InAccS->Fill(track->Pt());}  
2499         }
2500         if(nclsITS==3) {
2501           fHistPtITSMI3InAcc->Fill(track->Pt());
2502           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI3InAccwSDD->Fill(track->Pt());
2503           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI3InAccwoSDD->Fill(track->Pt());
2504           if(isTOFbc0) {
2505             fHistPtITSMI3InAccTOFbc0->Fill(track->Pt());
2506             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI3InAccTOFbc0wSDD->Fill(track->Pt());
2507             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI3InAccTOFbc0woSDD->Fill(track->Pt());
2508           }
2509           if(track->Pt()>1) {
2510             fHistPhiITSMI3InAcc->Fill(track->Phi());
2511             fHistEtaITSMI3InAcc->Fill(track->Eta());
2512           }
2513           if(isFake) fHistPtITSMI3InAccFake->Fill(track->Pt());
2514           if(isPrimary) {fHistPtITSMI3InAccP->Fill(track->Pt());} else {fHistPtITSMI3InAccS->Fill(track->Pt());}  
2515         }
2516         if(nclsITS==2) {
2517           fHistPtITSMI2InAcc->Fill(track->Pt());
2518           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI2InAccwSDD->Fill(track->Pt());
2519           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI2InAccwoSDD->Fill(track->Pt());
2520           if(isTOFbc0) {
2521             fHistPtITSMI2InAccTOFbc0->Fill(track->Pt());
2522             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMI2InAccTOFbc0wSDD->Fill(track->Pt());
2523             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMI2InAccTOFbc0woSDD->Fill(track->Pt());
2524           }
2525           if(track->Pt()>1) {
2526             fHistPhiITSMI2InAcc->Fill(track->Phi());
2527             fHistEtaITSMI2InAcc->Fill(track->Eta());
2528           }
2529           if(isFake) fHistPtITSMI2InAccFake->Fill(track->Pt());
2530           if(isPrimary) {fHistPtITSMI2InAccP->Fill(track->Pt());} else {fHistPtITSMI2InAccS->Fill(track->Pt());}  
2531         }
2532         if(ConditionSPD(track)) {
2533           fHistPtITSMISPDInAcc->Fill(track->Pt());
2534           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMISPDInAccwSDD->Fill(track->Pt());
2535           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMISPDInAccwoSDD->Fill(track->Pt());
2536           if(isTOFbc0) {
2537             fHistPtITSMISPDInAccTOFbc0->Fill(track->Pt());
2538             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMISPDInAccTOFbc0wSDD->Fill(track->Pt());
2539             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMISPDInAccTOFbc0woSDD->Fill(track->Pt());
2540           }
2541           if(track->Pt()>1) {
2542             fHistPhiITSMISPDInAcc->Fill(track->Phi());
2543             fHistEtaITSMISPDInAcc->Fill(track->Eta());
2544           }
2545           if(isFake) fHistPtITSMISPDInAccFake->Fill(track->Pt());
2546           if(isPrimary) {fHistPtITSMISPDInAccP->Fill(track->Pt());} else {fHistPtITSMISPDInAccS->Fill(track->Pt());}  
2547         }
2548         if(ConditionSPDtwo(track)) {
2549           fHistPtITSMItwoSPDInAcc->Fill(track->Pt());
2550           if(track->Pt()>1) {
2551             fHistPhiITSMItwoSPDInAcc->Fill(track->Phi());
2552             fHistEtaITSMItwoSPDInAcc->Fill(track->Eta());
2553           }
2554           if(isFake) fHistPtITSMItwoSPDInAccFake->Fill(track->Pt());
2555           if(isPrimary) {fHistPtITSMItwoSPDInAccP->Fill(track->Pt());} else {fHistPtITSMItwoSPDInAccS->Fill(track->Pt());}  
2556         }
2557         if(ConditionSPDone(track)) {
2558           fHistPtITSMIoneSPDInAcc->Fill(track->Pt());
2559           if(fCheckSDDIsIn && sddIsIn) fHistPtITSMIoneSPDInAccwSDD->Fill(track->Pt());
2560           if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMIoneSPDInAccwoSDD->Fill(track->Pt());
2561           if(isTOFbc0) {
2562             fHistPtITSMIoneSPDInAccTOFbc0->Fill(track->Pt());
2563             if(fCheckSDDIsIn && sddIsIn) fHistPtITSMIoneSPDInAccTOFbc0wSDD->Fill(track->Pt());
2564             if(fCheckSDDIsIn && !sddIsIn) fHistPtITSMIoneSPDInAccTOFbc0woSDD->Fill(track->Pt());
2565           }
2566           if(track->Pt()>1) {
2567             fHistPhiITSMIoneSPDInAcc->Fill(track->Phi());
2568             fHistEtaITSMIoneSPDInAcc->Fill(track->Eta());
2569           }
2570           if(track->HasSharedPointOnITSLayer(0) || 
2571              track->HasSharedPointOnITSLayer(1) || 
2572              track->HasSharedPointOnITSLayer(2) || 
2573              track->HasSharedPointOnITSLayer(3) || 
2574              track->HasSharedPointOnITSLayer(4) || 
2575              track->HasSharedPointOnITSLayer(5)) {
2576             fHistPtITSMIoneSPDInAccShared->Fill(track->Pt());
2577             if(isFake) fHistPtITSMIoneSPDInAccSharedFake->Fill(track->Pt());
2578           }
2579           if(track->HasSharedPointOnITSLayer(0) || track->HasSharedPointOnITSLayer(1)) {
2580             fHistPtITSMIoneSPDInAccSharedSPD->Fill(track->Pt());
2581             if(isFake) fHistPtITSMIoneSPDInAccSharedSPDFake->Fill(track->Pt());
2582           }
2583           if(track->HasSharedPointOnITSLayer(0)) fHistPtITSMISPD1InAccShared->Fill(track->Pt());
2584           if(track->HasSharedPointOnITSLayer(1)) fHistPtITSMISPD2InAccShared->Fill(track->Pt());
2585
2586
2587           Float_t chi2redITS = 0.;
2588           if(track->GetNcls(0)>0) chi2redITS = track->GetITSchi2()/(Float_t)track->GetNcls(0);
2589
2590           if(track->Pt()>0.18 && track->Pt()<0.25)  fHistITSRedChi2NonFakePt02->Fill(chi2redITS);
2591           if(track->Pt()>0.4 && track->Pt()<0.6)  fHistITSRedChi2NonFakePt05->Fill(chi2redITS);
2592           if(track->Pt()>0.9 && track->Pt()<1.5)  fHistITSRedChi2NonFakePt1->Fill(chi2redITS);
2593           if(isFake) {
2594             fHistPtITSMIoneSPDInAccFake->Fill(track->Pt());
2595             if(track->Pt()>0.18 && track->Pt()<0.25)  fHistITSRedChi2FakePt02->Fill(chi2redITS);
2596             if(track->Pt()>0.4 && track->Pt()<0.6)  fHistITSRedChi2FakePt05->Fill(chi2redITS);
2597             if(track->Pt()>0.9 && track->Pt()<1.5)  fHistITSRedChi2FakePt1->Fill(chi2redITS);
2598           }
2599           if(nclsSDDSSD>=3) fHistPtITSMIoneSPDthreeSDDSSDInAcc->Fill(track->Pt());
2600
2601           if(isPrimary) {fHistPtITSMIoneSPDInAccP->Fill(track->Pt());} else {fHistPtITSMIoneSPDInAccS->Fill(track->Pt());}  
2602         }
2603         if(nclsokbadoutinzITS==6) fHistPtITSMIokbadoutinz6InAcc->Fill(track->Pt());
2604         if(nclsokbadoutinzITS==5) fHistPtITSMIokbadoutinz5InAcc->Fill(track->Pt());
2605         if(nclsokbadoutinzITS==4) fHistPtITSMIokbadoutinz4InAcc->Fill(track->Pt());
2606         if(nclsokbadoutinzITS==6 && track->Pt()>1) fHistPhiITSMIokbadoutinz6InAcc->Fill(track->Phi());  
2607       }
2608     }
2609
2610     if(tpcrefit) {
2611       fHistNclsITSMI->Fill(nclsITS);
2612     } else {
2613       fHistNclsITSSA->Fill(nclsITS);
2614       if(!outInZ) fHistNclsITSSAInAcc->Fill(nclsITS);
2615     }
2616
2617     
2618     if((tpcrefit && fUseITSSAforNtuples) || // only ITS-SA for ntuples
2619        (!tpcrefit && !fUseITSSAforNtuples)) // only ITS-TPC for ntuples
2620       { delete trackTPC; trackTPC=0; continue; }
2621
2622     // impact parameter to VertexTracks
2623     Float_t d0z0[2]={0,0},covd0z0[3]={0,0,0};
2624     Double_t d0z0TPC[2]={0,0},covd0z0TPC[3]={0,0,0};
2625     if(useTRKvtx) {
2626       if(!track->RelateToVertex(vertexESD,fESD->GetMagneticField(),kVeryBig)) { delete trackTPC; trackTPC=0; continue; }
2627     } else { 
2628       //if(!track->RelateToVertex(vertexMC,fESD->GetMagneticField(),kVeryBig)) continue;
2629       if(!track->RelateToVertex(spdv,fESD->GetMagneticField(),kVeryBig)) { delete trackTPC; trackTPC=0; continue; }
2630     } 
2631     track->GetImpactParameters(d0z0,covd0z0);
2632     if(trackTPC) trackTPC->PropagateToDCA(spdv,fESD->GetMagneticField(),kVeryBig,d0z0TPC,covd0z0TPC);
2633     if(covd0z0[0]<0. || covd0z0[2]<0. || covd0z0TPC[0]<0. || covd0z0TPC[2]<0.) { delete trackTPC; trackTPC=0; continue; }
2634
2635
2636     // track that passes final ITS+TPC cuts
2637     if(itsfindableAcc && fESDtrackCutsITSTPC->AcceptTrack(track)) {
2638       fHistPtITSTPCsel->Fill(track->Pt());
2639       if(fCheckSDDIsIn && sddIsIn) fHistPtITSTPCselwSDD->Fill(track->Pt());
2640       if(fCheckSDDIsIn && !sddIsIn) fHistPtITSTPCselwoSDD->Fill(track->Pt());
2641       if(isTOFbc0) {
2642         fHistPtITSTPCselTOFbc0->Fill(track->Pt());
2643         if(fCheckSDDIsIn && sddIsIn) fHistPtITSTPCselTOFbc0wSDD->Fill(track->Pt());
2644         if(fCheckSDDIsIn && !sddIsIn) fHistPtITSTPCselTOFbc0woSDD->Fill(track->Pt());
2645       }
2646       if(isFake) fHistPtITSTPCselFake->Fill(track->Pt());
2647       fHistdEdxVSPtITSTPCsel->Fill(track->Pt(),track->GetITSsignal());
2648       if(isPrimary) {
2649         fHistPtITSTPCselP->Fill(track->Pt());
2650         if(pdgTrk==321) fHistPtITSTPCselPfromStrange->Fill(track->Pt());
2651       } else {
2652         fHistPtITSTPCselS->Fill(track->Pt());
2653         if(isFromMat) fHistPtITSTPCselSfromMat->Fill(track->Pt());
2654         if(isFromStrange) fHistPtITSTPCselSfromStrange->Fill(track->Pt());
2655       }  
2656     }
2657     
2658
2659     // fill d0 histos
2660     if(((!fUseITSSAforNtuples&&itsfindableAcc) || fUseITSSAforNtuples) /*&& track->Charge()>0*/) {
2661       if(track->Pt()>0.150 && track->Pt()<0.200) {
2662         if(isPrimary) {
2663           fHistd0rphiTPCInAccP150200->Fill(d0z0TPC[0]);
2664           if(ConditionSPD(track) && itsrefit)
2665             fHistd0rphiITSMISPDInAccP150200->Fill(d0z0[0]);
2666           if((ConditionSPDone(track)) && itsrefit) {
2667             //if(((track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1)) || (!track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1))) && itsrefit) {
2668             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) fHistd0rphiITSMIoneSPDInAccP150200->Fill(d0z0[0]);
2669             if(TMath::Abs(d0z0[0])<maxdcaxyITSTPC) fHistd0zITSMIoneSPDInAccP150200->Fill(d0z0[1]);
2670           }
2671         } else {
2672           fHistd0rphiTPCInAccS150200->Fill(d0z0TPC[0]);
2673           if(ConditionSPD(track) && itsrefit)
2674             fHistd0rphiITSMISPDInAccS150200->Fill(d0z0[0]);
2675           if((ConditionSPDone(track)) && itsrefit) {
2676             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) {
2677               fHistd0rphiITSMIoneSPDInAccS150200->Fill(d0z0[0]);
2678               if(isFromStrange) fHistd0rphiITSMIoneSPDInAccS150200fromStrange->Fill(d0z0[0]);
2679               if(isFromMat) fHistd0rphiITSMIoneSPDInAccS150200fromMat->Fill(d0z0[0]);
2680             }
2681             if(TMath::Abs(d0z0[0])<maxdcaxyITSTPC) fHistd0zITSMIoneSPDInAccS150200->Fill(d0z0[1]);
2682             if(TMath::Abs(d0z0[0])<0.1) fHistPDGMoth150200->Fill(pdgMoth);
2683           }
2684         }
2685       }
2686       if(track->Pt()>0.350 && track->Pt()<0.450) {
2687         if(isPrimary) {
2688           if((ConditionSPDone(track)) && itsrefit) {
2689             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) fHistd0rphiITSMIoneSPDInAccP350450->Fill(d0z0[0]);
2690           }
2691         } else {
2692           if((ConditionSPDone(track)) && itsrefit) {
2693             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) {
2694               fHistd0rphiITSMIoneSPDInAccS350450->Fill(d0z0[0]);
2695               if(isFromStrange) fHistd0rphiITSMIoneSPDInAccS350450fromStrange->Fill(d0z0[0]);
2696               if(isFromMat) fHistd0rphiITSMIoneSPDInAccS350450fromMat->Fill(d0z0[0]);
2697             }
2698           }
2699         }
2700       }
2701       if(track->Pt()>0.500 && track->Pt()<0.700) {
2702         if(isPrimary) {
2703           fHistd0rphiTPCInAccP500700->Fill(d0z0TPC[0]);
2704           if(ConditionSPD(track) && itsrefit)
2705             fHistd0rphiITSMISPDInAccP500700->Fill(d0z0[0]);
2706           if((ConditionSPDone(track)) && itsrefit) {
2707             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) fHistd0rphiITSMIoneSPDInAccP500700->Fill(d0z0[0]);
2708             if(TMath::Abs(d0z0[0])<maxdcaxyITSTPC) fHistd0zITSMIoneSPDInAccP500700->Fill(d0z0[1]);
2709           }
2710         } else {
2711           fHistd0rphiTPCInAccS500700->Fill(d0z0TPC[0]);
2712           if(ConditionSPD(track) && itsrefit)
2713             fHistd0rphiITSMISPDInAccS500700->Fill(d0z0[0]);
2714           if((ConditionSPDone(track)) && itsrefit) {
2715             fHistPDGTrk->Fill(pdgTrk);
2716             fHistPDGMoth->Fill(pdgMoth);
2717             if(TMath::Abs(d0z0[0])<0.1) fHistPDGMoth500700->Fill(pdgMoth);
2718             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) {
2719               fHistd0rphiITSMIoneSPDInAccS500700->Fill(d0z0[0]);
2720               if(isFromStrange) fHistd0rphiITSMIoneSPDInAccS500700fromStrange->Fill(d0z0[0]);
2721               if(isFromMat) fHistd0rphiITSMIoneSPDInAccS500700fromMat->Fill(d0z0[0]);
2722             }
2723             if(TMath::Abs(d0z0[0])<maxdcaxyITSTPC) fHistd0zITSMIoneSPDInAccS500700->Fill(d0z0[1]);
2724             if(pdgMoth==310) fHistd0rphiITSMIoneSPDInAccS500700from310->Fill(d0z0[0]);
2725             if(pdgMoth==321) fHistd0rphiITSMIoneSPDInAccS500700from321->Fill(d0z0[0]);
2726             if(pdgMoth==3122) fHistd0rphiITSMIoneSPDInAccS500700from3122->Fill(d0z0[0]);
2727             if(pdgMoth==211) fHistd0rphiITSMIoneSPDInAccS500700from211->Fill(d0z0[0]);
2728             if(pdgMoth==22) fHistd0rphiITSMIoneSPDInAccS500700from22->Fill(d0z0[0]);
2729             if(pdgMoth==211 && TMath::Abs(d0z0[0])>0.5) fHistRProdVtxInAccS->Fill(rProdVtx);
2730           }
2731         }
2732       }
2733       if(track->Pt()>1.000 && track->Pt()<1.500) {
2734         if(isPrimary) {
2735           fHistd0rphiTPCInAccP10001500->Fill(d0z0TPC[0]);
2736           fHistd0zVSetaTPCInAccP10001500->Fill(d0z0TPC[1],trackTPC->Eta());
2737
2738           if(ConditionSPD(track) && itsrefit)
2739             fHistd0rphiITSMISPDInAccP10001500->Fill(d0z0[0]);
2740           if((ConditionSPDone(track)) && itsrefit) {
2741             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) fHistd0rphiITSMIoneSPDInAccP10001500->Fill(d0z0[0]);
2742             if(TMath::Abs(d0z0[0])<maxdcaxyITSTPC) fHistd0zITSMIoneSPDInAccP10001500->Fill(d0z0[1]);
2743             fHistd0rphiVSphiITSMIoneSPDInAccP10001500->Fill(d0z0[0],track->Phi());
2744             fHistd0rphiVSetaITSMIoneSPDInAccP10001500->Fill(d0z0[0],track->Eta());
2745           }
2746         } else {
2747           fHistd0rphiTPCInAccS10001500->Fill(d0z0TPC[0]);
2748           if(ConditionSPD(track) && itsrefit)
2749             fHistd0rphiITSMISPDInAccS10001500->Fill(d0z0[0]);
2750           if((ConditionSPDone(track)) && itsrefit) {
2751             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) {
2752               fHistd0rphiITSMIoneSPDInAccS10001500->Fill(d0z0[0]);
2753               if(isFromStrange) fHistd0rphiITSMIoneSPDInAccS10001500fromStrange->Fill(d0z0[0]);
2754               if(isFromMat) fHistd0rphiITSMIoneSPDInAccS10001500fromMat->Fill(d0z0[0]);
2755             }
2756             if(TMath::Abs(d0z0[0])<maxdcaxyITSTPC) fHistd0zITSMIoneSPDInAccS10001500->Fill(d0z0[1]);
2757             if(TMath::Abs(d0z0[0])<0.1) fHistPDGMoth10001500->Fill(pdgMoth);
2758           }
2759         }
2760       }
2761       if(track->Pt()>2.500 && track->Pt()<4.000) {
2762         if(isPrimary) {
2763           if((ConditionSPDone(track)) && itsrefit) {
2764             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) fHistd0rphiITSMIoneSPDInAccP25004000->Fill(d0z0[0]);
2765           }
2766         } else {
2767           if((ConditionSPDone(track)) && itsrefit) {
2768             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) {
2769               fHistd0rphiITSMIoneSPDInAccS25004000->Fill(d0z0[0]);
2770               if(isFromStrange) fHistd0rphiITSMIoneSPDInAccS25004000fromStrange->Fill(d0z0[0]);
2771               if(isFromMat) fHistd0rphiITSMIoneSPDInAccS25004000fromMat->Fill(d0z0[0]);
2772             }
2773           }
2774         }
2775       }
2776       if(track->Pt()>4.000 && track->Pt()<8.000) {
2777         if(isPrimary) {
2778           if((ConditionSPDone(track)) && itsrefit) {
2779             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) fHistd0rphiITSMIoneSPDInAccP40008000->Fill(d0z0[0]);
2780           }
2781         } else {
2782           if((ConditionSPDone(track)) && itsrefit) {
2783             if(TMath::Abs(d0z0[1])<maxdcazITSTPC) {
2784               fHistd0rphiITSMIoneSPDInAccS40008000->Fill(d0z0[0]);
2785               if(isFromStrange) fHistd0rphiITSMIoneSPDInAccS40008000fromStrange->Fill(d0z0[0]);
2786               if(isFromMat) fHistd0rphiITSMIoneSPDInAccS40008000fromMat->Fill(d0z0[0]);
2787             }
2788           }
2789         }
2790       }
2791
2792     }
2793
2794     if(trackTPC) { delete trackTPC; trackTPC=0; }
2795
2796     // encode ITS cluster map, including MC info
2797     Int_t iITSflag=MakeITSflag(track);
2798
2799     // if MC info is available: get particle properties
2800     Float_t ptMC=-999.,pdgMC=-999.,d0MC=-999.;
2801     Double_t d0z0MCv[2]={-999.,-999.},covd0z0MCv[3]={1.,1.,1.};
2802     if(fReadMC) {
2803       part = (TParticle*)stack->Particle(trkLabel);
2804       ptMC=part->Pt();
2805       pdgMC=part->GetPdgCode();
2806       d0MC=ParticleImpParMC(part,vertexMC,0.1*fESD->GetMagneticField());
2807       track->PropagateToDCA(vertexMC,fESD->GetMagneticField(),100.,d0z0MCv,covd0z0MCv);
2808       if(covd0z0MCv[0]<0. || covd0z0MCv[2]<0.) continue;
2809     }
2810
2811     Double_t sigmad0MCv=TMath::Sqrt(covd0z0MCv[0]);
2812     if(!itsrefit) sigmad0MCv *= -1.;
2813     Float_t isPrimaryFl = (isPrimary ? 1. : 0.);
2814     Float_t isTPCSelFl  = (itsfindableAcc ? 1. : 0.);
2815
2816     // fill ntuple with track properties
2817     if(fFillNtuples && SelectPt(track->Pt())) {
2818       Float_t fillArray[22]={static_cast<Float_t>(track->Pt()),static_cast<Float_t>(track->Eta()),static_cast<Float_t>(track->Phi()),static_cast<Float_t>(d0z0[0]),static_cast<Float_t>(d0z0[1]),static_cast<Float_t>(TMath::Sqrt(covd0z0[0])),static_cast<Float_t>(TMath::Sqrt(covd0z0[2])),ptMC,static_cast<Float_t>(pdgMC),static_cast<Float_t>(pdgMoth),static_cast<Float_t>(d0MC),static_cast<Float_t>(d0z0MCv[0]),static_cast<Float_t>(d0z0MCv[1]),static_cast<Float_t>(sigmad0MCv),static_cast<Float_t>(TMath::Sqrt(covd0z0MCv[2])),static_cast<Float_t>(iITSflag),static_cast<Float_t>(isPrimaryFl),static_cast<Float_t>(isTPCSelFl)};
2819       fNtupleESDTracks->Fill(fillArray);
2820     }
2821
2822     //---------------------------------------------    
2823     // AliTrackPoints: alignment checks
2824     // 
2825     if(!fFillNtuples) continue;
2826
2827     const AliTrackPointArray *array = track->GetTrackPointArray();
2828     if(!array) continue;
2829     AliTrackPoint point;
2830     Int_t pointOnLayer[6]={0,0,0,0,0,0};
2831     Int_t indexAssociated[6]={-1,-1,-1,-1,-1,-1},indexExtra=-1;
2832     Bool_t extra=kFALSE;
2833     Int_t layerId,layerExtra=-1;
2834     for(Int_t ipt=0; ipt<array->GetNPoints(); ipt++) {
2835       array->GetPoint(point,ipt);
2836       Float_t r = TMath::Sqrt(point.GetX()*point.GetX()+point.GetY()*point.GetY());
2837
2838       if(r>3 && r<6) {
2839         layerId = 0;
2840       } else if(r>6 && r<8) {
2841         layerId = 1;
2842       } else if(r>8 && r<18) {
2843         layerId = 2;
2844       } else if(r>18 && r<30) {
2845         layerId = 3;
2846       } else if(r>30 && r<40) {
2847         layerId = 4;
2848       } else if(r>40 && r<50) {
2849         layerId = 5;
2850       } else {
2851         layerId=100;
2852       }
2853
2854       // only ITS points
2855       if(layerId>5) continue;
2856
2857       if(!point.IsExtra()) {
2858         pointOnLayer[layerId]++;
2859         indexAssociated[layerId]=ipt;
2860       } else {
2861         // this is an extra cluster
2862         extra=kTRUE;
2863         layerExtra=layerId;
2864         indexExtra=ipt;
2865       }
2866     } // end loop on AliTrackPoints
2867
2868     TString vtitle = spdv->GetTitle();
2869     if(!vtitle.Contains("3D")) continue; 
2870
2871     // SPD tracklet
2872     if(indexAssociated[0]>=0 && indexAssociated[1]>=0) {
2873       AliTrackPoint pointSPD1,pointSPD2;
2874       array->GetPoint(pointSPD1,indexAssociated[0]);
2875       array->GetPoint(pointSPD2,indexAssociated[1]);
2876       Float_t phi=TMath::ATan2(pointSPD2.GetY()-pointSPD1.GetY(),pointSPD2.GetX()-pointSPD1.GetX());
2877       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())));
2878       Float_t theta=0.5*TMath::Pi()-lambda;
2879       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);
2880       AliESDtrack tracklet(&particle);
2881       Float_t dz[2];
2882       // distance to primary SPD (only if 3D and high multiplicity)
2883       if(spdv->GetNContributors()>10) { 
2884         tracklet.GetDZ(spdv->GetX(),spdv->GetY(),spdv->GetZ(),0,dz);
2885         //tracklet.GetDZ(-0.07,0.25,spdv->GetZ(),0,dz);
2886         fNtupleITSAlignSPDTracklets->Fill(phi,theta,0.5*(pointSPD1.GetZ()+pointSPD2.GetZ()),dz[0],dz[1],track->Pt());
2887       }
2888     }
2889
2890     // distance to extra
2891     if(extra && spdv->GetNContributors()>4 && indexAssociated[layerExtra]>-1) {
2892       AliTrackPoint pointExtra,pointAssociated;
2893       array->GetPoint(pointAssociated,indexAssociated[layerExtra]);
2894       array->GetPoint(pointExtra,indexExtra);
2895       Float_t phiExtra = TMath::ATan2(pointExtra.GetY()-spdv->GetY(),pointExtra.GetX()-spdv->GetX());
2896       Float_t phiAssociated = TMath::ATan2(pointAssociated.GetY()-spdv->GetY(),pointAssociated.GetX()-spdv->GetX());
2897       Float_t rExtra = TMath::Sqrt((pointExtra.GetX()-spdv->GetX())*(pointExtra.GetX()-spdv->GetX())+(pointExtra.GetY()-spdv->GetY())*(pointExtra.GetY()-spdv->GetY()));
2898       Float_t rAssociated = TMath::Sqrt((pointAssociated.GetX()-spdv->GetX())*(pointAssociated.GetX()-spdv->GetX())+(pointAssociated.GetY()-spdv->GetY())*(pointAssociated.GetY()-spdv->GetY()));
2899       Float_t dzExtra[2];
2900       dzExtra[0] = (phiExtra-phiAssociated)*0.5*(rExtra+rAssociated);
2901       dzExtra[1] = pointExtra.GetZ()-pointAssociated.GetZ()-(rExtra-rAssociated)*(pointAssociated.GetZ()-spdv->GetZ())/rAssociated;
2902       Float_t xlocExtra=-100.,zlocExtra=-100.;
2903       fNtupleITSAlignExtra->Fill(layerExtra,pointExtra.GetX(),pointExtra.GetY(),pointExtra.GetZ(),dzExtra[0],dzExtra[1],xlocExtra,zlocExtra,nclsITS,track->Pt());  
2904     }
2905     
2906     if(trackTPC) { delete trackTPC; trackTPC=0; }
2907   } // end loop on tracks
2908   
2909   if(vertexMC) { delete vertexMC; vertexMC=0; }
2910
2911   delete esdtrackCutsTPC;    esdtrackCutsTPC=0;
2912   delete esdtrackCutsITSTPC; esdtrackCutsITSTPC=0;
2913
2914   PostData(1, fOutput);
2915
2916   return;
2917 }      
2918
2919 //________________________________________________________________________
2920 void AliAnalysisTaskITSTrackingCheck::Terminate(Option_t *) 
2921 {
2922   // Draw result to the screen
2923   // Called once at the end of the query
2924   fOutput = dynamic_cast<TList*> (GetOutputData(1));
2925   if (!fOutput) {     
2926     Printf("ERROR: fOutput not available");
2927     return;
2928   }
2929   fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEvents"));
2930   fHistNEventsFrac = dynamic_cast<TH1F*>(fOutput->FindObject("fHistNEventsFrac"));
2931   if(fHistNEvents && fHistNEventsFrac) {
2932     for(Int_t ibin=2; ibin<=fHistNEvents->GetNbinsX(); ibin++) {
2933       if(fHistNEvents->GetBinContent(2)) fHistNEventsFrac->SetBinContent(ibin,fHistNEvents->GetBinContent(ibin)/fHistNEvents->GetBinContent(2)); 
2934     }
2935   }
2936
2937   return;
2938 }
2939 //---------------------------------------------------------------------------
2940 Int_t AliAnalysisTaskITSTrackingCheck::NumberOfITSClustersMC(Int_t label,Int_t nModules) const
2941 {
2942   //
2943   // Return number of ITS clusters produced by MC particle with given label
2944   //
2945   
2946   AliESDInputHandlerRP *esdHRP = dynamic_cast<AliESDInputHandlerRP*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
2947   if(!esdHRP) return -1;
2948   TTree *cTree = (TTree*)esdHRP->GetTreeR("ITS");
2949   if(!cTree) return -1;
2950   TClonesArray *clusters=0;
2951   cTree->SetBranchAddress("ITSRecPoints",&clusters);
2952   if(!clusters) return -1;
2953
2954   AliITSRecPoint *c=0;
2955   Int_t i,n,icl,lay,ilab;
2956   Int_t ncls[7]={0,0,0,0,0,0,0};
2957   Int_t nclstot=0;
2958
2959   for(i=0; i<nModules; i++) {
2960     cTree->GetEvent(i);
2961     n=clusters->GetEntriesFast();
2962     for (icl=0; icl<n; icl++) {
2963       c=(AliITSRecPoint*)clusters->UncheckedAt(icl);
2964       lay=c->GetLayer();
2965       //printf("mod %d lay %d xloc %f zloc %f\n",i,lay,c->GetDetLocalX(),c->GetDetLocalZ());
2966       for(ilab=0;ilab<3;ilab++) {
2967         if(c->GetLabel(ilab)==label) ncls[lay]++;
2968       }
2969     }
2970   }
2971   for(i=0;i<fNITSLayers;i++) { 
2972     //printf("%d\n",ncls[i]); 
2973     if(ncls[i]) nclstot++; 
2974   }
2975
2976   return nclstot;
2977 }
2978 //---------------------------------------------------------------------------
2979 Int_t AliAnalysisTaskITSTrackingCheck::NumberOfITSClusters(Int_t idet,Float_t &xloc) const
2980 {
2981   //
2982   // Return number of ITS clusters produced by MC particle with given label
2983   //
2984   
2985   AliESDInputHandlerRP *esdHRP = dynamic_cast<AliESDInputHandlerRP*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
2986   if(!esdHRP) return -1;
2987   TTree *cTree = (TTree*)esdHRP->GetTreeR("ITS");
2988   if(!cTree) return -1;
2989   TClonesArray *clusters=0;   // new TClonesArray("AliITSRecPoint",10000);
2990   cTree->SetBranchAddress("ITSRecPoints",&clusters);
2991   if(!clusters) return -1;
2992
2993   AliITSRecPoint *c=0;
2994   Int_t n,icl;
2995
2996   cTree->GetEvent(idet);
2997   n=clusters->GetEntriesFast();
2998
2999   if(n==1) {
3000     for (icl=0; icl<n; icl++) {
3001       c=(AliITSRecPoint*)clusters->UncheckedAt(icl);
3002       xloc = c->GetDetLocalX();
3003     }
3004   }
3005   return n;
3006 }
3007 //---------------------------------------------------------------------------
3008 void AliAnalysisTaskITSTrackingCheck::FillNClustersModuleMap()
3009 {
3010   //
3011   // Number of clusters per module
3012   //
3013   
3014   AliESDInputHandlerRP *esdHRP = dynamic_cast<AliESDInputHandlerRP*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
3015   if(!esdHRP) return;
3016   TTree *cTree = (TTree*)esdHRP->GetTreeR("ITS");
3017   if(!cTree) return;
3018   TClonesArray *clusters=0;   // new TClonesArray("AliITSRecPoint",10000);
3019   cTree->SetBranchAddress("ITSRecPoints",&clusters);
3020
3021   for(Int_t idet=0;idet<2198;idet++) {
3022     cTree->GetEvent(idet);
3023     if(!clusters) continue;
3024     fHistNClustersMapModule->SetBinContent(idet,clusters->GetEntriesFast());
3025   }
3026
3027   return;
3028 }
3029 //---------------------------------------------------------------------------
3030 Double_t AliAnalysisTaskITSTrackingCheck::ParticleImpParMC(TParticle *part,
3031                                                            AliESDVertex *vert,
3032                                                            Double_t bzT) const
3033 {
3034   //
3035   // Return the MC value of the impact parameter
3036   //
3037
3038   bzT = TMath::Abs(bzT);
3039
3040  
3041   Double_t vx=part->Vx()-vert->GetX();
3042   Double_t vy=part->Vy()-vert->GetY();
3043       
3044   Double_t pt=part->Pt();     
3045   Double_t px=part->Px();     
3046   Double_t py=part->Py();     
3047   Double_t charge = (part->GetPdgCode()>0. ? 1. : -1.);
3048   if(TMath::Abs(part->GetPdgCode())<100) charge*=-1.;
3049
3050
3051   if(TMath::Abs(px)<0.000001) px=0.000001;     
3052   Double_t rAnd=((10./2.99792458)*pt/bzT)*100.;
3053   Double_t center[3],d0;
3054   center[0]=vx-(1./charge)*rAnd*(py/pt);
3055   center[1]=vy+(1./charge)*rAnd*(px/pt);
3056   center[2]=TMath::Sqrt(center[0]*center[0]+center[1]*center[1]);
3057   d0 = -center[2]+rAnd;
3058
3059   //if(pt>29) printf("%f %f %f %d %f %f %f %f %f\n",px,py,pt,part->GetPdgCode(),center[0],center[1],center[2],rAnd,d0);
3060
3061   return d0;
3062 }
3063 //---------------------------------------------------------------------------
3064 Bool_t AliAnalysisTaskITSTrackingCheck::SelectPt(Double_t pt)
3065 {
3066   //
3067   // Keep only tracks in given pt bins
3068   // 
3069   Double_t ptlower[11]={0.15,0.29,0.49,0.75,0.9,1.9,3.5,6.5, 9.,19.,27.};
3070   Double_t ptupper[11]={0.16,0.31,0.51,0.85,1.1,2.1,4.5,7.5,11.,21.,33.};
3071
3072   for(Int_t i=0; i<11; i++) {
3073     if(pt>ptlower[i] && pt<ptupper[i]) {
3074       fCountsPerPtBin[i]++;
3075       return kTRUE;
3076     }
3077   }
3078   return kFALSE;
3079   //return kTRUE;
3080 }
3081 //---------------------------------------------------------------------------
3082 Int_t AliAnalysisTaskITSTrackingCheck::MakeITSflag(AliESDtrack *track) const {
3083   //
3084   // ITSflag takes the value 0 if the track has no cluster assigned in the SPDs, 
3085   // 1 (2) if one cluster is assigned in SPD1(2), 3 if two clusters are present. 
3086   // Then the same adding 10,20 or 30 for SDD and 100,200 or 300 for SSD
3087   //
3088   Int_t iITSflag=0;
3089   if(track->HasPointOnITSLayer(0))             iITSflag+=1;
3090   if(track->HasPointOnITSLayer(fNITSLayers-5)) iITSflag+=2;
3091   if(track->HasPointOnITSLayer(fNITSLayers-4)) iITSflag+=10;
3092   if(track->HasPointOnITSLayer(fNITSLayers-3)) iITSflag+=20;
3093   if(track->HasPointOnITSLayer(fNITSLayers-2)) iITSflag+=100;
3094   if(track->HasPointOnITSLayer(fNITSLayers-1)) iITSflag+=200;
3095   
3096   // number of associated ITS clusters
3097   iITSflag += 1000*track->GetNcls(0);
3098   
3099   // number of associated TPC clusters
3100   iITSflag += 100000*track->GetNcls(1);
3101   
3102   // if MC info and is available
3103   // write the number of ITS clusters produced by this track
3104   Int_t nITSclsMC=0;
3105   if(fReadMC && fReadRPLabels) {
3106     nITSclsMC = NumberOfITSClustersMC(TMath::Abs(track->GetLabel()));
3107     if(nITSclsMC>=0) iITSflag += 10000*nITSclsMC;    
3108     // flag fake tracks
3109     if(track->GetLabel()<0) iITSflag *= -1;
3110   }
3111
3112   return iITSflag;
3113 }
3114 //---------------------------------------------------------------------------
3115 Bool_t AliAnalysisTaskITSTrackingCheck::IsSelectedCentrality() const
3116 {
3117   //
3118   // check if events is in the required multiplicity range
3119   //
3120
3121   const AliMultiplicity *alimult = fESD->GetMultiplicity();
3122   Int_t ntrklets=1;
3123   Int_t nclsSPDouter=0;
3124   if(alimult) {
3125     ntrklets = alimult->GetNumberOfTracklets();
3126     nclsSPDouter = alimult->GetNumberOfITSClusters(1);
3127   }
3128
3129   if(nclsSPDouter<fMinMult || nclsSPDouter>fMaxMult) return kFALSE;
3130
3131
3132   return kTRUE;
3133 }
3134 //---------------------------------------------------------------------------
3135 Bool_t AliAnalysisTaskITSTrackingCheck::ConditionSPD(AliESDtrack *track) const
3136 {
3137   //
3138   // check if track has points in all inner barrel layers
3139   //
3140
3141
3142   if(NPointsInnerBarrel(track)==(fNITSLayers-4)) return kTRUE;
3143   return kFALSE;
3144 }
3145 //---------------------------------------------------------------------------
3146 Bool_t AliAnalysisTaskITSTrackingCheck::ConditionSPDone(AliESDtrack *track) const
3147 {
3148   //
3149   // check if track has points in at least one inner barrel layer
3150   //
3151
3152
3153   if(NPointsInnerBarrel(track)>=1) return kTRUE;
3154   return kFALSE;
3155 }
3156 //---------------------------------------------------------------------------
3157 Bool_t AliAnalysisTaskITSTrackingCheck::ConditionSPDtwo(AliESDtrack *track) const
3158 {
3159   //
3160   // check if track has points in at least two inner barrel layers
3161   //
3162
3163
3164   if(NPointsInnerBarrel(track)>=2) return kTRUE;
3165   return kFALSE;
3166 }
3167 //---------------------------------------------------------------------------
3168 Int_t AliAnalysisTaskITSTrackingCheck::NPointsInnerBarrel(AliESDtrack *track) const
3169 {
3170   //
3171   // N of points in inner barrel layers
3172   //
3173   Int_t n=0;
3174
3175   for(Int_t i=0; i<(fNITSLayers-4); i++) {
3176     if(track->HasPointOnITSLayer(i)) n++;
3177   }
3178
3179   return n;
3180 }