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