New track selection and new track matching
[u/mrichter/AliRoot.git] / PWG0 / dNdPt / AlidNdPtAnalysis.cxx
CommitLineData
0aaa8b91 1/**************************************************************************\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
3 * *\r
4 * Author: The ALICE Off-line Project. *\r
5 * Contributors are mentioned in the code where appropriate. *\r
6 * *\r
7 * Permission to use, copy, modify and distribute this software and its *\r
8 * documentation strictly for non-commercial purposes is hereby granted *\r
9 * without fee, provided that the above copyright notice appears in all *\r
10 * copies and that both the copyright notice and this permission notice *\r
11 * appear in the supporting documentation. The authors make no claims *\r
12 * about the suitability of this software for any purpose. It is *\r
13 * provided "as is" without express or implied warranty. *\r
14 **************************************************************************/\r
00b81913 15//------------------------------------------------------------------------------\r
16// AlidNdPtAnalysis class. \r
17// \r
18// a. functionality:\r
19// - fills analysis control histograms\r
20// - fills generic correction matrices \r
21// - generates correction matrices \r
22//\r
23// b. data members:\r
24// - generic correction matrices\r
25// - control histograms\r
26//\r
27// Author: J.Otwinowski 04/11/2008 \r
68f10917 28// last change: 2011-04-04 by M.Knichel\r
00b81913 29//------------------------------------------------------------------------------\r
0aaa8b91 30\r
0aaa8b91 31#include "TH1.h"\r
32#include "TH2.h"\r
0aaa8b91 33#include "TCanvas.h"\r
c931948b 34#include "THnSparse.h"\r
0aaa8b91 35\r
36#include "AliHeader.h" \r
17f2bf95 37#include "AliInputEventHandler.h" \r
38#include "AliAnalysisManager.h" \r
0aaa8b91 39#include "AliGenEventHeader.h" \r
40#include "AliStack.h" \r
41#include "AliESDEvent.h" \r
42#include "AliMCEvent.h" \r
43#include "AliESDtrackCuts.h" \r
44#include "AliLog.h" \r
7f7dd416 45#include "AliMultiplicity.h"\r
46#include "AliTracker.h"\r
0aaa8b91 47\r
48#include "AlidNdPtEventCuts.h"\r
49#include "AlidNdPtAcceptanceCuts.h"\r
d269b0e6 50#include "AliPhysicsSelection.h"\r
17e8c701 51#include "AliTriggerAnalysis.h"\r
0aaa8b91 52\r
bad4ba69 53#include "AliPWG0Helper.h"\r
54#include "AlidNdPtHelper.h"\r
0aaa8b91 55#include "AlidNdPtAnalysis.h"\r
56\r
57using namespace std;\r
58\r
59ClassImp(AlidNdPtAnalysis)\r
60\r
61//_____________________________________________________________________________\r
62 AlidNdPtAnalysis::AlidNdPtAnalysis(): AlidNdPt(),\r
63 fAnalysisFolder(0),\r
64 fHistogramsOn(kFALSE),\r
65\r
66 // event multiplicity correlation matrix \r
67 fEventMultCorrelationMatrix(0),\r
68\r
69 // rec. track pt vs true track pt correlation matrix \r
70 fTrackPtCorrelationMatrix(0),\r
71\r
72 // event level correction\r
73 fGenEventMatrix(0),\r
74 fGenSDEventMatrix(0),\r
75 fGenDDEventMatrix(0),\r
76 fGenNDEventMatrix(0),\r
77 fGenNSDEventMatrix(0),\r
78\r
79 fTriggerEventMatrix(0),\r
80 fTriggerSDEventMatrix(0),\r
81 fTriggerDDEventMatrix(0),\r
82 fTriggerNDEventMatrix(0),\r
83 fTriggerNSDEventMatrix(0),\r
84\r
85 fRecEventMatrix(0),\r
86 fRecSDEventMatrix(0),\r
87 fRecDDEventMatrix(0),\r
88 fRecNDEventMatrix(0),\r
89 fRecNSDEventMatrix(0),\r
90\r
91 //\r
92 // track-event level correction \r
93 //\r
94 fGenTrackEventMatrix(0),\r
95 fGenTrackSDEventMatrix(0),\r
96 fGenTrackDDEventMatrix(0),\r
97 fGenTrackNDEventMatrix(0),\r
98 fGenTrackNSDEventMatrix(0),\r
99\r
100 fTriggerTrackEventMatrix(0),\r
101 fTriggerTrackSDEventMatrix(0),\r
102 fTriggerTrackDDEventMatrix(0),\r
103 fTriggerTrackNDEventMatrix(0),\r
104 fTriggerTrackNSDEventMatrix(0),\r
105\r
106 fRecTrackEventMatrix(0),\r
107 fRecTrackSDEventMatrix(0),\r
108 fRecTrackDDEventMatrix(0),\r
109 fRecTrackNDEventMatrix(0),\r
110 fRecTrackNSDEventMatrix(0),\r
111\r
112 // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)\r
985bdfd5 113 fGenTrackMatrix(0),\r
0aaa8b91 114 fGenPrimTrackMatrix(0),\r
115 fRecPrimTrackMatrix(0),\r
116\r
117 // secondary track contamination correction (fRecSecTrackMatrix / fRecTrackMatrix)\r
118 fRecTrackMatrix(0),\r
119 fRecSecTrackMatrix(0),\r
120\r
121 // multiple rec. track contamination corrections (fRecMultTrackMatrix / fRecTrackMatrix)\r
122 fRecMultTrackMatrix(0),\r
123\r
124 // event control histograms\r
125 fMCEventHist1(0),\r
126 fRecEventHist1(0),\r
127 fRecEventHist2(0),\r
128 fRecMCEventHist1(0),\r
129 fRecMCEventHist2(0),\r
130 fRecMCEventHist3(0),\r
131\r
132 // rec. pt and eta resolution w.r.t MC\r
133 fRecMCTrackHist1(0),\r
134\r
135 //multple reconstructed tracks\r
985bdfd5 136 fMCMultRecTrackHist1(0), \r
137\r
138 // rec. track control histograms\r
f4f8cae4 139 fRecTrackHist2(0),\r
140\r
141 // Generic histograms to be corrected\r
142 fRecEventHist(0),\r
55468faf 143 fRecTrackHist(0),\r
f4f8cae4 144\r
55468faf 145 // Candle event histogram\r
68f10917 146 fRecCandleEventMatrix(0),\r
147 \r
148 fMultNbins(0),\r
149 fPtNbins(0),\r
150 fPtCorrNbins(0),\r
151 fEtaNbins(0),\r
152 fZvNbins(0),\r
153 fBinsMult(0),\r
154 fBinsPt(0),\r
155 fBinsPtCorr(0),\r
156 fBinsEta(0),\r
157 fBinsZv(0),\r
158\r
159 fIsInit(kFALSE) \r
160 \r
0aaa8b91 161{\r
162 // default constructor\r
163 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
164 fMCTrackHist1[i]=0; \r
165 fMCPrimTrackHist1[i]=0; \r
7f7dd416 166 fMCPrimTrackHist2[i]=0; \r
0aaa8b91 167 fMCSecTrackHist1[i]=0; \r
168 fRecTrackHist1[i]=0; \r
169 fRecTrackMultHist1[i]=0; \r
170 }\r
68f10917 171 //Init();\r
0aaa8b91 172}\r
173\r
174//_____________________________________________________________________________\r
175AlidNdPtAnalysis::AlidNdPtAnalysis(Char_t* name, Char_t* title): AlidNdPt(name,title),\r
176 fAnalysisFolder(0),\r
177 fHistogramsOn(kFALSE),\r
178\r
179 // event multiplicity correlation matrix \r
180 fEventMultCorrelationMatrix(0),\r
181\r
182 // rec. track pt vs true track pt correlation matrix \r
183 fTrackPtCorrelationMatrix(0),\r
184\r
185 // event level correction\r
186 fGenEventMatrix(0),\r
187 fGenSDEventMatrix(0),\r
188 fGenDDEventMatrix(0),\r
189 fGenNDEventMatrix(0),\r
190 fGenNSDEventMatrix(0),\r
191\r
192 fTriggerEventMatrix(0),\r
193 fTriggerSDEventMatrix(0),\r
194 fTriggerDDEventMatrix(0),\r
195 fTriggerNDEventMatrix(0),\r
196 fTriggerNSDEventMatrix(0),\r
197\r
198 fRecEventMatrix(0),\r
199 fRecSDEventMatrix(0),\r
200 fRecDDEventMatrix(0),\r
201 fRecNDEventMatrix(0),\r
202 fRecNSDEventMatrix(0),\r
203\r
204 //\r
205 // track-event level correction \r
206 //\r
207 fGenTrackEventMatrix(0),\r
208 fGenTrackSDEventMatrix(0),\r
209 fGenTrackDDEventMatrix(0),\r
210 fGenTrackNDEventMatrix(0),\r
211 fGenTrackNSDEventMatrix(0),\r
212\r
213 fTriggerTrackEventMatrix(0),\r
214 fTriggerTrackSDEventMatrix(0),\r
215 fTriggerTrackDDEventMatrix(0),\r
216 fTriggerTrackNDEventMatrix(0),\r
217 fTriggerTrackNSDEventMatrix(0),\r
218\r
219 fRecTrackEventMatrix(0),\r
220 fRecTrackSDEventMatrix(0),\r
221 fRecTrackDDEventMatrix(0),\r
222 fRecTrackNDEventMatrix(0),\r
223 fRecTrackNSDEventMatrix(0),\r
224\r
225 // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)\r
985bdfd5 226 fGenTrackMatrix(0),\r
0aaa8b91 227 fGenPrimTrackMatrix(0),\r
228 fRecPrimTrackMatrix(0),\r
229\r
230 // secondary track contamination correction (fRecSecTrackMatrix / fRecTrackMatrix)\r
231 fRecTrackMatrix(0),\r
232 fRecSecTrackMatrix(0),\r
233\r
234 // multiple rec. track contamination corrections (fRecMultTrackMatrix / fRecTrackMatrix)\r
235 fRecMultTrackMatrix(0),\r
236\r
237 // event control histograms\r
238 fMCEventHist1(0),\r
239 fRecEventHist1(0),\r
240 fRecEventHist2(0),\r
241 fRecMCEventHist1(0),\r
242 fRecMCEventHist2(0),\r
243 fRecMCEventHist3(0),\r
244 \r
245 // rec. pt and eta resolution w.r.t MC\r
246 fRecMCTrackHist1(0),\r
247\r
248 //multple reconstructed tracks\r
985bdfd5 249 fMCMultRecTrackHist1(0), \r
250\r
251 // rec. track control histograms\r
f4f8cae4 252 fRecTrackHist2(0),\r
253\r
254 // Generic histograms to be corrected\r
255 fRecEventHist(0),\r
55468faf 256 fRecTrackHist(0),\r
257\r
258 // Candle event histogram\r
68f10917 259 fRecCandleEventMatrix(0),\r
260 \r
261 fMultNbins(0),\r
262 fPtNbins(0),\r
263 fPtCorrNbins(0),\r
264 fEtaNbins(0),\r
265 fZvNbins(0),\r
266 fBinsMult(0),\r
267 fBinsPt(0),\r
268 fBinsPtCorr(0),\r
269 fBinsEta(0),\r
270 fBinsZv(0),\r
271\r
272 fIsInit(kFALSE) \r
273 \r
0aaa8b91 274{\r
00b81913 275 //\r
0aaa8b91 276 // constructor\r
00b81913 277 //\r
0aaa8b91 278 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
279 fMCTrackHist1[i]=0; \r
280 fMCPrimTrackHist1[i]=0; \r
7f7dd416 281 fMCPrimTrackHist2[i]=0; \r
0aaa8b91 282 fMCSecTrackHist1[i]=0; \r
283 fRecTrackHist1[i]=0; \r
284 fRecTrackMultHist1[i]=0; \r
285 }\r
286\r
68f10917 287 //Init();\r
0aaa8b91 288}\r
289\r
290//_____________________________________________________________________________\r
291AlidNdPtAnalysis::~AlidNdPtAnalysis() {\r
00b81913 292 //\r
293 // destructor\r
0aaa8b91 294 //\r
295 if(fEventMultCorrelationMatrix) delete fEventMultCorrelationMatrix; fEventMultCorrelationMatrix=0;\r
296 //\r
297 if(fTrackPtCorrelationMatrix) delete fTrackPtCorrelationMatrix; fTrackPtCorrelationMatrix=0;\r
298 //\r
299 if(fGenEventMatrix) delete fGenEventMatrix; fGenEventMatrix=0;\r
300 if(fGenSDEventMatrix) delete fGenSDEventMatrix; fGenSDEventMatrix=0;\r
301 if(fGenDDEventMatrix) delete fGenDDEventMatrix; fGenDDEventMatrix=0;\r
302 if(fGenNDEventMatrix) delete fGenNDEventMatrix; fGenNDEventMatrix=0;\r
303 if(fGenNSDEventMatrix) delete fGenNSDEventMatrix; fGenNSDEventMatrix=0;\r
304\r
305 if(fTriggerEventMatrix) delete fTriggerEventMatrix; fTriggerEventMatrix=0;\r
306 if(fTriggerSDEventMatrix) delete fTriggerSDEventMatrix; fTriggerSDEventMatrix=0;\r
307 if(fTriggerDDEventMatrix) delete fTriggerDDEventMatrix; fTriggerDDEventMatrix=0;\r
308 if(fTriggerNDEventMatrix) delete fTriggerNDEventMatrix; fTriggerNDEventMatrix=0;\r
309 if(fTriggerNSDEventMatrix) delete fTriggerNSDEventMatrix; fTriggerNSDEventMatrix=0;\r
310\r
311 if(fRecEventMatrix) delete fRecEventMatrix; fRecEventMatrix=0;\r
312 if(fRecSDEventMatrix) delete fRecSDEventMatrix; fRecSDEventMatrix=0;\r
313 if(fRecDDEventMatrix) delete fRecDDEventMatrix; fRecDDEventMatrix=0;\r
314 if(fRecNDEventMatrix) delete fRecNDEventMatrix; fRecNDEventMatrix=0;\r
315 if(fRecNSDEventMatrix) delete fRecNSDEventMatrix; fRecNSDEventMatrix=0;\r
316\r
55468faf 317 if(fRecCandleEventMatrix) delete fRecCandleEventMatrix; fRecCandleEventMatrix=0;\r
0aaa8b91 318 //\r
319 if(fGenTrackEventMatrix) delete fGenTrackEventMatrix; fGenTrackEventMatrix=0;\r
320 if(fGenTrackSDEventMatrix) delete fGenTrackSDEventMatrix; fGenTrackSDEventMatrix=0;\r
321 if(fGenTrackDDEventMatrix) delete fGenTrackDDEventMatrix; fGenTrackDDEventMatrix=0;\r
322 if(fGenTrackNDEventMatrix) delete fGenTrackNDEventMatrix; fGenTrackNDEventMatrix=0;\r
323 if(fGenTrackNSDEventMatrix) delete fGenTrackNSDEventMatrix; fGenTrackNSDEventMatrix=0;\r
324\r
515964cb 325 if(fTriggerTrackEventMatrix) delete fTriggerTrackEventMatrix; fTriggerTrackEventMatrix=0;\r
0aaa8b91 326 if(fTriggerTrackSDEventMatrix) delete fTriggerTrackSDEventMatrix; fTriggerTrackSDEventMatrix=0;\r
327 if(fTriggerTrackDDEventMatrix) delete fTriggerTrackDDEventMatrix; fTriggerTrackDDEventMatrix=0;\r
328 if(fTriggerTrackNDEventMatrix) delete fTriggerTrackNDEventMatrix; fTriggerTrackNDEventMatrix=0;\r
329 if(fTriggerTrackNSDEventMatrix) delete fTriggerTrackNSDEventMatrix; fTriggerTrackNSDEventMatrix=0;\r
330\r
331 if(fRecTrackEventMatrix) delete fRecTrackEventMatrix; fRecTrackEventMatrix=0;\r
332 if(fRecTrackSDEventMatrix) delete fRecTrackSDEventMatrix; fRecTrackSDEventMatrix=0;\r
333 if(fRecTrackDDEventMatrix) delete fRecTrackDDEventMatrix; fRecTrackDDEventMatrix=0;\r
334 if(fRecTrackNDEventMatrix) delete fRecTrackNDEventMatrix; fRecTrackNDEventMatrix=0;\r
335 if(fRecTrackNSDEventMatrix) delete fRecTrackNSDEventMatrix; fRecTrackNSDEventMatrix=0;\r
336\r
337 //\r
985bdfd5 338 if(fGenTrackMatrix) delete fGenTrackMatrix; fGenTrackMatrix=0;\r
0aaa8b91 339 if(fGenPrimTrackMatrix) delete fGenPrimTrackMatrix; fGenPrimTrackMatrix=0;\r
340 if(fRecPrimTrackMatrix) delete fRecPrimTrackMatrix; fRecPrimTrackMatrix=0;\r
341 //\r
342 if(fRecTrackMatrix) delete fRecTrackMatrix; fRecTrackMatrix=0;\r
343 if(fRecSecTrackMatrix) delete fRecSecTrackMatrix; fRecSecTrackMatrix=0;\r
344 // \r
345 if(fRecMultTrackMatrix) delete fRecMultTrackMatrix; fRecMultTrackMatrix=0;\r
346 //\r
347 // Control histograms\r
348 //\r
349 if(fMCEventHist1) delete fMCEventHist1; fMCEventHist1=0;\r
350 if(fRecEventHist1) delete fRecEventHist1; fRecEventHist1=0;\r
351 if(fRecEventHist2) delete fRecEventHist2; fRecEventHist2=0;\r
352 if(fRecMCEventHist1) delete fRecMCEventHist1; fRecMCEventHist1=0;\r
353 if(fRecMCEventHist2) delete fRecMCEventHist2; fRecMCEventHist2=0;\r
354 if(fRecMCEventHist3) delete fRecMCEventHist3; fRecMCEventHist3=0;\r
355 //\r
356 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
357 if(fMCTrackHist1[i]) delete fMCTrackHist1[i]; fMCTrackHist1[i]=0;\r
358 if(fMCPrimTrackHist1[i]) delete fMCPrimTrackHist1[i]; fMCPrimTrackHist1[i]=0;\r
7f7dd416 359 if(fMCPrimTrackHist2[i]) delete fMCPrimTrackHist2[i]; fMCPrimTrackHist2[i]=0;\r
0aaa8b91 360 if(fMCSecTrackHist1[i]) delete fMCSecTrackHist1[i]; fMCSecTrackHist1[i]=0;\r
361 if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
362 if(fRecTrackMultHist1[i]) delete fRecTrackMultHist1[i]; fRecTrackMultHist1[i]=0;\r
363 }\r
364 if(fRecMCTrackHist1) delete fRecMCTrackHist1; fRecMCTrackHist1=0;\r
365 if(fMCMultRecTrackHist1) delete fMCMultRecTrackHist1; fMCMultRecTrackHist1=0; \r
985bdfd5 366 if(fRecTrackHist2) delete fRecTrackHist2; fRecTrackHist2=0; \r
f4f8cae4 367\r
368 //\r
369 if(fRecEventHist) delete fRecEventHist; fRecEventHist=0; \r
370 if(fRecTrackHist) delete fRecTrackHist; fRecTrackHist=0; \r
371\r
0aaa8b91 372 //\r
373 if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;\r
374}\r
375\r
376//_____________________________________________________________________________\r
377void AlidNdPtAnalysis::Init(){\r
68f10917 378 \r
379 Int_t multNbins = 27;\r
380 Int_t ptNbinsTrackEventCorr = 36;\r
381 Int_t ptNbins = 68;\r
382 Int_t etaNbins = 30;\r
383 Int_t zvNbins = 12;\r
0aaa8b91 384\r
68f10917 385 Double_t binsMultDefault[28] = {-0.5, 0.5 , 1.5 , 2.5 , 3.5 , 4.5 , 5.5 , 6.5 , 7.5 , 8.5,\r
695facdf 386 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5, 17.5, 18.5,\r
387 19.5,20.5, 21.5, 22.5, 23.5, 24.5, 29.5, 149.5};\r
791aaf54 388\r
68f10917 389 Double_t binsPtTrackEventCorrDefault[37] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,3.0,4.0,50.0};\r
791aaf54 390\r
68f10917 391 Double_t binsPtDefault[69] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,18.0,20.0,22.0,24.0,26.0,28.0,30.0,32.0,34.0,36.0,40.0,45.0,50.0};\r
791aaf54 392\r
68f10917 393 Double_t binsEtaDefault[31] = {-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5};\r
791aaf54 394\r
68f10917 395 Double_t binsZvDefault[13] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
396 \r
397 Double_t* binsMult = binsMultDefault;\r
398 Double_t* binsPtTrackEventCorr = binsPtTrackEventCorrDefault;\r
399 Double_t* binsPt = binsPtDefault;\r
400 Double_t* binsEta = binsEtaDefault;\r
401 Double_t* binsZv = binsZvDefault; \r
402\r
403 if (fMultNbins > 0) { multNbins = fMultNbins; binsMult = fBinsMult; }\r
404 if (fPtNbins > 0) { ptNbins = fPtNbins; binsPt = fBinsPt; }\r
405 if (fPtCorrNbins > 0) { ptNbinsTrackEventCorr = fPtCorrNbins; binsPtTrackEventCorr = fBinsPtCorr; }\r
406 if (fEtaNbins > 0) { etaNbins = fEtaNbins; binsEta = fBinsEta; }\r
407 if (fZvNbins > 0) { zvNbins = fZvNbins; binsZv = fBinsZv; } \r
0aaa8b91 408\r
17e8c701 409 //Int_t binsTrackMatrix[3]={zvNbins,ptNbins,etaNbins};\r
791aaf54 410 Int_t binsTrackEventCorrMatrix[3]={zvNbins,ptNbinsTrackEventCorr,etaNbins};\r
0aaa8b91 411\r
f4f8cae4 412\r
413 //\r
414 // Generic histograms to be corrected\r
415 //\r
416 Int_t binsEventHist[2]={100,150};\r
417 Double_t minEventHist[2]={-25.,-0.5}; \r
418 Double_t maxEventHist[2]={25.,149.5}; \r
419\r
420 fRecEventHist = new THnSparseF("fRecEventHist","Zv:multMB",2,binsEventHist,minEventHist,maxEventHist);\r
421 fRecEventHist->GetAxis(0)->SetTitle("Zv (cm)");\r
422 fRecEventHist->GetAxis(1)->SetTitle("multiplicity MB");\r
423 fRecEventHist->Sumw2();\r
424\r
425 //\r
426 Int_t binsTrackHist[3]={100,ptNbins,etaNbins};\r
427 Double_t minTrackHist[3]={-25.,0.,-1.5}; \r
428 Double_t maxTrackHist[3]={25.,50.,1.5}; \r
429\r
430 fRecTrackHist = new THnSparseF("fRecTrackHist","Zv:pT:eta",3,binsTrackHist,minTrackHist,maxTrackHist);\r
431 fRecTrackHist->SetBinEdges(1,binsPt);\r
432 fRecTrackHist->SetBinEdges(2,binsEta);\r
433 fRecTrackHist->GetAxis(0)->SetTitle("Zv (cm)");\r
434 fRecTrackHist->GetAxis(1)->SetTitle("p_{T} (GeV/c)");\r
435 fRecTrackHist->GetAxis(2)->SetTitle("#eta");\r
436 fRecTrackHist->Sumw2();\r
437\r
0aaa8b91 438 //\r
439 // rec. vs MC correlation matrices\r
440 //\r
441 Int_t binsMultTrueEventMatrix[2]={150,150};\r
442 Double_t minMultTrueEventMatrix[2]={-0.5,-0.5}; \r
443 Double_t maxMultTrueEventMatrix[2]={149.5,149.5}; \r
444 fEventMultCorrelationMatrix = new THnSparseF("fEventMultCorrelationMatrix","mult:true_mult",2,binsMultTrueEventMatrix,minMultTrueEventMatrix,maxMultTrueEventMatrix);\r
445 fEventMultCorrelationMatrix->GetAxis(0)->SetTitle("track multiplicity");\r
7f7dd416 446 fEventMultCorrelationMatrix->GetAxis(1)->SetTitle("true multiplicity");\r
0aaa8b91 447 fEventMultCorrelationMatrix->Sumw2();\r
448 \r
449 Int_t binsTrackPtCorrelationMatrix[3]={ptNbins,ptNbins,etaNbins};\r
450 fTrackPtCorrelationMatrix = new THnSparseF("fTrackPtCorrelationMatrix","Pt:mcPt:mcEta",3,binsTrackPtCorrelationMatrix);\r
451 fTrackPtCorrelationMatrix->SetBinEdges(0,binsPt);\r
452 fTrackPtCorrelationMatrix->SetBinEdges(1,binsPt);\r
453 fTrackPtCorrelationMatrix->SetBinEdges(2,binsEta);\r
454 fTrackPtCorrelationMatrix->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
455 fTrackPtCorrelationMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
456 fTrackPtCorrelationMatrix->GetAxis(2)->SetTitle("mcEta");\r
457 fTrackPtCorrelationMatrix->Sumw2();\r
458\r
459 //\r
460 // Efficiency and contamination correction matrices\r
461 //\r
791aaf54 462 Int_t binsEventMatrix[2]={zvNbins,multNbins};\r
0aaa8b91 463 Double_t minEventMatrix[2]={-25.,-0.5}; \r
464 Double_t maxEventMatrix[2]={25.,149.5}; \r
465\r
bad4ba69 466 fGenEventMatrix = new THnSparseF("fGenEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 467 fGenEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 468 fGenEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 469 fGenEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 470 fGenEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 471 fGenEventMatrix->Sumw2();\r
472 \r
bad4ba69 473 fGenSDEventMatrix = new THnSparseF("fGenSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 474 fGenSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 475 fGenSDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 476 fGenSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 477 fGenSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 478 fGenSDEventMatrix->Sumw2();\r
479 \r
bad4ba69 480 fGenDDEventMatrix = new THnSparseF("fGenDDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 481 fGenDDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 482 fGenDDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 483 fGenDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 484 fGenDDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 485 fGenDDEventMatrix->Sumw2();\r
486 \r
bad4ba69 487 fGenNDEventMatrix = new THnSparseF("fGenNDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 488 fGenNDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 489 fGenNDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 490 fGenNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 491 fGenNDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 492 fGenNDEventMatrix->Sumw2();\r
493\r
bad4ba69 494 fGenNSDEventMatrix = new THnSparseF("fGenNSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 495 fGenNSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 496 fGenNSDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 497 fGenNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 498 fGenNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 499 fGenNSDEventMatrix->Sumw2();\r
500\r
501 //\r
bad4ba69 502 fTriggerEventMatrix = new THnSparseF("fTriggerEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 503 fTriggerEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 504 fTriggerEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 505 fTriggerEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 506 fTriggerEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 507 fTriggerEventMatrix->Sumw2();\r
508\r
bad4ba69 509 fTriggerSDEventMatrix = new THnSparseF("fTriggerSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 510 fTriggerSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 511 fTriggerSDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 512 fTriggerSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 513 fTriggerSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 514 fTriggerSDEventMatrix->Sumw2();\r
515 \r
bad4ba69 516 fTriggerDDEventMatrix = new THnSparseF("fTriggerDDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 517 fTriggerDDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 518 fTriggerDDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 519 fTriggerDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 520 fTriggerDDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 521 fTriggerDDEventMatrix->Sumw2();\r
522 \r
bad4ba69 523 fTriggerNDEventMatrix = new THnSparseF("fTriggerNDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 524 fTriggerNDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 525 fTriggerNDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 526 fTriggerNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 527 fTriggerNDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 528 fTriggerNDEventMatrix->Sumw2();\r
529 \r
bad4ba69 530 fTriggerNSDEventMatrix = new THnSparseF("fTriggerNSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 531 fTriggerNSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 532 fTriggerNSDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 533 fTriggerNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 534 fTriggerNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 535 fTriggerNSDEventMatrix->Sumw2();\r
536 \r
537 //\r
bad4ba69 538 fRecEventMatrix = new THnSparseF("fRecEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 539 fRecEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 540 fRecEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 541 fRecEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 542 fRecEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 543 fRecEventMatrix->Sumw2();\r
544\r
bad4ba69 545 fRecSDEventMatrix = new THnSparseF("fRecSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 546 fRecSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 547 fRecSDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 548 fRecSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 549 fRecSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 550 fRecSDEventMatrix->Sumw2();\r
551 \r
bad4ba69 552 fRecDDEventMatrix = new THnSparseF("fRecDDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 553 fRecDDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 554 fRecDDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 555 fRecDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 556 fRecDDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 557 fRecDDEventMatrix->Sumw2();\r
558 \r
bad4ba69 559 fRecNDEventMatrix = new THnSparseF("fRecNDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 560 fRecNDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 561 fRecNDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 562 fRecNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 563 fRecNDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 564 fRecNDEventMatrix->Sumw2();\r
565 \r
bad4ba69 566 fRecNSDEventMatrix = new THnSparseF("fRecNSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
0aaa8b91 567 fRecNSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 568 fRecNSDEventMatrix->SetBinEdges(1,binsMult);\r
0aaa8b91 569 fRecNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
bad4ba69 570 fRecNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
0aaa8b91 571 fRecNSDEventMatrix->Sumw2();\r
572\r
55468faf 573 fRecCandleEventMatrix = new THnSparseF("fRecCandleEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
574 fRecCandleEventMatrix->SetBinEdges(0,binsZv);\r
575 fRecCandleEventMatrix->SetBinEdges(1,binsMult);\r
576 fRecCandleEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
577 fRecCandleEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
578 fRecCandleEventMatrix->Sumw2();\r
579\r
0aaa8b91 580 // \r
581 // track to event corrections\r
582 //\r
583\r
791aaf54 584 fGenTrackEventMatrix = new THnSparseF("fGenTrackEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 585 fGenTrackEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 586 fGenTrackEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 587 fGenTrackEventMatrix->SetBinEdges(2,binsEta);\r
588 fGenTrackEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
589 fGenTrackEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
590 fGenTrackEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
591 fGenTrackEventMatrix->Sumw2();\r
592\r
791aaf54 593 fGenTrackSDEventMatrix = new THnSparseF("fGenTrackSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 594 fGenTrackSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 595 fGenTrackSDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 596 fGenTrackSDEventMatrix->SetBinEdges(2,binsEta);\r
597 fGenTrackSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
598 fGenTrackSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
599 fGenTrackSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
600 fGenTrackSDEventMatrix->Sumw2();\r
601\r
791aaf54 602 fGenTrackDDEventMatrix = new THnSparseF("fGenTrackDDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 603 fGenTrackDDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 604 fGenTrackDDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 605 fGenTrackDDEventMatrix->SetBinEdges(2,binsEta);\r
606 fGenTrackDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
607 fGenTrackDDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
608 fGenTrackDDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
609 fGenTrackDDEventMatrix->Sumw2();\r
610\r
791aaf54 611 fGenTrackNDEventMatrix = new THnSparseF("fGenTrackNDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 612 fGenTrackNDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 613 fGenTrackNDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 614 fGenTrackNDEventMatrix->SetBinEdges(2,binsEta);\r
615 fGenTrackNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
616 fGenTrackNDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
617 fGenTrackNDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
618 fGenTrackNDEventMatrix->Sumw2();\r
619\r
791aaf54 620 fGenTrackNSDEventMatrix = new THnSparseF("fGenTrackNSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 621 fGenTrackNSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 622 fGenTrackNSDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 623 fGenTrackNSDEventMatrix->SetBinEdges(2,binsEta);\r
624 fGenTrackNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
625 fGenTrackNSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
626 fGenTrackNSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
627 fGenTrackNSDEventMatrix->Sumw2();\r
628\r
629\r
630 //\r
791aaf54 631 fTriggerTrackEventMatrix = new THnSparseF("fTriggerTrackEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 632 fTriggerTrackEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 633 fTriggerTrackEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 634 fTriggerTrackEventMatrix->SetBinEdges(2,binsEta);\r
635 fTriggerTrackEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
636 fTriggerTrackEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
637 fTriggerTrackEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
638 fTriggerTrackEventMatrix->Sumw2();\r
639\r
791aaf54 640 fTriggerTrackSDEventMatrix = new THnSparseF("fTriggerTrackSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 641 fTriggerTrackSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 642 fTriggerTrackSDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 643 fTriggerTrackSDEventMatrix->SetBinEdges(2,binsEta);\r
644 fTriggerTrackSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
645 fTriggerTrackSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
646 fTriggerTrackSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
647 fTriggerTrackSDEventMatrix->Sumw2();\r
648\r
791aaf54 649 fTriggerTrackDDEventMatrix = new THnSparseF("fTriggerTrackDDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 650 fTriggerTrackDDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 651 fTriggerTrackDDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 652 fTriggerTrackDDEventMatrix->SetBinEdges(2,binsEta);\r
653 fTriggerTrackDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
654 fTriggerTrackDDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
655 fTriggerTrackDDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
656 fTriggerTrackDDEventMatrix->Sumw2();\r
657\r
791aaf54 658 fTriggerTrackNDEventMatrix = new THnSparseF("fTriggerTrackNDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 659 fTriggerTrackNDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 660 fTriggerTrackNDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 661 fTriggerTrackNDEventMatrix->SetBinEdges(2,binsEta);\r
662 fTriggerTrackNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
663 fTriggerTrackNDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
664 fTriggerTrackNDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
665 fTriggerTrackNDEventMatrix->Sumw2();\r
666\r
791aaf54 667 fTriggerTrackNSDEventMatrix = new THnSparseF("fTriggerTrackNSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 668 fTriggerTrackNSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 669 fTriggerTrackNSDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 670 fTriggerTrackNSDEventMatrix->SetBinEdges(2,binsEta);\r
671 fTriggerTrackNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
672 fTriggerTrackNSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
673 fTriggerTrackNSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
674 fTriggerTrackNSDEventMatrix->Sumw2();\r
675\r
676 //\r
791aaf54 677 fRecTrackEventMatrix = new THnSparseF("fRecTrackEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 678 fRecTrackEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 679 fRecTrackEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 680 fRecTrackEventMatrix->SetBinEdges(2,binsEta);\r
681 fRecTrackEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
682 fRecTrackEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
683 fRecTrackEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
684 fRecTrackEventMatrix->Sumw2();\r
685\r
791aaf54 686 fRecTrackSDEventMatrix = new THnSparseF("fRecTrackSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 687 fRecTrackSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 688 fRecTrackSDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 689 fRecTrackSDEventMatrix->SetBinEdges(2,binsEta);\r
690 fRecTrackSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
691 fRecTrackSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
692 fRecTrackSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
693 fRecTrackSDEventMatrix->Sumw2();\r
694\r
791aaf54 695 fRecTrackDDEventMatrix = new THnSparseF("fRecTrackDDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 696 fRecTrackDDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 697 fRecTrackDDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 698 fRecTrackDDEventMatrix->SetBinEdges(2,binsEta);\r
699 fRecTrackDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
700 fRecTrackDDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
701 fRecTrackDDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
702 fRecTrackDDEventMatrix->Sumw2();\r
703\r
791aaf54 704 fRecTrackNDEventMatrix = new THnSparseF("fRecTrackNDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 705 fRecTrackNDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 706 fRecTrackNDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 707 fRecTrackNDEventMatrix->SetBinEdges(2,binsEta);\r
708 fRecTrackNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
709 fRecTrackNDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
710 fRecTrackNDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
711 fRecTrackNDEventMatrix->Sumw2();\r
712\r
791aaf54 713 fRecTrackNSDEventMatrix = new THnSparseF("fRecTrackNSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 714 fRecTrackNSDEventMatrix->SetBinEdges(0,binsZv);\r
791aaf54 715 fRecTrackNSDEventMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 716 fRecTrackNSDEventMatrix->SetBinEdges(2,binsEta);\r
717 fRecTrackNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
718 fRecTrackNSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
719 fRecTrackNSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
720 fRecTrackNSDEventMatrix->Sumw2();\r
721\r
722 //\r
723 // tracks correction matrices\r
724 //\r
17e8c701 725 //fGenTrackMatrix = new THnSparseF("fGenTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
726 fGenTrackMatrix = new THnSparseF("fGenTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
985bdfd5 727 fGenTrackMatrix->SetBinEdges(0,binsZv);\r
17e8c701 728 //fGenTrackMatrix->SetBinEdges(1,binsPt);\r
729 fGenTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
985bdfd5 730 fGenTrackMatrix->SetBinEdges(2,binsEta);\r
731 fGenTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
732 fGenTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
733 fGenTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
734 fGenTrackMatrix->Sumw2();\r
735\r
17e8c701 736 //fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
737 fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 738 fGenPrimTrackMatrix->SetBinEdges(0,binsZv);\r
17e8c701 739 //fGenPrimTrackMatrix->SetBinEdges(1,binsPt);\r
740 fGenPrimTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 741 fGenPrimTrackMatrix->SetBinEdges(2,binsEta);\r
742 fGenPrimTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
743 fGenPrimTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
744 fGenPrimTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
745 fGenPrimTrackMatrix->Sumw2();\r
746\r
17e8c701 747 //fRecPrimTrackMatrix = new THnSparseF("fRecPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
748 fRecPrimTrackMatrix = new THnSparseF("fRecPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 749 fRecPrimTrackMatrix->SetBinEdges(0,binsZv);\r
17e8c701 750 //fRecPrimTrackMatrix->SetBinEdges(1,binsPt);\r
751 fRecPrimTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 752 fRecPrimTrackMatrix->SetBinEdges(2,binsEta);\r
753 fRecPrimTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
754 fRecPrimTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
755 fRecPrimTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
756 fRecPrimTrackMatrix->Sumw2();\r
757\r
758 //\r
17e8c701 759 //fRecTrackMatrix = new THnSparseF("fRecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
760 fRecTrackMatrix = new THnSparseF("fRecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 761 fRecTrackMatrix->SetBinEdges(0,binsZv);\r
17e8c701 762 //fRecTrackMatrix->SetBinEdges(1,binsPt);\r
763 fRecTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 764 fRecTrackMatrix->SetBinEdges(2,binsEta);\r
765 fRecTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
766 fRecTrackMatrix->GetAxis(1)->SetTitle("Pt (GeV/c)");\r
767 fRecTrackMatrix->GetAxis(2)->SetTitle("Eta");\r
768 fRecTrackMatrix->Sumw2();\r
769\r
17e8c701 770 //fRecSecTrackMatrix = new THnSparseF("fRecSecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
771 fRecSecTrackMatrix = new THnSparseF("fRecSecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 772 fRecSecTrackMatrix->SetBinEdges(0,binsZv);\r
17e8c701 773 //fRecSecTrackMatrix->SetBinEdges(1,binsPt);\r
774 fRecSecTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 775 fRecSecTrackMatrix->SetBinEdges(2,binsEta);\r
776 fRecSecTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
777 fRecSecTrackMatrix->GetAxis(1)->SetTitle("Pt (GeV/c)");\r
778 fRecSecTrackMatrix->GetAxis(2)->SetTitle("Eta");\r
779 fRecSecTrackMatrix->Sumw2();\r
780\r
781 //\r
17e8c701 782 //fRecMultTrackMatrix = new THnSparseF("fRecMultTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
783 fRecMultTrackMatrix = new THnSparseF("fRecMultTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
0aaa8b91 784 fRecMultTrackMatrix->SetBinEdges(0,binsZv);\r
17e8c701 785 //fRecMultTrackMatrix->SetBinEdges(1,binsPt);\r
786 fRecMultTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
0aaa8b91 787 fRecMultTrackMatrix->SetBinEdges(2,binsEta);\r
788 fRecMultTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
789 fRecMultTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
790 fRecMultTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
791 fRecMultTrackMatrix->Sumw2();\r
792\r
793 //\r
794 // Control analysis histograms\r
795 //\r
796\r
797 Int_t binsMCEventHist1[3]={100,100,140};\r
798 Double_t minMCEventHist1[3]={-0.1,-0.1,-35.}; \r
799 Double_t maxMCEventHist1[3]={0.1,0.1,35.}; \r
800 fMCEventHist1 = new THnSparseF("fMCEventHist1","mcXv:mcYv:mcZv",3,binsMCEventHist1,minMCEventHist1,maxMCEventHist1);\r
801 fMCEventHist1->GetAxis(0)->SetTitle("mcXv (cm)");\r
802 fMCEventHist1->GetAxis(1)->SetTitle("mcYv (cm)");\r
803 fMCEventHist1->GetAxis(2)->SetTitle("mcZv (cm)");\r
804 fMCEventHist1->Sumw2();\r
805\r
806 //\r
807 Int_t binsRecEventHist1[3]={100,100,140};\r
808 Double_t minRecEventHist1[3]={-3.,-3.,-35.}; \r
809 Double_t maxRecEventHist1[3]={3.,3.,35.}; \r
810 \r
811 fRecEventHist1 = new THnSparseF("fRecEventHist1","Xv:Yv:Zv",3,binsRecEventHist1,minRecEventHist1,maxRecEventHist1);\r
812 fRecEventHist1->GetAxis(0)->SetTitle("Xv (cm)");\r
813 fRecEventHist1->GetAxis(1)->SetTitle("Yv (cm)");\r
814 fRecEventHist1->GetAxis(2)->SetTitle("Zv (cm)");\r
815 fRecEventHist1->Sumw2();\r
816\r
817 //\r
bad4ba69 818 Int_t binsRecEventHist2[3]={zvNbins,150,150};\r
819 Double_t minRecEventHist2[3]={-25.,-0.5,-0.5}; \r
820 Double_t maxRecEventHist2[3]={25.,149.5,149.5}; \r
0aaa8b91 821 \r
bad4ba69 822 fRecEventHist2 = new THnSparseF("fRecEventHist2","Zv:multMB:mult",3,binsRecEventHist2,minRecEventHist2,maxRecEventHist2);\r
0aaa8b91 823 fRecEventHist2->SetBinEdges(0,binsZv);\r
824 fRecEventHist2->GetAxis(0)->SetTitle("Zv (cm)");\r
bad4ba69 825 fRecEventHist2->GetAxis(1)->SetTitle("multiplicity MB");\r
826 fRecEventHist2->GetAxis(2)->SetTitle("multiplicity");\r
0aaa8b91 827 fRecEventHist2->Sumw2();\r
828\r
829 //\r
00b81913 830 Double_t kFact = 0.1;\r
0aaa8b91 831 Int_t binsRecMCEventHist1[3]={100,100,100};\r
832 Double_t minRecMCEventHist1[3]={-10.0*kFact,-10.0*kFact,-10.0*kFact}; \r
833 Double_t maxRecMCEventHist1[3]={10.0*kFact,10.0*kFact,10.0*kFact}; \r
834 \r
bad4ba69 835 fRecMCEventHist1 = new THnSparseF("fRecMCEventHist1","Xv-mcXv:Yv-mcYv:Zv-mcZv",3,binsRecMCEventHist1,minRecMCEventHist1,maxRecMCEventHist1);\r
836 fRecMCEventHist1->GetAxis(0)->SetTitle("Xv-mcXv (cm)");\r
837 fRecMCEventHist1->GetAxis(1)->SetTitle("Yv-mcYv (cm)");\r
838 fRecMCEventHist1->GetAxis(2)->SetTitle("Zv-mcZv (cm)");\r
0aaa8b91 839 fRecMCEventHist1->Sumw2();\r
840\r
841 //\r
842 Int_t binsRecMCEventHist2[3]={100,100,150};\r
843 Double_t minRecMCEventHist2[3]={-10.0*kFact,-10.0*kFact,0.0}; \r
844 Double_t maxRecMCEventHist2[3]={10.0*kFact,10.0*kFact,149.50}; \r
845\r
bad4ba69 846 fRecMCEventHist2 = new THnSparseF("fRecMCEventHist2","Xv-mcXv:Zv-mcZv:mult",3,binsRecMCEventHist2,minRecMCEventHist2,maxRecMCEventHist2);\r
847 fRecMCEventHist2->GetAxis(0)->SetTitle("Xv-mcXv (cm)");\r
848 fRecMCEventHist2->GetAxis(1)->SetTitle("Zv-mcZv (cm)");\r
849 fRecMCEventHist2->GetAxis(2)->SetTitle("multiplicity");\r
0aaa8b91 850 fRecMCEventHist2->Sumw2();\r
851\r
852 Int_t binsRecMCEventHist3[2]={150,5};\r
853 Double_t minRecMCEventHist3[2]={-0.5,0.0}; \r
854 Double_t maxRecMCEventHist3[2]={149.50,5.0}; \r
bad4ba69 855 fRecMCEventHist3 = new THnSparseF("fRecMCEventHist3","mult:EventType (ND, DD, SD)",2,binsRecMCEventHist3,minRecMCEventHist3,maxRecMCEventHist3);\r
856 fRecMCEventHist3->GetAxis(0)->SetTitle("multiplicity");\r
0aaa8b91 857 fRecMCEventHist3->GetAxis(1)->SetTitle("EventType");\r
858 fRecMCEventHist3->Sumw2();\r
859\r
860 //\r
861 char name[256];\r
862 char title[256];\r
863 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) \r
864 {\r
865 // THnSparse track histograms\r
866 \r
867 Int_t binsMCTrackHist1[3]= {ptNbins, etaNbins, 90};\r
868 Double_t minMCTrackHist1[3]={0.,-1.,0.}; \r
869 Double_t maxMCTrackHist1[3]={10.,1.,2.*TMath::Pi()}; \r
870 sprintf(name,"fMCTrackHist1_%d",i);\r
871 sprintf(title,"mcPt:mcEta:mcPhi");\r
872 \r
873 fMCTrackHist1[i] = new THnSparseF(name,title,3,binsMCTrackHist1,minMCTrackHist1,maxMCTrackHist1);\r
874 fMCTrackHist1[i]->SetBinEdges(0,binsPt);\r
875 fMCTrackHist1[i]->SetBinEdges(1,binsEta);\r
876 fMCTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
877 fMCTrackHist1[i]->GetAxis(1)->SetTitle("mcEta");\r
878 fMCTrackHist1[i]->GetAxis(2)->SetTitle("mcPhi (rad)");\r
879 fMCTrackHist1[i]->Sumw2();\r
880\r
7f7dd416 881 Int_t binsMCPrimTrackHist1[5]= {ptNbins,etaNbins,6,20,4000};\r
882 Double_t minMCPrimTrackHist1[5]={0.,-1.,0.,0.,0.}; \r
883 Double_t maxMCPrimTrackHist1[5]={10.,1.,6.,20.,4000.}; \r
0aaa8b91 884 sprintf(name,"fMCPrimTrackHist1_%d",i);\r
885 sprintf(title,"mcPt:mcEta:pid:mech:mother");\r
886 \r
7f7dd416 887 fMCPrimTrackHist1[i] = new THnSparseF(name,title,5,binsMCPrimTrackHist1,minMCPrimTrackHist1,maxMCPrimTrackHist1);\r
0aaa8b91 888 fMCPrimTrackHist1[i]->SetBinEdges(0,binsPt);\r
889 fMCPrimTrackHist1[i]->SetBinEdges(1,binsEta);\r
890 fMCPrimTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
891 fMCPrimTrackHist1[i]->GetAxis(1)->SetTitle("mcEta");\r
892 fMCPrimTrackHist1[i]->GetAxis(2)->SetTitle("pid");\r
893 fMCPrimTrackHist1[i]->GetAxis(3)->SetTitle("mech");\r
894 fMCPrimTrackHist1[i]->GetAxis(4)->SetTitle("mother");\r
895 fMCPrimTrackHist1[i]->Sumw2();\r
896\r
73ca0831 897 Int_t binsMCPrimTrackHist2[3]= {4000,20,4000};\r
898 Double_t minMCPrimTrackHist2[3]={0.,0.,0.}; \r
899 Double_t maxMCPrimTrackHist2[3]={4000.,20.,4000.}; \r
7f7dd416 900 sprintf(name,"fMCPrimTrackHist2_%d",i);\r
901 sprintf(title,"pdg:mech:mother");\r
902 \r
73ca0831 903 fMCPrimTrackHist2[i] = new THnSparseF(name,title,3,binsMCPrimTrackHist2,minMCPrimTrackHist2,maxMCPrimTrackHist2);\r
7f7dd416 904 fMCPrimTrackHist2[i]->GetAxis(0)->SetTitle("pdg");\r
905 fMCPrimTrackHist2[i]->GetAxis(1)->SetTitle("mech");\r
906 fMCPrimTrackHist2[i]->GetAxis(2)->SetTitle("mother");\r
907 fMCPrimTrackHist2[i]->Sumw2();\r
908\r
0aaa8b91 909 Int_t binsMCSecTrackHist1[5]= {ptNbins,etaNbins,6,20,4000};\r
910 Double_t minMCSecTrackHist1[5]={0.,-1.,0.,0.,0.}; \r
911 Double_t maxMCSecTrackHist1[5]={10.,1.,6.,20.,4000.}; \r
912 sprintf(name,"fMCSecTrackHist1_%d",i);\r
73ca0831 913 sprintf(title,"mcPt:mcEta:pid:mech:mother");\r
0aaa8b91 914 \r
915 fMCSecTrackHist1[i] = new THnSparseF(name,title,5,binsMCSecTrackHist1,minMCSecTrackHist1,maxMCSecTrackHist1);\r
916 fMCSecTrackHist1[i]->SetBinEdges(0,binsPt);\r
917 fMCSecTrackHist1[i]->SetBinEdges(1,binsEta);\r
918 fMCSecTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
919 fMCSecTrackHist1[i]->GetAxis(1)->SetTitle("mcEta");\r
920 fMCSecTrackHist1[i]->GetAxis(2)->SetTitle("pid");\r
921 fMCSecTrackHist1[i]->GetAxis(3)->SetTitle("mech");\r
922 fMCSecTrackHist1[i]->GetAxis(4)->SetTitle("mother");\r
923 fMCSecTrackHist1[i]->Sumw2();\r
924\r
925 //\r
926\r
927 // \r
928 \r
929 Int_t binsRecTrackHist1[3]={ptNbins,etaNbins,90};\r
930 Double_t minRecTrackHist1[3]={0.,-1.,0.}; \r
931 Double_t maxRecTrackHist1[3]={10.,1.,2.*TMath::Pi()};\r
932 sprintf(name,"fRecTrackHist1_%d",i);\r
933 sprintf(title,"Pt:Eta:Phi");\r
934 fRecTrackHist1[i] = new THnSparseF(name,title,3,binsRecTrackHist1,minRecTrackHist1,maxRecTrackHist1);\r
935 fRecTrackHist1[i]->SetBinEdges(0,binsPt);\r
936 fRecTrackHist1[i]->SetBinEdges(1,binsEta);\r
985bdfd5 937 fRecTrackHist1[i]->GetAxis(0)->SetTitle("p_{T} (GeV/c)");\r
938 fRecTrackHist1[i]->GetAxis(1)->SetTitle("#eta");\r
939 fRecTrackHist1[i]->GetAxis(2)->SetTitle("#phi (rad)");\r
0aaa8b91 940 fRecTrackHist1[i]->Sumw2();\r
941\r
942 // \r
943 Int_t binsRecTrackMultHist1[2]={ptNbins,150};\r
944 Double_t minRecTrackMultHist1[2]={0.,-0.5}; \r
945 Double_t maxRecTrackMultHist1[2]={10.,149.5};\r
946 sprintf(name,"fRecTrackMultHist_%d",i);\r
947 sprintf(title,"Pt:Mult");\r
948 fRecTrackMultHist1[i] = new THnSparseF(name,title,2,binsRecTrackMultHist1,minRecTrackMultHist1,maxRecTrackMultHist1);\r
949 fRecTrackMultHist1[i]->SetBinEdges(0,binsPt);\r
950 fRecTrackMultHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
951 fRecTrackMultHist1[i]->GetAxis(1)->SetTitle("multiplicity");\r
952 fRecTrackMultHist1[i]->Sumw2();\r
953 }\r
954\r
955 Int_t binsRecMCTrackHist1[4] = {ptNbins,etaNbins,100,100};\r
956 Double_t minRecMCTrackHist1[4]={0.,-1.,-0.5,-0.5}; \r
957 Double_t maxRecMCTrackHist1[4]={20.,1.,0.5,0.5}; \r
958 sprintf(name,"fRecMCTrackHist1");\r
959 sprintf(title,"mcPt:mcEta:(Pt-mcPt)/mcPt:(Eta-mcEta)");\r
960 fRecMCTrackHist1 = new THnSparseF(name,title,4,binsRecMCTrackHist1,minRecMCTrackHist1,maxRecMCTrackHist1);\r
961 fRecMCTrackHist1->SetBinEdges(0,binsPt);\r
962 fRecMCTrackHist1->SetBinEdges(1,binsEta);\r
963 fRecMCTrackHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
964 fRecMCTrackHist1->GetAxis(1)->SetTitle("mcEta");\r
965 fRecMCTrackHist1->GetAxis(2)->SetTitle("(Pt-mcPt)/mcPt");\r
966 fRecMCTrackHist1->GetAxis(3)->SetTitle("Eta-mcEta");\r
967\r
968 Int_t binsMCMultRecTrackHist1[3] = {ptNbins,etaNbins,6};\r
969 Double_t minMCMultRecTrackHist1[3]={0.,-1.,0.}; \r
970 Double_t maxMCMultRecTrackHist1[3]={20.,1.,6.}; \r
971 sprintf(name,"fMCMultRecTrackHist1");\r
972 sprintf(title,"mcPt:mcEta:pid");\r
973 fMCMultRecTrackHist1 = new THnSparseF(name,title,3,binsMCMultRecTrackHist1,minMCMultRecTrackHist1,maxMCMultRecTrackHist1);\r
974 fMCMultRecTrackHist1->SetBinEdges(0,binsPt);\r
975 fMCMultRecTrackHist1->SetBinEdges(1,binsEta);\r
976 fMCMultRecTrackHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
977 fMCMultRecTrackHist1->GetAxis(1)->SetTitle("mcEta");\r
978 fMCMultRecTrackHist1->GetAxis(2)->SetTitle("pid");\r
979\r
985bdfd5 980 //nClust:chi2PerClust:pt:eta:phi\r
981 Int_t binsRecTrackHist2[5]={160,100,ptNbins,etaNbins,90};\r
982 Double_t minRecTrackHist2[5]={0., 0., 0, -1.5, 0.};\r
983 Double_t maxRecRecTrackHist2[5]={160.,10., 16, 1.5, 2.*TMath::Pi()};\r
984\r
985 fRecTrackHist2 = new THnSparseF("fRecTrackHist2","nClust:chi2PerClust:pt:eta:phi",5,binsRecTrackHist2,minRecTrackHist2,maxRecRecTrackHist2);\r
986 fRecTrackHist2->SetBinEdges(2,binsPt);\r
987 fRecTrackHist2->SetBinEdges(3,binsEta);\r
988 fRecTrackHist2->GetAxis(0)->SetTitle("nClust");\r
989 fRecTrackHist2->GetAxis(1)->SetTitle("chi2PerClust");\r
990 fRecTrackHist2->GetAxis(2)->SetTitle("p_{T} (GeV/c)");\r
991 fRecTrackHist2->GetAxis(3)->SetTitle("#eta");\r
992 fRecTrackHist2->GetAxis(4)->SetTitle("#phi (rad)");\r
993 fRecTrackHist2->Sumw2();\r
994\r
0aaa8b91 995 // init folder\r
996 fAnalysisFolder = CreateFolder("folderdNdPt","Analysis dNdPt Folder");\r
68f10917 997 \r
998 // set init flag\r
999 fIsInit = kTRUE;\r
0aaa8b91 1000}\r
1001\r
1002//_____________________________________________________________________________\r
1003void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mcEvent)\r
1004{\r
68f10917 1005 // init if not done already\r
1006 if (!fIsInit) { Init(); }\r
1007 \r
0aaa8b91 1008 //\r
1009 // Process real and/or simulated events\r
1010 //\r
1011 if(!esdEvent) {\r
1012 AliDebug(AliLog::kError, "esdEvent not available");\r
1013 return;\r
1014 }\r
0aaa8b91 1015\r
bad4ba69 1016 // get selection cuts\r
0aaa8b91 1017 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
1018 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
1019 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
1020\r
1021 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
1022 AliDebug(AliLog::kError, "cuts not available");\r
1023 return;\r
1024 }\r
bad4ba69 1025\r
1026 // trigger selection\r
1027 Bool_t isEventTriggered = kTRUE;\r
17f2bf95 1028 AliPhysicsSelection *physicsSelection = NULL;\r
1029 AliTriggerAnalysis* triggerAnalysis = NULL;\r
1030\r
1031 // \r
1032 AliInputEventHandler* inputHandler = (AliInputEventHandler*) AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();\r
1033 if (!inputHandler)\r
1034 {\r
1035 Printf("ERROR: Could not receive input handler");\r
1036 return;\r
1037 }\r
17e8c701 1038\r
17f2bf95 1039 if(evtCuts->IsTriggerRequired()) \r
1040 {\r
1041 // always MB\r
1042 isEventTriggered = inputHandler->IsEventSelected() & AliVEvent::kMB;\r
1043\r
1044 physicsSelection = static_cast<AliPhysicsSelection*> (inputHandler->GetEventSelection());\r
1045 if(!physicsSelection) return;\r
1046 //SetPhysicsTriggerSelection(physicsSelection);\r
1047\r
1048 if (isEventTriggered) {\r
1049 // set trigger (V0AND)\r
1050 triggerAnalysis = physicsSelection->GetTriggerAnalysis();\r
1051 if(!triggerAnalysis) return;\r
1052 isEventTriggered = triggerAnalysis->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1053 }\r
1054\r
1055 // calculate LHC background\r
1056 if(!IsUseMCInfo()) \r
1057 { \r
1058 //\r
1059 // 0-multiplicity bin for LHC background correction\r
1060 //\r
1061 if( GetAnalysisMode() == AlidNdPtHelper::kTPCITS || \r
1062 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || \r
1063 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
1064 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || \r
1065 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt ) \r
1066 {\r
1067 physicsSelection->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroTrackSPDvtx);\r
1068 } else {\r
1069 physicsSelection->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroSPDvtx);\r
1070 }\r
1071 }\r
1072 }\r
1073\r
1074\r
1075 /*\r
7f7dd416 1076 if(evtCuts->IsTriggerRequired()) \r
1077 {\r
17e8c701 1078 //\r
791aaf54 1079 trigSel = GetPhysicsTriggerSelection();\r
7f7dd416 1080 if(!trigSel) {\r
515964cb 1081 AliDebug(AliLog::kError, "cannot get trigSel");\r
7f7dd416 1082 return;\r
1083 }\r
515964cb 1084 \r
17e8c701 1085 if(IsUseMCInfo()) \r
1086 { \r
d269b0e6 1087 trigSel->SetAnalyzeMC();\r
17e8c701 1088\r
695facdf 1089 if(GetParticleMode() == AlidNdPtHelper::kVZEROCase1)\r
1090 {\r
1091 // check V0 systematics (case1)\r
1092 // Initialization done in the macro\r
1093 trigAna = trigSel->GetTriggerAnalysis();\r
1094 if(!trigAna) \r
1095 return;\r
1096\r
1097 //trigAna->SetV0HwPars(15, 61.5, 86.5);\r
1098 //trigAna->SetV0AdcThr(15);\r
1099\r
1100 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
1101 //printf("MB1 & kVZEROCase1 %d \n",isEventTriggered);\r
1102 //isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1103 \r
1104 if(GetTrigger() == AliTriggerAnalysis::kV0AND) \r
1105 {\r
1106 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1107 //printf("V0AND %d \n",isEventTriggered);\r
1108 }\r
1109 }\r
1110 else if(GetParticleMode() == AlidNdPtHelper::kVZEROCase2)\r
1111 {\r
1112 // check V0 systematics (case2 only in MC)\r
1113 // Initialization done in the macro\r
1114\r
1115 trigAna = trigSel->GetTriggerAnalysis();\r
1116 if(!trigAna) \r
515964cb 1117 return;\r
695facdf 1118\r
1119 //trigAna->SetV0HwPars(0, 0, 125);\r
1120 //trigAna->SetV0AdcThr(0);\r
1121\r
1122 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
1123 //isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1124 \r
1125 if(GetTrigger() == AliTriggerAnalysis::kV0AND) \r
1126 {\r
1127 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1128 //printf("V0AND %d \n",isEventTriggered);\r
1129 }\r
1130 }\r
1131 else {\r
1132 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
1133 //printf("MB1 %d \n",isEventTriggered);\r
1134 \r
1135 if(GetTrigger() == AliTriggerAnalysis::kV0AND) \r
1136 {\r
1137 trigAna = trigSel->GetTriggerAnalysis();\r
1138 if(!trigAna) \r
1139 return;\r
1140\r
1141 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1142 //printf("V0AND %d \n",isEventTriggered);\r
1143 }\r
1144 }\r
f537848a 1145 }\r
1146 else {\r
791aaf54 1147 //\r
1148 // 0-multiplicity bin for LHC background correction\r
1149 //\r
ecab7b3d 1150 if( GetAnalysisMode() == AlidNdPtHelper::kTPCITS || \r
1151 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || \r
1152 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
515964cb 1153 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || \r
1154 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt ) \r
791aaf54 1155 {\r
515964cb 1156 trigSel->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroTrackSPDvtx);\r
791aaf54 1157 } else {\r
515964cb 1158 trigSel->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroSPDvtx);\r
791aaf54 1159 }\r
17e8c701 1160\r
695facdf 1161 if(GetParticleMode() == AlidNdPtHelper::kVZEROCase1)\r
1162 {\r
1163 // check V0 systematics (case1)\r
1164 // Initialization done in the macro\r
1165 trigAna = trigSel->GetTriggerAnalysis();\r
1166 if(!trigAna) \r
1167 return;\r
1168\r
1169 //trigAna->SetV0HwPars(15, 61.5, 86.5);\r
1170 //trigAna->SetV0AdcThr(15);\r
1171\r
1172 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
1173 //isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1174 \r
1175 if(GetTrigger() == AliTriggerAnalysis::kV0AND) \r
1176 {\r
1177 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1178 //printf("V0AND %d \n",isEventTriggered);\r
1179 }\r
1180 }\r
1181 else {\r
1182 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
1183 //printf("MB1 %d \n",isEventTriggered);\r
1184 \r
1185 if(GetTrigger() == AliTriggerAnalysis::kV0AND) \r
1186 {\r
1187 trigAna = trigSel->GetTriggerAnalysis();\r
1188 if(!trigAna) \r
1189 return;\r
1190\r
1191 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
1192 //printf("V0AND %d \n",isEventTriggered);\r
1193 }\r
1194 }\r
f537848a 1195 }\r
bad4ba69 1196 }\r
17f2bf95 1197 */\r
0aaa8b91 1198\r
515964cb 1199\r
0aaa8b91 1200 // use MC information\r
1201 AliHeader* header = 0;\r
1202 AliGenEventHeader* genHeader = 0;\r
1203 AliStack* stack = 0;\r
1204 TArrayF vtxMC(3);\r
bad4ba69 1205 AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
0aaa8b91 1206\r
1207 Int_t multMCTrueTracks = 0;\r
1208 if(IsUseMCInfo())\r
1209 {\r
1210 //\r
1211 if(!mcEvent) {\r
1212 AliDebug(AliLog::kError, "mcEvent not available");\r
1213 return;\r
1214 }\r
1215 // get MC event header\r
1216 header = mcEvent->Header();\r
1217 if (!header) {\r
1218 AliDebug(AliLog::kError, "Header not available");\r
1219 return;\r
1220 }\r
1221 // MC particle stack\r
1222 stack = mcEvent->Stack();\r
1223 if (!stack) {\r
1224 AliDebug(AliLog::kError, "Stack not available");\r
1225 return;\r
1226 }\r
1227 // get event type (ND=0x1, DD=0x2, SD=0x4)\r
bad4ba69 1228 evtType = AliPWG0Helper::GetEventProcessType(header);\r
0aaa8b91 1229 AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
1230\r
1231 // get MC vertex\r
1232 genHeader = header->GenEventHeader();\r
1233 if (!genHeader) {\r
1234 AliDebug(AliLog::kError, "Could not retrieve genHeader from Header");\r
1235 return;\r
1236 }\r
1237 genHeader->PrimaryVertex(vtxMC);\r
1238\r
1239 Double_t vMCEventHist1[3]={vtxMC[0],vtxMC[1],vtxMC[2]};\r
1240 fMCEventHist1->Fill(vMCEventHist1);\r
1241\r
1242 // multipliticy of all MC primary tracks\r
1243 // in Zv, pt and eta ranges)\r
1244 multMCTrueTracks = AlidNdPtHelper::GetMCTrueTrackMult(mcEvent,evtCuts,accCuts);\r
1245\r
1246 } // end bUseMC\r
1247\r
55468faf 1248\r
0aaa8b91 1249 // get reconstructed vertex \r
1250 const AliESDVertex* vtxESD = 0; \r
1251 Bool_t isRecVertex = kFALSE;\r
1252 if(evtCuts->IsRecVertexRequired()) \r
1253 {\r
bad4ba69 1254 Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
1255 Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
1256 vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
791aaf54 1257 isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, esdEvent->GetPrimaryVertexSPD(), GetAnalysisMode(), kFALSE);\r
0aaa8b91 1258 }\r
847e74b2 1259\r
0aaa8b91 1260 if( IsUseMCInfo() && !evtCuts->IsRecVertexRequired() ) {\r
1261 vtxESD = new AliESDVertex(vtxMC[2],10.,genHeader->NProduced(),"smearMC");\r
1262 isRecVertex = kTRUE;\r
1263 }\r
847e74b2 1264\r
0aaa8b91 1265 Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex; \r
985bdfd5 1266 //printf("isEventOK %d, isEventTriggered %d \n",isEventOK, isEventTriggered);\r
847e74b2 1267 //printf("GetAnalysisMode() %d \n",GetAnalysisMode());\r
0aaa8b91 1268\r
847e74b2 1269 // vertex contributors\r
0aaa8b91 1270 Int_t multMBTracks = 0; \r
847e74b2 1271 if(GetAnalysisMode() == AlidNdPtHelper::kTPC) \r
1272 { \r
791aaf54 1273 if(vtxESD->GetStatus() && isRecVertex)\r
1274 multMBTracks = AlidNdPtHelper::GetTPCMBTrackMult(esdEvent,evtCuts,accCuts,esdTrackCuts);\r
0aaa8b91 1275 } \r
ecab7b3d 1276 else if( GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || \r
1277 GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate ) \r
847e74b2 1278 {\r
7f7dd416 1279 const AliMultiplicity* mult = esdEvent->GetMultiplicity();\r
791aaf54 1280 if(mult && vtxESD->GetStatus() && isRecVertex)\r
1281 multMBTracks = mult->GetNumberOfTracklets();\r
0aaa8b91 1282 } \r
ecab7b3d 1283 else if( GetAnalysisMode() == AlidNdPtHelper::kTPCITS || \r
1284 GetAnalysisMode()==AlidNdPtHelper::kTPCITSHybrid || \r
1285 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || \r
1286 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
1287 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || \r
1288 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt || \r
1289 GetAnalysisMode() == AlidNdPtHelper::kITSStandAloneTrackSPDvtx || \r
1290 GetAnalysisMode() == AlidNdPtHelper::kITSStandAloneTPCTrackSPDvtx\r
695facdf 1291 )\r
791aaf54 1292 {\r
1293 if(vtxESD->GetStatus() && isRecVertex)\r
1294 multMBTracks = vtxESD->GetNContributors();\r
1295 }\r
0aaa8b91 1296 else {\r
d0d90851 1297 AliDebug(AliLog::kError, Form("Found analysis type %d", GetAnalysisMode()));\r
0aaa8b91 1298 return; \r
1299 }\r
791aaf54 1300\r
55468faf 1301 Bool_t isEventSelected = kTRUE;\r
1302 if(evtCuts->IsEventSelectedRequired()) \r
1303 { \r
1304 // select events with at least \r
1305 // one prompt track in acceptance\r
1306 // pT>0.5 GeV/c, |eta|<0.8 for the Cross Section studies\r
1307\r
1308 isEventSelected = AlidNdPtHelper::SelectEvent(esdEvent,esdTrackCuts);\r
1309 //printf("isEventSelected %d \n", isEventSelected);\r
1310 }\r
1311\r
0aaa8b91 1312 TObjArray *allChargedTracks=0;\r
1313 Int_t multAll=0, multAcc=0, multRec=0;\r
1314 Int_t *labelsAll=0, *labelsAcc=0, *labelsRec=0;\r
1315\r
7f7dd416 1316 // cosmics analysis\r
1317 Int_t cosmicCount = 0;\r
1318 // high-pt tracks\r
1319 Int_t highPtCount = 0;\r
1320\r
0aaa8b91 1321 // check event cuts\r
55468faf 1322 if(isEventOK && isEventTriggered && isEventSelected)\r
0aaa8b91 1323 {\r
1324 // get all charged tracks\r
bad4ba69 1325 allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
0aaa8b91 1326 if(!allChargedTracks) return;\r
1327\r
1328 Int_t entries = allChargedTracks->GetEntries();\r
847e74b2 1329 //printf("entries %d \n",entries);\r
1330\r
0aaa8b91 1331 labelsAll = new Int_t[entries];\r
1332 labelsAcc = new Int_t[entries];\r
1333 labelsRec = new Int_t[entries];\r
1334 for(Int_t i=0; i<entries;++i) \r
1335 {\r
1336 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
1337 if(!track) continue;\r
1338 if(track->Charge()==0) continue;\r
847e74b2 1339\r
847e74b2 1340 // only postive charged \r
1341 if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
1342 continue;\r
1343 \r
1344 // only negative charged \r
1345 if(GetParticleMode() == AlidNdPtHelper::kMinus && track->Charge() > 0) \r
1346 continue;\r
1347\r
695facdf 1348\r
f55ea19e 1349 // esd track selection \r
695facdf 1350 // ITS stand alone\r
1351 if(GetAnalysisMode() == AlidNdPtHelper::kITSStandAloneTrackSPDvtx) \r
1352 {\r
1353 if(!(track->GetStatus() & AliESDtrack::kITSpureSA)) continue;\r
1354 if(!(track->GetStatus() & AliESDtrack::kITSrefit)) continue;\r
1355 if(track->GetNcls(0)<4) continue;\r
1356 if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1)) continue;\r
1357 } \r
1358 else if(GetAnalysisMode() == AlidNdPtHelper::kITSStandAloneTPCTrackSPDvtx) \r
1359 {\r
1360 //\r
1361 // ITS and TPC stand alone tracks\r
1362 //\r
1363 if(!(track->GetStatus() & AliESDtrack::kITSpureSA)) continue;\r
1364 if(!(track->GetStatus() & AliESDtrack::kITSrefit)) continue;\r
1365 if(track->GetNcls(0)<4) continue;\r
1366 if(!track->HasPointOnITSLayer(0) && !track->HasPointOnITSLayer(1)) continue;\r
1367\r
1368 // Check matching with TPC only track\r
1369 Bool_t hasMatch = kFALSE;\r
1370 for(Int_t j=0; j<entries;++j) \r
1371 {\r
1372 if(i==j) continue;\r
1373 AliESDtrack *track2 = (AliESDtrack*)allChargedTracks->At(j);\r
1374 if(!track2) continue;\r
1375 if(track2->Charge()==0) continue;\r
1376 if (!track2->GetTPCInnerParam()) continue;\r
1377\r
1378 // check loose cuts for TPC tracks\r
1379 if(!esdTrackCuts->AcceptTrack(track2)) continue; \r
1380\r
1381 AliExternalTrackParam *innerTPC = new AliExternalTrackParam(*(track2->GetTPCInnerParam()));\r
1382 if(!innerTPC) continue;\r
1383 Double_t x2[3]; track2->GetXYZ(x2);\r
1384 Double_t b2[3]; AliTracker::GetBxByBz(x2,b2);\r
1385 Double_t dz[2],cov[3];\r
1386 Bool_t isPropOK = innerTPC->PropagateToDCABxByBz(vtxESD,b2,kVeryBig,dz,cov);\r
1387 if(!isPropOK && innerTPC) {delete innerTPC; continue;}\r
1388\r
1389 // check matching\r
1390 if (TMath::Abs(track->GetY() - innerTPC->GetY()) > 3) { delete innerTPC; continue; }\r
1391 if (TMath::Abs(track->GetSnp() - innerTPC->GetSnp()) > 0.2) { delete innerTPC; continue; }\r
1392 if (TMath::Abs(track->GetTgl() - innerTPC->GetTgl()) > 0.2) { delete innerTPC; continue; }\r
1393\r
1394 hasMatch = kTRUE;\r
1395 if(innerTPC) delete innerTPC;\r
1396 }\r
1397\r
1398 if(!hasMatch) continue;\r
1399 }\r
1400 else {\r
ecab7b3d 1401 // check track cuts\r
695facdf 1402 if(!esdTrackCuts->AcceptTrack(track)) \r
1403 continue;\r
1404 }\r
1405\r
7f7dd416 1406 //\r
1407 Bool_t isOK = kFALSE;\r
1408 Double_t x[3]; track->GetXYZ(x);\r
1409 Double_t b[3]; AliTracker::GetBxByBz(x,b);\r
1410\r
1411 //\r
1412 // if TPC-ITS hybrid tracking (kTPCITSHybrid)\r
1413 // replace track parameters with TPC-ony track parameters\r
1414 //\r
695facdf 1415 if( GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybrid || \r
1416 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || \r
1417 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
7f7dd416 1418 {\r
791aaf54 1419 // Relate TPC-only tracks to Track or SPD vertex\r
1420 isOK = track->RelateToVertexTPCBxByBz(vtxESD, b, kVeryBig);\r
7f7dd416 1421 if(!isOK) continue;\r
1422\r
1423 // replace esd track parameters with TPCinner\r
1424 AliExternalTrackParam *tpcTrack = new AliExternalTrackParam(*(track->GetTPCInnerParam()));\r
1425 if (!tpcTrack) return;\r
1426 track->Set(tpcTrack->GetX(),tpcTrack->GetAlpha(),tpcTrack->GetParameter(),tpcTrack->GetCovariance());\r
1427\r
1428 if(tpcTrack) delete tpcTrack; \r
1429 } \r
1430\r
f4f8cae4 1431 FillHistograms(track,stack,vtxESD->GetZv(),AlidNdPtHelper::kAllTracks); \r
847e74b2 1432 labelsAll[multAll] = TMath::Abs(track->GetLabel());\r
1433 multAll++;\r
1434\r
847e74b2 1435 //FillHistograms(track,stack,AlidNdPtHelper::kAccTracks); \r
1436 //labelsAcc[multAcc] = TMath::Abs(track->GetLabel());\r
1437 //multAcc++;\r
7f7dd416 1438 \r
1439 // check high-pt tracks\r
1440 if(accCuts->AcceptTrack(track) && track->Pt() > 6.)\r
1441 {\r
1442 //printf(" high pt: pt %f \n",track->Pt());\r
1443 highPtCount++;\r
1444 }\r
847e74b2 1445\r
7f7dd416 1446 // check cosmics tracks\r
1447 if( GetParticleMode()==AlidNdPtHelper::kCosmic )\r
a8ac5525 1448 {\r
7f7dd416 1449 if(accCuts->AcceptTrack(track)) \r
a8ac5525 1450 { \r
1451 for(Int_t j=0; j<entries;++j) \r
1452 {\r
1453 AliESDtrack *track1 = (AliESDtrack*)allChargedTracks->At(j);\r
1454 if(!track1) continue;\r
1455 if(track1->Charge()==0) continue;\r
1456\r
1457 if( esdTrackCuts->AcceptTrack(track1) && accCuts->AcceptTrack(track1) ) \r
1458 { \r
7f7dd416 1459 if ( AlidNdPtHelper::IsCosmicTrack(track,track1) ) { \r
1460 cosmicCount++;\r
1461 break;\r
1462 }\r
a8ac5525 1463 }\r
1464 }\r
1465 }\r
7f7dd416 1466 // if(!isCosmic) continue;\r
a8ac5525 1467 }\r
1468\r
7f7dd416 1469 // update track parameters using vertex point \r
ecab7b3d 1470 if( GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtxUpdate || \r
1471 GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate ) \r
1472 {\r
a8ac5525 1473 // update track parameters\r
847e74b2 1474 AliExternalTrackParam cParam;\r
791aaf54 1475 isOK = track->RelateToVertexTPCBxByBz(vtxESD, b, kVeryBig, &cParam);\r
7f7dd416 1476 if(!isOK) continue;\r
847e74b2 1477 track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
1478\r
1479 if(accCuts->AcceptTrack(track)) {\r
f4f8cae4 1480 FillHistograms(track,stack,vtxESD->GetZv(),AlidNdPtHelper::kRecTracks); \r
847e74b2 1481 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
1482 multRec++;\r
1483 } \r
a8ac5525 1484 }\r
1485 else {\r
695facdf 1486 if(accCuts->AcceptTrack(track)) \r
1487 {\r
f4f8cae4 1488 FillHistograms(track,stack,vtxESD->GetZv(),AlidNdPtHelper::kRecTracks); \r
847e74b2 1489 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
1490 multRec++;\r
1491 }\r
791aaf54 1492 }\r
7f7dd416 1493 }\r
1494 if(cosmicCount) \r
791aaf54 1495 //printf("COSMIC EVENT: number %d , mult %d \n", esdEvent->GetEventNumberInFile(), multRec);\r
7f7dd416 1496\r
1497 if(highPtCount) \r
791aaf54 1498 //printf("HIGH PT EVENT: number %d , mult %d \n", esdEvent->GetEventNumberInFile(), multRec);\r
7f7dd416 1499\r
1500 if(multRec > 30) \r
791aaf54 1501 //printf("HIGH MULT EVENT: number %d , mult %d \n", esdEvent->GetEventNumberInFile(), multRec);\r
a8ac5525 1502\r
0aaa8b91 1503 // fill track multiplicity histograms\r
1504 FillHistograms(allChargedTracks,labelsAll,multAll,labelsAcc,multAcc,labelsRec,multRec);\r
1505\r
1506 Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
1507 fRecEventHist1->Fill(vRecEventHist1);\r
1508\r
bad4ba69 1509 Double_t vRecEventHist2[3] = {vtxESD->GetZv(),multMBTracks,multRec};\r
0aaa8b91 1510 fRecEventHist2->Fill(vRecEventHist2);\r
f4f8cae4 1511\r
1512 // \r
1513 Double_t vRecEventHist[2] = {vtxESD->GetZv(),multMBTracks};\r
1514 fRecEventHist->Fill(vRecEventHist);\r
0aaa8b91 1515 } \r
1516\r
0aaa8b91 1517 if(IsUseMCInfo()) \r
1518 {\r
55468faf 1519 if(!mcEvent) return; \r
1520\r
1521 if(evtCuts->IsEventSelectedRequired()) \r
1522 { \r
1523 // select events with at least \r
1524 // one MC primary track in acceptance\r
1525 // pT>0.5 GeV/c, |eta|<0.8 for the Cross Section studies\r
1526\r
1527 Bool_t isMCEventSelected = AlidNdPtHelper::SelectMCEvent(mcEvent);\r
1528 //printf("isMCEventSelected %d \n", isMCEventSelected);\r
1529 if(!isMCEventSelected) return; \r
1530 }\r
1531\r
695facdf 1532 Double_t vMultTrueEventMatrix[2] = { multRec, multMCTrueTracks };\r
695facdf 1533 if(isEventOK && isEventTriggered) { \r
1534 if(TMath::Abs(vtxMC[2]) < 10.0) // both Rec. and corresponding MC events must be accepted\r
1535 fEventMultCorrelationMatrix->Fill(vMultTrueEventMatrix);\r
1536 }\r
0aaa8b91 1537\r
1538 // \r
1539 // event level corrections (zv,N_MB)\r
1540 //\r
1541\r
1542 // all inelastic\r
1543 Double_t vEventMatrix[2] = {vtxMC[2],multMBTracks};\r
1544 fGenEventMatrix->Fill(vEventMatrix); \r
1545 if(isEventTriggered) fTriggerEventMatrix->Fill(vEventMatrix);\r
1546 if(isEventOK && isEventTriggered) fRecEventMatrix->Fill(vEventMatrix);\r
1547\r
1548 // single diffractive\r
bad4ba69 1549 if(evtType == AliPWG0Helper::kSD) {\r
0aaa8b91 1550 fGenSDEventMatrix->Fill(vEventMatrix); \r
1551 if(isEventTriggered) fTriggerSDEventMatrix->Fill(vEventMatrix);\r
1552 if(isEventOK && isEventTriggered) fRecSDEventMatrix->Fill(vEventMatrix);\r
1553 }\r
1554\r
1555 // double diffractive\r
bad4ba69 1556 if(evtType == AliPWG0Helper::kDD) {\r
0aaa8b91 1557 fGenDDEventMatrix->Fill(vEventMatrix); \r
1558 if(isEventTriggered) fTriggerDDEventMatrix->Fill(vEventMatrix);\r
1559 if(isEventOK && isEventTriggered) fRecDDEventMatrix->Fill(vEventMatrix);\r
1560 }\r
1561\r
1562 // non diffractive\r
bad4ba69 1563 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 1564 fGenNDEventMatrix->Fill(vEventMatrix); \r
1565 if(isEventTriggered) fTriggerNDEventMatrix->Fill(vEventMatrix);\r
1566 if(isEventOK && isEventTriggered) fRecNDEventMatrix->Fill(vEventMatrix);\r
1567 }\r
1568\r
1569 // non single diffractive\r
bad4ba69 1570 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 1571 fGenNSDEventMatrix->Fill(vEventMatrix); \r
1572 if(isEventTriggered) fTriggerNSDEventMatrix->Fill(vEventMatrix);\r
1573 if(isEventOK && isEventTriggered) fRecNSDEventMatrix->Fill(vEventMatrix);\r
1574 }\r
1575\r
1576 //\r
1577 // track-event level corrections (zv,pt,eta)\r
1578 //\r
9208324e 1579 for (Int_t iMc = 0; iMc < stack->GetNtrack(); ++iMc) \r
0aaa8b91 1580 {\r
1581 TParticle* particle = stack->Particle(iMc);\r
1582 if (!particle)\r
1583 continue;\r
1584\r
1585 // only charged particles\r
09abaebb 1586 if(!particle->GetPDG()) continue;\r
0aaa8b91 1587 Double_t charge = particle->GetPDG()->Charge()/3.;\r
00b81913 1588 if ( TMath::Abs(charge) < 0.001 )\r
0aaa8b91 1589 continue;\r
1590\r
1591 // only postive charged \r
847e74b2 1592 if(GetParticleMode() == AlidNdPtHelper::kPlus && charge < 0.) \r
0aaa8b91 1593 continue;\r
1594 \r
1595 // only negative charged \r
847e74b2 1596 if(GetParticleMode() == AlidNdPtHelper::kMinus && charge > 0.) \r
0aaa8b91 1597 continue;\r
1598 \r
1599 // physical primary\r
1600 Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
1601 if(!prim) continue;\r
1602\r
1603 // checked accepted\r
1604 if(accCuts->AcceptTrack(particle)) \r
1605 {\r
1606 Double_t vTrackEventMatrix[3] = {vtxMC[2], particle->Pt(), particle->Eta()}; \r
1607 fGenTrackEventMatrix->Fill(vTrackEventMatrix);\r
1608\r
bad4ba69 1609 if(evtType == AliPWG0Helper::kSD) {\r
0aaa8b91 1610 fGenTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
1611 }\r
bad4ba69 1612 if(evtType == AliPWG0Helper::kDD) {\r
0aaa8b91 1613 fGenTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
1614 }\r
bad4ba69 1615 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 1616 fGenTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
1617 }\r
bad4ba69 1618 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 1619 fGenTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
1620 }\r
1621\r
1622 //\r
1623 if(!isEventTriggered) continue; \r
1624\r
1625 fTriggerTrackEventMatrix->Fill(vTrackEventMatrix);\r
bad4ba69 1626 if(evtType == AliPWG0Helper::kSD) {\r
0aaa8b91 1627 fTriggerTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
1628 }\r
bad4ba69 1629 if(evtType == AliPWG0Helper::kDD) {\r
0aaa8b91 1630 fTriggerTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
1631 }\r
bad4ba69 1632 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 1633 fTriggerTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
1634 }\r
bad4ba69 1635 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 1636 fTriggerTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
1637 }\r
1638\r
1639 //\r
1640 if(!isEventOK) continue; \r
1641\r
1642 fRecTrackEventMatrix->Fill(vTrackEventMatrix);\r
bad4ba69 1643 if(evtType == AliPWG0Helper::kSD) {\r
0aaa8b91 1644 fRecTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
1645 }\r
bad4ba69 1646 if(evtType == AliPWG0Helper::kDD) {\r
0aaa8b91 1647 fRecTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
1648 }\r
bad4ba69 1649 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 1650 fRecTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
1651 }\r
bad4ba69 1652 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 1653 fRecTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
1654 }\r
1655 }\r
1656 }\r
1657\r
1658 // \r
791aaf54 1659 // track-level corrections (zv,pt,eta)\r
0aaa8b91 1660 //\r
1661 if(isEventOK && isEventTriggered)\r
1662 {\r
1663\r
1664 // fill MC and rec event control histograms\r
1665 if(fHistogramsOn) {\r
bad4ba69 1666 Double_t vRecMCEventHist1[3] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetYv()-vtxMC[1],vtxESD->GetZv()-vtxMC[2]};\r
0aaa8b91 1667 fRecMCEventHist1->Fill(vRecMCEventHist1);\r
1668\r
bad4ba69 1669 Double_t vRecMCEventHist2[3] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetZv()-vtxMC[2],multMBTracks};\r
0aaa8b91 1670 fRecMCEventHist2->Fill(vRecMCEventHist2);\r
1671\r
1672 Double_t vRecMCEventHist3[2] = {multRec,evtType};\r
1673 fRecMCEventHist3->Fill(vRecMCEventHist3);\r
1674 }\r
1675\r
1676 //\r
1677 // MC histograms for track efficiency studies\r
1678 //\r
55468faf 1679 Int_t countRecCandle = 0;\r
9208324e 1680 for (Int_t iMc = 0; iMc < stack->GetNtrack(); ++iMc) \r
0aaa8b91 1681 {\r
1682 TParticle* particle = stack->Particle(iMc);\r
1683 if (!particle)\r
1684 continue;\r
1685\r
985bdfd5 1686 Double_t vTrackMatrix[3] = {vtxMC[2],particle->Pt(),particle->Eta()}; \r
1687\r
1688 // all genertated primaries including neutral\r
1689 if( iMc < stack->GetNprimary() ) {\r
847e74b2 1690 //fGenTrackMatrix->Fill(vTrackMatrix);\r
985bdfd5 1691 }\r
1692\r
0aaa8b91 1693 // only charged particles\r
09abaebb 1694 if(!particle->GetPDG()) continue;\r
0aaa8b91 1695 Double_t charge = particle->GetPDG()->Charge()/3.;\r
7f7dd416 1696 if (TMath::Abs(charge) < 0.001)\r
0aaa8b91 1697 continue;\r
1698\r
1699 // only postive charged \r
847e74b2 1700 if(GetParticleMode() == AlidNdPtHelper::kPlus && charge < 0.) \r
0aaa8b91 1701 continue;\r
1702 \r
1703 // only negative charged \r
847e74b2 1704 if(GetParticleMode() == AlidNdPtHelper::kMinus && charge > 0.) \r
0aaa8b91 1705 continue;\r
1706 \r
1707 // physical primary\r
1708 Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
1709\r
1710 // check accepted\r
1711 if(accCuts->AcceptTrack(particle)) \r
1712 {\r
985bdfd5 1713\r
7f7dd416 1714 if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetParticleMode()) ) \r
1715 fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
0aaa8b91 1716\r
1717 // fill control histograms\r
1718 if(fHistogramsOn) \r
1719 FillHistograms(stack,iMc,AlidNdPtHelper::kAccTracks); \r
1720\r
1721 // check multiple found tracks\r
00b81913 1722 Int_t multCount = 0;\r
0aaa8b91 1723 for(Int_t iRec=0; iRec<multRec; ++iRec)\r
1724 {\r
1725 if(iMc == labelsRec[iRec]) \r
1726 {\r
00b81913 1727 multCount++;\r
1728 if(multCount>1)\r
0aaa8b91 1729 { \r
1730 fRecMultTrackMatrix->Fill(vTrackMatrix);\r
1731\r
1732 // fill control histogram\r
1733 if(fHistogramsOn) {\r
1734 Int_t pid = AlidNdPtHelper::ConvertPdgToPid(particle);\r
1735 Double_t vMCMultRecTrackHist1[3] = {particle->Pt(), particle->Eta(), pid};\r
1736 fMCMultRecTrackHist1->Fill(vMCMultRecTrackHist1);\r
1737 }\r
1738 }\r
1739 }\r
1740 }\r
1741\r
1742 // check reconstructed\r
1743 for(Int_t iRec=0; iRec<multRec; ++iRec)\r
1744 {\r
1745 if(iMc == labelsRec[iRec]) \r
1746 {\r
1747 fRecTrackMatrix->Fill(vTrackMatrix);\r
55468faf 1748 \r
d0d90851 1749 if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetParticleMode()) ) {\r
7f7dd416 1750 fRecPrimTrackMatrix->Fill(vTrackMatrix);\r
d0d90851 1751 //AliESDtrack *track = esdEvent->GetTrack(iRec);\r
1752 //if(track && track->GetKinkIndex(0) < 0) \r
1753 // printf("prim kink \n");\r
55468faf 1754 countRecCandle++;\r
d0d90851 1755 }\r
7f7dd416 1756\r
0aaa8b91 1757 if(!prim) fRecSecTrackMatrix->Fill(vTrackMatrix);\r
1758\r
1759 // fill control histograms\r
1760 if(fHistogramsOn) \r
1761 FillHistograms(stack,iMc,AlidNdPtHelper::kRecTracks); \r
1762 \r
1763 break;\r
1764 }\r
1765 }\r
1766 }\r
1767 }\r
55468faf 1768\r
1769 if(countRecCandle>0) fRecCandleEventMatrix->Fill(vEventMatrix);\r
0aaa8b91 1770 }\r
55468faf 1771\r
1772\r
0aaa8b91 1773 } // end bUseMC\r
1774\r
1775 if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
1776 if(labelsAll) delete [] labelsAll; labelsAll = 0;\r
1777 if(labelsAcc) delete [] labelsAcc; labelsAcc = 0;\r
1778 if(labelsRec) delete [] labelsRec; labelsRec = 0;\r
1779\r
1780 if(!evtCuts->IsRecVertexRequired() && vtxESD != NULL) delete vtxESD;\r
17e8c701 1781 //if(trigAna) delete trigAna;\r
0aaa8b91 1782\r
1783}\r
1784\r
1785//_____________________________________________________________________________\r
1786void AlidNdPtAnalysis::FillHistograms(TObjArray *const allChargedTracks,Int_t *const labelsAll,Int_t multAll,Int_t *const labelsAcc,Int_t multAcc,Int_t *const labelsRec,Int_t multRec) {\r
1787 // multiplicity histograms\r
1788 \r
1789 if(!allChargedTracks) return;\r
1790 if(!labelsAll) return;\r
1791 if(!labelsAcc) return;\r
1792 if(!labelsRec) return;\r
1793\r
1794 Int_t entries = allChargedTracks->GetEntries();\r
1795 for(Int_t i=0; i<entries; ++i)\r
1796 {\r
1797 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
1798 if(!track) continue;\r
1799 if(track->Charge() == 0) continue;\r
1800\r
1801 Int_t label = TMath::Abs(track->GetLabel());\r
1802 for(Int_t iAll=0; iAll<multAll; ++iAll) {\r
1803 if(label == labelsAll[iAll]) {\r
1804 Double_t v1[2] = {track->Pt(), multAll}; \r
1805 fRecTrackMultHist1[AlidNdPtHelper::kAllTracks]->Fill(v1);\r
1806 }\r
1807 }\r
1808 for(Int_t iAcc=0; iAcc<multAcc; ++iAcc) {\r
1809 if(label == labelsAcc[iAcc]) {\r
1810 Double_t v2[2] = {track->Pt(), multAcc}; \r
1811 fRecTrackMultHist1[AlidNdPtHelper::kAccTracks]->Fill(v2);\r
1812 }\r
1813 }\r
1814 for(Int_t iRec=0; iRec<multRec; ++iRec) {\r
1815 if(label == labelsRec[iRec]) {\r
1816 Double_t v3[2] = {track->Pt(), multRec}; \r
1817 fRecTrackMultHist1[AlidNdPtHelper::kRecTracks]->Fill(v3);\r
1818 }\r
1819 }\r
1820 }\r
1821}\r
1822\r
1823//_____________________________________________________________________________\r
f4f8cae4 1824void AlidNdPtAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, const Double_t zv, AlidNdPtHelper::TrackObject trackObj)\r
0aaa8b91 1825{\r
1826 //\r
1827 // Fill ESD track and MC histograms \r
1828 //\r
1829 if(!esdTrack) return;\r
1830\r
1831 Float_t q = esdTrack->Charge();\r
00b81913 1832 if(TMath::Abs(q) < 0.001) return;\r
0aaa8b91 1833\r
1834 Float_t pt = esdTrack->Pt();\r
1835 //Float_t qpt = esdTrack->Pt() * q;\r
1836 Float_t eta = esdTrack->Eta();\r
1837 Float_t phi = esdTrack->Phi();\r
1838\r
1839 Float_t dca[2], bCov[3];\r
1840 esdTrack->GetImpactParameters(dca,bCov);\r
1841\r
985bdfd5 1842 Int_t nClust = esdTrack->GetTPCclusters(0);\r
1843 Float_t chi2PerCluster = 0.;\r
1844 if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
1845\r
0aaa8b91 1846\r
1847 // fill histograms\r
f4f8cae4 1848 Double_t values1[3] = {pt,eta,phi}; \r
1849 fRecTrackHist1[trackObj]->Fill(values1);\r
1850\r
1851 Double_t values[3] = {zv, pt,eta}; \r
1852 if(trackObj == AlidNdPtHelper::kRecTracks) {\r
1853 fRecTrackHist->Fill(values);\r
1854 }\r
985bdfd5 1855\r
7f7dd416 1856 /*\r
f4f8cae4 1857 Double_t values2[5] = {nClust,chi2PerCluster,pt,eta,phi}; \r
985bdfd5 1858 if(trackObj == AlidNdPtHelper::kRecTracks) \r
1859 {\r
1860 if(fHistogramsOn)\r
f4f8cae4 1861 fRecTrackHist2->Fill(values2);\r
985bdfd5 1862 }\r
7f7dd416 1863 */\r
0aaa8b91 1864 \r
1865 //\r
1866 // Fill rec vs MC information\r
1867 //\r
1868 if(!stack) return;\r
1869\r
1870 Int_t label = TMath::Abs(esdTrack->GetLabel()); \r
1871 //if(label == 0) return;\r
1872\r
1873 TParticle* particle = stack->Particle(label);\r
1874 if(!particle) return;\r
1875\r
1876 //Bool_t prim = stack->IsPhysicalPrimary(label);\r
1877 //Int_t pid = AlidNdPtHelper::ConvertPdgToPid(particle);\r
1878\r
00b81913 1879 Int_t motherPdg = -1;\r
0aaa8b91 1880 TParticle* mother = 0;\r
1881\r
1882 //TParticle* prim_mother = AlidNdPtHelper::FindPrimaryMother(stack,label);\r
1883 Int_t motherLabel = particle->GetMother(0); \r
1884 if(motherLabel>0) mother = stack->Particle(motherLabel);\r
00b81913 1885 if(mother) motherPdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only\r
0aaa8b91 1886 //Int_t mech = particle->GetUniqueID(); // production mechanism\r
1887\r
09abaebb 1888 if(!particle->GetPDG()) return;\r
0aaa8b91 1889 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
00b81913 1890 if(TMath::Abs(gq)<0.001) return;\r
0aaa8b91 1891 Float_t gpt = particle->Pt();\r
1892 Float_t geta = particle->Eta();\r
1893 //Float_t qgpt = particle->Pt() * gq;\r
1894 //Float_t gphi = particle->Phi();\r
1895\r
1896 Double_t dpt=0;\r
847e74b2 1897 //printf("pt %f, gpt %f \n",pt,gpt);\r
0aaa8b91 1898 if(gpt) dpt = (pt-gpt)/gpt;\r
1899 Double_t deta = (eta-geta);\r
1900 \r
1901 // fill histograms\r
1902 if(trackObj == AlidNdPtHelper::kRecTracks) \r
1903 {\r
1904 Double_t vTrackPtCorrelationMatrix[3]={pt,gpt,geta};\r
1905 fTrackPtCorrelationMatrix->Fill(vTrackPtCorrelationMatrix);\r
1906\r
1907 Double_t vRecMCTrackHist1[4]={gpt,geta,dpt,deta};\r
1908 fRecMCTrackHist1->Fill(vRecMCTrackHist1);\r
0aaa8b91 1909 }\r
1910}\r
1911\r
1912//_____________________________________________________________________________\r
1913void AlidNdPtAnalysis::FillHistograms(AliStack *const stack, Int_t label, AlidNdPtHelper::TrackObject trackObj)\r
1914{\r
1915 // Fill MC histograms\r
1916 if(!stack) return;\r
1917\r
1918 TParticle* particle = stack->Particle(label);\r
1919 if(!particle) return;\r
1920\r
00b81913 1921 Int_t motherPdg = -1;\r
0aaa8b91 1922 TParticle* mother = 0;\r
1923\r
1924 //TParticle* prim_mother = AlidNdPtHelper::FindPrimaryMother(stack,label);\r
1925 Int_t motherLabel = particle->GetMother(0); \r
1926 if(motherLabel>0) mother = stack->Particle(motherLabel);\r
00b81913 1927 if(mother) motherPdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only\r
0aaa8b91 1928 Int_t mech = particle->GetUniqueID(); // production mechanism\r
1929\r
09abaebb 1930 if(!particle->GetPDG()) return;\r
0aaa8b91 1931 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
00b81913 1932 if(TMath::Abs(gq) < 0.001) return;\r
7f7dd416 1933\r
0aaa8b91 1934 Float_t gpt = particle->Pt();\r
1935 //Float_t qgpt = particle->Pt() * gq;\r
1936 Float_t geta = particle->Eta();\r
1937 Float_t gphi = particle->Phi();\r
1938 //Float_t gpz = particle->Pz();\r
1939\r
1940 Bool_t prim = stack->IsPhysicalPrimary(label);\r
1941 //Float_t vx = particle->Vx(); Float_t vy = particle->Vy(); Float_t vz = particle->Vz();\r
1942\r
1943 Int_t pid = AlidNdPtHelper::ConvertPdgToPid(particle);\r
1944\r
1945 //if(prim&&pid==5) printf("pdgcode %d, production mech %d \n",particle->GetPdgCode(),mech);\r
00b81913 1946 //if(!prim) printf("motherPdg %d, particle %d, production mech %d\n",motherPdg, particle->GetPdgCode(),mech);\r
0aaa8b91 1947 \r
1948 //\r
1949 // fill histogram\r
1950 //\r
1951 Double_t vMCTrackHist1[3] = {gpt,geta,gphi};\r
1952 fMCTrackHist1[trackObj]->Fill(vMCTrackHist1);\r
1953\r
00b81913 1954 Double_t vMCPrimTrackHist1[5] = {gpt,geta,pid,mech,motherPdg};\r
7f7dd416 1955 Double_t vMCPrimTrackHist2[5] = {TMath::Abs(particle->GetPdgCode()),mech,motherPdg};\r
1956 //if(prim && AliPWG0Helper::IsPrimaryCharged(particle, label)) fMCPrimTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
1957 if(prim) { \r
1958 fMCPrimTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
1959 if(pid == 5) fMCPrimTrackHist2[trackObj]->Fill(vMCPrimTrackHist2);\r
0aaa8b91 1960 }\r
7f7dd416 1961 else { \r
1962 fMCSecTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
1963 }\r
1964\r
0aaa8b91 1965}\r
1966\r
1967//_____________________________________________________________________________\r
00b81913 1968Long64_t AlidNdPtAnalysis::Merge(TCollection* const list) \r
0aaa8b91 1969{\r
68f10917 1970 // init if not done already\r
1971 if (!fIsInit) { Init(); }\r
1972 \r
0aaa8b91 1973 // Merge list of objects (needed by PROOF)\r
1974\r
1975 if (!list)\r
1976 return 0;\r
1977\r
1978 if (list->IsEmpty())\r
1979 return 1;\r
1980\r
1981 TIterator* iter = list->MakeIterator();\r
1982 TObject* obj = 0;\r
1983\r
791aaf54 1984 //\r
17f2bf95 1985 //TList *collPhysSelection = new TList;\r
791aaf54 1986\r
0aaa8b91 1987 // collection of generated histograms\r
1988\r
1989 Int_t count=0;\r
1990 while((obj = iter->Next()) != 0) {\r
1991 AlidNdPtAnalysis* entry = dynamic_cast<AlidNdPtAnalysis*>(obj);\r
1992 if (entry == 0) continue; \r
1993\r
791aaf54 1994 // physics selection\r
1995 //printf("entry->GetPhysicsTriggerSelection() %p \n", entry->GetPhysicsTriggerSelection());\r
17f2bf95 1996 //collPhysSelection->Add(entry->GetPhysicsTriggerSelection());\r
791aaf54 1997 \r
f4f8cae4 1998 //\r
1999 fRecEventHist->Add(entry->fRecEventHist);\r
2000 fRecTrackHist->Add(entry->fRecTrackHist);\r
2001\r
0aaa8b91 2002 //\r
2003 fEventMultCorrelationMatrix->Add(entry->fEventMultCorrelationMatrix);\r
2004 fTrackPtCorrelationMatrix->Add(entry->fTrackPtCorrelationMatrix);\r
2005\r
2006 //\r
2007 fGenEventMatrix->Add(entry->fGenEventMatrix);\r
2008 fGenSDEventMatrix->Add(entry->fGenSDEventMatrix);\r
2009 fGenDDEventMatrix->Add(entry->fGenDDEventMatrix);\r
2010 fGenNDEventMatrix->Add(entry->fGenNDEventMatrix);\r
2011 fGenNSDEventMatrix->Add(entry->fGenNSDEventMatrix);\r
2012\r
2013 fTriggerEventMatrix->Add(entry->fTriggerEventMatrix);\r
2014 fTriggerSDEventMatrix->Add(entry->fTriggerSDEventMatrix);\r
2015 fTriggerDDEventMatrix->Add(entry->fTriggerDDEventMatrix);\r
2016 fTriggerNDEventMatrix->Add(entry->fTriggerNDEventMatrix);\r
2017 fTriggerNSDEventMatrix->Add(entry->fTriggerNSDEventMatrix);\r
2018\r
2019 fRecEventMatrix->Add(entry->fRecEventMatrix);\r
2020 fRecSDEventMatrix->Add(entry->fRecSDEventMatrix);\r
2021 fRecDDEventMatrix->Add(entry->fRecDDEventMatrix);\r
2022 fRecNDEventMatrix->Add(entry->fRecNDEventMatrix);\r
2023 fRecNSDEventMatrix->Add(entry->fRecNSDEventMatrix);\r
2024\r
55468faf 2025 fRecCandleEventMatrix->Add(entry->fRecCandleEventMatrix);\r
0aaa8b91 2026 //\r
2027 fGenTrackEventMatrix->Add(entry->fGenTrackEventMatrix);\r
2028 fGenTrackSDEventMatrix->Add(entry->fGenTrackSDEventMatrix);\r
2029 fGenTrackDDEventMatrix->Add(entry->fGenTrackDDEventMatrix);\r
2030 fGenTrackNDEventMatrix->Add(entry->fGenTrackNDEventMatrix);\r
2031 fGenTrackNSDEventMatrix->Add(entry->fGenTrackNSDEventMatrix);\r
2032\r
2033 fTriggerTrackEventMatrix->Add(entry->fTriggerTrackEventMatrix);\r
2034 fTriggerTrackSDEventMatrix->Add(entry->fTriggerTrackSDEventMatrix);\r
2035 fTriggerTrackDDEventMatrix->Add(entry->fTriggerTrackDDEventMatrix);\r
2036 fTriggerTrackNDEventMatrix->Add(entry->fTriggerTrackNDEventMatrix);\r
2037 fTriggerTrackNSDEventMatrix->Add(entry->fTriggerTrackNSDEventMatrix);\r
2038\r
2039 fRecTrackEventMatrix->Add(entry->fRecTrackEventMatrix);\r
2040 fRecTrackSDEventMatrix->Add(entry->fRecTrackSDEventMatrix);\r
2041 fRecTrackDDEventMatrix->Add(entry->fRecTrackDDEventMatrix);\r
2042 fRecTrackNDEventMatrix->Add(entry->fRecTrackNDEventMatrix);\r
2043 fRecTrackNSDEventMatrix->Add(entry->fRecTrackNSDEventMatrix);\r
2044\r
2045 //\r
985bdfd5 2046 fGenTrackMatrix->Add(entry->fGenTrackMatrix);\r
0aaa8b91 2047 fGenPrimTrackMatrix->Add(entry->fGenPrimTrackMatrix);\r
2048 fRecPrimTrackMatrix->Add(entry->fRecPrimTrackMatrix);\r
2049 //\r
2050 fRecTrackMatrix->Add(entry->fRecTrackMatrix);\r
2051 fRecSecTrackMatrix->Add(entry->fRecSecTrackMatrix);\r
2052 //\r
2053 fRecMultTrackMatrix->Add(entry->fRecMultTrackMatrix);\r
2054\r
2055 //\r
2056 // control analysis histograms\r
2057 //\r
2058 fMCEventHist1->Add(entry->fMCEventHist1);\r
2059 fRecEventHist1->Add(entry->fRecEventHist1);\r
2060 fRecEventHist2->Add(entry->fRecEventHist2);\r
2061 fRecMCEventHist1->Add(entry->fRecMCEventHist1);\r
2062 fRecMCEventHist2->Add(entry->fRecMCEventHist2);\r
2063 fRecMCEventHist3->Add(entry->fRecMCEventHist3);\r
2064\r
2065 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) {\r
2066 fMCTrackHist1[i]->Add(entry->fMCTrackHist1[i]);\r
2067\r
2068 fMCPrimTrackHist1[i]->Add(entry->fMCPrimTrackHist1[i]);\r
7f7dd416 2069 fMCPrimTrackHist2[i]->Add(entry->fMCPrimTrackHist2[i]);\r
0aaa8b91 2070 fMCSecTrackHist1[i]->Add(entry->fMCSecTrackHist1[i]);\r
2071\r
2072 fRecTrackHist1[i]->Add(entry->fRecTrackHist1[i]);\r
2073 fRecTrackMultHist1[i]->Add(entry->fRecTrackMultHist1[i]);\r
2074 }\r
2075 fRecMCTrackHist1->Add(entry->fRecMCTrackHist1);\r
2076 fMCMultRecTrackHist1->Add(entry->fMCMultRecTrackHist1);\r
985bdfd5 2077 fRecTrackHist2->Add(entry->fRecTrackHist2);\r
0aaa8b91 2078\r
2079 count++;\r
2080 }\r
2081\r
17f2bf95 2082 //AliPhysicsSelection *trigSelection = GetPhysicsTriggerSelection();\r
2083 //trigSelection->Merge(collPhysSelection);\r
2084 //if(collPhysSelection) delete collPhysSelection;\r
791aaf54 2085\r
0aaa8b91 2086return count;\r
2087}\r
791aaf54 2088\r
2089//____________________________________________________________________\r
2090Bool_t AlidNdPtAnalysis::IsBinZeroTrackSPDvtx(const AliESDEvent* esdEvent) {\r
2091//\r
2092// check 0-bin\r
2093// for LHC background calculation\r
2094// return kTRUE if vertex not reconstructed or\r
2095// track multiplicity == 0\r
2096//\r
2097if(!esdEvent) return kFALSE;\r
2098\r
2099 // check vertex\r
2100 const AliESDVertex *vertex = esdEvent->GetPrimaryVertexTracks();\r
2101 if(!vertex) return kTRUE;\r
2102\r
2103 if(vertex->GetNContributors() < 1) {\r
2104 // SPD vertex\r
2105 vertex = esdEvent->GetPrimaryVertexSPD();\r
695facdf 2106 if(!vertex) return kTRUE;\r
791aaf54 2107 }\r
695facdf 2108 if(TMath::Abs(vertex->GetZv()) > 15.0) return kTRUE; \r
791aaf54 2109 if( !AlidNdPtHelper::TestRecVertex(vertex, esdEvent->GetPrimaryVertexSPD(), AlidNdPtHelper::kTPCITSHybridTrackSPDvtx) ) \r
2110 return kTRUE;\r
695facdf 2111 \r
791aaf54 2112return kFALSE;\r
2113}\r
2114\r
2115//____________________________________________________________________\r
2116Bool_t AlidNdPtAnalysis::IsBinZeroSPDvtx(const AliESDEvent* esdEvent) {\r
2117//\r
2118// check 0-bin\r
2119// for LHC background calculation\r
2120// return kTRUE if vertex not reconstructed or\r
2121// tracklet multiplicity == 0\r
2122//\r
2123if(!esdEvent) return kFALSE;\r
2124\r
2125 // check vertex\r
2126 const AliESDVertex* vertex = esdEvent->GetPrimaryVertexSPD();\r
2127 if(!vertex) return kTRUE;\r
2128 if(TMath::Abs(vertex->GetZv()) > 15.0) return kTRUE; \r
2129 if( !AlidNdPtHelper::TestRecVertex(vertex, esdEvent->GetPrimaryVertexSPD(), AlidNdPtHelper::kTPCSPDvtx) ) return kTRUE;\r
695facdf 2130 \r
791aaf54 2131return kFALSE;\r
2132}\r
2133\r
0aaa8b91 2134//_____________________________________________________________________________\r
2135void AlidNdPtAnalysis::Analyse() \r
2136{\r
68f10917 2137 // init if not done already\r
2138 if (!fIsInit) { Init(); }\r
2139 \r
0aaa8b91 2140 // Analyse histograms\r
2141 //\r
2142 TH1::AddDirectory(kFALSE);\r
2143 TH1 *h=0, *h1=0, *h2=0, *h2c = 0; \r
0aaa8b91 2144 THnSparse *hs=0; \r
2145 TH2 *h2D=0; \r
0aaa8b91 2146\r
2147 char name[256];\r
2148 TObjArray *aFolderObj = new TObjArray;\r
791aaf54 2149 \r
2150 //\r
2151 // LHC backgraund in all and 0-bins\r
2152 //\r
17f2bf95 2153 //AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
2154 //trigSel->SaveHistograms("physics_selection");\r
791aaf54 2155\r
bad4ba69 2156 //\r
2157 // Reconstructed event vertex\r
2158 //\r
2159 h = fRecEventHist1->Projection(0);\r
2160 h->SetName("Xv");\r
2161 aFolderObj->Add(h);\r
2162\r
2163 h = fRecEventHist1->Projection(1);\r
2164 h->SetName("Yv");\r
2165 aFolderObj->Add(h);\r
2166\r
2167 h = fRecEventHist1->Projection(2);\r
2168 h->SetName("Zv");\r
2169 aFolderObj->Add(h);\r
2170\r
2171 //\r
2172 // multiplicity\r
2173 //\r
2174 h = fRecEventHist2->Projection(1);\r
2175 h->SetName("multMB");\r
2176 aFolderObj->Add(h);\r
2177\r
2178 h = fRecEventHist2->Projection(2);\r
2179 h->SetName("multiplicity");\r
2180 aFolderObj->Add(h);\r
2181\r
2182 h2D = fRecEventHist2->Projection(0,1); \r
2183 h2D->SetName("Zv_vs_multiplicity_MB");\r
2184 aFolderObj->Add(h2D);\r
2185\r
2186 //\r
2187 // reconstructed pt histograms\r
2188 //\r
2189 h = fRecTrackHist1[0]->Projection(0);\r
985bdfd5 2190 h->Scale(1.,"width");\r
bad4ba69 2191 h->SetName("pt_all_ch");\r
2192 aFolderObj->Add(h);\r
2193\r
2194 h = fRecTrackHist1[1]->Projection(0);\r
985bdfd5 2195 h->Scale(1.,"width");\r
bad4ba69 2196 h->SetName("pt_acc");\r
2197 aFolderObj->Add(h);\r
2198\r
2199 h = fRecTrackHist1[2]->Projection(0);\r
985bdfd5 2200 h->Scale(1.,"width");\r
bad4ba69 2201 h->SetName("pt_rec");\r
2202 aFolderObj->Add(h);\r
2203\r
2204 //\r
2205 // reconstructed eta histograms\r
2206 //\r
2207 h = fRecTrackHist1[0]->Projection(1);\r
2208 h->SetName("eta_all_ch");\r
2209 aFolderObj->Add(h);\r
2210\r
2211 h = fRecTrackHist1[1]->Projection(1);\r
2212 h->SetName("eta_acc");\r
2213 aFolderObj->Add(h);\r
2214\r
2215 h = fRecTrackHist1[2]->Projection(1);\r
2216 h->SetName("eta_rec");\r
2217 aFolderObj->Add(h);\r
2218\r
2219 //\r
2220 // reconstructed phi histograms\r
2221 //\r
2222 h = fRecTrackHist1[0]->Projection(2);\r
2223 h->SetName("phi_all_ch");\r
2224 aFolderObj->Add(h);\r
2225\r
2226 h = fRecTrackHist1[1]->Projection(2);\r
2227 h->SetName("phi_acc");\r
2228 aFolderObj->Add(h);\r
2229\r
2230 h = fRecTrackHist1[2]->Projection(2);\r
2231 h->SetName("phi_rec");\r
2232 aFolderObj->Add(h);\r
2233\r
2234 //\r
2235 // reconstructed eta:pt histograms\r
2236 //\r
2237 h2D = fRecTrackHist1[0]->Projection(1,0);\r
2238 h2D->SetName("pt_eta_all_ch");\r
2239 aFolderObj->Add(h2D);\r
2240\r
2241 h2D = fRecTrackHist1[1]->Projection(1,0);\r
2242 h2D->SetName("pt_eta_acc");\r
2243 aFolderObj->Add(h2D);\r
2244\r
2245 h2D = fRecTrackHist1[2]->Projection(1,0);\r
2246 h2D->SetName("pt_eta_rec");\r
2247 aFolderObj->Add(h2D);\r
2248\r
2249 //\r
2250 // reconstructed phi:pt histograms\r
2251 //\r
2252 h2D = fRecTrackHist1[0]->Projection(2,0);\r
2253 h2D->SetName("pt_phi_all_ch");\r
2254 aFolderObj->Add(h2D);\r
2255\r
2256 h2D = fRecTrackHist1[1]->Projection(2,0);\r
2257 h2D->SetName("pt_phi_acc");\r
2258 aFolderObj->Add(h2D);\r
2259\r
2260 h2D = fRecTrackHist1[2]->Projection(2,0);\r
2261 h2D->SetName("pt_phi_rec");\r
2262 aFolderObj->Add(h2D);\r
2263\r
2264 //\r
2265 // reconstructed phi:eta histograms\r
2266 //\r
2267 h2D = fRecTrackHist1[0]->Projection(2,1);\r
2268 h2D->SetName("eta_phi_all_ch");\r
2269 aFolderObj->Add(h2D);\r
2270\r
2271 h2D = fRecTrackHist1[1]->Projection(2,1);\r
2272 h2D->SetName("eta_phi_acc");\r
2273 aFolderObj->Add(h2D);\r
2274\r
2275 h2D = fRecTrackHist1[2]->Projection(2,1);\r
2276 h2D->SetName("eta_phi_rec");\r
2277 aFolderObj->Add(h2D);\r
2278\r
985bdfd5 2279 //\r
2280 // reconstructed nClust, chi2 vs pt, eta, phi\r
2281 //\r
2282 if(fHistogramsOn) {\r
2283\r
2284 h2D = fRecTrackHist2->Projection(0,1);\r
2285 h2D->SetName("nClust_chi2_rec");\r
2286 aFolderObj->Add(h2D);\r
2287\r
2288 h2D = fRecTrackHist2->Projection(0,2);\r
2289 h2D->SetName("nClust_pt_rec");\r
2290 aFolderObj->Add(h2D);\r
2291\r
2292 h2D = fRecTrackHist2->Projection(0,3);\r
2293 h2D->SetName("nClust_eta_rec");\r
2294 aFolderObj->Add(h2D);\r
2295\r
2296 h2D = fRecTrackHist2->Projection(0,4);\r
2297 h2D->SetName("nClust_phi_rec");\r
2298 aFolderObj->Add(h2D);\r
2299\r
2300 h2D = fRecTrackHist2->Projection(1,2);\r
2301 h2D->SetName("chi2_pt_rec");\r
2302 aFolderObj->Add(h2D);\r
2303\r
2304 h2D = fRecTrackHist2->Projection(1,3);\r
2305 h2D->SetName("chi2_eta_rec");\r
2306 aFolderObj->Add(h2D);\r
2307\r
2308 h2D = fRecTrackHist2->Projection(1,4);\r
2309 h2D->SetName("chi2_phi_rec");\r
2310 aFolderObj->Add(h2D);\r
2311\r
2312 }\r
2313\r
0aaa8b91 2314 //\r
2315 // calculate corrections for empty events\r
2316 // with multMB==0 \r
2317 //\r
2318\r
2319 //\r
2320 // normalised zv to generate zv for triggered events\r
2321 //\r
2322 h = fRecEventHist2->Projection(0);\r
2323 if( h->Integral() ) h->Scale(1./h->Integral());\r
2324 h->SetName("zv_distribution_norm");\r
2325 aFolderObj->Add(h);\r
bad4ba69 2326 \r
2327 //\r
2328 // MC available\r
2329 //\r
2330 if(IsUseMCInfo()) {\r
2331\r
2332 //\r
2333 // Event vertex resolution\r
2334 //\r
2335 h2D = fRecMCEventHist2->Projection(0,2);\r
2336 h2D->SetName("DeltaXv_vs_mult");\r
2337 aFolderObj->Add(h2D);\r
2338\r
2339 h2D = fRecMCEventHist2->Projection(1,2);\r
2340 h2D->SetName("DeltaZv_vs_mult");\r
2341 aFolderObj->Add(h2D);\r
0aaa8b91 2342\r
2343 //\r
2344 // normalised zv to get trigger/trigger+vertex event differences\r
2345 // F(zv) = E_trig(zv,0)/Int(E_trig(zv,0) / Sum(E_trigvtx(zv,n))/Sum(Int(E_trigvtx(zv,n))dzv)\r
2346 //\r
2347 fTriggerEventMatrix->GetAxis(1)->SetRangeUser(0.,0.);\r
2348 h = fTriggerEventMatrix->Projection(0);\r
bad4ba69 2349 h2D = fTriggerEventMatrix->Projection(0,1);\r
2350 if(h2D->Integral()) h->Scale(1./h2D->Integral());\r
0aaa8b91 2351\r
2352 h1 = fRecEventMatrix->Projection(0);\r
bad4ba69 2353 h2D = fRecEventMatrix->Projection(0,1);\r
2354 if(h2D->Integral()) h1->Scale(1./h2D->Integral());\r
0aaa8b91 2355\r
2356 h->Divide(h1);\r
2357 h->SetName("zv_empty_events_norm");\r
2358 aFolderObj->Add(h);\r
2359 \r
2360 fTriggerEventMatrix->GetAxis(1)->SetRange(1,fTriggerEventMatrix->GetAxis(1)->GetNbins());\r
2361\r
2362 //\r
2363 // rec. vs true multiplicity correlation matrix\r
2364 //\r
2365 hs = (THnSparse*)fEventMultCorrelationMatrix->Clone("event_mult_correlation_matrix");\r
2366 aFolderObj->Add(hs);\r
2367 \r
2368 //\r
2369 // rec. vs true track pt correlation matrix\r
2370 //\r
2371 hs = (THnSparse*)fTrackPtCorrelationMatrix->Clone("track_pt_correlation_matrix");\r
2372 aFolderObj->Add(hs);\r
2373\r
2374 //\r
2375 // trigger efficiency for INEL\r
2376 //\r
bad4ba69 2377 h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fGenEventMatrix->Projection(0),"zv_trig_INEL_eff_matrix");\r
2378 aFolderObj->Add(h);\r
0aaa8b91 2379\r
2380 //\r
2381 // trigger efficiency for NSD\r
2382 //\r
bad4ba69 2383 h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerNSDEventMatrix->Projection(0),fGenNSDEventMatrix->Projection(0),"zv_trig_NSD_eff_matrix");\r
2384 aFolderObj->Add(h);\r
0aaa8b91 2385\r
2386 //\r
2387 // trigger bias correction (MB to ND)\r
2388 //\r
2389 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoND_corr_matrix");\r
2390 aFolderObj->Add(hs);\r
2391\r
bad4ba69 2392 h = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoND_corr_matrix");\r
2393 aFolderObj->Add(h);\r
0aaa8b91 2394\r
0aaa8b91 2395\r
bad4ba69 2396 h = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoND_corr_matrix");\r
0aaa8b91 2397\r
bad4ba69 2398 aFolderObj->Add(h);\r
0aaa8b91 2399\r
2400 //\r
2401 // trigger bias correction (MB to NSD)\r
2402 //\r
2403 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoNSD_corr_matrix");\r
2404 aFolderObj->Add(hs);\r
2405\r
2406 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0,1),fTriggerEventMatrix->Projection(0,1),"zv_mult_trig_MBtoNSD_corr_matrix_2D");\r
2407 aFolderObj->Add(h2D);\r
2408\r
bad4ba69 2409 h = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoNSD_corr_matrix");\r
2410 aFolderObj->Add(h);\r
0aaa8b91 2411\r
0aaa8b91 2412\r
bad4ba69 2413 h = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoNSD_corr_matrix");\r
2414 aFolderObj->Add(h);\r
0aaa8b91 2415\r
0aaa8b91 2416\r
2417 //\r
2418 // trigger bias correction (MB to INEL)\r
2419 //\r
2420 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoInel_corr_matrix");\r
2421 aFolderObj->Add(hs);\r
2422\r
0aaa8b91 2423 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0,1),fTriggerEventMatrix->Projection(0,1),"zv_mult_trig_MBtoInel_corr_matrix_2D");\r
2424 aFolderObj->Add(h2D);\r
2425\r
515964cb 2426 h = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoInel_corr_matrix");\r
2427 aFolderObj->Add(h);\r
0aaa8b91 2428\r
bad4ba69 2429 h = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoInel_corr_matrix");\r
2430 aFolderObj->Add(h);\r
0aaa8b91 2431\r
0aaa8b91 2432\r
2433 //\r
2434 // event vertex reconstruction correction (MB)\r
2435 //\r
2436 hs = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix,fRecEventMatrix,"zv_mult_event_corr_matrix");\r
2437 aFolderObj->Add(hs);\r
2438\r
2439 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0,1),fRecEventMatrix->Projection(0,1),"zv_mult_event_corr_matrix_2D");\r
2440 aFolderObj->Add(h2D);\r
2441\r
0aaa8b91 2442\r
bad4ba69 2443 h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(1),fRecEventMatrix->Projection(1),"mult_event_corr_matrix");\r
2444 aFolderObj->Add(h);\r
0aaa8b91 2445\r
0aaa8b91 2446\r
bad4ba69 2447 h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fRecEventMatrix->Projection(0),"zv_event_corr_matrix");\r
2448 aFolderObj->Add(h);\r
0aaa8b91 2449\r
2450 //\r
2451 // track-event trigger bias correction (MB to ND)\r
2452 //\r
2453\r
2454 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix,fTriggerTrackEventMatrix,"zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
2455 aFolderObj->Add(hs);\r
2456\r
2457 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix->Projection(1,2),fTriggerTrackEventMatrix->Projection(1,2),"eta_pt_track_trig_MBtoND_corr_matrix");\r
2458 aFolderObj->Add(h2D);\r
2459\r
2460 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix->Projection(1,0),fTriggerTrackEventMatrix->Projection(1,0),"pt_zv_track_trig_MBtoND_corr_matrix");\r
2461 aFolderObj->Add(h2D);\r
2462\r
2463 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix->Projection(2,0),fTriggerTrackEventMatrix->Projection(2,0),"zv_eta_track_trig_MBtoND_corr_matrix");\r
2464 aFolderObj->Add(h2D);\r
2465\r
2466 //\r
2467 // track-event trigger bias correction (MB to NSD)\r
2468 //\r
2469 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix,fTriggerTrackEventMatrix,"zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
2470 aFolderObj->Add(hs);\r
2471\r
2472 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix->Projection(1,2),fTriggerTrackEventMatrix->Projection(1,2),"eta_pt_track_trig_MBtoNSD_corr_matrix");\r
2473 aFolderObj->Add(h2D);\r
2474\r
2475 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix->Projection(1,0),fTriggerTrackEventMatrix->Projection(1,0),"pt_zv_track_trig_MBtoNSD_corr_matrix");\r
2476 aFolderObj->Add(h2D);\r
2477\r
2478 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix->Projection(2,0),fTriggerTrackEventMatrix->Projection(2,0),"zv_eta_track_trig_MBtoNSD_corr_matrix");\r
2479 aFolderObj->Add(h2D);\r
2480\r
2481\r
2482 //\r
2483 // track-event trigger bias correction (MB to INEL)\r
2484 //\r
2485 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix,fTriggerTrackEventMatrix,"zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
2486 aFolderObj->Add(hs);\r
2487\r
2488 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix->Projection(1,2),fTriggerTrackEventMatrix->Projection(1,2),"eta_pt_track_trig_MBtoInel_corr_matrix");\r
2489 aFolderObj->Add(h2D);\r
2490\r
2491 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix->Projection(1,0),fTriggerTrackEventMatrix->Projection(1,0),"pt_zv_track_trig_MBtoInel_corr_matrix");\r
2492 aFolderObj->Add(h2D);\r
2493\r
2494 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix->Projection(2,0),fTriggerTrackEventMatrix->Projection(2,0),"zv_eta_track_trig_MBtoInel_corr_matrix");\r
2495 aFolderObj->Add(h2D);\r
2496\r
2497 // efficiency\r
0aaa8b91 2498\r
bad4ba69 2499 h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1),fGenTrackEventMatrix->Projection(1),"pt_track_trig_MBtoInel_eff_matrix");\r
2500 aFolderObj->Add(h);\r
0aaa8b91 2501\r
0aaa8b91 2502\r
2503 //\r
2504 // track-event vertex reconstruction correction (MB)\r
2505 //\r
2506 hs = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix,fRecTrackEventMatrix,"zv_pt_eta_track_event_corr_matrix");\r
2507 aFolderObj->Add(hs);\r
2508\r
2509 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1,2),fRecTrackEventMatrix->Projection(1,2),"eta_pt_track_event_corr_matrix");\r
2510 aFolderObj->Add(h2D);\r
2511\r
2512 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1,0),fRecTrackEventMatrix->Projection(1,0),"pt_zv_track_event_corr_matrix");\r
2513 aFolderObj->Add(h2D);\r
2514\r
2515 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(2,0),fRecTrackEventMatrix->Projection(2,0),"zv_eta_track_event_corr_matrix");\r
2516 aFolderObj->Add(h2D);\r
2517 \r
2518 // efficiency\r
0aaa8b91 2519\r
bad4ba69 2520 h = AlidNdPtHelper::GenerateCorrMatrix(fRecTrackEventMatrix->Projection(1),fTriggerTrackEventMatrix->Projection(1),"pt_track_event_eff_matrix");\r
2521 aFolderObj->Add(h);\r
0aaa8b91 2522\r
0aaa8b91 2523\r
2524 //\r
2525 // track rec. efficiency correction\r
2526 //\r
2527 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix,fRecPrimTrackMatrix,"zv_pt_eta_track_corr_matrix");\r
2528 aFolderObj->Add(hs);\r
2529\r
2530 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1,2),fRecPrimTrackMatrix->Projection(1,2),"eta_pt_track_corr_matrix");\r
2531 aFolderObj->Add(h2D);\r
2532\r
2533 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1,0),fRecPrimTrackMatrix->Projection(1,0),"pt_zv_track_corr_matrix");\r
2534 aFolderObj->Add(h2D);\r
2535\r
2536 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(2,0),fRecPrimTrackMatrix->Projection(2,0),"zv_eta_track_corr_matrix");\r
2537 aFolderObj->Add(h2D);\r
2538\r
0aaa8b91 2539 \r
bad4ba69 2540 h = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(0),fRecPrimTrackMatrix->Projection(0),"zv_track_corr_matrix");\r
2541 aFolderObj->Add(h);\r
0aaa8b91 2542\r
bad4ba69 2543 h = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1),fRecPrimTrackMatrix->Projection(1),"pt_track_corr_matrix");\r
2544 aFolderObj->Add(h);\r
0aaa8b91 2545\r
2546 // efficiency\r
847e74b2 2547\r
bad4ba69 2548 h = AlidNdPtHelper::GenerateCorrMatrix(fRecPrimTrackMatrix->Projection(1), fGenPrimTrackMatrix->Projection(1),"pt_track_eff_matrix");\r
2549 aFolderObj->Add(h);\r
0aaa8b91 2550\r
bad4ba69 2551 h = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(2),fRecPrimTrackMatrix->Projection(2),"eta_track_corr_matrix");\r
2552 aFolderObj->Add(h);\r
0aaa8b91 2553\r
0aaa8b91 2554 //\r
2555 // secondary track contamination correction\r
2556 //\r
2557 //hs = AlidNdPtHelper::GenerateContCorrMatrix(fRecSecTrackMatrix,fRecTrackMatrix,"zv_pt_eta_track_cont_matrix");\r
2558 hs = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix,fRecTrackMatrix,"zv_pt_eta_track_cont_matrix");\r
2559 aFolderObj->Add(hs);\r
2560\r
2561 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1,2),fRecTrackMatrix->Projection(1,2),"eta_pt_track_cont_matrix");\r
2562 aFolderObj->Add(h2D);\r
2563\r
2564 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1,0),fRecTrackMatrix->Projection(1,0),"pt_zv_track_cont_matrix");\r
2565 aFolderObj->Add(h2D);\r
2566\r
2567 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(2,0),fRecTrackMatrix->Projection(2,0),"zv_eta_track_cont_matrix");\r
2568 aFolderObj->Add(h2D);\r
2569\r
bad4ba69 2570 h = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_track_cont_matrix");\r
2571 aFolderObj->Add(h);\r
0aaa8b91 2572\r
847e74b2 2573\r
bad4ba69 2574 h = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_track_cont_matrix");\r
2575 aFolderObj->Add(h);\r
0aaa8b91 2576\r
bad4ba69 2577 h = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_track_cont_matrix");\r
2578 aFolderObj->Add(h);\r
0aaa8b91 2579\r
0aaa8b91 2580 //\r
2581 // multiple track reconstruction correction\r
2582 //\r
2583 //hs = AlidNdPtHelper::GenerateContCorrMatrix(fRecMultTrackMatrix,fRecTrackMatrix,"zv_pt_eta_mult_track_cont_matrix");\r
2584 hs = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix,fRecTrackMatrix,"zv_pt_eta_mult_track_cont_matrix");\r
2585 aFolderObj->Add(hs);\r
2586\r
2587 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1,2),fRecTrackMatrix->Projection(1,2),"eta_pt_mult_track_cont_matrix");\r
2588 aFolderObj->Add(h2D);\r
2589\r
2590 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1,0),fRecTrackMatrix->Projection(1,0),"pt_zv_mult_track_cont_matrix");\r
2591 aFolderObj->Add(h2D);\r
2592\r
2593 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(2,0),fRecTrackMatrix->Projection(2,0),"zv_eta_mult_track_cont_matrix");\r
2594 aFolderObj->Add(h2D);\r
2595\r
bad4ba69 2596 h = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_mult_track_cont_matrix");\r
2597 aFolderObj->Add(h);\r
0aaa8b91 2598\r
bad4ba69 2599 h = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_mult_track_cont_matrix");\r
2600 aFolderObj->Add(h);\r
0aaa8b91 2601\r
bad4ba69 2602 h = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_mult_track_cont_matrix");\r
2603 aFolderObj->Add(h);\r
0aaa8b91 2604\r
0aaa8b91 2605 //\r
2606 // Control histograms\r
2607 //\r
2608 \r
2609 if(fHistogramsOn) {\r
2610\r
2611 // Efficiency electrons, muons, pions, kaons, protons, all\r
2612 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,1); \r
2613 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,1); \r
2614 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2615 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2616 h2c = (TH1D *)h2->Clone();\r
2617 h2c->Divide(h1);\r
2618 h2c->SetName("eff_pt_electrons");\r
2619 aFolderObj->Add(h2c);\r
2620\r
2621 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(2,2); \r
2622 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(2,2); \r
2623 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2624 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2625 h2c = (TH1D *)h2->Clone();\r
2626 h2c->Divide(h1);\r
2627 h2c->SetName("eff_pt_muons");\r
2628 aFolderObj->Add(h2c);\r
2629\r
2630 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(3,3); \r
2631 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(3,3); \r
2632 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2633 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2634 h2c = (TH1D *)h2->Clone();\r
2635 h2c->Divide(h1);\r
2636 h2c->SetName("eff_pt_pions");\r
2637 aFolderObj->Add(h2c);\r
2638\r
2639 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(4,4); \r
2640 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(4,4); \r
2641 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2642 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2643 h2c = (TH1D *)h2->Clone();\r
2644 h2c->Divide(h1);\r
2645 h2c->SetName("eff_pt_kaons");\r
2646 aFolderObj->Add(h2c);\r
2647\r
2648 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(5,5); \r
2649 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(5,5); \r
2650 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2651 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2652 h2c = (TH1D *)h2->Clone();\r
2653 h2c->Divide(h1);\r
2654 h2c->SetName("eff_pt_protons");\r
2655 aFolderObj->Add(h2c);\r
2656\r
7f7dd416 2657 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,5); \r
2658 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,5); \r
2659 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2660 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2661 h2c = (TH1D *)h2->Clone();\r
2662 h2c->Divide(h1);\r
2663 h2c->SetName("eff_pt_selected");\r
2664 aFolderObj->Add(h2c);\r
2665\r
0aaa8b91 2666 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,6); \r
2667 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,6); \r
2668 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
2669 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
2670 h2c = (TH1D *)h2->Clone();\r
2671 h2c->Divide(h1);\r
2672 h2c->SetName("eff_pt_all");\r
2673 aFolderObj->Add(h2c);\r
2674\r
bad4ba69 2675 fMCPrimTrackHist1[1]->GetAxis(1)->SetRange(1,fMCPrimTrackHist1[1]->GetAxis(1)->GetNbins()); \r
2676 fMCPrimTrackHist1[2]->GetAxis(1)->SetRange(1,fMCPrimTrackHist1[2]->GetAxis(1)->GetNbins());\r
2677\r
0aaa8b91 2678 // pt spetra\r
2679 // - rec, primaries, secondaries\r
2680 // - primaries (pid) \r
2681 // - secondaries (pid)\r
2682 // - secondaries (mech)\r
2683 // - secondaries (mother)\r
2684 //\r
0aaa8b91 2685\r
00b81913 2686 TH1D *mcPtAccall = fMCTrackHist1[1]->Projection(0);\r
2687 mcPtAccall->SetName("mc_pt_acc_all");\r
2688 aFolderObj->Add(mcPtAccall);\r
0aaa8b91 2689\r
00b81913 2690 TH1D *mcPtAccprim = fMCPrimTrackHist1[1]->Projection(0);\r
2691 mcPtAccprim->SetName("mc_pt_acc_prim");\r
2692 aFolderObj->Add(mcPtAccprim);\r
0aaa8b91 2693\r
00b81913 2694 TH1D *mcPtRecall = fMCTrackHist1[2]->Projection(0);\r
2695 mcPtRecall->SetName("mc_pt_rec_all");\r
2696 aFolderObj->Add(mcPtRecall);\r
0aaa8b91 2697\r
00b81913 2698 TH1D *mcPtRecprim = fMCPrimTrackHist1[2]->Projection(0);\r
2699 mcPtRecprim->SetName("mc_pt_rec_prim");\r
2700 aFolderObj->Add(mcPtRecprim);\r
0aaa8b91 2701\r
00b81913 2702 TH1D *mcPtRecsec = fMCSecTrackHist1[2]->Projection(0);\r
2703 mcPtRecsec->SetName("mc_pt_rec_sec");\r
2704 aFolderObj->Add(mcPtRecsec);\r
0aaa8b91 2705\r
2706 for(Int_t i = 0; i<6; i++) \r
2707 { \r
2708 sprintf(name,"mc_pt_rec_prim_pid_%d",i); \r
2709 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(i+1,i+1);\r
2710 h = fMCPrimTrackHist1[2]->Projection(0);\r
2711 h->SetName(name);\r
2712 aFolderObj->Add(h);\r
2713\r
2714 sprintf(name,"mc_pt_rec_sec_pid_%d",i); \r
2715 fMCSecTrackHist1[2]->GetAxis(2)->SetRange(i+1,i+1);\r
2716 h = fMCSecTrackHist1[2]->Projection(0);\r
2717 h->SetName(name);\r
2718 aFolderObj->Add(h);\r
2719\r
2720 // production mechanisms for given pid\r
2721 fMCSecTrackHist1[2]->GetAxis(2)->SetRange(i+1,i+1);\r
2722\r
2723 for(Int_t j=0; j<20; j++) {\r
2724 if(j == 4) {\r
2725 // decay\r
2726 \r
2727 sprintf(name,"mc_pt_rec_sec_pid_%d_decay",i); \r
2728 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2729 h = fMCSecTrackHist1[2]->Projection(0);\r
2730 h->SetName(name);\r
2731 aFolderObj->Add(h);\r
2732\r
2733 sprintf(name,"mc_eta_rec_sec_pid_%d_decay",i); \r
2734 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2735 h = fMCSecTrackHist1[2]->Projection(1);\r
2736 h->SetName(name);\r
2737 aFolderObj->Add(h);\r
2738\r
2739 sprintf(name,"mc_mother_rec_sec_pid_%d_decay",i); \r
2740 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2741 h = fMCSecTrackHist1[2]->Projection(4);\r
2742 h->SetName(name);\r
2743 aFolderObj->Add(h);\r
2744\r
2745 } else if (j == 5) {\r
2746 // conversion\r
2747\r
2748 sprintf(name,"mc_pt_rec_sec_pid_%d_conv",i); \r
2749 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2750 h = fMCSecTrackHist1[2]->Projection(0);\r
2751 h->SetName(name);\r
2752 aFolderObj->Add(h);\r
2753\r
2754 sprintf(name,"mc_eta_rec_sec_pid_%d_conv",i); \r
2755 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2756 h = fMCSecTrackHist1[2]->Projection(1);\r
2757 h->SetName(name);\r
2758 aFolderObj->Add(h);\r
2759\r
2760 sprintf(name,"mc_mother_rec_sec_pid_%d_conv",i); \r
2761 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2762 h = fMCSecTrackHist1[2]->Projection(4);\r
2763 h->SetName(name);\r
2764 aFolderObj->Add(h);\r
2765\r
2766 } else if (j == 13) {\r
2767 // mat\r
2768 \r
2769 sprintf(name,"mc_pt_rec_sec_pid_%d_mat",i); \r
2770 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2771 h = fMCSecTrackHist1[2]->Projection(0);\r
2772 h->SetName(name);\r
2773 aFolderObj->Add(h);\r
2774\r
2775 sprintf(name,"mc_eta_rec_sec_pid_%d_mat",i); \r
2776 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2777 h = fMCSecTrackHist1[2]->Projection(1);\r
2778 h->SetName(name);\r
2779 aFolderObj->Add(h);\r
2780\r
2781 sprintf(name,"mc_eta_mother_rec_sec_pid_%d_mat",i); \r
2782 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2783 h = fMCSecTrackHist1[2]->Projection(4,1);\r
2784 h->SetName(name);\r
2785 aFolderObj->Add(h);\r
2786\r
2787 sprintf(name,"mc_mother_rec_sec_pid_%d_mat",i); \r
2788 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2789 h = fMCSecTrackHist1[2]->Projection(4);\r
2790 h->SetName(name);\r
2791 aFolderObj->Add(h);\r
2792\r
2793 sprintf(name,"mc_pt_mother_rec_sec_pid_%d_mat",i); \r
2794 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2795 h = fMCSecTrackHist1[2]->Projection(4,0);\r
2796 h->SetName(name);\r
2797 aFolderObj->Add(h);\r
2798\r
2799 } else {\r
2800 continue;\r
2801 }\r
2802 }\r
2803\r
2804 }\r
2805 } // end fHistogramOn\r
2806\r
2807 //\r
2808 // resolution histograms\r
2809 // only for reconstructed tracks\r
2810 //\r
2811\r
2812 TH2F *h2F=0;\r
2813 TCanvas * c = new TCanvas("resol","resol");\r
2814 c->cd();\r
2815\r
2816 //\r
847e74b2 2817 fRecMCTrackHist1->GetAxis(1)->SetRangeUser(-0.8,0.79); \r
0aaa8b91 2818\r
2819 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,0);\r
2820 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2821 h->SetXTitle("p_{tmc} (GeV/c)");\r
2822 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} resolution");\r
2823 h->Draw();\r
2824 h->SetName("pt_resolution_vs_mcpt");\r
2825 aFolderObj->Add(h);\r
2826\r
2827 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,0);\r
2828 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2829 h->SetXTitle("p_{tmc} (GeV/c)");\r
2830 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} mean");\r
2831 h->Draw();\r
2832 h->SetName("dpt_mean_vs_mcpt");\r
2833 aFolderObj->Add(h);\r
2834\r
2835 //\r
2836 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,0);\r
2837 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2838 h->SetXTitle("p_{tmc} (GeV/c)");\r
2839 h->SetYTitle("(#eta-#eta_{mc}) resolution");\r
2840 h->Draw();\r
2841 h->SetName("eta_resolution_vs_mcpt");\r
2842 aFolderObj->Add(h);\r
2843\r
2844 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,0);\r
2845 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2846 h->SetXTitle("p_{tmc} (GeV/c)");\r
2847 h->SetYTitle("(#eta-mc#eta) mean");\r
2848 h->Draw();\r
2849 h->SetName("deta_mean_vs_mcpt");\r
2850 aFolderObj->Add(h);\r
2851 \r
2852 // \r
2853 fRecMCTrackHist1->GetAxis(1)->SetRange(1,fRecMCTrackHist1->GetAxis(1)->GetNbins()); \r
0aaa8b91 2854\r
2855 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,1);\r
2856 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2857 h->SetXTitle("#eta_{mc}");\r
2858 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} resolution");\r
2859 h->Draw();\r
2860 h->SetName("pt_resolution_vs_mceta");\r
2861 aFolderObj->Add(h);\r
2862\r
2863 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,1);\r
2864 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2865 h->SetXTitle("#eta_{mc}");\r
2866 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} mean");\r
2867 h->Draw();\r
2868 h->SetName("dpt_mean_vs_mceta");\r
2869 aFolderObj->Add(h);\r
2870\r
2871 //\r
2872 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,1);\r
2873 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2874 h->SetXTitle("#eta_{mc}");\r
2875 h->SetYTitle("(#eta-#eta_{mc}) resolution");\r
2876 h->Draw();\r
2877 h->SetName("eta_resolution_vs_mceta");\r
2878 aFolderObj->Add(h);\r
2879\r
2880 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,1);\r
2881 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2882 h->SetXTitle("#eta_{mc}");\r
2883 h->SetYTitle("(#eta-mc#eta) mean");\r
2884 h->Draw();\r
2885 h->SetName(&quo