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