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