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