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