dNdPt analysis
[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
15\r
16#include <iostream>\r
17\r
18#include "TFile.h"\r
19#include "TCint.h"\r
20#include "TH1.h"\r
21#include "TH2.h"\r
22//#include "THnSparse.h"\r
23#include "TCanvas.h"\r
24\r
25#include "AliHeader.h" \r
26#include "AliGenEventHeader.h" \r
27#include "AliStack.h" \r
28#include "AliESDEvent.h" \r
29#include "AliMCEvent.h" \r
30#include "AliESDtrackCuts.h" \r
31#include "AliLog.h" \r
32\r
33#include "AlidNdPtEventCuts.h"\r
34#include "AlidNdPtAcceptanceCuts.h"\r
35\r
36#include "AlidNdPtAnalysis.h"\r
37\r
38using namespace std;\r
39\r
40ClassImp(AlidNdPtAnalysis)\r
41\r
42//_____________________________________________________________________________\r
43 AlidNdPtAnalysis::AlidNdPtAnalysis(): AlidNdPt(),\r
44 fAnalysisFolder(0),\r
45 fHistogramsOn(kFALSE),\r
46\r
47 // event multiplicity correlation matrix \r
48 fEventMultCorrelationMatrix(0),\r
49\r
50 // rec. track pt vs true track pt correlation matrix \r
51 fTrackPtCorrelationMatrix(0),\r
52\r
53 // event level correction\r
54 fGenEventMatrix(0),\r
55 fGenSDEventMatrix(0),\r
56 fGenDDEventMatrix(0),\r
57 fGenNDEventMatrix(0),\r
58 fGenNSDEventMatrix(0),\r
59\r
60 fTriggerEventMatrix(0),\r
61 fTriggerSDEventMatrix(0),\r
62 fTriggerDDEventMatrix(0),\r
63 fTriggerNDEventMatrix(0),\r
64 fTriggerNSDEventMatrix(0),\r
65\r
66 fRecEventMatrix(0),\r
67 fRecSDEventMatrix(0),\r
68 fRecDDEventMatrix(0),\r
69 fRecNDEventMatrix(0),\r
70 fRecNSDEventMatrix(0),\r
71\r
72 //\r
73 // track-event level correction \r
74 //\r
75 fGenTrackEventMatrix(0),\r
76 fGenTrackSDEventMatrix(0),\r
77 fGenTrackDDEventMatrix(0),\r
78 fGenTrackNDEventMatrix(0),\r
79 fGenTrackNSDEventMatrix(0),\r
80\r
81 fTriggerTrackEventMatrix(0),\r
82 fTriggerTrackSDEventMatrix(0),\r
83 fTriggerTrackDDEventMatrix(0),\r
84 fTriggerTrackNDEventMatrix(0),\r
85 fTriggerTrackNSDEventMatrix(0),\r
86\r
87 fRecTrackEventMatrix(0),\r
88 fRecTrackSDEventMatrix(0),\r
89 fRecTrackDDEventMatrix(0),\r
90 fRecTrackNDEventMatrix(0),\r
91 fRecTrackNSDEventMatrix(0),\r
92\r
93 // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)\r
94 fGenPrimTrackMatrix(0),\r
95 fRecPrimTrackMatrix(0),\r
96\r
97 // secondary track contamination correction (fRecSecTrackMatrix / fRecTrackMatrix)\r
98 fRecTrackMatrix(0),\r
99 fRecSecTrackMatrix(0),\r
100\r
101 // multiple rec. track contamination corrections (fRecMultTrackMatrix / fRecTrackMatrix)\r
102 fRecMultTrackMatrix(0),\r
103\r
104 // event control histograms\r
105 fMCEventHist1(0),\r
106 fRecEventHist1(0),\r
107 fRecEventHist2(0),\r
108 fRecMCEventHist1(0),\r
109 fRecMCEventHist2(0),\r
110 fRecMCEventHist3(0),\r
111\r
112 // rec. pt and eta resolution w.r.t MC\r
113 fRecMCTrackHist1(0),\r
114\r
115 //multple reconstructed tracks\r
116 fMCMultRecTrackHist1(0) \r
117{\r
118 // default constructor\r
119 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
120 fMCTrackHist1[i]=0; \r
121 fMCPrimTrackHist1[i]=0; \r
122 fMCSecTrackHist1[i]=0; \r
123 fRecTrackHist1[i]=0; \r
124 fRecTrackMultHist1[i]=0; \r
125 }\r
126 Init();\r
127}\r
128\r
129//_____________________________________________________________________________\r
130AlidNdPtAnalysis::AlidNdPtAnalysis(Char_t* name, Char_t* title): AlidNdPt(name,title),\r
131 fAnalysisFolder(0),\r
132 fHistogramsOn(kFALSE),\r
133\r
134 // event multiplicity correlation matrix \r
135 fEventMultCorrelationMatrix(0),\r
136\r
137 // rec. track pt vs true track pt correlation matrix \r
138 fTrackPtCorrelationMatrix(0),\r
139\r
140 // event level correction\r
141 fGenEventMatrix(0),\r
142 fGenSDEventMatrix(0),\r
143 fGenDDEventMatrix(0),\r
144 fGenNDEventMatrix(0),\r
145 fGenNSDEventMatrix(0),\r
146\r
147 fTriggerEventMatrix(0),\r
148 fTriggerSDEventMatrix(0),\r
149 fTriggerDDEventMatrix(0),\r
150 fTriggerNDEventMatrix(0),\r
151 fTriggerNSDEventMatrix(0),\r
152\r
153 fRecEventMatrix(0),\r
154 fRecSDEventMatrix(0),\r
155 fRecDDEventMatrix(0),\r
156 fRecNDEventMatrix(0),\r
157 fRecNSDEventMatrix(0),\r
158\r
159 //\r
160 // track-event level correction \r
161 //\r
162 fGenTrackEventMatrix(0),\r
163 fGenTrackSDEventMatrix(0),\r
164 fGenTrackDDEventMatrix(0),\r
165 fGenTrackNDEventMatrix(0),\r
166 fGenTrackNSDEventMatrix(0),\r
167\r
168 fTriggerTrackEventMatrix(0),\r
169 fTriggerTrackSDEventMatrix(0),\r
170 fTriggerTrackDDEventMatrix(0),\r
171 fTriggerTrackNDEventMatrix(0),\r
172 fTriggerTrackNSDEventMatrix(0),\r
173\r
174 fRecTrackEventMatrix(0),\r
175 fRecTrackSDEventMatrix(0),\r
176 fRecTrackDDEventMatrix(0),\r
177 fRecTrackNDEventMatrix(0),\r
178 fRecTrackNSDEventMatrix(0),\r
179\r
180 // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)\r
181 fGenPrimTrackMatrix(0),\r
182 fRecPrimTrackMatrix(0),\r
183\r
184 // secondary track contamination correction (fRecSecTrackMatrix / fRecTrackMatrix)\r
185 fRecTrackMatrix(0),\r
186 fRecSecTrackMatrix(0),\r
187\r
188 // multiple rec. track contamination corrections (fRecMultTrackMatrix / fRecTrackMatrix)\r
189 fRecMultTrackMatrix(0),\r
190\r
191 // event control histograms\r
192 fMCEventHist1(0),\r
193 fRecEventHist1(0),\r
194 fRecEventHist2(0),\r
195 fRecMCEventHist1(0),\r
196 fRecMCEventHist2(0),\r
197 fRecMCEventHist3(0),\r
198 \r
199 // rec. pt and eta resolution w.r.t MC\r
200 fRecMCTrackHist1(0),\r
201\r
202 //multple reconstructed tracks\r
203 fMCMultRecTrackHist1(0) \r
204{\r
205 // constructor\r
206 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
207 fMCTrackHist1[i]=0; \r
208 fMCPrimTrackHist1[i]=0; \r
209 fMCSecTrackHist1[i]=0; \r
210 fRecTrackHist1[i]=0; \r
211 fRecTrackMultHist1[i]=0; \r
212 }\r
213\r
214 Init();\r
215}\r
216\r
217//_____________________________________________________________________________\r
218AlidNdPtAnalysis::~AlidNdPtAnalysis() {\r
219 //\r
220 if(fEventMultCorrelationMatrix) delete fEventMultCorrelationMatrix; fEventMultCorrelationMatrix=0;\r
221 //\r
222 if(fTrackPtCorrelationMatrix) delete fTrackPtCorrelationMatrix; fTrackPtCorrelationMatrix=0;\r
223 //\r
224 if(fGenEventMatrix) delete fGenEventMatrix; fGenEventMatrix=0;\r
225 if(fGenSDEventMatrix) delete fGenSDEventMatrix; fGenSDEventMatrix=0;\r
226 if(fGenDDEventMatrix) delete fGenDDEventMatrix; fGenDDEventMatrix=0;\r
227 if(fGenNDEventMatrix) delete fGenNDEventMatrix; fGenNDEventMatrix=0;\r
228 if(fGenNSDEventMatrix) delete fGenNSDEventMatrix; fGenNSDEventMatrix=0;\r
229\r
230 if(fTriggerEventMatrix) delete fTriggerEventMatrix; fTriggerEventMatrix=0;\r
231 if(fTriggerSDEventMatrix) delete fTriggerSDEventMatrix; fTriggerSDEventMatrix=0;\r
232 if(fTriggerDDEventMatrix) delete fTriggerDDEventMatrix; fTriggerDDEventMatrix=0;\r
233 if(fTriggerNDEventMatrix) delete fTriggerNDEventMatrix; fTriggerNDEventMatrix=0;\r
234 if(fTriggerNSDEventMatrix) delete fTriggerNSDEventMatrix; fTriggerNSDEventMatrix=0;\r
235\r
236 if(fRecEventMatrix) delete fRecEventMatrix; fRecEventMatrix=0;\r
237 if(fRecSDEventMatrix) delete fRecSDEventMatrix; fRecSDEventMatrix=0;\r
238 if(fRecDDEventMatrix) delete fRecDDEventMatrix; fRecDDEventMatrix=0;\r
239 if(fRecNDEventMatrix) delete fRecNDEventMatrix; fRecNDEventMatrix=0;\r
240 if(fRecNSDEventMatrix) delete fRecNSDEventMatrix; fRecNSDEventMatrix=0;\r
241\r
242 //\r
243 if(fGenTrackEventMatrix) delete fGenTrackEventMatrix; fGenTrackEventMatrix=0;\r
244 if(fGenTrackSDEventMatrix) delete fGenTrackSDEventMatrix; fGenTrackSDEventMatrix=0;\r
245 if(fGenTrackDDEventMatrix) delete fGenTrackDDEventMatrix; fGenTrackDDEventMatrix=0;\r
246 if(fGenTrackNDEventMatrix) delete fGenTrackNDEventMatrix; fGenTrackNDEventMatrix=0;\r
247 if(fGenTrackNSDEventMatrix) delete fGenTrackNSDEventMatrix; fGenTrackNSDEventMatrix=0;\r
248\r
249 if(fTriggerEventMatrix) delete fTriggerEventMatrix; fTriggerEventMatrix=0;\r
250 if(fTriggerTrackSDEventMatrix) delete fTriggerTrackSDEventMatrix; fTriggerTrackSDEventMatrix=0;\r
251 if(fTriggerTrackDDEventMatrix) delete fTriggerTrackDDEventMatrix; fTriggerTrackDDEventMatrix=0;\r
252 if(fTriggerTrackNDEventMatrix) delete fTriggerTrackNDEventMatrix; fTriggerTrackNDEventMatrix=0;\r
253 if(fTriggerTrackNSDEventMatrix) delete fTriggerTrackNSDEventMatrix; fTriggerTrackNSDEventMatrix=0;\r
254\r
255 if(fRecTrackEventMatrix) delete fRecTrackEventMatrix; fRecTrackEventMatrix=0;\r
256 if(fRecTrackSDEventMatrix) delete fRecTrackSDEventMatrix; fRecTrackSDEventMatrix=0;\r
257 if(fRecTrackDDEventMatrix) delete fRecTrackDDEventMatrix; fRecTrackDDEventMatrix=0;\r
258 if(fRecTrackNDEventMatrix) delete fRecTrackNDEventMatrix; fRecTrackNDEventMatrix=0;\r
259 if(fRecTrackNSDEventMatrix) delete fRecTrackNSDEventMatrix; fRecTrackNSDEventMatrix=0;\r
260\r
261 //\r
262 if(fGenPrimTrackMatrix) delete fGenPrimTrackMatrix; fGenPrimTrackMatrix=0;\r
263 if(fRecPrimTrackMatrix) delete fRecPrimTrackMatrix; fRecPrimTrackMatrix=0;\r
264 //\r
265 if(fRecTrackMatrix) delete fRecTrackMatrix; fRecTrackMatrix=0;\r
266 if(fRecSecTrackMatrix) delete fRecSecTrackMatrix; fRecSecTrackMatrix=0;\r
267 // \r
268 if(fRecMultTrackMatrix) delete fRecMultTrackMatrix; fRecMultTrackMatrix=0;\r
269 //\r
270 // Control histograms\r
271 //\r
272 if(fMCEventHist1) delete fMCEventHist1; fMCEventHist1=0;\r
273 if(fRecEventHist1) delete fRecEventHist1; fRecEventHist1=0;\r
274 if(fRecEventHist2) delete fRecEventHist2; fRecEventHist2=0;\r
275 if(fRecMCEventHist1) delete fRecMCEventHist1; fRecMCEventHist1=0;\r
276 if(fRecMCEventHist2) delete fRecMCEventHist2; fRecMCEventHist2=0;\r
277 if(fRecMCEventHist3) delete fRecMCEventHist3; fRecMCEventHist3=0;\r
278 //\r
279 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
280 if(fMCTrackHist1[i]) delete fMCTrackHist1[i]; fMCTrackHist1[i]=0;\r
281 if(fMCPrimTrackHist1[i]) delete fMCPrimTrackHist1[i]; fMCPrimTrackHist1[i]=0;\r
282 if(fMCSecTrackHist1[i]) delete fMCSecTrackHist1[i]; fMCSecTrackHist1[i]=0;\r
283 if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
284 if(fRecTrackMultHist1[i]) delete fRecTrackMultHist1[i]; fRecTrackMultHist1[i]=0;\r
285 }\r
286 if(fRecMCTrackHist1) delete fRecMCTrackHist1; fRecMCTrackHist1=0;\r
287 if(fMCMultRecTrackHist1) delete fMCMultRecTrackHist1; fMCMultRecTrackHist1=0; \r
288 //\r
289 if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;\r
290}\r
291\r
292//_____________________________________________________________________________\r
293void AlidNdPtAnalysis::Init(){\r
294 //\r
295 // Init histograms\r
296 //\r
297\r
298 const Int_t ptNbins = 56;\r
299 const Int_t etaNbins = 30;\r
300 const Int_t zvNbins = 12;\r
301 //const Int_t multNbins = 22;\r
302\r
303 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,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0};\r
304 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
305 Double_t binsZv[zvNbins+1] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
306 //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
307\r
308 //Int_t binsTrackMatrix[4]={zvNbins,ptNbins,etaNbins,multNbins};\r
309 Int_t binsTrackMatrix[3]={zvNbins,ptNbins,etaNbins};\r
310 //Int_t binsTrackMatrix[3]={multNbins,ptNbins,etaNbins};\r
311\r
312 //\r
313 // rec. vs MC correlation matrices\r
314 //\r
315 Int_t binsMultTrueEventMatrix[2]={150,150};\r
316 Double_t minMultTrueEventMatrix[2]={-0.5,-0.5}; \r
317 Double_t maxMultTrueEventMatrix[2]={149.5,149.5}; \r
318 fEventMultCorrelationMatrix = new THnSparseF("fEventMultCorrelationMatrix","mult:true_mult",2,binsMultTrueEventMatrix,minMultTrueEventMatrix,maxMultTrueEventMatrix);\r
319 fEventMultCorrelationMatrix->GetAxis(0)->SetTitle("track multiplicity");\r
320 fEventMultCorrelationMatrix->GetAxis(1)->SetTitle("multiplicity");\r
321 fEventMultCorrelationMatrix->Sumw2();\r
322 \r
323 Int_t binsTrackPtCorrelationMatrix[3]={ptNbins,ptNbins,etaNbins};\r
324 fTrackPtCorrelationMatrix = new THnSparseF("fTrackPtCorrelationMatrix","Pt:mcPt:mcEta",3,binsTrackPtCorrelationMatrix);\r
325 fTrackPtCorrelationMatrix->SetBinEdges(0,binsPt);\r
326 fTrackPtCorrelationMatrix->SetBinEdges(1,binsPt);\r
327 fTrackPtCorrelationMatrix->SetBinEdges(2,binsEta);\r
328 fTrackPtCorrelationMatrix->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
329 fTrackPtCorrelationMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
330 fTrackPtCorrelationMatrix->GetAxis(2)->SetTitle("mcEta");\r
331 fTrackPtCorrelationMatrix->Sumw2();\r
332\r
333 //\r
334 // Efficiency and contamination correction matrices\r
335 //\r
336 Int_t binsEventMatrix[2]={zvNbins,150};\r
337 Double_t minEventMatrix[2]={-25.,-0.5}; \r
338 Double_t maxEventMatrix[2]={25.,149.5}; \r
339\r
340 fGenEventMatrix = new THnSparseF("fGenEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
341 fGenEventMatrix->SetBinEdges(0,binsZv);\r
342 fGenEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
343 fGenEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
344 fGenEventMatrix->Sumw2();\r
345 \r
346 fGenSDEventMatrix = new THnSparseF("fGenSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
347 fGenSDEventMatrix->SetBinEdges(0,binsZv);\r
348 fGenSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
349 fGenSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
350 fGenSDEventMatrix->Sumw2();\r
351 \r
352 fGenDDEventMatrix = new THnSparseF("fGenDDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
353 fGenDDEventMatrix->SetBinEdges(0,binsZv);\r
354 fGenDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
355 fGenDDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
356 fGenDDEventMatrix->Sumw2();\r
357 \r
358 fGenNDEventMatrix = new THnSparseF("fGenNDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
359 fGenNDEventMatrix->SetBinEdges(0,binsZv);\r
360 fGenNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
361 fGenNDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
362 fGenNDEventMatrix->Sumw2();\r
363\r
364 fGenNSDEventMatrix = new THnSparseF("fGenNSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
365 fGenNSDEventMatrix->SetBinEdges(0,binsZv);\r
366 fGenNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
367 fGenNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
368 fGenNSDEventMatrix->Sumw2();\r
369\r
370 //\r
371 fTriggerEventMatrix = new THnSparseF("fTriggerEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
372 fTriggerEventMatrix->SetBinEdges(0,binsZv);\r
373 fTriggerEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
374 fTriggerEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
375 fTriggerEventMatrix->Sumw2();\r
376\r
377 fTriggerSDEventMatrix = new THnSparseF("fTriggerSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
378 fTriggerSDEventMatrix->SetBinEdges(0,binsZv);\r
379 fTriggerSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
380 fTriggerSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
381 fTriggerSDEventMatrix->Sumw2();\r
382 \r
383 fTriggerDDEventMatrix = new THnSparseF("fTriggerDDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
384 fTriggerDDEventMatrix->SetBinEdges(0,binsZv);\r
385 fTriggerDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
386 fTriggerDDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
387 fTriggerDDEventMatrix->Sumw2();\r
388 \r
389 fTriggerNDEventMatrix = new THnSparseF("fTriggerNDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
390 fTriggerNDEventMatrix->SetBinEdges(0,binsZv);\r
391 fTriggerNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
392 fTriggerNDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
393 fTriggerNDEventMatrix->Sumw2();\r
394 \r
395 fTriggerNSDEventMatrix = new THnSparseF("fTriggerNSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
396 fTriggerNSDEventMatrix->SetBinEdges(0,binsZv);\r
397 fTriggerNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
398 fTriggerNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
399 fTriggerNSDEventMatrix->Sumw2();\r
400 \r
401 //\r
402 fRecEventMatrix = new THnSparseF("fRecEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
403 fRecEventMatrix->SetBinEdges(0,binsZv);\r
404 fRecEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
405 fRecEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
406 fRecEventMatrix->Sumw2();\r
407\r
408 fRecSDEventMatrix = new THnSparseF("fRecSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
409 fRecSDEventMatrix->SetBinEdges(0,binsZv);\r
410 fRecSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
411 fRecSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
412 fRecSDEventMatrix->Sumw2();\r
413 \r
414 fRecDDEventMatrix = new THnSparseF("fRecDDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
415 fRecDDEventMatrix->SetBinEdges(0,binsZv);\r
416 fRecDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
417 fRecDDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
418 fRecDDEventMatrix->Sumw2();\r
419 \r
420 fRecNDEventMatrix = new THnSparseF("fRecNDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
421 fRecNDEventMatrix->SetBinEdges(0,binsZv);\r
422 fRecNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
423 fRecNDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
424 fRecNDEventMatrix->Sumw2();\r
425 \r
426 fRecNSDEventMatrix = new THnSparseF("fRecNSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
427 fRecNSDEventMatrix->SetBinEdges(0,binsZv);\r
428 fRecNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
429 fRecNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
430 fRecNSDEventMatrix->Sumw2();\r
431\r
432 // \r
433 // track to event corrections\r
434 //\r
435\r
436 fGenTrackEventMatrix = new THnSparseF("fGenTrackEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
437 fGenTrackEventMatrix->SetBinEdges(0,binsZv);\r
438 fGenTrackEventMatrix->SetBinEdges(1,binsPt);\r
439 fGenTrackEventMatrix->SetBinEdges(2,binsEta);\r
440 fGenTrackEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
441 fGenTrackEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
442 fGenTrackEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
443 fGenTrackEventMatrix->Sumw2();\r
444\r
445 fGenTrackSDEventMatrix = new THnSparseF("fGenTrackSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
446 fGenTrackSDEventMatrix->SetBinEdges(0,binsZv);\r
447 fGenTrackSDEventMatrix->SetBinEdges(1,binsPt);\r
448 fGenTrackSDEventMatrix->SetBinEdges(2,binsEta);\r
449 fGenTrackSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
450 fGenTrackSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
451 fGenTrackSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
452 fGenTrackSDEventMatrix->Sumw2();\r
453\r
454 fGenTrackDDEventMatrix = new THnSparseF("fGenTrackDDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
455 fGenTrackDDEventMatrix->SetBinEdges(0,binsZv);\r
456 fGenTrackDDEventMatrix->SetBinEdges(1,binsPt);\r
457 fGenTrackDDEventMatrix->SetBinEdges(2,binsEta);\r
458 fGenTrackDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
459 fGenTrackDDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
460 fGenTrackDDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
461 fGenTrackDDEventMatrix->Sumw2();\r
462\r
463 fGenTrackNDEventMatrix = new THnSparseF("fGenTrackNDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
464 fGenTrackNDEventMatrix->SetBinEdges(0,binsZv);\r
465 fGenTrackNDEventMatrix->SetBinEdges(1,binsPt);\r
466 fGenTrackNDEventMatrix->SetBinEdges(2,binsEta);\r
467 fGenTrackNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
468 fGenTrackNDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
469 fGenTrackNDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
470 fGenTrackNDEventMatrix->Sumw2();\r
471\r
472 fGenTrackNSDEventMatrix = new THnSparseF("fGenTrackNSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
473 fGenTrackNSDEventMatrix->SetBinEdges(0,binsZv);\r
474 fGenTrackNSDEventMatrix->SetBinEdges(1,binsPt);\r
475 fGenTrackNSDEventMatrix->SetBinEdges(2,binsEta);\r
476 fGenTrackNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
477 fGenTrackNSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
478 fGenTrackNSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
479 fGenTrackNSDEventMatrix->Sumw2();\r
480\r
481\r
482 //\r
483 fTriggerTrackEventMatrix = new THnSparseF("fTriggerTrackEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
484 fTriggerTrackEventMatrix->SetBinEdges(0,binsZv);\r
485 fTriggerTrackEventMatrix->SetBinEdges(1,binsPt);\r
486 fTriggerTrackEventMatrix->SetBinEdges(2,binsEta);\r
487 fTriggerTrackEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
488 fTriggerTrackEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
489 fTriggerTrackEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
490 fTriggerTrackEventMatrix->Sumw2();\r
491\r
492 fTriggerTrackSDEventMatrix = new THnSparseF("fTriggerTrackSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
493 fTriggerTrackSDEventMatrix->SetBinEdges(0,binsZv);\r
494 fTriggerTrackSDEventMatrix->SetBinEdges(1,binsPt);\r
495 fTriggerTrackSDEventMatrix->SetBinEdges(2,binsEta);\r
496 fTriggerTrackSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
497 fTriggerTrackSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
498 fTriggerTrackSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
499 fTriggerTrackSDEventMatrix->Sumw2();\r
500\r
501 fTriggerTrackDDEventMatrix = new THnSparseF("fTriggerTrackDDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
502 fTriggerTrackDDEventMatrix->SetBinEdges(0,binsZv);\r
503 fTriggerTrackDDEventMatrix->SetBinEdges(1,binsPt);\r
504 fTriggerTrackDDEventMatrix->SetBinEdges(2,binsEta);\r
505 fTriggerTrackDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
506 fTriggerTrackDDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
507 fTriggerTrackDDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
508 fTriggerTrackDDEventMatrix->Sumw2();\r
509\r
510 fTriggerTrackNDEventMatrix = new THnSparseF("fTriggerTrackNDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
511 fTriggerTrackNDEventMatrix->SetBinEdges(0,binsZv);\r
512 fTriggerTrackNDEventMatrix->SetBinEdges(1,binsPt);\r
513 fTriggerTrackNDEventMatrix->SetBinEdges(2,binsEta);\r
514 fTriggerTrackNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
515 fTriggerTrackNDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
516 fTriggerTrackNDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
517 fTriggerTrackNDEventMatrix->Sumw2();\r
518\r
519 fTriggerTrackNSDEventMatrix = new THnSparseF("fTriggerTrackNSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
520 fTriggerTrackNSDEventMatrix->SetBinEdges(0,binsZv);\r
521 fTriggerTrackNSDEventMatrix->SetBinEdges(1,binsPt);\r
522 fTriggerTrackNSDEventMatrix->SetBinEdges(2,binsEta);\r
523 fTriggerTrackNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
524 fTriggerTrackNSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
525 fTriggerTrackNSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
526 fTriggerTrackNSDEventMatrix->Sumw2();\r
527\r
528 //\r
529 fRecTrackEventMatrix = new THnSparseF("fRecTrackEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
530 fRecTrackEventMatrix->SetBinEdges(0,binsZv);\r
531 fRecTrackEventMatrix->SetBinEdges(1,binsPt);\r
532 fRecTrackEventMatrix->SetBinEdges(2,binsEta);\r
533 fRecTrackEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
534 fRecTrackEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
535 fRecTrackEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
536 fRecTrackEventMatrix->Sumw2();\r
537\r
538 fRecTrackSDEventMatrix = new THnSparseF("fRecTrackSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
539 fRecTrackSDEventMatrix->SetBinEdges(0,binsZv);\r
540 fRecTrackSDEventMatrix->SetBinEdges(1,binsPt);\r
541 fRecTrackSDEventMatrix->SetBinEdges(2,binsEta);\r
542 fRecTrackSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
543 fRecTrackSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
544 fRecTrackSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
545 fRecTrackSDEventMatrix->Sumw2();\r
546\r
547 fRecTrackDDEventMatrix = new THnSparseF("fRecTrackDDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
548 fRecTrackDDEventMatrix->SetBinEdges(0,binsZv);\r
549 fRecTrackDDEventMatrix->SetBinEdges(1,binsPt);\r
550 fRecTrackDDEventMatrix->SetBinEdges(2,binsEta);\r
551 fRecTrackDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
552 fRecTrackDDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
553 fRecTrackDDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
554 fRecTrackDDEventMatrix->Sumw2();\r
555\r
556 fRecTrackNDEventMatrix = new THnSparseF("fRecTrackNDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
557 fRecTrackNDEventMatrix->SetBinEdges(0,binsZv);\r
558 fRecTrackNDEventMatrix->SetBinEdges(1,binsPt);\r
559 fRecTrackNDEventMatrix->SetBinEdges(2,binsEta);\r
560 fRecTrackNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
561 fRecTrackNDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
562 fRecTrackNDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
563 fRecTrackNDEventMatrix->Sumw2();\r
564\r
565 fRecTrackNSDEventMatrix = new THnSparseF("fRecTrackNSDEventMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
566 fRecTrackNSDEventMatrix->SetBinEdges(0,binsZv);\r
567 fRecTrackNSDEventMatrix->SetBinEdges(1,binsPt);\r
568 fRecTrackNSDEventMatrix->SetBinEdges(2,binsEta);\r
569 fRecTrackNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
570 fRecTrackNSDEventMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
571 fRecTrackNSDEventMatrix->GetAxis(2)->SetTitle("mcEta");\r
572 fRecTrackNSDEventMatrix->Sumw2();\r
573\r
574 //\r
575 // tracks correction matrices\r
576 //\r
577 fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
578 fGenPrimTrackMatrix->SetBinEdges(0,binsZv);\r
579 fGenPrimTrackMatrix->SetBinEdges(1,binsPt);\r
580 fGenPrimTrackMatrix->SetBinEdges(2,binsEta);\r
581 fGenPrimTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
582 fGenPrimTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
583 fGenPrimTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
584 fGenPrimTrackMatrix->Sumw2();\r
585\r
586 fRecPrimTrackMatrix = new THnSparseF("fRecPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
587 fRecPrimTrackMatrix->SetBinEdges(0,binsZv);\r
588 fRecPrimTrackMatrix->SetBinEdges(1,binsPt);\r
589 fRecPrimTrackMatrix->SetBinEdges(2,binsEta);\r
590 fRecPrimTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
591 fRecPrimTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
592 fRecPrimTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
593 fRecPrimTrackMatrix->Sumw2();\r
594\r
595 //\r
596 fRecTrackMatrix = new THnSparseF("fRecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
597 fRecTrackMatrix->SetBinEdges(0,binsZv);\r
598 fRecTrackMatrix->SetBinEdges(1,binsPt);\r
599 fRecTrackMatrix->SetBinEdges(2,binsEta);\r
600 fRecTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
601 fRecTrackMatrix->GetAxis(1)->SetTitle("Pt (GeV/c)");\r
602 fRecTrackMatrix->GetAxis(2)->SetTitle("Eta");\r
603 fRecTrackMatrix->Sumw2();\r
604\r
605 fRecSecTrackMatrix = new THnSparseF("fRecSecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
606 fRecSecTrackMatrix->SetBinEdges(0,binsZv);\r
607 fRecSecTrackMatrix->SetBinEdges(1,binsPt);\r
608 fRecSecTrackMatrix->SetBinEdges(2,binsEta);\r
609 fRecSecTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
610 fRecSecTrackMatrix->GetAxis(1)->SetTitle("Pt (GeV/c)");\r
611 fRecSecTrackMatrix->GetAxis(2)->SetTitle("Eta");\r
612 fRecSecTrackMatrix->Sumw2();\r
613\r
614 //\r
615 fRecMultTrackMatrix = new THnSparseF("fRecMultTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
616 fRecMultTrackMatrix->SetBinEdges(0,binsZv);\r
617 fRecMultTrackMatrix->SetBinEdges(1,binsPt);\r
618 fRecMultTrackMatrix->SetBinEdges(2,binsEta);\r
619 fRecMultTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
620 fRecMultTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
621 fRecMultTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
622 fRecMultTrackMatrix->Sumw2();\r
623\r
624 //\r
625 // Control analysis histograms\r
626 //\r
627\r
628 Int_t binsMCEventHist1[3]={100,100,140};\r
629 Double_t minMCEventHist1[3]={-0.1,-0.1,-35.}; \r
630 Double_t maxMCEventHist1[3]={0.1,0.1,35.}; \r
631 fMCEventHist1 = new THnSparseF("fMCEventHist1","mcXv:mcYv:mcZv",3,binsMCEventHist1,minMCEventHist1,maxMCEventHist1);\r
632 fMCEventHist1->GetAxis(0)->SetTitle("mcXv (cm)");\r
633 fMCEventHist1->GetAxis(1)->SetTitle("mcYv (cm)");\r
634 fMCEventHist1->GetAxis(2)->SetTitle("mcZv (cm)");\r
635 fMCEventHist1->Sumw2();\r
636\r
637 //\r
638 Int_t binsRecEventHist1[3]={100,100,140};\r
639 Double_t minRecEventHist1[3]={-3.,-3.,-35.}; \r
640 Double_t maxRecEventHist1[3]={3.,3.,35.}; \r
641 \r
642 fRecEventHist1 = new THnSparseF("fRecEventHist1","Xv:Yv:Zv",3,binsRecEventHist1,minRecEventHist1,maxRecEventHist1);\r
643 fRecEventHist1->GetAxis(0)->SetTitle("Xv (cm)");\r
644 fRecEventHist1->GetAxis(1)->SetTitle("Yv (cm)");\r
645 fRecEventHist1->GetAxis(2)->SetTitle("Zv (cm)");\r
646 fRecEventHist1->Sumw2();\r
647\r
648 //\r
649 Int_t binsRecEventHist2[2]={zvNbins,150};\r
650 Double_t minRecEventHist2[2]={-25.,-0.5}; \r
651 Double_t maxRecEventHist2[2]={25.,149.5}; \r
652 \r
653 fRecEventHist2 = new THnSparseF("fRecEventHist2","Zv:multMB",2,binsRecEventHist2,minRecEventHist2,maxRecEventHist2);\r
654 fRecEventHist2->SetBinEdges(0,binsZv);\r
655 fRecEventHist2->GetAxis(0)->SetTitle("Zv (cm)");\r
656 fRecEventHist2->GetAxis(1)->SetTitle("multMB");\r
657 fRecEventHist2->Sumw2();\r
658\r
659 //\r
660 Double_t kFact = 1.0;\r
661 if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx) kFact = 0.05; \r
662\r
663 Int_t binsRecMCEventHist1[3]={100,100,100};\r
664 Double_t minRecMCEventHist1[3]={-10.0*kFact,-10.0*kFact,-10.0*kFact}; \r
665 Double_t maxRecMCEventHist1[3]={10.0*kFact,10.0*kFact,10.0*kFact}; \r
666 \r
667 fRecMCEventHist1 = new THnSparseF("fRecMCEventHist1","mcXv-Xv:mcYv-Yv:mcZv-Zv",3,binsRecMCEventHist1,minRecMCEventHist1,maxRecMCEventHist1);\r
668 fRecMCEventHist1->GetAxis(0)->SetTitle("mcXv-Xv (cm)");\r
669 fRecMCEventHist1->GetAxis(1)->SetTitle("mcYv-Yv (cm)");\r
670 fRecMCEventHist1->GetAxis(2)->SetTitle("mcZv-Zv (cm)");\r
671 fRecMCEventHist1->Sumw2();\r
672\r
673 //\r
674 Int_t binsRecMCEventHist2[3]={100,100,150};\r
675 Double_t minRecMCEventHist2[3]={-10.0*kFact,-10.0*kFact,0.0}; \r
676 Double_t maxRecMCEventHist2[3]={10.0*kFact,10.0*kFact,149.50}; \r
677\r
678 fRecMCEventHist2 = new THnSparseF("fRecMCEventHist2","mcXv-Xv:mcZv-Zv:Mult",3,binsRecMCEventHist2,minRecMCEventHist2,maxRecMCEventHist2);\r
679 fRecMCEventHist2->GetAxis(0)->SetTitle("mcXv-Xv (cm)");\r
680 fRecMCEventHist2->GetAxis(1)->SetTitle("mcZv-Zv (cm)");\r
681 fRecMCEventHist2->GetAxis(2)->SetTitle("Mult");\r
682 fRecMCEventHist2->Sumw2();\r
683\r
684 Int_t binsRecMCEventHist3[2]={150,5};\r
685 Double_t minRecMCEventHist3[2]={-0.5,0.0}; \r
686 Double_t maxRecMCEventHist3[2]={149.50,5.0}; \r
687 fRecMCEventHist3 = new THnSparseF("fRecMCEventHist3","Mult:EventType (ND, DD, SD)",2,binsRecMCEventHist3,minRecMCEventHist3,maxRecMCEventHist3);\r
688 fRecMCEventHist3->GetAxis(0)->SetTitle("Mult");\r
689 fRecMCEventHist3->GetAxis(1)->SetTitle("EventType");\r
690 fRecMCEventHist3->Sumw2();\r
691\r
692 //\r
693 char name[256];\r
694 char title[256];\r
695 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) \r
696 {\r
697 // THnSparse track histograms\r
698 \r
699 Int_t binsMCTrackHist1[3]= {ptNbins, etaNbins, 90};\r
700 Double_t minMCTrackHist1[3]={0.,-1.,0.}; \r
701 Double_t maxMCTrackHist1[3]={10.,1.,2.*TMath::Pi()}; \r
702 sprintf(name,"fMCTrackHist1_%d",i);\r
703 sprintf(title,"mcPt:mcEta:mcPhi");\r
704 \r
705 fMCTrackHist1[i] = new THnSparseF(name,title,3,binsMCTrackHist1,minMCTrackHist1,maxMCTrackHist1);\r
706 fMCTrackHist1[i]->SetBinEdges(0,binsPt);\r
707 fMCTrackHist1[i]->SetBinEdges(1,binsEta);\r
708 fMCTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
709 fMCTrackHist1[i]->GetAxis(1)->SetTitle("mcEta");\r
710 fMCTrackHist1[i]->GetAxis(2)->SetTitle("mcPhi (rad)");\r
711 fMCTrackHist1[i]->Sumw2();\r
712\r
713 Int_t binsMCPrimTrackHist2[5]= {ptNbins,etaNbins,6,20,4000};\r
714 Double_t minMCPrimTrackHist2[5]={0.,-1.,0.,0.,0.}; \r
715 Double_t maxMCPrimTrackHist2[5]={10.,1.,6.,20.,4000.}; \r
716 sprintf(name,"fMCPrimTrackHist1_%d",i);\r
717 sprintf(title,"mcPt:mcEta:pid:mech:mother");\r
718 \r
719 fMCPrimTrackHist1[i] = new THnSparseF(name,title,5,binsMCPrimTrackHist2,minMCPrimTrackHist2,maxMCPrimTrackHist2);\r
720 fMCPrimTrackHist1[i]->SetBinEdges(0,binsPt);\r
721 fMCPrimTrackHist1[i]->SetBinEdges(1,binsEta);\r
722 fMCPrimTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
723 fMCPrimTrackHist1[i]->GetAxis(1)->SetTitle("mcEta");\r
724 fMCPrimTrackHist1[i]->GetAxis(2)->SetTitle("pid");\r
725 fMCPrimTrackHist1[i]->GetAxis(3)->SetTitle("mech");\r
726 fMCPrimTrackHist1[i]->GetAxis(4)->SetTitle("mother");\r
727 fMCPrimTrackHist1[i]->Sumw2();\r
728\r
729 Int_t binsMCSecTrackHist1[5]= {ptNbins,etaNbins,6,20,4000};\r
730 Double_t minMCSecTrackHist1[5]={0.,-1.,0.,0.,0.}; \r
731 Double_t maxMCSecTrackHist1[5]={10.,1.,6.,20.,4000.}; \r
732 sprintf(name,"fMCSecTrackHist1_%d",i);\r
733 sprintf(title,"mcPt:mcEta:mcPhi:pid:mech:mother");\r
734 \r
735 fMCSecTrackHist1[i] = new THnSparseF(name,title,5,binsMCSecTrackHist1,minMCSecTrackHist1,maxMCSecTrackHist1);\r
736 fMCSecTrackHist1[i]->SetBinEdges(0,binsPt);\r
737 fMCSecTrackHist1[i]->SetBinEdges(1,binsEta);\r
738 fMCSecTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
739 fMCSecTrackHist1[i]->GetAxis(1)->SetTitle("mcEta");\r
740 fMCSecTrackHist1[i]->GetAxis(2)->SetTitle("pid");\r
741 fMCSecTrackHist1[i]->GetAxis(3)->SetTitle("mech");\r
742 fMCSecTrackHist1[i]->GetAxis(4)->SetTitle("mother");\r
743 fMCSecTrackHist1[i]->Sumw2();\r
744\r
745 //\r
746\r
747 // \r
748 \r
749 Int_t binsRecTrackHist1[3]={ptNbins,etaNbins,90};\r
750 Double_t minRecTrackHist1[3]={0.,-1.,0.}; \r
751 Double_t maxRecTrackHist1[3]={10.,1.,2.*TMath::Pi()};\r
752 sprintf(name,"fRecTrackHist1_%d",i);\r
753 sprintf(title,"Pt:Eta:Phi");\r
754 fRecTrackHist1[i] = new THnSparseF(name,title,3,binsRecTrackHist1,minRecTrackHist1,maxRecTrackHist1);\r
755 fRecTrackHist1[i]->SetBinEdges(0,binsPt);\r
756 fRecTrackHist1[i]->SetBinEdges(1,binsEta);\r
757 fRecTrackHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
758 fRecTrackHist1[i]->GetAxis(1)->SetTitle("Eta");\r
759 fRecTrackHist1[i]->GetAxis(2)->SetTitle("Phi (rad)");\r
760 fRecTrackHist1[i]->Sumw2();\r
761\r
762 // \r
763 Int_t binsRecTrackMultHist1[2]={ptNbins,150};\r
764 Double_t minRecTrackMultHist1[2]={0.,-0.5}; \r
765 Double_t maxRecTrackMultHist1[2]={10.,149.5};\r
766 sprintf(name,"fRecTrackMultHist_%d",i);\r
767 sprintf(title,"Pt:Mult");\r
768 fRecTrackMultHist1[i] = new THnSparseF(name,title,2,binsRecTrackMultHist1,minRecTrackMultHist1,maxRecTrackMultHist1);\r
769 fRecTrackMultHist1[i]->SetBinEdges(0,binsPt);\r
770 fRecTrackMultHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
771 fRecTrackMultHist1[i]->GetAxis(1)->SetTitle("multiplicity");\r
772 fRecTrackMultHist1[i]->Sumw2();\r
773 }\r
774\r
775 Int_t binsRecMCTrackHist1[4] = {ptNbins,etaNbins,100,100};\r
776 Double_t minRecMCTrackHist1[4]={0.,-1.,-0.5,-0.5}; \r
777 Double_t maxRecMCTrackHist1[4]={20.,1.,0.5,0.5}; \r
778 sprintf(name,"fRecMCTrackHist1");\r
779 sprintf(title,"mcPt:mcEta:(Pt-mcPt)/mcPt:(Eta-mcEta)");\r
780 fRecMCTrackHist1 = new THnSparseF(name,title,4,binsRecMCTrackHist1,minRecMCTrackHist1,maxRecMCTrackHist1);\r
781 fRecMCTrackHist1->SetBinEdges(0,binsPt);\r
782 fRecMCTrackHist1->SetBinEdges(1,binsEta);\r
783 fRecMCTrackHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
784 fRecMCTrackHist1->GetAxis(1)->SetTitle("mcEta");\r
785 fRecMCTrackHist1->GetAxis(2)->SetTitle("(Pt-mcPt)/mcPt");\r
786 fRecMCTrackHist1->GetAxis(3)->SetTitle("Eta-mcEta");\r
787\r
788 Int_t binsMCMultRecTrackHist1[3] = {ptNbins,etaNbins,6};\r
789 Double_t minMCMultRecTrackHist1[3]={0.,-1.,0.}; \r
790 Double_t maxMCMultRecTrackHist1[3]={20.,1.,6.}; \r
791 sprintf(name,"fMCMultRecTrackHist1");\r
792 sprintf(title,"mcPt:mcEta:pid");\r
793 fMCMultRecTrackHist1 = new THnSparseF(name,title,3,binsMCMultRecTrackHist1,minMCMultRecTrackHist1,maxMCMultRecTrackHist1);\r
794 fMCMultRecTrackHist1->SetBinEdges(0,binsPt);\r
795 fMCMultRecTrackHist1->SetBinEdges(1,binsEta);\r
796 fMCMultRecTrackHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
797 fMCMultRecTrackHist1->GetAxis(1)->SetTitle("mcEta");\r
798 fMCMultRecTrackHist1->GetAxis(2)->SetTitle("pid");\r
799\r
800 // init folder\r
801 fAnalysisFolder = CreateFolder("folderdNdPt","Analysis dNdPt Folder");\r
802}\r
803\r
804//_____________________________________________________________________________\r
805void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mcEvent)\r
806{\r
807 //\r
808 // Process real and/or simulated events\r
809 //\r
810 if(!esdEvent) {\r
811 AliDebug(AliLog::kError, "esdEvent not available");\r
812 return;\r
813 }\r
814 // trigger definition\r
815 Bool_t isEventTriggered = AlidNdPtHelper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
816 //if(!isEventTriggered) printf("no MB1 trigger ... \n");\r
817 //\r
818\r
819 // cuts\r
820 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
821 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
822 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
823\r
824 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
825 AliDebug(AliLog::kError, "cuts not available");\r
826 return;\r
827 }\r
828 //if(!evtCuts->IsTriggerRequired()) isEventTriggered = kTRUE;\r
829\r
830 // use MC information\r
831 AliHeader* header = 0;\r
832 AliGenEventHeader* genHeader = 0;\r
833 AliStack* stack = 0;\r
834 TArrayF vtxMC(3);\r
835 AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
836\r
837 Int_t multMCTrueTracks = 0;\r
838 if(IsUseMCInfo())\r
839 {\r
840 //\r
841 if(!mcEvent) {\r
842 AliDebug(AliLog::kError, "mcEvent not available");\r
843 return;\r
844 }\r
845 // get MC event header\r
846 header = mcEvent->Header();\r
847 if (!header) {\r
848 AliDebug(AliLog::kError, "Header not available");\r
849 return;\r
850 }\r
851 // MC particle stack\r
852 stack = mcEvent->Stack();\r
853 if (!stack) {\r
854 AliDebug(AliLog::kError, "Stack not available");\r
855 return;\r
856 }\r
857 // get event type (ND=0x1, DD=0x2, SD=0x4)\r
858 evtType = AlidNdPtHelper::GetEventProcessType(header);\r
859 AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
860\r
861 // get MC vertex\r
862 genHeader = header->GenEventHeader();\r
863 if (!genHeader) {\r
864 AliDebug(AliLog::kError, "Could not retrieve genHeader from Header");\r
865 return;\r
866 }\r
867 genHeader->PrimaryVertex(vtxMC);\r
868\r
869 Double_t vMCEventHist1[3]={vtxMC[0],vtxMC[1],vtxMC[2]};\r
870 fMCEventHist1->Fill(vMCEventHist1);\r
871\r
872 // multipliticy of all MC primary tracks\r
873 // in Zv, pt and eta ranges)\r
874 multMCTrueTracks = AlidNdPtHelper::GetMCTrueTrackMult(mcEvent,evtCuts,accCuts);\r
875\r
876 } // end bUseMC\r
877\r
878 // get reconstructed vertex \r
879 const AliESDVertex* vtxESD = 0; \r
880 Bool_t isRecVertex = kFALSE;\r
881 if(evtCuts->IsRecVertexRequired()) \r
882 {\r
883 vtxESD = AlidNdPtHelper::GetVertex(esdEvent, evtCuts, accCuts, esdTrackCuts, GetAnalysisMode(), kFALSE, kTRUE, kTRUE);\r
884 isRecVertex = AlidNdPtHelper::TestVertex(vtxESD, GetAnalysisMode(), kFALSE); // should be moved to AcceptEvent\r
885 }\r
886 if( IsUseMCInfo() && !evtCuts->IsRecVertexRequired() ) {\r
887 vtxESD = new AliESDVertex(vtxMC[2],10.,genHeader->NProduced(),"smearMC");\r
888 isRecVertex = kTRUE;\r
889 }\r
890 Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex; \r
891 //printf("isEventOK %d \n",isEventOK);\r
892\r
893 // MB bias tracks\r
894 Int_t multMBTracks = 0; \r
895 if(GetAnalysisMode() == AlidNdPtHelper::kTPC || GetAnalysisMode() == AlidNdPtHelper::kMCPion || \r
896 GetAnalysisMode() == AlidNdPtHelper::kMCKaon || GetAnalysisMode() == AlidNdPtHelper::kMCProton || \r
897 GetAnalysisMode() ==AlidNdPtHelper::kPlus || GetAnalysisMode() ==AlidNdPtHelper::kMinus) { \r
898\r
899 multMBTracks = AlidNdPtHelper::GetTPCMBTrackMult(esdEvent,evtCuts,accCuts,esdTrackCuts);\r
900 } \r
901 else if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kMCPion || \r
902 GetAnalysisMode() == AlidNdPtHelper::kMCKaon || GetAnalysisMode() == AlidNdPtHelper::kMCProton || \r
903 GetAnalysisMode() ==AlidNdPtHelper::kPlus || GetAnalysisMode() == AlidNdPtHelper::kMinus) {\r
904\r
905 multMBTracks = AlidNdPtHelper::GetSPDMBTrackMult(esdEvent,0.0);\r
906 } \r
907 else {\r
908 AliDebug(AliLog::kError, Form("Found analysis type %s", GetAnalysisMode()));\r
909 return; \r
910 }\r
911 \r
912 TObjArray *allChargedTracks=0;\r
913 Int_t multAll=0, multAcc=0, multRec=0;\r
914 Int_t *labelsAll=0, *labelsAcc=0, *labelsRec=0;\r
915\r
916 // check event cuts\r
917 if(isEventOK && isEventTriggered)\r
918 {\r
919 // get all charged tracks\r
920 allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
921 if(!allChargedTracks) return;\r
922\r
923 Int_t entries = allChargedTracks->GetEntries();\r
924 labelsAll = new Int_t[entries];\r
925 labelsAcc = new Int_t[entries];\r
926 labelsRec = new Int_t[entries];\r
927 for(Int_t i=0; i<entries;++i) \r
928 {\r
929 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
930 if(!track) continue;\r
931 if(track->Charge()==0) continue;\r
932 \r
933 FillHistograms(track,stack,AlidNdPtHelper::kAllTracks); \r
934 labelsAll[multAll] = TMath::Abs(track->GetLabel());\r
935 multAll++;\r
936\r
937 if(accCuts->AcceptTrack(track)) {\r
938 FillHistograms(track,stack,AlidNdPtHelper::kAccTracks); \r
939 labelsAcc[multAcc] = TMath::Abs(track->GetLabel());\r
940 multAcc++;\r
941\r
942 if(esdTrackCuts->AcceptTrack(track)) {\r
943 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks); \r
944 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
945 multRec++;\r
946 }\r
947 }\r
948 } \r
949 // fill track multiplicity histograms\r
950 FillHistograms(allChargedTracks,labelsAll,multAll,labelsAcc,multAcc,labelsRec,multRec);\r
951\r
952 Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
953 fRecEventHist1->Fill(vRecEventHist1);\r
954\r
955 Double_t vRecEventHist2[2] = {vtxESD->GetZv(),multMBTracks};\r
956 fRecEventHist2->Fill(vRecEventHist2);\r
957 } \r
958\r
959 //\r
960 // Determine correction matrices\r
961 //\r
962 if(IsUseMCInfo()) \r
963 {\r
964 //\r
965 // multiplicity correlation matrix\r
966 //\r
967 Double_t vMultTrueEventMatrix[2] = {multRec,multMCTrueTracks};\r
968 fEventMultCorrelationMatrix->Fill(vMultTrueEventMatrix);\r
969\r
970 // \r
971 // event level corrections (zv,N_MB)\r
972 //\r
973\r
974 // all inelastic\r
975 Double_t vEventMatrix[2] = {vtxMC[2],multMBTracks};\r
976 fGenEventMatrix->Fill(vEventMatrix); \r
977 if(isEventTriggered) fTriggerEventMatrix->Fill(vEventMatrix);\r
978 if(isEventOK && isEventTriggered) fRecEventMatrix->Fill(vEventMatrix);\r
979\r
980 // single diffractive\r
981 if(evtType == AlidNdPtHelper::kSD) {\r
982 fGenSDEventMatrix->Fill(vEventMatrix); \r
983 if(isEventTriggered) fTriggerSDEventMatrix->Fill(vEventMatrix);\r
984 if(isEventOK && isEventTriggered) fRecSDEventMatrix->Fill(vEventMatrix);\r
985 }\r
986\r
987 // double diffractive\r
988 if(evtType == AlidNdPtHelper::kDD) {\r
989 fGenDDEventMatrix->Fill(vEventMatrix); \r
990 if(isEventTriggered) fTriggerDDEventMatrix->Fill(vEventMatrix);\r
991 if(isEventOK && isEventTriggered) fRecDDEventMatrix->Fill(vEventMatrix);\r
992 }\r
993\r
994 // non diffractive\r
995 if(evtType == AlidNdPtHelper::kND) {\r
996 fGenNDEventMatrix->Fill(vEventMatrix); \r
997 if(isEventTriggered) fTriggerNDEventMatrix->Fill(vEventMatrix);\r
998 if(isEventOK && isEventTriggered) fRecNDEventMatrix->Fill(vEventMatrix);\r
999 }\r
1000\r
1001 // non single diffractive\r
1002 if(evtType != AlidNdPtHelper::kSD) {\r
1003 fGenNSDEventMatrix->Fill(vEventMatrix); \r
1004 if(isEventTriggered) fTriggerNSDEventMatrix->Fill(vEventMatrix);\r
1005 if(isEventOK && isEventTriggered) fRecNSDEventMatrix->Fill(vEventMatrix);\r
1006 }\r
1007\r
1008 //\r
1009 // track-event level corrections (zv,pt,eta)\r
1010 //\r
1011 Int_t nPart = stack->GetNtrack();\r
1012 for (Int_t iMc = 0; iMc < nPart; ++iMc) \r
1013 {\r
1014 TParticle* particle = stack->Particle(iMc);\r
1015 if (!particle)\r
1016 continue;\r
1017\r
1018 // only charged particles\r
1019 Double_t charge = particle->GetPDG()->Charge()/3.;\r
1020 if (charge == 0.0)\r
1021 continue;\r
1022\r
1023 // only postive charged \r
1024 if(GetAnalysisMode() == AlidNdPtHelper::kPlus && charge < 0.) \r
1025 continue;\r
1026 \r
1027 // only negative charged \r
1028 if(GetAnalysisMode() == AlidNdPtHelper::kMinus && charge > 0.) \r
1029 continue;\r
1030 \r
1031 // physical primary\r
1032 Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
1033 if(!prim) continue;\r
1034\r
1035 // checked accepted\r
1036 if(accCuts->AcceptTrack(particle)) \r
1037 {\r
1038 Double_t vTrackEventMatrix[3] = {vtxMC[2], particle->Pt(), particle->Eta()}; \r
1039 fGenTrackEventMatrix->Fill(vTrackEventMatrix);\r
1040\r
1041 if(evtType == AlidNdPtHelper::kSD) {\r
1042 fGenTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
1043 }\r
1044 if(evtType == AlidNdPtHelper::kDD) {\r
1045 fGenTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
1046 }\r
1047 if(evtType == AlidNdPtHelper::kND) {\r
1048 fGenTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
1049 }\r
1050 if(evtType != AlidNdPtHelper::kSD) {\r
1051 fGenTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
1052 }\r
1053\r
1054 //\r
1055 if(!isEventTriggered) continue; \r
1056\r
1057 fTriggerTrackEventMatrix->Fill(vTrackEventMatrix);\r
1058 if(evtType == AlidNdPtHelper::kSD) {\r
1059 fTriggerTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
1060 }\r
1061 if(evtType == AlidNdPtHelper::kDD) {\r
1062 fTriggerTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
1063 }\r
1064 if(evtType == AlidNdPtHelper::kND) {\r
1065 fTriggerTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
1066 }\r
1067 if(evtType != AlidNdPtHelper::kSD) {\r
1068 fTriggerTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
1069 }\r
1070\r
1071 //\r
1072 if(!isEventOK) continue; \r
1073\r
1074 fRecTrackEventMatrix->Fill(vTrackEventMatrix);\r
1075 if(evtType == AlidNdPtHelper::kSD) {\r
1076 fRecTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
1077 }\r
1078 if(evtType == AlidNdPtHelper::kDD) {\r
1079 fRecTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
1080 }\r
1081 if(evtType == AlidNdPtHelper::kND) {\r
1082 fRecTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
1083 }\r
1084 if(evtType != AlidNdPtHelper::kSD) {\r
1085 fRecTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
1086 }\r
1087 }\r
1088 }\r
1089\r
1090 // \r
1091 // track-level corrections (zv,pt.eta)\r
1092 //\r
1093 if(isEventOK && isEventTriggered)\r
1094 {\r
1095\r
1096 // fill MC and rec event control histograms\r
1097 if(fHistogramsOn) {\r
1098 Double_t vRecMCEventHist1[3] = {vtxMC[0]-vtxESD->GetXv(),vtxMC[1]-vtxESD->GetYv(),vtxMC[2]-vtxESD->GetZv()};\r
1099 fRecMCEventHist1->Fill(vRecMCEventHist1);\r
1100\r
1101 Double_t vRecMCEventHist2[3] = {vtxMC[0]-vtxESD->GetXv(),vtxMC[2]-vtxESD->GetZv(),multMBTracks};\r
1102 fRecMCEventHist2->Fill(vRecMCEventHist2);\r
1103\r
1104 Double_t vRecMCEventHist3[2] = {multRec,evtType};\r
1105 fRecMCEventHist3->Fill(vRecMCEventHist3);\r
1106 }\r
1107\r
1108 //\r
1109 // MC histograms for track efficiency studies\r
1110 //\r
1111 Int_t nPart = stack->GetNtrack();\r
1112 for (Int_t iMc = 0; iMc < nPart; ++iMc) \r
1113 {\r
1114 TParticle* particle = stack->Particle(iMc);\r
1115 if (!particle)\r
1116 continue;\r
1117\r
1118 // only charged particles\r
1119 Double_t charge = particle->GetPDG()->Charge()/3.;\r
1120 if (charge == 0.0)\r
1121 continue;\r
1122\r
1123 // only postive charged \r
1124 if(GetAnalysisMode() == AlidNdPtHelper::kPlus && charge < 0.) \r
1125 continue;\r
1126 \r
1127 // only negative charged \r
1128 if(GetAnalysisMode() == AlidNdPtHelper::kMinus && charge > 0.) \r
1129 continue;\r
1130 \r
1131 // physical primary\r
1132 Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
1133\r
1134 // check accepted\r
1135 if(accCuts->AcceptTrack(particle)) \r
1136 {\r
1137 Double_t vTrackMatrix[3] = {vtxMC[2],particle->Pt(),particle->Eta()}; \r
1138 //if(prim) fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
1139 if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetAnalysisMode()) ) fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
1140\r
1141 // fill control histograms\r
1142 if(fHistogramsOn) \r
1143 FillHistograms(stack,iMc,AlidNdPtHelper::kAccTracks); \r
1144\r
1145 // check multiple found tracks\r
1146 Int_t mult_count = 0;\r
1147 for(Int_t iRec=0; iRec<multRec; ++iRec)\r
1148 {\r
1149 if(iMc == labelsRec[iRec]) \r
1150 {\r
1151 mult_count++;\r
1152 if(mult_count>1)\r
1153 { \r
1154 fRecMultTrackMatrix->Fill(vTrackMatrix);\r
1155\r
1156 // fill control histogram\r
1157 if(fHistogramsOn) {\r
1158 Int_t pid = AlidNdPtHelper::ConvertPdgToPid(particle);\r
1159 Double_t vMCMultRecTrackHist1[3] = {particle->Pt(), particle->Eta(), pid};\r
1160 fMCMultRecTrackHist1->Fill(vMCMultRecTrackHist1);\r
1161 }\r
1162 }\r
1163 }\r
1164 }\r
1165\r
1166 // check reconstructed\r
1167 for(Int_t iRec=0; iRec<multRec; ++iRec)\r
1168 {\r
1169 if(iMc == labelsRec[iRec]) \r
1170 {\r
1171 fRecTrackMatrix->Fill(vTrackMatrix);\r
1172 if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetAnalysisMode()) ) fRecPrimTrackMatrix->Fill(vTrackMatrix);\r
1173 if(!prim) fRecSecTrackMatrix->Fill(vTrackMatrix);\r
1174\r
1175 // fill control histograms\r
1176 if(fHistogramsOn) \r
1177 FillHistograms(stack,iMc,AlidNdPtHelper::kRecTracks); \r
1178 \r
1179 break;\r
1180 }\r
1181 }\r
1182 }\r
1183 }\r
1184 }\r
1185 } // end bUseMC\r
1186\r
1187 if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
1188 if(labelsAll) delete [] labelsAll; labelsAll = 0;\r
1189 if(labelsAcc) delete [] labelsAcc; labelsAcc = 0;\r
1190 if(labelsRec) delete [] labelsRec; labelsRec = 0;\r
1191\r
1192 if(!evtCuts->IsRecVertexRequired() && vtxESD != NULL) delete vtxESD;\r
1193\r
1194}\r
1195\r
1196//_____________________________________________________________________________\r
1197void 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
1198 // multiplicity histograms\r
1199 \r
1200 if(!allChargedTracks) return;\r
1201 if(!labelsAll) return;\r
1202 if(!labelsAcc) return;\r
1203 if(!labelsRec) return;\r
1204\r
1205 Int_t entries = allChargedTracks->GetEntries();\r
1206 for(Int_t i=0; i<entries; ++i)\r
1207 {\r
1208 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
1209 if(!track) continue;\r
1210 if(track->Charge() == 0) continue;\r
1211\r
1212 Int_t label = TMath::Abs(track->GetLabel());\r
1213 for(Int_t iAll=0; iAll<multAll; ++iAll) {\r
1214 if(label == labelsAll[iAll]) {\r
1215 Double_t v1[2] = {track->Pt(), multAll}; \r
1216 fRecTrackMultHist1[AlidNdPtHelper::kAllTracks]->Fill(v1);\r
1217 }\r
1218 }\r
1219 for(Int_t iAcc=0; iAcc<multAcc; ++iAcc) {\r
1220 if(label == labelsAcc[iAcc]) {\r
1221 Double_t v2[2] = {track->Pt(), multAcc}; \r
1222 fRecTrackMultHist1[AlidNdPtHelper::kAccTracks]->Fill(v2);\r
1223 }\r
1224 }\r
1225 for(Int_t iRec=0; iRec<multRec; ++iRec) {\r
1226 if(label == labelsRec[iRec]) {\r
1227 Double_t v3[2] = {track->Pt(), multRec}; \r
1228 fRecTrackMultHist1[AlidNdPtHelper::kRecTracks]->Fill(v3);\r
1229 }\r
1230 }\r
1231 }\r
1232}\r
1233\r
1234//_____________________________________________________________________________\r
1235void AlidNdPtAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, AlidNdPtHelper::TrackObject trackObj)\r
1236{\r
1237 //\r
1238 // Fill ESD track and MC histograms \r
1239 //\r
1240 if(!esdTrack) return;\r
1241\r
1242 Float_t q = esdTrack->Charge();\r
1243 if(q==0) return;\r
1244\r
1245 Float_t pt = esdTrack->Pt();\r
1246 //Float_t qpt = esdTrack->Pt() * q;\r
1247 Float_t eta = esdTrack->Eta();\r
1248 Float_t phi = esdTrack->Phi();\r
1249\r
1250 Float_t dca[2], bCov[3];\r
1251 esdTrack->GetImpactParameters(dca,bCov);\r
1252\r
1253\r
1254 // fill histograms\r
1255 Double_t values[3] = {pt,eta,phi}; \r
1256 fRecTrackHist1[trackObj]->Fill(values);\r
1257 \r
1258 //\r
1259 // Fill rec vs MC information\r
1260 //\r
1261 if(!stack) return;\r
1262\r
1263 Int_t label = TMath::Abs(esdTrack->GetLabel()); \r
1264 //if(label == 0) return;\r
1265\r
1266 TParticle* particle = stack->Particle(label);\r
1267 if(!particle) return;\r
1268\r
1269 //Bool_t prim = stack->IsPhysicalPrimary(label);\r
1270 //Int_t pid = AlidNdPtHelper::ConvertPdgToPid(particle);\r
1271\r
1272 Int_t mother_pdg = -1;\r
1273 TParticle* mother = 0;\r
1274\r
1275 //TParticle* prim_mother = AlidNdPtHelper::FindPrimaryMother(stack,label);\r
1276 Int_t motherLabel = particle->GetMother(0); \r
1277 if(motherLabel>0) mother = stack->Particle(motherLabel);\r
1278 if(mother) mother_pdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only\r
1279 //Int_t mech = particle->GetUniqueID(); // production mechanism\r
1280\r
1281 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
1282 if(gq==0) return;\r
1283 Float_t gpt = particle->Pt();\r
1284 Float_t geta = particle->Eta();\r
1285 //Float_t qgpt = particle->Pt() * gq;\r
1286 //Float_t gphi = particle->Phi();\r
1287\r
1288 Double_t dpt=0;\r
1289 if(gpt) dpt = (pt-gpt)/gpt;\r
1290 Double_t deta = (eta-geta);\r
1291 \r
1292 // fill histograms\r
1293 if(trackObj == AlidNdPtHelper::kRecTracks) \r
1294 {\r
1295 Double_t vTrackPtCorrelationMatrix[3]={pt,gpt,geta};\r
1296 fTrackPtCorrelationMatrix->Fill(vTrackPtCorrelationMatrix);\r
1297\r
1298 Double_t vRecMCTrackHist1[4]={gpt,geta,dpt,deta};\r
1299 fRecMCTrackHist1->Fill(vRecMCTrackHist1);\r
1300\r
1301 }\r
1302}\r
1303\r
1304//_____________________________________________________________________________\r
1305void AlidNdPtAnalysis::FillHistograms(AliStack *const stack, Int_t label, AlidNdPtHelper::TrackObject trackObj)\r
1306{\r
1307 // Fill MC histograms\r
1308 if(!stack) return;\r
1309\r
1310 TParticle* particle = stack->Particle(label);\r
1311 if(!particle) return;\r
1312\r
1313 Int_t mother_pdg = -1;\r
1314 TParticle* mother = 0;\r
1315\r
1316 //TParticle* prim_mother = AlidNdPtHelper::FindPrimaryMother(stack,label);\r
1317 Int_t motherLabel = particle->GetMother(0); \r
1318 if(motherLabel>0) mother = stack->Particle(motherLabel);\r
1319 if(mother) mother_pdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only\r
1320 Int_t mech = particle->GetUniqueID(); // production mechanism\r
1321\r
1322 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
1323 if(gq == 0) return;\r
1324 Float_t gpt = particle->Pt();\r
1325 //Float_t qgpt = particle->Pt() * gq;\r
1326 Float_t geta = particle->Eta();\r
1327 Float_t gphi = particle->Phi();\r
1328 //Float_t gpz = particle->Pz();\r
1329\r
1330 Bool_t prim = stack->IsPhysicalPrimary(label);\r
1331 //Float_t vx = particle->Vx(); Float_t vy = particle->Vy(); Float_t vz = particle->Vz();\r
1332\r
1333 Int_t pid = AlidNdPtHelper::ConvertPdgToPid(particle);\r
1334\r
1335 //if(prim&&pid==5) printf("pdgcode %d, production mech %d \n",particle->GetPdgCode(),mech);\r
1336 //if(!prim) printf("mother_pdg %d, particle %d, production mech %d\n",mother_pdg, particle->GetPdgCode(),mech);\r
1337 \r
1338 //\r
1339 // fill histogram\r
1340 //\r
1341 Double_t vMCTrackHist1[3] = {gpt,geta,gphi};\r
1342 fMCTrackHist1[trackObj]->Fill(vMCTrackHist1);\r
1343\r
1344 Double_t vMCPrimTrackHist1[5] = {gpt,geta,pid,mech,mother_pdg};\r
1345 if(prim) fMCPrimTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
1346 else { \r
1347 fMCSecTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
1348 }\r
1349}\r
1350\r
1351//_____________________________________________________________________________\r
1352Long64_t AlidNdPtAnalysis::Merge(TCollection* list) \r
1353{\r
1354 // Merge list of objects (needed by PROOF)\r
1355\r
1356 if (!list)\r
1357 return 0;\r
1358\r
1359 if (list->IsEmpty())\r
1360 return 1;\r
1361\r
1362 TIterator* iter = list->MakeIterator();\r
1363 TObject* obj = 0;\r
1364\r
1365 // collection of generated histograms\r
1366\r
1367 Int_t count=0;\r
1368 while((obj = iter->Next()) != 0) {\r
1369 AlidNdPtAnalysis* entry = dynamic_cast<AlidNdPtAnalysis*>(obj);\r
1370 if (entry == 0) continue; \r
1371\r
1372 //\r
1373 fEventMultCorrelationMatrix->Add(entry->fEventMultCorrelationMatrix);\r
1374 fTrackPtCorrelationMatrix->Add(entry->fTrackPtCorrelationMatrix);\r
1375\r
1376 //\r
1377 fGenEventMatrix->Add(entry->fGenEventMatrix);\r
1378 fGenSDEventMatrix->Add(entry->fGenSDEventMatrix);\r
1379 fGenDDEventMatrix->Add(entry->fGenDDEventMatrix);\r
1380 fGenNDEventMatrix->Add(entry->fGenNDEventMatrix);\r
1381 fGenNSDEventMatrix->Add(entry->fGenNSDEventMatrix);\r
1382\r
1383 fTriggerEventMatrix->Add(entry->fTriggerEventMatrix);\r
1384 fTriggerSDEventMatrix->Add(entry->fTriggerSDEventMatrix);\r
1385 fTriggerDDEventMatrix->Add(entry->fTriggerDDEventMatrix);\r
1386 fTriggerNDEventMatrix->Add(entry->fTriggerNDEventMatrix);\r
1387 fTriggerNSDEventMatrix->Add(entry->fTriggerNSDEventMatrix);\r
1388\r
1389 fRecEventMatrix->Add(entry->fRecEventMatrix);\r
1390 fRecSDEventMatrix->Add(entry->fRecSDEventMatrix);\r
1391 fRecDDEventMatrix->Add(entry->fRecDDEventMatrix);\r
1392 fRecNDEventMatrix->Add(entry->fRecNDEventMatrix);\r
1393 fRecNSDEventMatrix->Add(entry->fRecNSDEventMatrix);\r
1394\r
1395 //\r
1396 fGenTrackEventMatrix->Add(entry->fGenTrackEventMatrix);\r
1397 fGenTrackSDEventMatrix->Add(entry->fGenTrackSDEventMatrix);\r
1398 fGenTrackDDEventMatrix->Add(entry->fGenTrackDDEventMatrix);\r
1399 fGenTrackNDEventMatrix->Add(entry->fGenTrackNDEventMatrix);\r
1400 fGenTrackNSDEventMatrix->Add(entry->fGenTrackNSDEventMatrix);\r
1401\r
1402 fTriggerTrackEventMatrix->Add(entry->fTriggerTrackEventMatrix);\r
1403 fTriggerTrackSDEventMatrix->Add(entry->fTriggerTrackSDEventMatrix);\r
1404 fTriggerTrackDDEventMatrix->Add(entry->fTriggerTrackDDEventMatrix);\r
1405 fTriggerTrackNDEventMatrix->Add(entry->fTriggerTrackNDEventMatrix);\r
1406 fTriggerTrackNSDEventMatrix->Add(entry->fTriggerTrackNSDEventMatrix);\r
1407\r
1408 fRecTrackEventMatrix->Add(entry->fRecTrackEventMatrix);\r
1409 fRecTrackSDEventMatrix->Add(entry->fRecTrackSDEventMatrix);\r
1410 fRecTrackDDEventMatrix->Add(entry->fRecTrackDDEventMatrix);\r
1411 fRecTrackNDEventMatrix->Add(entry->fRecTrackNDEventMatrix);\r
1412 fRecTrackNSDEventMatrix->Add(entry->fRecTrackNSDEventMatrix);\r
1413\r
1414 //\r
1415 fGenPrimTrackMatrix->Add(entry->fGenPrimTrackMatrix);\r
1416 fRecPrimTrackMatrix->Add(entry->fRecPrimTrackMatrix);\r
1417 //\r
1418 fRecTrackMatrix->Add(entry->fRecTrackMatrix);\r
1419 fRecSecTrackMatrix->Add(entry->fRecSecTrackMatrix);\r
1420 //\r
1421 fRecMultTrackMatrix->Add(entry->fRecMultTrackMatrix);\r
1422\r
1423 //\r
1424 // control analysis histograms\r
1425 //\r
1426 fMCEventHist1->Add(entry->fMCEventHist1);\r
1427 fRecEventHist1->Add(entry->fRecEventHist1);\r
1428 fRecEventHist2->Add(entry->fRecEventHist2);\r
1429 fRecMCEventHist1->Add(entry->fRecMCEventHist1);\r
1430 fRecMCEventHist2->Add(entry->fRecMCEventHist2);\r
1431 fRecMCEventHist3->Add(entry->fRecMCEventHist3);\r
1432\r
1433 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) {\r
1434 fMCTrackHist1[i]->Add(entry->fMCTrackHist1[i]);\r
1435\r
1436 fMCPrimTrackHist1[i]->Add(entry->fMCPrimTrackHist1[i]);\r
1437 fMCSecTrackHist1[i]->Add(entry->fMCSecTrackHist1[i]);\r
1438\r
1439 fRecTrackHist1[i]->Add(entry->fRecTrackHist1[i]);\r
1440 fRecTrackMultHist1[i]->Add(entry->fRecTrackMultHist1[i]);\r
1441 }\r
1442 fRecMCTrackHist1->Add(entry->fRecMCTrackHist1);\r
1443 fMCMultRecTrackHist1->Add(entry->fMCMultRecTrackHist1);\r
1444\r
1445 count++;\r
1446 }\r
1447\r
1448return count;\r
1449}\r
1450 \r
1451//_____________________________________________________________________________\r
1452void AlidNdPtAnalysis::Analyse() \r
1453{\r
1454 // Analyse histograms\r
1455 //\r
1456 TH1::AddDirectory(kFALSE);\r
1457 TH1 *h=0, *h1=0, *h2=0, *h2c = 0; \r
1458 TH2D *hgen2D=0;\r
1459 THnSparse *hs=0; \r
1460 TH2 *h2D=0; \r
1461 TH1 *h1D=0; \r
1462\r
1463 char name[256];\r
1464 TObjArray *aFolderObj = new TObjArray;\r
1465\r
1466 //\r
1467 // get cuts\r
1468 //\r
1469 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
1470 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
1471 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
1472\r
1473 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
1474 Error("AlidNdPtCutAnalysis::Analyse()", "cuts not available");\r
1475 return;\r
1476 }\r
1477\r
1478 //\r
1479 // set min and max values\r
1480 //\r
1481 Double_t minZv = evtCuts->GetMinZv();\r
1482 Double_t maxZv = evtCuts->GetMaxZv()-0.00001;\r
1483 Double_t minPt = accCuts->GetMinPt();\r
1484 Double_t maxPt = accCuts->GetMaxPt();\r
1485 Double_t minEta = accCuts->GetMinEta();\r
1486 Double_t maxEta = accCuts->GetMaxEta()-0.00001;\r
1487\r
1488 //\r
1489 // calculate corrections for empty events\r
1490 // with multMB==0 \r
1491 //\r
1492\r
1493 //\r
1494 // normalised zv to generate zv for triggered events\r
1495 //\r
1496 h = fRecEventHist2->Projection(0);\r
1497 if( h->Integral() ) h->Scale(1./h->Integral());\r
1498 h->SetName("zv_distribution_norm");\r
1499 aFolderObj->Add(h);\r
1500\r
1501 //\r
1502 // normalised zv to get trigger/trigger+vertex event differences\r
1503 // F(zv) = E_trig(zv,0)/Int(E_trig(zv,0) / Sum(E_trigvtx(zv,n))/Sum(Int(E_trigvtx(zv,n))dzv)\r
1504 //\r
1505 fTriggerEventMatrix->GetAxis(1)->SetRangeUser(0.,0.);\r
1506 h = fTriggerEventMatrix->Projection(0);\r
1507 hgen2D = fTriggerEventMatrix->Projection(0,1);\r
1508 if(hgen2D->Integral()) h->Scale(1./hgen2D->Integral());\r
1509\r
1510 h1 = fRecEventMatrix->Projection(0);\r
1511 hgen2D = fRecEventMatrix->Projection(0,1);\r
1512 if(hgen2D->Integral()) h1->Scale(1./hgen2D->Integral());\r
1513\r
1514 h->Divide(h1);\r
1515 h->SetName("zv_empty_events_norm");\r
1516 aFolderObj->Add(h);\r
1517 \r
1518 fTriggerEventMatrix->GetAxis(1)->SetRange(1,fTriggerEventMatrix->GetAxis(1)->GetNbins());\r
1519\r
1520 //\r
1521 // rec. vs true multiplicity correlation matrix\r
1522 //\r
1523 hs = (THnSparse*)fEventMultCorrelationMatrix->Clone("event_mult_correlation_matrix");\r
1524 aFolderObj->Add(hs);\r
1525 \r
1526 //\r
1527 // rec. vs true track pt correlation matrix\r
1528 //\r
1529 hs = (THnSparse*)fTrackPtCorrelationMatrix->Clone("track_pt_correlation_matrix");\r
1530 aFolderObj->Add(hs);\r
1531\r
1532 //\r
1533 // trigger efficiency for INEL\r
1534 //\r
1535 h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fGenEventMatrix->Projection(0),"zv_trig_INEL_eff_matrix");\r
1536 aFolderObj->Add(h1D);\r
1537\r
1538 //\r
1539 // trigger efficiency for NSD\r
1540 //\r
1541 h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerNSDEventMatrix->Projection(0),fGenNSDEventMatrix->Projection(0),"zv_trig_NSD_eff_matrix");\r
1542 aFolderObj->Add(h1D);\r
1543\r
1544 //\r
1545 // trigger bias correction (MB to ND)\r
1546 //\r
1547 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoND_corr_matrix");\r
1548 aFolderObj->Add(hs);\r
1549\r
1550 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoND_corr_matrix");\r
1551 aFolderObj->Add(h1D);\r
1552\r
1553 fGenNDEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1554 fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1555\r
1556 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoND_corr_matrix");\r
1557\r
1558 aFolderObj->Add(h1D);\r
1559 fGenNDEventMatrix->GetAxis(0)->SetRange(1,fGenNDEventMatrix->GetAxis(0)->GetNbins());\r
1560 fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
1561\r
1562 //\r
1563 // trigger bias correction (MB to NSD)\r
1564 //\r
1565 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoNSD_corr_matrix");\r
1566 aFolderObj->Add(hs);\r
1567\r
1568 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0,1),fTriggerEventMatrix->Projection(0,1),"zv_mult_trig_MBtoNSD_corr_matrix_2D");\r
1569 aFolderObj->Add(h2D);\r
1570\r
1571 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoNSD_corr_matrix");\r
1572 aFolderObj->Add(h1D);\r
1573\r
1574 fGenNSDEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1575 fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1576\r
1577 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoNSD_corr_matrix");\r
1578 aFolderObj->Add(h1D);\r
1579\r
1580 fGenNSDEventMatrix->GetAxis(0)->SetRange(1,fGenNSDEventMatrix->GetAxis(0)->GetNbins());\r
1581 fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
1582\r
1583 //\r
1584 // trigger bias correction (MB to INEL)\r
1585 //\r
1586 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoInel_corr_matrix");\r
1587 aFolderObj->Add(hs);\r
1588\r
1589 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoInel_corr_matrix");\r
1590 aFolderObj->Add(h1D);\r
1591\r
1592 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0,1),fTriggerEventMatrix->Projection(0,1),"zv_mult_trig_MBtoInel_corr_matrix_2D");\r
1593 aFolderObj->Add(h2D);\r
1594\r
1595 fGenEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1596 fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1597\r
1598 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoInel_corr_matrix");\r
1599 aFolderObj->Add(h1D);\r
1600\r
1601 fGenEventMatrix->GetAxis(0)->SetRange(1,fGenEventMatrix->GetAxis(0)->GetNbins());\r
1602 fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
1603\r
1604 //\r
1605 // event vertex reconstruction correction (MB)\r
1606 //\r
1607 hs = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix,fRecEventMatrix,"zv_mult_event_corr_matrix");\r
1608 aFolderObj->Add(hs);\r
1609\r
1610 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0,1),fRecEventMatrix->Projection(0,1),"zv_mult_event_corr_matrix_2D");\r
1611 aFolderObj->Add(h2D);\r
1612\r
1613 fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1614 fRecEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1615\r
1616 h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(1),fRecEventMatrix->Projection(1),"mult_event_corr_matrix");\r
1617 aFolderObj->Add(h1D);\r
1618\r
1619 fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
1620 fRecEventMatrix->GetAxis(0)->SetRange(1,fRecEventMatrix->GetAxis(0)->GetNbins());\r
1621\r
1622 h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fRecEventMatrix->Projection(0),"zv_event_corr_matrix");\r
1623 aFolderObj->Add(h1D);\r
1624\r
1625 //\r
1626 // track-event trigger bias correction (MB to ND)\r
1627 //\r
1628\r
1629 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix,fTriggerTrackEventMatrix,"zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
1630 aFolderObj->Add(hs);\r
1631\r
1632 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix->Projection(1,2),fTriggerTrackEventMatrix->Projection(1,2),"eta_pt_track_trig_MBtoND_corr_matrix");\r
1633 aFolderObj->Add(h2D);\r
1634\r
1635 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix->Projection(1,0),fTriggerTrackEventMatrix->Projection(1,0),"pt_zv_track_trig_MBtoND_corr_matrix");\r
1636 aFolderObj->Add(h2D);\r
1637\r
1638 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNDEventMatrix->Projection(2,0),fTriggerTrackEventMatrix->Projection(2,0),"zv_eta_track_trig_MBtoND_corr_matrix");\r
1639 aFolderObj->Add(h2D);\r
1640\r
1641 //\r
1642 // track-event trigger bias correction (MB to NSD)\r
1643 //\r
1644 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix,fTriggerTrackEventMatrix,"zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
1645 aFolderObj->Add(hs);\r
1646\r
1647 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix->Projection(1,2),fTriggerTrackEventMatrix->Projection(1,2),"eta_pt_track_trig_MBtoNSD_corr_matrix");\r
1648 aFolderObj->Add(h2D);\r
1649\r
1650 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix->Projection(1,0),fTriggerTrackEventMatrix->Projection(1,0),"pt_zv_track_trig_MBtoNSD_corr_matrix");\r
1651 aFolderObj->Add(h2D);\r
1652\r
1653 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackNSDEventMatrix->Projection(2,0),fTriggerTrackEventMatrix->Projection(2,0),"zv_eta_track_trig_MBtoNSD_corr_matrix");\r
1654 aFolderObj->Add(h2D);\r
1655\r
1656\r
1657 //\r
1658 // track-event trigger bias correction (MB to INEL)\r
1659 //\r
1660 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix,fTriggerTrackEventMatrix,"zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
1661 aFolderObj->Add(hs);\r
1662\r
1663 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix->Projection(1,2),fTriggerTrackEventMatrix->Projection(1,2),"eta_pt_track_trig_MBtoInel_corr_matrix");\r
1664 aFolderObj->Add(h2D);\r
1665\r
1666 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix->Projection(1,0),fTriggerTrackEventMatrix->Projection(1,0),"pt_zv_track_trig_MBtoInel_corr_matrix");\r
1667 aFolderObj->Add(h2D);\r
1668\r
1669 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenTrackEventMatrix->Projection(2,0),fTriggerTrackEventMatrix->Projection(2,0),"zv_eta_track_trig_MBtoInel_corr_matrix");\r
1670 aFolderObj->Add(h2D);\r
1671\r
1672 // efficiency\r
1673 fTriggerTrackEventMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1674 fGenTrackEventMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1675 fTriggerTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1676 fGenTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1677\r
1678 h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1),fGenTrackEventMatrix->Projection(1),"pt_track_trig_MBtoInel_eff_matrix");\r
1679 aFolderObj->Add(h1D);\r
1680\r
1681 fTriggerTrackEventMatrix->GetAxis(2)->SetRange(1,fTriggerTrackEventMatrix->GetAxis(2)->GetNbins());\r
1682 fGenTrackEventMatrix->GetAxis(2)->SetRange(1,fGenTrackEventMatrix->GetAxis(2)->GetNbins());\r
1683 fTriggerTrackEventMatrix->GetAxis(0)->SetRange(1,fTriggerTrackEventMatrix->GetAxis(0)->GetNbins());\r
1684 fGenTrackEventMatrix->GetAxis(0)->SetRange(1,fGenTrackEventMatrix->GetAxis(0)->GetNbins());\r
1685\r
1686\r
1687 //\r
1688 // track-event vertex reconstruction correction (MB)\r
1689 //\r
1690 hs = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix,fRecTrackEventMatrix,"zv_pt_eta_track_event_corr_matrix");\r
1691 aFolderObj->Add(hs);\r
1692\r
1693 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1,2),fRecTrackEventMatrix->Projection(1,2),"eta_pt_track_event_corr_matrix");\r
1694 aFolderObj->Add(h2D);\r
1695\r
1696 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1,0),fRecTrackEventMatrix->Projection(1,0),"pt_zv_track_event_corr_matrix");\r
1697 aFolderObj->Add(h2D);\r
1698\r
1699 h2D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(2,0),fRecTrackEventMatrix->Projection(2,0),"zv_eta_track_event_corr_matrix");\r
1700 aFolderObj->Add(h2D);\r
1701 \r
1702 // efficiency\r
1703 fTriggerTrackEventMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1704 fRecTrackEventMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1705 fTriggerTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1706 fRecTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1707\r
1708 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecTrackEventMatrix->Projection(1),fTriggerTrackEventMatrix->Projection(1),"pt_track_event_eff_matrix");\r
1709 aFolderObj->Add(h1D);\r
1710\r
1711 fTriggerTrackEventMatrix->GetAxis(2)->SetRange(1,fTriggerTrackEventMatrix->GetAxis(2)->GetNbins());\r
1712 fRecTrackEventMatrix->GetAxis(2)->SetRange(1,fRecTrackEventMatrix->GetAxis(2)->GetNbins());\r
1713 fTriggerTrackEventMatrix->GetAxis(0)->SetRange(1,fTriggerTrackEventMatrix->GetAxis(0)->GetNbins());\r
1714 fRecTrackEventMatrix->GetAxis(0)->SetRange(1,fRecTrackEventMatrix->GetAxis(0)->GetNbins());\r
1715\r
1716 //\r
1717 // track rec. efficiency correction\r
1718 //\r
1719 hs = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix,fRecPrimTrackMatrix,"zv_pt_eta_track_corr_matrix");\r
1720 aFolderObj->Add(hs);\r
1721\r
1722 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1,2),fRecPrimTrackMatrix->Projection(1,2),"eta_pt_track_corr_matrix");\r
1723 aFolderObj->Add(h2D);\r
1724\r
1725 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1,0),fRecPrimTrackMatrix->Projection(1,0),"pt_zv_track_corr_matrix");\r
1726 aFolderObj->Add(h2D);\r
1727\r
1728 h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(2,0),fRecPrimTrackMatrix->Projection(2,0),"zv_eta_track_corr_matrix");\r
1729 aFolderObj->Add(h2D);\r
1730\r
1731 fGenPrimTrackMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1732 fRecPrimTrackMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1733 fGenPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1734 fRecPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1735 \r
1736 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(0),fRecPrimTrackMatrix->Projection(0),"zv_track_corr_matrix");\r
1737 aFolderObj->Add(h1D);\r
1738\r
1739 fGenPrimTrackMatrix->GetAxis(1)->SetRange(1,fGenPrimTrackMatrix->GetAxis(1)->GetNbins());\r
1740 fRecPrimTrackMatrix->GetAxis(1)->SetRange(1,fRecPrimTrackMatrix->GetAxis(1)->GetNbins());\r
1741 fGenPrimTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1742 fRecPrimTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1743\r
1744 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1),fRecPrimTrackMatrix->Projection(1),"pt_track_corr_matrix");\r
1745 aFolderObj->Add(h1D);\r
1746\r
1747 // efficiency\r
1748 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecPrimTrackMatrix->Projection(1), fGenPrimTrackMatrix->Projection(1),"pt_track_eff_matrix");\r
1749 aFolderObj->Add(h1D);\r
1750\r
1751 fGenPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1752 fRecPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1753 fGenPrimTrackMatrix->GetAxis(2)->SetRange(1,fGenPrimTrackMatrix->GetAxis(2)->GetNbins());\r
1754 fRecPrimTrackMatrix->GetAxis(2)->SetRange(1,fRecPrimTrackMatrix->GetAxis(2)->GetNbins());\r
1755\r
1756 h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(2),fRecPrimTrackMatrix->Projection(2),"eta_track_corr_matrix");\r
1757 aFolderObj->Add(h1D);\r
1758\r
1759 fGenPrimTrackMatrix->GetAxis(1)->SetRange(1,fGenPrimTrackMatrix->GetAxis(1)->GetNbins());\r
1760 fRecPrimTrackMatrix->GetAxis(1)->SetRange(1,fRecPrimTrackMatrix->GetAxis(1)->GetNbins());\r
1761 fGenPrimTrackMatrix->GetAxis(0)->SetRange(1,fGenPrimTrackMatrix->GetAxis(0)->GetNbins());\r
1762 fRecPrimTrackMatrix->GetAxis(0)->SetRange(1,fRecPrimTrackMatrix->GetAxis(0)->GetNbins());\r
1763\r
1764 //\r
1765 // secondary track contamination correction\r
1766 //\r
1767 //hs = AlidNdPtHelper::GenerateContCorrMatrix(fRecSecTrackMatrix,fRecTrackMatrix,"zv_pt_eta_track_cont_matrix");\r
1768 hs = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix,fRecTrackMatrix,"zv_pt_eta_track_cont_matrix");\r
1769 aFolderObj->Add(hs);\r
1770\r
1771 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1,2),fRecTrackMatrix->Projection(1,2),"eta_pt_track_cont_matrix");\r
1772 aFolderObj->Add(h2D);\r
1773\r
1774 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1,0),fRecTrackMatrix->Projection(1,0),"pt_zv_track_cont_matrix");\r
1775 aFolderObj->Add(h2D);\r
1776\r
1777 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(2,0),fRecTrackMatrix->Projection(2,0),"zv_eta_track_cont_matrix");\r
1778 aFolderObj->Add(h2D);\r
1779\r
1780 fRecSecTrackMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1781 fRecTrackMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1782 fRecSecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1783 fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1784 \r
1785 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_track_cont_matrix");\r
1786 aFolderObj->Add(h1D);\r
1787\r
1788 fRecSecTrackMatrix->GetAxis(1)->SetRange(1,fRecSecTrackMatrix->GetAxis(1)->GetNbins());\r
1789 fRecTrackMatrix->GetAxis(1)->SetRange(1,fRecTrackMatrix->GetAxis(1)->GetNbins());\r
1790 fRecSecTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1791 fRecTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1792\r
1793 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_track_cont_matrix");\r
1794 aFolderObj->Add(h1D);\r
1795\r
1796 fRecSecTrackMatrix->GetAxis(2)->SetRange(1,fRecSecTrackMatrix->GetAxis(2)->GetNbins());\r
1797 fRecTrackMatrix->GetAxis(2)->SetRange(1,fRecTrackMatrix->GetAxis(2)->GetNbins());\r
1798\r
1799 fRecSecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1800 fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1801\r
1802 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_track_cont_matrix");\r
1803 aFolderObj->Add(h1D);\r
1804\r
1805 fRecSecTrackMatrix->GetAxis(0)->SetRange(1,fRecSecTrackMatrix->GetAxis(0)->GetNbins());\r
1806 fRecTrackMatrix->GetAxis(0)->SetRange(1,fRecTrackMatrix->GetAxis(0)->GetNbins());\r
1807 fRecSecTrackMatrix->GetAxis(1)->SetRange(1,fRecSecTrackMatrix->GetAxis(1)->GetNbins());\r
1808 fRecTrackMatrix->GetAxis(1)->SetRange(1,fRecTrackMatrix->GetAxis(1)->GetNbins());\r
1809\r
1810 //\r
1811 // multiple track reconstruction correction\r
1812 //\r
1813 //hs = AlidNdPtHelper::GenerateContCorrMatrix(fRecMultTrackMatrix,fRecTrackMatrix,"zv_pt_eta_mult_track_cont_matrix");\r
1814 hs = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix,fRecTrackMatrix,"zv_pt_eta_mult_track_cont_matrix");\r
1815 aFolderObj->Add(hs);\r
1816\r
1817 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1,2),fRecTrackMatrix->Projection(1,2),"eta_pt_mult_track_cont_matrix");\r
1818 aFolderObj->Add(h2D);\r
1819\r
1820 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1,0),fRecTrackMatrix->Projection(1,0),"pt_zv_mult_track_cont_matrix");\r
1821 aFolderObj->Add(h2D);\r
1822\r
1823 h2D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(2,0),fRecTrackMatrix->Projection(2,0),"zv_eta_mult_track_cont_matrix");\r
1824 aFolderObj->Add(h2D);\r
1825\r
1826 fRecMultTrackMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1827 fRecTrackMatrix->GetAxis(2)->SetRangeUser(minEta,maxEta);\r
1828 fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1829 fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1830 \r
1831 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_mult_track_cont_matrix");\r
1832 aFolderObj->Add(h1D);\r
1833\r
1834 fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
1835 fRecTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
1836 fRecMultTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1837 fRecTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
1838\r
1839 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_mult_track_cont_matrix");\r
1840 aFolderObj->Add(h1D);\r
1841\r
1842 fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1843 fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
1844\r
1845 fRecMultTrackMatrix->GetAxis(2)->SetRange(1,fRecMultTrackMatrix->GetAxis(2)->GetNbins());\r
1846 fRecTrackMatrix->GetAxis(2)->SetRange(1,fRecTrackMatrix->GetAxis(2)->GetNbins());\r
1847\r
1848 h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_mult_track_cont_matrix");\r
1849 aFolderObj->Add(h1D);\r
1850\r
1851 fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
1852 fRecTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
1853\r
1854 fRecMultTrackMatrix->GetAxis(0)->SetRange(1,fRecMultTrackMatrix->GetAxis(0)->GetNbins());\r
1855 fRecTrackMatrix->GetAxis(0)->SetRange(1,fRecTrackMatrix->GetAxis(0)->GetNbins());\r
1856\r
1857 //\r
1858 // Control histograms\r
1859 //\r
1860 \r
1861 if(fHistogramsOn) {\r
1862\r
1863 // Efficiency electrons, muons, pions, kaons, protons, all\r
1864 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,1); \r
1865 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,1); \r
1866 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
1867 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
1868 h2c = (TH1D *)h2->Clone();\r
1869 h2c->Divide(h1);\r
1870 h2c->SetName("eff_pt_electrons");\r
1871 aFolderObj->Add(h2c);\r
1872\r
1873 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(2,2); \r
1874 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(2,2); \r
1875 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
1876 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
1877 h2c = (TH1D *)h2->Clone();\r
1878 h2c->Divide(h1);\r
1879 h2c->SetName("eff_pt_muons");\r
1880 aFolderObj->Add(h2c);\r
1881\r
1882 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(3,3); \r
1883 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(3,3); \r
1884 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
1885 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
1886 h2c = (TH1D *)h2->Clone();\r
1887 h2c->Divide(h1);\r
1888 h2c->SetName("eff_pt_pions");\r
1889 aFolderObj->Add(h2c);\r
1890\r
1891 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(4,4); \r
1892 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(4,4); \r
1893 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
1894 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
1895 h2c = (TH1D *)h2->Clone();\r
1896 h2c->Divide(h1);\r
1897 h2c->SetName("eff_pt_kaons");\r
1898 aFolderObj->Add(h2c);\r
1899\r
1900 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(5,5); \r
1901 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(5,5); \r
1902 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
1903 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
1904 h2c = (TH1D *)h2->Clone();\r
1905 h2c->Divide(h1);\r
1906 h2c->SetName("eff_pt_protons");\r
1907 aFolderObj->Add(h2c);\r
1908\r
1909 fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,6); \r
1910 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,6); \r
1911 h1 = fMCPrimTrackHist1[1]->Projection(0);\r
1912 h2 = fMCPrimTrackHist1[2]->Projection(0);\r
1913 h2c = (TH1D *)h2->Clone();\r
1914 h2c->Divide(h1);\r
1915 h2c->SetName("eff_pt_all");\r
1916 aFolderObj->Add(h2c);\r
1917\r
1918 // pt spetra\r
1919 // - rec, primaries, secondaries\r
1920 // - primaries (pid) \r
1921 // - secondaries (pid)\r
1922 // - secondaries (mech)\r
1923 // - secondaries (mother)\r
1924 //\r
1925 TH1D *pt_acc = fRecTrackHist1[1]->Projection(0);\r
1926 pt_acc->SetName("pt_acc");\r
1927 aFolderObj->Add(pt_acc);\r
1928\r
1929 TH1D *pt_rec = fRecTrackHist1[2]->Projection(0);\r
1930 pt_rec->SetName("pt_rec");\r
1931 aFolderObj->Add(pt_rec);\r
1932\r
1933 TH1D *mc_pt_acc_all = fMCTrackHist1[1]->Projection(0);\r
1934 mc_pt_acc_all->SetName("mc_pt_acc_all");\r
1935 aFolderObj->Add(mc_pt_acc_all);\r
1936\r
1937 TH1D *mc_pt_acc_prim = fMCPrimTrackHist1[1]->Projection(0);\r
1938 mc_pt_acc_prim->SetName("mc_pt_acc_prim");\r
1939 aFolderObj->Add(mc_pt_acc_prim);\r
1940\r
1941 TH1D *mc_pt_rec_all = fMCTrackHist1[2]->Projection(0);\r
1942 mc_pt_rec_all->SetName("mc_pt_rec_all");\r
1943 aFolderObj->Add(mc_pt_rec_all);\r
1944\r
1945 TH1D *mc_pt_rec_prim = fMCPrimTrackHist1[2]->Projection(0);\r
1946 mc_pt_rec_prim->SetName("mc_pt_rec_prim");\r
1947 aFolderObj->Add(mc_pt_rec_prim);\r
1948\r
1949 TH1D *mc_pt_rec_sec = fMCSecTrackHist1[2]->Projection(0);\r
1950 mc_pt_rec_sec->SetName("mc_pt_rec_sec");\r
1951 aFolderObj->Add(mc_pt_rec_sec);\r
1952\r
1953 for(Int_t i = 0; i<6; i++) \r
1954 { \r
1955 sprintf(name,"mc_pt_rec_prim_pid_%d",i); \r
1956 fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(i+1,i+1);\r
1957 h = fMCPrimTrackHist1[2]->Projection(0);\r
1958 h->SetName(name);\r
1959 aFolderObj->Add(h);\r
1960\r
1961 sprintf(name,"mc_pt_rec_sec_pid_%d",i); \r
1962 fMCSecTrackHist1[2]->GetAxis(2)->SetRange(i+1,i+1);\r
1963 h = fMCSecTrackHist1[2]->Projection(0);\r
1964 h->SetName(name);\r
1965 aFolderObj->Add(h);\r
1966\r
1967 // production mechanisms for given pid\r
1968 fMCSecTrackHist1[2]->GetAxis(2)->SetRange(i+1,i+1);\r
1969\r
1970 for(Int_t j=0; j<20; j++) {\r
1971 if(j == 4) {\r
1972 // decay\r
1973 \r
1974 sprintf(name,"mc_pt_rec_sec_pid_%d_decay",i); \r
1975 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
1976 h = fMCSecTrackHist1[2]->Projection(0);\r
1977 h->SetName(name);\r
1978 aFolderObj->Add(h);\r
1979\r
1980 sprintf(name,"mc_eta_rec_sec_pid_%d_decay",i); \r
1981 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
1982 h = fMCSecTrackHist1[2]->Projection(1);\r
1983 h->SetName(name);\r
1984 aFolderObj->Add(h);\r
1985\r
1986 sprintf(name,"mc_mother_rec_sec_pid_%d_decay",i); \r
1987 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
1988 h = fMCSecTrackHist1[2]->Projection(4);\r
1989 h->SetName(name);\r
1990 aFolderObj->Add(h);\r
1991\r
1992 } else if (j == 5) {\r
1993 // conversion\r
1994\r
1995 sprintf(name,"mc_pt_rec_sec_pid_%d_conv",i); \r
1996 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
1997 h = fMCSecTrackHist1[2]->Projection(0);\r
1998 h->SetName(name);\r
1999 aFolderObj->Add(h);\r
2000\r
2001 sprintf(name,"mc_eta_rec_sec_pid_%d_conv",i); \r
2002 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2003 h = fMCSecTrackHist1[2]->Projection(1);\r
2004 h->SetName(name);\r
2005 aFolderObj->Add(h);\r
2006\r
2007 sprintf(name,"mc_mother_rec_sec_pid_%d_conv",i); \r
2008 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2009 h = fMCSecTrackHist1[2]->Projection(4);\r
2010 h->SetName(name);\r
2011 aFolderObj->Add(h);\r
2012\r
2013 } else if (j == 13) {\r
2014 // mat\r
2015 \r
2016 sprintf(name,"mc_pt_rec_sec_pid_%d_mat",i); \r
2017 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2018 h = fMCSecTrackHist1[2]->Projection(0);\r
2019 h->SetName(name);\r
2020 aFolderObj->Add(h);\r
2021\r
2022 sprintf(name,"mc_eta_rec_sec_pid_%d_mat",i); \r
2023 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2024 h = fMCSecTrackHist1[2]->Projection(1);\r
2025 h->SetName(name);\r
2026 aFolderObj->Add(h);\r
2027\r
2028 sprintf(name,"mc_eta_mother_rec_sec_pid_%d_mat",i); \r
2029 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2030 h = fMCSecTrackHist1[2]->Projection(4,1);\r
2031 h->SetName(name);\r
2032 aFolderObj->Add(h);\r
2033\r
2034 sprintf(name,"mc_mother_rec_sec_pid_%d_mat",i); \r
2035 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2036 h = fMCSecTrackHist1[2]->Projection(4);\r
2037 h->SetName(name);\r
2038 aFolderObj->Add(h);\r
2039\r
2040 sprintf(name,"mc_pt_mother_rec_sec_pid_%d_mat",i); \r
2041 fMCSecTrackHist1[2]->GetAxis(3)->SetRange(j+1,j+1);\r
2042 h = fMCSecTrackHist1[2]->Projection(4,0);\r
2043 h->SetName(name);\r
2044 aFolderObj->Add(h);\r
2045\r
2046 } else {\r
2047 continue;\r
2048 }\r
2049 }\r
2050\r
2051 }\r
2052 } // end fHistogramOn\r
2053\r
2054 //\r
2055 // resolution histograms\r
2056 // only for reconstructed tracks\r
2057 //\r
2058\r
2059 TH2F *h2F=0;\r
2060 TCanvas * c = new TCanvas("resol","resol");\r
2061 c->cd();\r
2062\r
2063 //\r
2064 fRecMCTrackHist1->GetAxis(1)->SetRangeUser(-0.9,0.89); \r
2065\r
2066 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,0);\r
2067 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2068 h->SetXTitle("p_{tmc} (GeV/c)");\r
2069 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} resolution");\r
2070 h->Draw();\r
2071 h->SetName("pt_resolution_vs_mcpt");\r
2072 aFolderObj->Add(h);\r
2073\r
2074 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,0);\r
2075 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2076 h->SetXTitle("p_{tmc} (GeV/c)");\r
2077 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} mean");\r
2078 h->Draw();\r
2079 h->SetName("dpt_mean_vs_mcpt");\r
2080 aFolderObj->Add(h);\r
2081\r
2082 //\r
2083 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,0);\r
2084 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2085 h->SetXTitle("p_{tmc} (GeV/c)");\r
2086 h->SetYTitle("(#eta-#eta_{mc}) resolution");\r
2087 h->Draw();\r
2088 h->SetName("eta_resolution_vs_mcpt");\r
2089 aFolderObj->Add(h);\r
2090\r
2091 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,0);\r
2092 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2093 h->SetXTitle("p_{tmc} (GeV/c)");\r
2094 h->SetYTitle("(#eta-mc#eta) mean");\r
2095 h->Draw();\r
2096 h->SetName("deta_mean_vs_mcpt");\r
2097 aFolderObj->Add(h);\r
2098 \r
2099 // \r
2100 fRecMCTrackHist1->GetAxis(1)->SetRange(1,fRecMCTrackHist1->GetAxis(1)->GetNbins()); \r
2101 fRecMCTrackHist1->GetAxis(0)->SetRangeUser(minPt,maxPt); \r
2102\r
2103 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,1);\r
2104 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2105 h->SetXTitle("#eta_{mc}");\r
2106 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} resolution");\r
2107 h->Draw();\r
2108 h->SetName("pt_resolution_vs_mceta");\r
2109 aFolderObj->Add(h);\r
2110\r
2111 h2F = (TH2F*)fRecMCTrackHist1->Projection(2,1);\r
2112 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2113 h->SetXTitle("#eta_{mc}");\r
2114 h->SetYTitle("(p_{t}-p_{tmc})/p_{tmc} mean");\r
2115 h->Draw();\r
2116 h->SetName("dpt_mean_vs_mceta");\r
2117 aFolderObj->Add(h);\r
2118\r
2119 //\r
2120 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,1);\r
2121 h = AlidNdPtHelper::MakeResol(h2F,1,0,kTRUE,10);\r
2122 h->SetXTitle("#eta_{mc}");\r
2123 h->SetYTitle("(#eta-#eta_{mc}) resolution");\r
2124 h->Draw();\r
2125 h->SetName("eta_resolution_vs_mceta");\r
2126 aFolderObj->Add(h);\r
2127\r
2128 h2F = (TH2F*)fRecMCTrackHist1->Projection(3,1);\r
2129 h = AlidNdPtHelper::MakeResol(h2F,1,1,kTRUE,10);\r
2130 h->SetXTitle("#eta_{mc}");\r
2131 h->SetYTitle("(#eta-mc#eta) mean");\r
2132 h->Draw();\r
2133 h->SetName("deta_mean_vs_mceta");\r
2134 aFolderObj->Add(h);\r
2135\r
2136 fRecMCTrackHist1->GetAxis(0)->SetRange(1,fRecMCTrackHist1->GetAxis(0)->GetNbins()); \r
2137\r
2138 \r
2139 // export objects to analysis folder\r
2140 fAnalysisFolder = ExportToFolder(aFolderObj);\r
2141\r
2142 // delete only TObjArray\r
2143 if(aFolderObj) delete aFolderObj;\r
2144}\r
2145\r
2146//_____________________________________________________________________________\r
2147TFolder* AlidNdPtAnalysis::ExportToFolder(TObjArray * array) \r
2148{\r
2149 // recreate folder avery time and export objects to new one\r
2150 //\r
2151 AlidNdPtAnalysis * comp=this;\r
2152 TFolder *folder = comp->GetAnalysisFolder();\r
2153\r
2154 TString name, title;\r
2155 TFolder *newFolder = 0;\r
2156 Int_t i = 0;\r
2157 Int_t size = array->GetSize();\r
2158\r
2159 if(folder) { \r
2160 // get name and title from old folder\r
2161 name = folder->GetName(); \r
2162 title = folder->GetTitle(); \r
2163\r
2164 // delete old one\r
2165 delete folder;\r
2166\r
2167 // create new one\r
2168 newFolder = CreateFolder(name.Data(),title.Data());\r
2169 newFolder->SetOwner();\r
2170\r
2171 // add objects to folder\r
2172 while(i < size) {\r
2173 newFolder->Add(array->At(i));\r
2174 i++;\r
2175 }\r
2176 }\r
2177\r
2178return newFolder;\r
2179}\r
2180\r
2181//_____________________________________________________________________________\r
2182TFolder* AlidNdPtAnalysis::CreateFolder(TString name,TString title) { \r
2183// create folder for analysed histograms\r
2184//\r
2185TFolder *folder = 0;\r
2186 folder = new TFolder(name.Data(),title.Data());\r
2187\r
2188 return folder;\r
2189}\r