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