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