Coding rule violations corrected.
[u/mrichter/AliRoot.git] / PWG0 / dNdPt / AlidNdPtCorrection.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
22\r
23#include "AliHeader.h" \r
24#include "AliGenEventHeader.h" \r
25#include "AliStack.h" \r
26#include "AliESDEvent.h" \r
27#include "AliMCEvent.h" \r
28#include "AliESDtrackCuts.h" \r
29#include "AliLog.h" \r
30\r
31#include "AlidNdPtEventCuts.h"\r
32#include "AlidNdPtAcceptanceCuts.h"\r
d269b0e6 33#include "AliPhysicsSelection.h"\r
0aaa8b91 34\r
bad4ba69 35#include "AliPWG0Helper.h"\r
36#include "AlidNdPtHelper.h"\r
0aaa8b91 37#include "AlidNdPtCorrection.h"\r
38\r
39using namespace std;\r
40\r
41ClassImp(AlidNdPtCorrection)\r
42\r
43//_____________________________________________________________________________\r
44//AlidNdPtCorrection::AlidNdPtCorrection(): TNamed(),\r
45 AlidNdPtCorrection::AlidNdPtCorrection(): AlidNdPt(),\r
46 fCorrectionFolder(0),\r
47 fMCEventHist1(0),\r
48 fRecEventHist1(0),\r
49 fMCAllEventMultHist1(0),\r
50 fMCAllNDEventMultHist1(0),\r
51 fMCAllNSDEventMultHist1(0),\r
52 fMCTriggerMultHist1(0),\r
53 fMCEventMultHist1(0),\r
54 fMCAllPrimTrackMultHist1(0),\r
55 fMCNDEventAllPrimTrackMultHist1(0),\r
56 fMCNSDEventAllPrimTrackMultHist1(0),\r
57 fMCTriggerPrimTrackMultHist1(0),\r
58 fMCEventPrimTrackMultHist1(0),\r
0aaa8b91 59 fEventMultCorrelationMatrix(0),\r
60 fZvNorm(0),\r
61 fZvEmptyEventsNorm(0),\r
62 fCorrTriggerMBtoInelEventMatrix(0),\r
63 fCorrTriggerMBtoNDEventMatrix(0),\r
64 fCorrTriggerMBtoNSDEventMatrix(0),\r
65 fCorrEventMatrix(0),\r
66 fCorrTriggerMBtoInelTrackEventMatrix(0),\r
67 fCorrTriggerMBtoNDTrackEventMatrix(0),\r
68 fCorrTriggerMBtoNSDTrackEventMatrix(0),\r
69 fCorrTrackEventMatrix(0),\r
70 fCorrTrackMatrix(0),\r
71 fContTrackMatrix(0),\r
72 fContMultTrackMatrix(0),\r
d269b0e6 73 fCorrMatrixFileName(""),\r
74 fCosmicsHisto(0)\r
0aaa8b91 75{\r
76 // default constructor\r
77 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
78 fRecTrackHist1[i]=0; \r
79 }\r
80\r
81 for(Int_t i=0; i<8; i++) { \r
82 fCorrRecTrackMultHist1[i] = 0;\r
83 }\r
84\r
85 for(Int_t i=0; i<5; i++) { \r
86 fCorrRecEventHist1[i] = 0;\r
87 fCorrRecEventHist2[i] = 0;\r
88 }\r
89\r
90 Init();\r
91}\r
92\r
93//_____________________________________________________________________________\r
94AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corrMatrixFileName): AlidNdPt(name,title),\r
95 fCorrectionFolder(0),\r
96 fMCEventHist1(0),\r
97 fRecEventHist1(0),\r
98 fMCAllEventMultHist1(0),\r
99 fMCAllNDEventMultHist1(0),\r
100 fMCAllNSDEventMultHist1(0),\r
101 fMCTriggerMultHist1(0),\r
102 fMCEventMultHist1(0),\r
103 fMCAllPrimTrackMultHist1(0),\r
104 fMCNDEventAllPrimTrackMultHist1(0),\r
105 fMCNSDEventAllPrimTrackMultHist1(0),\r
106 fMCTriggerPrimTrackMultHist1(0),\r
107 fMCEventPrimTrackMultHist1(0),\r
0aaa8b91 108 fEventMultCorrelationMatrix(0),\r
109 fZvNorm(0),\r
110 fZvEmptyEventsNorm(0),\r
111 fCorrTriggerMBtoInelEventMatrix(0),\r
112 fCorrTriggerMBtoNDEventMatrix(0),\r
113 fCorrTriggerMBtoNSDEventMatrix(0),\r
114 fCorrEventMatrix(0),\r
115 fCorrTriggerMBtoInelTrackEventMatrix(0),\r
116 fCorrTriggerMBtoNDTrackEventMatrix(0),\r
117 fCorrTriggerMBtoNSDTrackEventMatrix(0),\r
118 fCorrTrackEventMatrix(0),\r
119 fCorrTrackMatrix(0),\r
120 fContTrackMatrix(0),\r
121 fContMultTrackMatrix(0),\r
d269b0e6 122 fCorrMatrixFileName(corrMatrixFileName),\r
123 fCosmicsHisto(0)\r
0aaa8b91 124{\r
125 // constructor\r
126 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
127 fRecTrackHist1[i]=0; \r
128 }\r
129\r
130 for(Int_t i=0; i<8; i++) { \r
131 fCorrRecTrackMultHist1[i] = 0;\r
bad4ba69 132 fPtvsPt[i] = 0;\r
0aaa8b91 133 }\r
134\r
135 for(Int_t i=0; i<5; i++) { \r
136 fCorrRecEventHist1[i] = 0;\r
137 fCorrRecEventHist2[i] = 0;\r
138 }\r
139\r
140 Init();\r
141}\r
142\r
143//_____________________________________________________________________________\r
144AlidNdPtCorrection::~AlidNdPtCorrection() {\r
145 // \r
146 // destructor\r
147 //\r
148 if(fMCEventHist1) delete fMCEventHist1; fMCEventHist1=0;\r
149 if(fRecEventHist1) delete fRecEventHist1; fRecEventHist1=0;\r
150\r
151 if(fMCAllEventMultHist1) delete fMCAllEventMultHist1; fMCAllEventMultHist1=0;\r
152 if(fMCAllNDEventMultHist1) delete fMCAllNDEventMultHist1; fMCAllNDEventMultHist1=0;\r
153 if(fMCAllNSDEventMultHist1) delete fMCAllNSDEventMultHist1; fMCAllNSDEventMultHist1=0;\r
154 if(fMCTriggerMultHist1) delete fMCTriggerMultHist1; fMCTriggerMultHist1=0;\r
155 if(fMCEventMultHist1) delete fMCEventMultHist1; fMCEventMultHist1=0;\r
156\r
157 if(fMCAllPrimTrackMultHist1) delete fMCAllPrimTrackMultHist1; fMCAllPrimTrackMultHist1=0;\r
158 if(fMCNDEventAllPrimTrackMultHist1) delete fMCNDEventAllPrimTrackMultHist1; fMCNDEventAllPrimTrackMultHist1=0;\r
159 if(fMCNSDEventAllPrimTrackMultHist1) delete fMCNSDEventAllPrimTrackMultHist1; fMCNSDEventAllPrimTrackMultHist1=0;\r
160 if(fMCTriggerPrimTrackMultHist1) delete fMCTriggerPrimTrackMultHist1; fMCTriggerPrimTrackMultHist1=0;\r
161 if(fMCEventPrimTrackMultHist1) delete fMCEventPrimTrackMultHist1; fMCEventPrimTrackMultHist1=0;\r
d269b0e6 162 if(fCosmicsHisto) delete fCosmicsHisto; fCosmicsHisto=0;\r
0aaa8b91 163\r
164 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
165 if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
166 }\r
167\r
168 for(Int_t i=0; i<8; i++) { \r
169 if(fCorrRecTrackMultHist1[i]) delete fCorrRecTrackMultHist1[i]; fCorrRecTrackMultHist1[i]=0;\r
bad4ba69 170 if(fPtvsPt[i]) delete fPtvsPt[i]; fPtvsPt[i]=0;\r
0aaa8b91 171 }\r
172\r
173 for(Int_t i=0; i<5; i++) { \r
174 if(fCorrRecEventHist1[i]) delete fCorrRecEventHist1[i]; fCorrRecEventHist1[i]=0;\r
175 if(fCorrRecEventHist2[i]) delete fCorrRecEventHist2[i]; fCorrRecEventHist2[i]=0;\r
176 }\r
177\r
178 if(fCorrectionFolder) delete fCorrectionFolder; fCorrectionFolder=0;\r
0aaa8b91 179}\r
180\r
181//_____________________________________________________________________________\r
182void AlidNdPtCorrection::Init(){\r
183 //\r
184 // Init histograms\r
185 //\r
186 const Int_t etaNbins = 30; \r
187 const Int_t zvNbins = 12;\r
188\r
189 // UA1 bining\r
190 //const Int_t ptNbins = 52; \r
191 //Double_t binsPt[ptNbins+1] = { 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.80, 2.90, 3.00, 3.10, 3.20, 3.30, 3.40, 3.50, 3.60, 3.70, 3.80, 3.90, 4.00, 4.20, 4.40, 4.60, 4.80, 5.00, 5.20, 5.40, 5.60, 5.80, 6.00, 7.00, 7.60, 8.80, 9.60 }; \r
192\r
193 const Int_t ptNbins = 56; \r
194 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
195 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
196 Double_t binsZv[zvNbins+1] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
197\r
0aaa8b91 198\r
199 //\r
200 Int_t binsMCEventHist1[3]={100,100,140};\r
201 Double_t minMCEventHist1[3]={-0.1,-0.1,-35.}; \r
202 Double_t maxMCEventHist1[3]={0.1,0.1,35.}; \r
203 fMCEventHist1 = new THnSparseF("fMCEventHist1","mcXv:mcYv:mcZv",3,binsMCEventHist1,minMCEventHist1,maxMCEventHist1);\r
204 fMCEventHist1->GetAxis(0)->SetTitle("mcXv (cm)");\r
205 fMCEventHist1->GetAxis(1)->SetTitle("mcYv (cm)");\r
206 fMCEventHist1->GetAxis(2)->SetTitle("mcZv (cm)");\r
207 fMCEventHist1->Sumw2();\r
208\r
209 //\r
210 Int_t binsRecEventHist1[3]={100,100,140};\r
211 Double_t minRecEventHist1[3]={-3.,-3.,-35.}; \r
212 Double_t maxRecEventHist1[3]={3.,3.,35.}; \r
213 fRecEventHist1 = new THnSparseF("fRecEventHist1","Xv:Yv:Zv",3,binsRecEventHist1,minRecEventHist1,maxRecEventHist1);\r
214 fRecEventHist1->GetAxis(0)->SetTitle("Xv (cm)");\r
215 fRecEventHist1->GetAxis(1)->SetTitle("Yv (cm)");\r
216 fRecEventHist1->GetAxis(2)->SetTitle("Zv (cm)");\r
217 fRecEventHist1->Sumw2();\r
218\r
219 //\r
220 char name[256];\r
221 char title[256];\r
222\r
223 Int_t binsMCAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
224 Double_t minMCAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
225 Double_t maxMCAllPrimTrackMultHist1[3]={20.,1.,149.5}; \r
226 sprintf(name,"fMCAllPrimTrackMultHist1");\r
227 sprintf(title,"mcPt:mcEta:multiplicity");\r
228 \r
229 fMCAllPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCAllPrimTrackMultHist1,minMCAllPrimTrackMultHist1,maxMCAllPrimTrackMultHist1);\r
230 fMCAllPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
231 fMCAllPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
232 fMCAllPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
233 fMCAllPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
234 fMCAllPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
235 fMCAllPrimTrackMultHist1->Sumw2();\r
236\r
237 Int_t binsMCNDEventAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
238 Double_t minMCNDEventAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
239 Double_t maxMCNDEventAllPrimTrackMultHist1[3]={20.,1.,149.5}; \r
240 sprintf(name,"fMCNDEventAllPrimTrackMultHist1");\r
241 sprintf(title,"mcPt:mcEta:multiplicity");\r
242 \r
243 fMCNDEventAllPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCNDEventAllPrimTrackMultHist1,minMCNDEventAllPrimTrackMultHist1,maxMCNDEventAllPrimTrackMultHist1);\r
244 fMCNDEventAllPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
245 fMCNDEventAllPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
246 fMCNDEventAllPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
247 fMCNDEventAllPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
248 fMCNDEventAllPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
249 fMCNDEventAllPrimTrackMultHist1->Sumw2();\r
250\r
251 Int_t binsMCNSDEventAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
252 Double_t minMCNSDEventAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
253 Double_t maxMCNSDEventAllPrimTrackMultHist1[3]={20.,1.,140.9}; \r
254 sprintf(name,"fMCNSDEventAllPrimTrackMultHist1");\r
255 sprintf(title,"mcPt:mcEta:multiplicity");\r
256 \r
257 fMCNSDEventAllPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCNSDEventAllPrimTrackMultHist1,minMCNSDEventAllPrimTrackMultHist1,maxMCNSDEventAllPrimTrackMultHist1);\r
258 fMCNSDEventAllPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
259 fMCNSDEventAllPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
260 fMCNSDEventAllPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
261 fMCNSDEventAllPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
262 fMCNSDEventAllPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
263 fMCNSDEventAllPrimTrackMultHist1->Sumw2();\r
264\r
265 Int_t binsMCEventTriggerPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
266 Double_t minMCEventTriggerPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
267 Double_t maxMCEventTriggerPrimTrackMultHist1[3]={20.,1.,149.5}; \r
268 sprintf(name,"fMCTriggerPrimTrackMultHist1");\r
269 sprintf(title,"mcPt:mcEta:multiplicity");\r
270 \r
271 fMCTriggerPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCEventTriggerPrimTrackMultHist1,minMCEventTriggerPrimTrackMultHist1,maxMCEventTriggerPrimTrackMultHist1);\r
272 fMCTriggerPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
273 fMCTriggerPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
274 fMCTriggerPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
275 fMCTriggerPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
276 fMCTriggerPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
277 fMCTriggerPrimTrackMultHist1->Sumw2();\r
278\r
279 Int_t binsMCEventPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
280 Double_t minMCEventPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
281 Double_t maxMCEventPrimTrackMultHist1[3]={20.,1.,149.5}; \r
282 sprintf(name,"fMCEventPrimTrackMultHist1");\r
283 sprintf(title,"mcPt:mcEta:multiplicity");\r
284 \r
285 fMCEventPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCEventPrimTrackMultHist1,minMCEventPrimTrackMultHist1,maxMCEventPrimTrackMultHist1);\r
286 fMCEventPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
287 fMCEventPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
288 fMCEventPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
289 fMCEventPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
290 fMCEventPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
291 fMCEventPrimTrackMultHist1->Sumw2();\r
292\r
293 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) \r
294 {\r
295 // THnSparse track histograms\r
296 //\r
297 Int_t binsRecTrackHist1[3]={ptNbins,etaNbins,90};\r
298 Double_t minRecTrackHist1[3]={0.,-1.,0.}; \r
299 Double_t maxRecTrackHist1[3]={10.,1.,2.*TMath::Pi()};\r
300 sprintf(name,"fRecTrackHist1_%d",i);\r
301 sprintf(title,"Pt:Eta:Phi");\r
302 \r
303 fRecTrackHist1[i] = new THnSparseF(name,title,3,binsRecTrackHist1,minRecTrackHist1,maxRecTrackHist1);\r
304 fRecTrackHist1[i]->SetBinEdges(0,binsPt);\r
305 fRecTrackHist1[i]->SetBinEdges(1,binsEta);\r
306 fRecTrackHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
307 fRecTrackHist1[i]->GetAxis(1)->SetTitle("Eta");\r
308 fRecTrackHist1[i]->GetAxis(2)->SetTitle("Phi (rad)");\r
309 fRecTrackHist1[i]->Sumw2();\r
310 }\r
311\r
312 Int_t binsCorrRecTrackMultHist1[3]={ptNbins,etaNbins,150};\r
313 Double_t minCorrRecTrackMultHist1[3]={0.,-1.,-0.5}; \r
314 Double_t maxCorrRecTrackMultHist1[3]={20.,1.,149.5};\r
bad4ba69 315\r
316 Int_t binsPtvsPt[3]={ptNbins,320};\r
317 Double_t minPtvsPt[3]={0.,0.}; \r
318 Double_t maxPtvsPt[3]={20.,16.};\r
319\r
0aaa8b91 320 for(Int_t i=0; i<8; i++) \r
321 {\r
322 // THnSparse track histograms\r
323 sprintf(name,"fCorrRecTrackMultHist1_%d",i);\r
324 sprintf(title,"Pt:Eta:mult");\r
325 fCorrRecTrackMultHist1[i] = new THnSparseF(name,title,3,binsCorrRecTrackMultHist1,minCorrRecTrackMultHist1,maxCorrRecTrackMultHist1);\r
326 fCorrRecTrackMultHist1[i]->SetBinEdges(0,binsPt);\r
327 fCorrRecTrackMultHist1[i]->SetBinEdges(1,binsEta);\r
328 fCorrRecTrackMultHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
329 fCorrRecTrackMultHist1[i]->GetAxis(1)->SetTitle("Eta");\r
330 fCorrRecTrackMultHist1[i]->GetAxis(2)->SetTitle("multiplicity");\r
331 fCorrRecTrackMultHist1[i]->Sumw2();\r
bad4ba69 332\r
333 sprintf(name,"fPtvsPt_%d",i);\r
334 sprintf(title,"Pt:Pt");\r
335 fPtvsPt[i] = new THnSparseF(name,title,2,binsPtvsPt,minPtvsPt,maxPtvsPt);\r
336 fPtvsPt[i]->SetBinEdges(0,binsPt);\r
337 fPtvsPt[i]->GetAxis(0)->SetTitle("Pt (GeV/c)"); \r
338 fPtvsPt[i]->GetAxis(1)->SetTitle("Pt (GeV/c)"); \r
339 fPtvsPt[i]->Sumw2();\r
0aaa8b91 340 }\r
341\r
342 Int_t binsEventMatrix[2]={zvNbins,150};\r
343 Double_t minEventMatrix[2]={-25.,-0.5};\r
344 Double_t maxEventMatrix[2]={25.,149.5};\r
345\r
346 fMCAllEventMultHist1 = new THnSparseF("fMCAllEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
347 fMCAllEventMultHist1->SetBinEdges(0,binsZv);\r
348 fMCAllEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
349 fMCAllEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
350 fMCAllEventMultHist1->Sumw2();\r
351\r
352 fMCAllNDEventMultHist1 = new THnSparseF("fMCAllNDEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
353 fMCAllNDEventMultHist1->SetBinEdges(0,binsZv);\r
354 fMCAllNDEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
355 fMCAllNDEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
356 fMCAllNDEventMultHist1->Sumw2();\r
357\r
358 fMCAllNSDEventMultHist1 = new THnSparseF("fMCAllNSDEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
359 fMCAllNSDEventMultHist1->SetBinEdges(0,binsZv);\r
360 fMCAllNSDEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
361 fMCAllNSDEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
362 fMCAllNSDEventMultHist1->Sumw2();\r
363\r
364 fMCTriggerMultHist1 = new THnSparseF("fMCTriggerMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
365 fMCTriggerMultHist1->SetBinEdges(0,binsZv);\r
366 fMCTriggerMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
367 fMCTriggerMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
368 fMCTriggerMultHist1->Sumw2();\r
369\r
370 fMCEventMultHist1 = new THnSparseF("fMCEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
371 fMCEventMultHist1->SetBinEdges(0,binsZv);\r
372 fMCEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
373 fMCEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
374 fMCEventMultHist1->Sumw2();\r
375\r
376 for(Int_t i=0; i<5; i++) \r
377 {\r
378 // event corrected histograms\r
379 sprintf(name,"fCorrRecEventHist1_%d",i);\r
380 sprintf(title,"mcZv:mult");\r
381 fCorrRecEventHist1[i] = new THnSparseF("fCorrRecEventHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
382 fCorrRecEventHist1[i]->SetBinEdges(0,binsZv);\r
383 fCorrRecEventHist1[i]->GetAxis(0)->SetTitle("Zv (cm)");\r
384 fCorrRecEventHist1[i]->GetAxis(1)->SetTitle("multiplicity");\r
385 fCorrRecEventHist1[i]->Sumw2();\r
386\r
387 // empty event corrected histograms\r
388 sprintf(name,"fCorrRecEventHist2_%d",i);\r
389 sprintf(title,"mcZv:mult");\r
390 fCorrRecEventHist2[i] = new THnSparseF("fCorrRecEventHist2","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
391 fCorrRecEventHist2[i]->SetBinEdges(0,binsZv);\r
392 fCorrRecEventHist2[i]->GetAxis(0)->SetTitle("Zv (cm)");\r
393 fCorrRecEventHist2[i]->GetAxis(1)->SetTitle("multiplicity");\r
394 fCorrRecEventHist2[i]->Sumw2();\r
395 }\r
d269b0e6 396 \r
397 //\r
398 // cosmics histo\r
399 //\r
400 Int_t binsCosmicsHisto[3]= {151, 300, ptNbins};\r
401 Double_t minCosmicsHisto[3]={-1.5, -2.*TMath::Pi(), 0.0}; \r
402 Double_t maxCosmicsHisto[3]={ 1.5, 2.*TMath::Pi(), 16.0}; \r
403 sprintf(name,"fCosmicsHisto");\r
404 sprintf(title,"deta:dphi:pt");\r
405 \r
406 fCosmicsHisto = new THnSparseF(name,title,3,binsCosmicsHisto,minCosmicsHisto,maxCosmicsHisto);\r
407 fCosmicsHisto->SetBinEdges(2,binsPt);\r
408 fCosmicsHisto->GetAxis(0)->SetTitle("#Delta#eta");\r
409 fCosmicsHisto->GetAxis(1)->SetTitle("#Delta#phi (rad)");\r
410 fCosmicsHisto->GetAxis(2)->SetTitle("pt (GV/c)");\r
411 fCosmicsHisto->Sumw2();\r
0aaa8b91 412\r
413 // init output folder\r
414 fCorrectionFolder = CreateFolder("folderdNdPt","Correction dNdPt Folder");\r
415\r
416 // init correction matrices\r
417 TFile *file = (TFile *)TFile::Open(fCorrMatrixFileName.Data()); \r
418 if(!file) { \r
419 AliDebug(AliLog::kError, "file with efficiency matrices not available");\r
420 printf("file with efficiency matrices not available \n");\r
421 } else {\r
422 TFolder *folder = (TFolder *)file->FindObjectAny("folderdNdPt");\r
423 if(!folder) { \r
424 AliDebug(AliLog::kError, "file without folderdNdPt");\r
425 printf("file without folderdNdPt \n");\r
426 } else {\r
427 // rec. event mult vs true multiplicity \r
428 fEventMultCorrelationMatrix = (THnSparseF*)folder->FindObject("event_mult_correlation_matrix");\r
429 if(!fEventMultCorrelationMatrix) {\r
430 Printf("No %s matrix \n", "event_mult_correlation_matrix");\r
431 }\r
432\r
433 //\r
434 // event level corrections (zv,mult_MB)\r
435 //\r
436 \r
437 // trigger bias correction (MBtoND) \r
438 fCorrTriggerMBtoNDEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoND_corr_matrix");\r
439 if(!fCorrTriggerMBtoNDEventMatrix) {\r
440 Printf("No %s matrix \n", "zv_mult_trig_MBtoND_corr_matrix");\r
441 }\r
442\r
443 // trigger bias correction (MBtoNSD)\r
444 fCorrTriggerMBtoNSDEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoNSD_corr_matrix");\r
445 if(!fCorrTriggerMBtoNSDEventMatrix) {\r
446 Printf("No %s matrix \n", "zv_mult_trig_MBtoNSD_corr_matrix");\r
447 }\r
448\r
449 // trigger bias correction (MBtoInel)\r
450 fCorrTriggerMBtoInelEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoInel_corr_matrix");\r
451 if(!fCorrTriggerMBtoInelEventMatrix) {\r
452 Printf("No %s matrix \n", "zv_mult_trig_MBtoInel_corr_matrix"); \r
453 }\r
454 \r
455 // vertex reconstruction efficiency correction\r
456 fCorrEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_event_corr_matrix");\r
457 if(!fCorrEventMatrix) {\r
458 Printf("No %s matrix \n", "zv_mult_event_corr_matrix");\r
459 }\r
460\r
461 //\r
462 // histogram needed for empty events corrections\r
463 //\r
464 fZvNorm = (TH1D*)folder->FindObject("zv_distribution_norm");\r
465 if(!fZvNorm) {\r
466 Printf("No %s matrix \n", "fZvNorm");\r
467 }\r
468\r
469 fZvEmptyEventsNorm = (TH1D*)folder->FindObject("zv_empty_events_norm");\r
470 if(!fZvEmptyEventsNorm) {\r
471 Printf("No %s matrix \n", "fZvEmptyEventsNorm");\r
472 }\r
473\r
474 //\r
475 // track-event level corrections (zv,pt,eta)\r
476 //\r
477\r
478 // trigger bias correction (MBtoND) \r
479 fCorrTriggerMBtoNDTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
480 if(!fCorrTriggerMBtoNDTrackEventMatrix) {\r
481 Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
482 }\r
483\r
484 // trigger bias correction (MBtoNSD)\r
485 fCorrTriggerMBtoNSDTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
486 if(!fCorrTriggerMBtoNSDTrackEventMatrix) {\r
487 Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
488 }\r
489\r
490 // trigger bias correction (MBtoInel) \r
491 fCorrTriggerMBtoInelTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
492 if(!fCorrTriggerMBtoInelTrackEventMatrix) {\r
493 Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
494 }\r
495 \r
496 // vertex reconstruction efficiency correction (zv,pt,eta)\r
497 fCorrTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_event_corr_matrix");\r
498 if(!fCorrTrackEventMatrix) {\r
499 Printf("No %s matrix \n", "zv_pt_eta_track_event_corr_matrix");\r
500 }\r
501\r
502 // track reconstruction efficiency correction (zv,pt,eta)\r
503 fCorrTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_corr_matrix");\r
504 if(!fCorrTrackMatrix) {\r
505 Printf("No %s matrix \n", "zv_pt_eta_track_corr_matrix");\r
506 }\r
507\r
508 // secondary tracks contamination correction (zv,pt,eta)\r
509 fContTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_cont_matrix");\r
510 if(!fContTrackMatrix) {\r
511 Printf("No %s matrix \n", "zv_pt_eta_track_cont_matrix");\r
512 }\r
513\r
514 // multiply reconstructed tracks correction\r
515 fContMultTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_mult_track_cont_matrix");\r
516 if(!fContMultTrackMatrix) {\r
517 Printf("No %s matrix \n", "zv_pt_eta_mult_track_cont_matrix");\r
518 }\r
519 }\r
520 }\r
521\r
522}\r
523\r
524//_____________________________________________________________________________\r
525void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)\r
526{\r
527 //\r
528 // Process real and/or simulated events\r
529 //\r
530 if(!esdEvent) {\r
531 AliDebug(AliLog::kError, "esdEvent not available");\r
532 return;\r
533 }\r
534\r
bad4ba69 535 // get selection cuts\r
0aaa8b91 536 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
537 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
538 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
539\r
bad4ba69 540 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
0aaa8b91 541 AliDebug(AliLog::kError, "cuts not available");\r
542 return;\r
543 }\r
544\r
d269b0e6 545 // get physics trigger selection \r
546 AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
547 if(!trigSel) {\r
548 AliDebug(AliLog::kError, "cannot get trigSel");\r
549 return;\r
550 }\r
551\r
bad4ba69 552 // trigger selection\r
553 Bool_t isEventTriggered = kTRUE;\r
554 if(evtCuts->IsTriggerRequired()) {\r
f537848a 555 if(IsUseMCInfo()) { \r
d269b0e6 556 //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
557 //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
558 trigSel->SetAnalyzeMC();\r
559 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
f537848a 560 }\r
561 else {\r
d269b0e6 562 //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
563 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
f537848a 564 }\r
bad4ba69 565 }\r
0aaa8b91 566\r
bad4ba69 567 // use MC information\r
0aaa8b91 568 AliHeader* header = 0;\r
569 AliGenEventHeader* genHeader = 0;\r
570 AliStack* stack = 0;\r
571 TArrayF vtxMC(3);\r
bad4ba69 572 AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
0aaa8b91 573 Int_t multMCTrueTracks = 0;\r
574\r
575 if(IsUseMCInfo())\r
576 {\r
577 if(!mcEvent) {\r
578 AliDebug(AliLog::kError, "mcEvent not available");\r
579 return;\r
580 }\r
581\r
582 // get MC event header\r
583 header = mcEvent->Header();\r
584 if (!header) {\r
585 AliDebug(AliLog::kError, "Header not available");\r
586 return;\r
587 }\r
588 // MC particle stack\r
589 stack = mcEvent->Stack();\r
590 if (!stack) {\r
591 AliDebug(AliLog::kError, "Stack not available");\r
592 return;\r
593 }\r
594\r
595 // get event type (ND=0x1, DD=0x2, SD=0x4)\r
bad4ba69 596 evtType = AliPWG0Helper::GetEventProcessType(header);\r
0aaa8b91 597 //Printf("evtType %d \n", evtType);\r
598 AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
599\r
600 // get MC vertex\r
601 genHeader = header->GenEventHeader();\r
602 if (!genHeader) {\r
603 AliDebug(AliLog::kError, "Could not retrieve genHeader from Header");\r
604 return;\r
605 }\r
606 genHeader->PrimaryVertex(vtxMC);\r
607\r
608 // Fill MC event histogram\r
609 Double_t vMCEventHist1[3]={vtxMC[0],vtxMC[1],vtxMC[2]};\r
610 fMCEventHist1->Fill(vMCEventHist1);\r
611\r
612 // multipliticy of all MC primary tracks\r
613 // in Zvtx, pt and eta ranges\r
614 multMCTrueTracks = AlidNdPtHelper::GetMCTrueTrackMult(mcEvent,evtCuts,accCuts);\r
615\r
616 } // end bUseMC\r
617\r
618 // get reconstructed vertex \r
619 const AliESDVertex* vtxESD = 0; \r
620 Bool_t isRecVertex = kFALSE;\r
621 if(evtCuts->IsRecVertexRequired()) \r
622 {\r
bad4ba69 623 Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
624 Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
625 vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
847e74b2 626 isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, GetAnalysisMode(), kFALSE); \r
0aaa8b91 627 }\r
628 if( IsUseMCInfo() && !evtCuts->IsRecVertexRequired() ) {\r
629 vtxESD = new AliESDVertex(vtxMC[2],10.,genHeader->NProduced());\r
630 isRecVertex = kTRUE;\r
631 }\r
632 Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex; \r
633 //printf("isEventOK %d \n",isEventOK);\r
634\r
635 //\r
847e74b2 636 // get multiplicity vertex contributors\r
0aaa8b91 637 //\r
638 Int_t multMBTracks = 0; \r
639 if(GetAnalysisMode() == AlidNdPtHelper::kTPC || GetAnalysisMode() == AlidNdPtHelper::kMCRec) { \r
640 multMBTracks = AlidNdPtHelper::GetTPCMBTrackMult(esdEvent,evtCuts,accCuts,esdTrackCuts);\r
641 } \r
847e74b2 642 else if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtxUpdate || GetAnalysisMode() == AlidNdPtHelper::kMCRec) {\r
643 //multMBTracks = AlidNdPtHelper::GetSPDMBTrackMult(esdEvent,0.0);\r
644 multMBTracks = vtxESD->GetNContributors();\r
0aaa8b91 645 } \r
646 else {\r
647 AliDebug(AliLog::kError, Form("Found analysis type %s", GetAnalysisMode()));\r
648 return; \r
649 }\r
650\r
651 //\r
652 // correct event and track histograms\r
653 //\r
654 TObjArray *allChargedTracks=0;\r
655 Int_t multRec=0, multRecTemp=0;\r
656 Int_t *labelsRec=0;\r
657\r
658 if(isEventOK && isEventTriggered)\r
659 {\r
660 // get all charged tracks\r
bad4ba69 661 allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
0aaa8b91 662 if(!allChargedTracks) return;\r
663\r
664 Int_t entries = allChargedTracks->GetEntries();\r
665 labelsRec = new Int_t[entries];\r
666\r
667 // calculate mult of reconstructed tracks\r
668 for(Int_t i=0; i<entries;++i) \r
669 {\r
670 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
671 if(!track) continue;\r
847e74b2 672 if(track->Charge()==0) continue;\r
673\r
674 // only postive charged \r
675 if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
676 continue;\r
677 \r
678 // only negative charged \r
679 if(GetParticleMode() == AlidNdPtHelper::kMinus && track->Charge() > 0) \r
680 continue;\r
681\r
d269b0e6 682 // cosmics analysis\r
683 Bool_t isCosmic = kFALSE;\r
684 if( GetParticleMode()==AlidNdPtHelper::kCosmics )\r
685 {\r
686 for(Int_t j=0; j<entries;++j) \r
687 {\r
688 AliESDtrack *track1 = (AliESDtrack*)allChargedTracks->At(j);\r
689 if(!track1) continue;\r
690 if(track1->Charge()==0) continue;\r
691\r
692 if( esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track) && \r
693 esdTrackCuts->AcceptTrack(track1) && accCuts->AcceptTrack(track1) ) \r
694 { \r
695 isCosmic = AlidNdPtHelper::IsCosmicTrack(track, track1, i, accCuts, esdTrackCuts);\r
696 }\r
697 if(isCosmic) \r
698 {\r
699 Double_t vCosmicsHisto[3] = {track->Eta()+track1->Eta(), track->Phi()-track1->Phi(), track1->Pt()};\r
700 fCosmicsHisto->Fill(vCosmicsHisto);\r
701 }\r
702 }\r
703 \r
704 if(!isCosmic) continue;\r
705 }\r
706\r
847e74b2 707 if(esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track)) \r
708 multRecTemp++;\r
0aaa8b91 709 } \r
710\r
847e74b2 711 //\r
0aaa8b91 712 for(Int_t i=0; i<entries;++i) \r
713 {\r
714 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
715 if(!track) continue;\r
847e74b2 716 if(track->Charge()==0) continue;\r
717\r
718 // only postive charged \r
719 if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
720 continue;\r
721 \r
722 // only negative charged \r
723 if(GetParticleMode() == AlidNdPtHelper::kMinus && track->Charge() > 0) \r
724 continue;\r
0aaa8b91 725 \r
847e74b2 726 // track-level corrections\r
727 if(esdTrackCuts->AcceptTrack(track)) \r
0aaa8b91 728 {\r
847e74b2 729 if (GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate) \r
730 {\r
731 //\r
732 // update track parameters\r
733 //\r
734 AliExternalTrackParam cParam;\r
735 track->RelateToVertexTPC(esdEvent->GetPrimaryVertexSPD(),esdEvent->GetMagneticField(),kVeryBig,&cParam);\r
736 track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
737\r
738 if(accCuts->AcceptTrack(track)) { \r
739 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp); \r
740 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
741 multRec++;\r
742 }\r
743 }\r
744 else if (GetAnalysisMode()==AlidNdPtHelper::kMCRec && IsUseMCInfo()) \r
745 { \r
746 //\r
747 // Replace rec with MC\r
748 //\r
749 if(accCuts->AcceptTrack(track)) { \r
750 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxMC[2],multRecTemp); \r
751 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
752 multRec++;\r
753 }\r
754 } \r
755 else {\r
756 //\r
757 // all the rest tracking scenarios\r
758 //\r
759 if(accCuts->AcceptTrack(track)) { \r
760 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp); \r
761 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
762 multRec++;\r
763 }\r
764 }\r
765 }\r
0aaa8b91 766 }\r
767 // event-level corrections\r
768 if(GetAnalysisMode()==AlidNdPtHelper::kMCRec && IsUseMCInfo()) { \r
769 FillHistograms(AlidNdPtHelper::kRecEvents,vtxMC[2],multMBTracks);\r
770 }\r
771 else {\r
772 FillHistograms(AlidNdPtHelper::kRecEvents,vtxESD->GetZv(),multMBTracks);\r
773 }\r
774\r
775 // control event histograms\r
776 Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
777 fRecEventHist1->Fill(vRecEventHist1);\r
778 } \r
779\r
780 // empty events corrections\r
781 // no reconstructed zv\r
782 if(isEventTriggered && multMBTracks==0) {\r
783 if(GetAnalysisMode()==AlidNdPtHelper::kMCRec && IsUseMCInfo()) {\r
784 FillHistograms(AlidNdPtHelper::kTriggeredEvents,vtxMC[2],multMBTracks);\r
785 }\r
786 else {\r
787 Double_t zv = fZvNorm->GetRandom();\r
788 FillHistograms(AlidNdPtHelper::kTriggeredEvents,zv,multMBTracks);\r
789 }\r
790 }\r
791\r
792 if(IsUseMCInfo()) \r
793 {\r
794 // select MC events \r
795 if(evtCuts->AcceptMCEvent(mcEvent))\r
796 {\r
797 //\r
798 // event histograms\r
799 //\r
800 Double_t vMCEventMatrix[2] = {vtxMC[2],multMBTracks};\r
801 fMCAllEventMultHist1->Fill(vMCEventMatrix);\r
bad4ba69 802 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 803 fMCAllNDEventMultHist1->Fill(vMCEventMatrix);\r
804 }\r
bad4ba69 805 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 806 fMCAllNSDEventMultHist1->Fill(vMCEventMatrix);\r
807 }\r
808 if(isEventTriggered) fMCTriggerMultHist1->Fill(vMCEventMatrix);\r
809 if(isEventTriggered && isEventOK) fMCEventMultHist1->Fill(vMCEventMatrix);\r
810\r
811 //\r
812 // MC histograms for efficiency studies\r
813 //\r
814 Int_t nPart = stack->GetNtrack();\r
815 for (Int_t iMc = 0; iMc < nPart; ++iMc) \r
816 {\r
817 // print MC stack info\r
818 //AlidNdPtHelper::PrintMCInfo(stack,iMc);\r
819\r
820 TParticle* particle = stack->Particle(iMc);\r
821 if (!particle)\r
822 continue;\r
823\r
824 // only charged particles\r
825 Double_t charge = particle->GetPDG()->Charge()/3.;\r
826 if (charge == 0.0)\r
827 continue;\r
847e74b2 828\r
829 // only postive charged \r
830 if(GetParticleMode() == AlidNdPtHelper::kPlus && charge < 0.) \r
831 continue;\r
832 \r
833 // only negative charged \r
834 if(GetParticleMode() == AlidNdPtHelper::kMinus && charge > 0.) \r
835 continue;\r
0aaa8b91 836 \r
837 // physical primary\r
838 Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
839\r
840 // all primaries in acceptance\r
841 if(!accCuts->AcceptTrack(particle)) continue;\r
842 if(!prim) continue;\r
843\r
844 Double_t gpt = particle->Pt();\r
845 Double_t geta = particle->Eta();\r
846\r
847 Double_t valMCAllTrackMultHist1[3] = {gpt,geta,multRec}; \r
848 fMCAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
bad4ba69 849 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 850 fMCNDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
851 }\r
bad4ba69 852 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 853 fMCNSDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
854 }\r
855 if(isEventTriggered) fMCTriggerPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
856 if(isEventTriggered && isEventOK) fMCEventPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
857 }\r
858 }\r
859 } // end bUseMC\r
860\r
861 if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
862 if(labelsRec) delete [] labelsRec; labelsRec = 0;\r
863\r
f537848a 864 if(!evtCuts->IsRecVertexRequired() && vtxESD != NULL) delete vtxESD;\r
0aaa8b91 865}\r
866\r
867//_____________________________________________________________________________\r
868void AlidNdPtCorrection::FillHistograms(AlidNdPtHelper::EventObject eventObj, Double_t zv, Int_t multMBTracks)\r
869{\r
870 //\r
871 // Fill corrected histograms\r
872 //\r
873\r
874 Double_t vEventMatrix[2] = {zv,multMBTracks};\r
875 //\r
876 // Correct for efficiency \r
877 //\r
878 if(eventObj == AlidNdPtHelper::kRecEvents && multMBTracks>0) \r
879 {\r
880 Double_t corrToMBF = GetCorrFactZvMult(fCorrEventMatrix,zv,multMBTracks);\r
881 Double_t corrToInelF = GetCorrFactZvMult(fCorrTriggerMBtoInelEventMatrix,zv,multMBTracks);\r
882 Double_t corrToNDF = GetCorrFactZvMult(fCorrTriggerMBtoNDEventMatrix,zv,multMBTracks);\r
883 Double_t corrToNSDF = GetCorrFactZvMult(fCorrTriggerMBtoNSDEventMatrix,zv,multMBTracks);\r
884 //printf("corrToMBF %f, corrToInelF %f, corrToNDF %f corrToNSDF %f \n",corrToMBF,corrToInelF,corrToNDF,corrToNSDF);\r
885\r
886 fCorrRecEventHist1[0]->Fill(vEventMatrix);\r
887 fCorrRecEventHist1[1]->Fill(vEventMatrix,corrToMBF);\r
888 fCorrRecEventHist1[2]->Fill(vEventMatrix,corrToMBF*corrToInelF);\r
889 fCorrRecEventHist1[3]->Fill(vEventMatrix,corrToMBF*corrToNDF);\r
890 fCorrRecEventHist1[4]->Fill(vEventMatrix,corrToMBF*corrToNSDF);\r
891 }\r
892\r
893 if(eventObj==AlidNdPtHelper::kTriggeredEvents && multMBTracks==0) // empty triggered events\r
894 {\r
895 Int_t bin = fZvEmptyEventsNorm->FindBin(zv);\r
896 Double_t Fz = fZvEmptyEventsNorm->GetBinContent(bin);\r
897 Double_t corrToInelF0 = GetCorrFactZvMult(fCorrTriggerMBtoInelEventMatrix,zv,multMBTracks);\r
898 Double_t corrToNDF0 = GetCorrFactZvMult(fCorrTriggerMBtoNDEventMatrix,zv,multMBTracks);\r
899 Double_t corrToNSDF0 = GetCorrFactZvMult(fCorrTriggerMBtoNSDEventMatrix,zv,multMBTracks);\r
900 //printf("Fz %f, corrToInelF0 %f, corrToNDF0 %f, corrToNSDF0 %f \n",Fz,corrToInelF0,corrToNDF0,corrToNSDF0);\r
901\r
902 fCorrRecEventHist2[0]->Fill(vEventMatrix);\r
903 fCorrRecEventHist2[1]->Fill(vEventMatrix,Fz);\r
904 fCorrRecEventHist2[2]->Fill(vEventMatrix,Fz*corrToInelF0);\r
905 fCorrRecEventHist2[3]->Fill(vEventMatrix,Fz*corrToNDF0);\r
906 fCorrRecEventHist2[4]->Fill(vEventMatrix,Fz*corrToNSDF0);\r
907 }\r
908}\r
909\r
910//_____________________________________________________________________________\r
911void AlidNdPtCorrection::FillHistograms(AliESDtrack *esdTrack, AliStack *stack, AlidNdPtHelper::TrackObject trackObj, Double_t zv, Int_t mult)\r
912{\r
913 //\r
914 // Fill ESD track and MC histograms \r
915 //\r
916 if(!esdTrack) return;\r
917\r
918 //Float_t q = esdTrack->Charge();\r
919 Float_t pt = esdTrack->Pt();\r
920 Float_t eta = esdTrack->Eta();\r
921 Float_t phi = esdTrack->Phi();\r
922\r
923 if(stack && GetAnalysisMode() == AlidNdPtHelper::kMCRec) \r
924 {\r
925 Int_t label = TMath::Abs(esdTrack->GetLabel());\r
926 \r
927 TParticle* particle = stack->Particle(label);\r
928 if(!particle) return;\r
929 \r
930 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3\r
931 if(gq==0) return;\r
932 Float_t gpt = particle->Pt();\r
933 Float_t geta = particle->Eta();\r
934 Float_t gphi = particle->Phi();\r
935\r
936 // replace reconstructed values with MC\r
937 pt = gpt;\r
938 eta = geta;\r
939 phi = gphi;\r
940 }\r
941\r
942 //\r
943 // Fill histograms\r
944 //\r
945 Double_t values[3] = {pt,eta,phi}; \r
946 fRecTrackHist1[trackObj]->Fill(values);\r
947\r
948 //\r
949 // Correct for contamination and efficiency \r
950 //\r
951 if(trackObj == AlidNdPtHelper::kRecTracks || GetAnalysisMode() == AlidNdPtHelper::kMCRec) \r
952 {\r
953 // track level corrections\r
954 Double_t trackEffF = GetCorrFactZvPtEta(fCorrTrackMatrix,zv,pt,eta);\r
955 Double_t trackContF = GetContFactZvPtEta(fContTrackMatrix,zv,pt,eta);\r
956 Double_t multTrackContF = GetContFactZvPtEta(fContMultTrackMatrix,zv,pt,eta);\r
957 //printf("zv %f, pt %f, eta %f \n",zv,pt,eta);\r
958 //printf("trackEffF %f, trackContF %f, multTrackContF %f \n", trackEffF, trackContF, multTrackContF);\r
959 \r
960 // track-event level corrections\r
961 Double_t vertexEffF = GetCorrFactZvPtEta(fCorrTrackEventMatrix,zv,pt,eta);\r
962 Double_t trigMBToInel = GetCorrFactZvPtEta(fCorrTriggerMBtoInelTrackEventMatrix,zv,pt,eta); \r
963 Double_t trigMBToND = GetCorrFactZvPtEta(fCorrTriggerMBtoNDTrackEventMatrix,zv,pt,eta);\r
964 Double_t trigMBToNSD = GetCorrFactZvPtEta(fCorrTriggerMBtoNSDTrackEventMatrix,zv,pt,eta);\r
965 //printf("vertexEffF %f, trigMBToInel %f, trigMBToNSD %f \n", vertexEffF, trigMBToInel, trigMBToNSD);\r
bad4ba69 966 \r
967 Double_t corrF[8] = { 1.0, \r
968 trackContF,\r
969 trackContF*trackEffF,\r
970 trackContF*trackEffF*multTrackContF,\r
971 trackContF*trackEffF*multTrackContF*vertexEffF,\r
972 trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToInel,\r
973 trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToND,\r
974 trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToNSD\r
975 }; \r
976 \r
977 // Fill histograms\r
0aaa8b91 978 Double_t valCorrRecTrackMultHist1[3] = {pt,eta,mult}; \r
bad4ba69 979 Double_t valPtvsPt[2] = {pt,pt}; \r
980 for(Int_t i=0; i<8; i++) {\r
981 fCorrRecTrackMultHist1[i]->Fill(valCorrRecTrackMultHist1,corrF[i]);\r
982 fPtvsPt[i]->Fill(valPtvsPt,corrF[i]);\r
983 }\r
0aaa8b91 984 }\r
985}\r
986\r
987//_____________________________________________________________________________\r
988void AlidNdPtCorrection::FillHistograms(AliStack *stack, Int_t /*label*/, AlidNdPtHelper::TrackObject /*trackObj*/, Int_t /*mult*/)\r
989{\r
990 // Fill MC histograms\r
991 if(!stack) return;\r
992\r
993 /*\r
994 TParticle* particle = stack->Particle(label);\r
995 if(!particle) return;\r
996\r
997 Int_t mother_pdg = -1;\r
998 TParticle* mother = 0;\r
999\r
1000 //TParticle* prim_mother = AlidNdPtHelper::FindPrimaryMother(stack,label);\r
1001 Int_t motherLabel = particle->GetMother(0); \r
1002 if(motherLabel>0) mother = stack->Particle(motherLabel);\r
1003 if(mother) mother_pdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only\r
1004 Int_t mech = particle->GetUniqueID(); // production mechanism\r
1005\r
1006 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
1007 Float_t gpt = particle->Pt();\r
1008 Float_t qgpt = particle->Pt() * gq;\r
1009 Float_t geta = particle->Eta();\r
1010 Float_t gphi = particle->Phi();\r
1011 Float_t gpz = particle->Pz();\r
1012\r
1013 Bool_t prim = stack->IsPhysicalPrimary(label);\r
1014 Float_t vx = particle->Vx(); Float_t vy = particle->Vy(); Float_t vz = particle->Vz();\r
1015\r
1016 Int_t pid=-1;\r
1017 if (TMath::Abs(particle->GetPdgCode()) == kElectron) { pid = 0; }\r
1018 else if (TMath::Abs(particle->GetPdgCode()) == kMuonMinus) { pid = 1; }\r
1019 else if (TMath::Abs(particle->GetPdgCode()) == kPiPlus) { pid = 2; }\r
1020 else if (TMath::Abs(particle->GetPdgCode()) == kKPlus) { pid = 3; }\r
1021 else if (TMath::Abs(particle->GetPdgCode()) == kProton) { pid = 4; }\r
1022 else { pid = 5; }\r
1023 */\r
1024\r
1025 //if(!prim) printf("prim_mother %d, mother %d, particle %d, production mech %d\n",prim_mother->GetPdgCode(),mother->GetPdgCode(), particle->GetPdgCode(),mech);\r
1026 \r
1027}\r
1028\r
1029//_____________________________________________________________________________\r
1030Double_t AlidNdPtCorrection::GetCorrFactZvPtEta(THnSparse *hist, Double_t zv, Double_t pt, Double_t eta) const {\r
1031// return correction factor F(zv,pt,eta)\r
1032\r
1033 if(!hist) return 1.;\r
1034\r
1035 //\r
1036 TAxis *ax = hist->GetAxis(0);\r
1037 TAxis *ay = hist->GetAxis(1);\r
1038 TAxis *az = hist->GetAxis(2);\r
1039\r
1040 Int_t binx = ax->FindBin(zv);\r
1041 Int_t biny = ay->FindBin(pt);\r
1042 Int_t binz = az->FindBin(eta);\r
1043 Int_t dim[3] = {binx,biny,binz};\r
1044\r
1045 Double_t fact = hist->GetBinContent(dim); \r
1046\r
1047return fact;\r
1048}\r
1049\r
1050//_____________________________________________________________________________\r
1051Double_t AlidNdPtCorrection::GetContFactZvPtEta(THnSparse *hist, Double_t zv, Double_t pt, Double_t eta) const {\r
1052// return contamination correction factor F(zv,pt,eta)\r
1053\r
1054 if(!hist) return 1.0;\r
1055\r
1056 //\r
1057 TAxis *ax = hist->GetAxis(0);\r
1058 TAxis *ay = hist->GetAxis(1);\r
1059 TAxis *az = hist->GetAxis(2);\r
1060\r
1061 Int_t binx = ax->FindBin(zv);\r
1062 Int_t biny = ay->FindBin(pt);\r
1063 Int_t binz = az->FindBin(eta);\r
1064 Int_t dim[3] = {binx,biny,binz};\r
1065\r
1066 Double_t fact = 1.0-hist->GetBinContent(dim); \r
1067 //Double_t fact = hist->GetBinContent(dim); \r
1068\r
1069return fact;\r
1070}\r
1071\r
1072//_____________________________________________________________________________\r
1073Double_t AlidNdPtCorrection::GetCorrFactZvMult(THnSparse *hist, Double_t zv, Int_t mult) const {\r
1074// return correction factor F(zv,mult)\r
1075\r
1076 if(!hist) return 1.;\r
1077\r
1078 TAxis *ax = hist->GetAxis(0);\r
1079 TAxis *ay = hist->GetAxis(1);\r
1080 Int_t binx = ax->FindBin(zv);\r
1081 Int_t biny = ay->FindBin(mult);\r
1082 Int_t dim[2] = {binx,biny};\r
1083\r
1084 Double_t fact = hist->GetBinContent(dim); \r
1085\r
1086\r
1087return fact;\r
1088}\r
1089\r
1090//_____________________________________________________________________________\r
1091Double_t AlidNdPtCorrection::GetContFactZvMult(THnSparse *hist, Double_t zv, Int_t mult) const {\r
1092// return contamination correction factor F(zv,mult)\r
1093\r
1094 if(!hist) return 1.;\r
1095\r
1096 TAxis *ax = hist->GetAxis(0);\r
1097 TAxis *ay = hist->GetAxis(1);\r
1098 Int_t binx = ax->FindBin(zv);\r
1099 Int_t biny = ay->FindBin(mult);\r
1100 Int_t dim[2] = {binx,biny};\r
1101 Double_t fact = 1.0-hist->GetBinContent(dim); \r
1102\r
1103return fact;\r
1104}\r
1105\r
1106//_____________________________________________________________________________\r
1107Long64_t AlidNdPtCorrection::Merge(TCollection* list) \r
1108{\r
1109 // Merge list of objects (needed by PROOF)\r
1110\r
1111 if (!list)\r
1112 return 0;\r
1113\r
1114 if (list->IsEmpty())\r
1115 return 1;\r
1116\r
1117 TIterator* iter = list->MakeIterator();\r
1118 TObject* obj = 0;\r
1119\r
1120 // collection of generated histograms\r
1121\r
1122 Int_t count=0;\r
1123 while((obj = iter->Next()) != 0) {\r
1124 AlidNdPtCorrection* entry = dynamic_cast<AlidNdPtCorrection*>(obj);\r
1125 if (entry == 0) continue; \r
1126 \r
1127 fMCEventHist1->Add(entry->fMCEventHist1);\r
1128 fRecEventHist1->Add(entry->fRecEventHist1);\r
1129\r
1130 fMCAllEventMultHist1->Add(entry->fMCAllEventMultHist1);\r
1131 fMCAllNDEventMultHist1->Add(entry->fMCAllNDEventMultHist1);\r
1132 fMCAllNSDEventMultHist1->Add(entry->fMCAllNSDEventMultHist1);\r
1133 fMCTriggerMultHist1->Add(entry->fMCTriggerMultHist1);\r
1134 fMCEventMultHist1->Add(entry->fMCEventMultHist1);\r
1135\r
1136 fMCAllPrimTrackMultHist1->Add(entry->fMCAllPrimTrackMultHist1);\r
1137 fMCNDEventAllPrimTrackMultHist1->Add(entry->fMCNDEventAllPrimTrackMultHist1);\r
1138 fMCNSDEventAllPrimTrackMultHist1->Add(entry->fMCNSDEventAllPrimTrackMultHist1);\r
1139 fMCTriggerPrimTrackMultHist1->Add(entry->fMCTriggerPrimTrackMultHist1);\r
1140 fMCEventPrimTrackMultHist1->Add(entry->fMCEventPrimTrackMultHist1);\r
d269b0e6 1141 fCosmicsHisto->Add(entry->fCosmicsHisto);\r
0aaa8b91 1142\r
1143 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) {\r
1144 fRecTrackHist1[i]->Add(entry->fRecTrackHist1[i]);\r
1145 }\r
1146\r
1147 for(Int_t i=0; i<8; i++) {\r
1148 fCorrRecTrackMultHist1[i]->Add(entry->fCorrRecTrackMultHist1[i]);\r
bad4ba69 1149 fPtvsPt[i]->Add(entry->fPtvsPt[i]);\r
0aaa8b91 1150 }\r
1151\r
1152 for(Int_t i=0; i<5; i++) {\r
1153 fCorrRecEventHist1[i]->Add(entry->fCorrRecEventHist1[i]);\r
1154 fCorrRecEventHist2[i]->Add(entry->fCorrRecEventHist2[i]);\r
1155 }\r
1156\r
0aaa8b91 1157 count++;\r
1158 }\r
1159\r
1160return count;\r
1161}\r
1162 \r
1163Int_t AlidNdPtCorrection::GetTrueMult(THnSparse *hist, Int_t mult)\r
1164{\r
1165 if(!hist) return 0;\r
1166 Int_t true_mult = 0;\r
1167\r
1168 // 0 bins exluded\r
1169 TAxis *ax = hist->GetAxis(0);\r
1170 TAxis *ay = hist->GetAxis(1);\r
1171 ax->SetRange(1,ax->GetNbins());\r
1172 ay->SetRange(1,ay->GetNbins());\r
1173\r
1174 // measured mult\r
1175 ax->SetRangeUser((Float_t)mult,(Float_t)mult); \r
1176\r
1177 // get true multiplicity\r
1178 TH1D *h1 = (TH1D *)hist->Projection(1);\r
1179 true_mult = (Int_t)h1->GetMean();\r
1180\r
1181 return true_mult;\r
1182}\r
1183\r
1184//_____________________________________________________________________________\r
1185void AlidNdPtCorrection::Analyse() \r
1186{\r
1187 // Analyse histograms\r
1188 //\r
1189 TH1::AddDirectory(kFALSE);\r
1190 TH1 *h = 0, *hs=0, *hsc=0; \r
1191 TH2 *h2D = 0; \r
1192\r
1193 TObjArray *aFolderObj = new TObjArray;\r
1194\r
1195 //\r
1196 // get cuts\r
1197 //\r
1198 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
1199 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
1200 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
1201\r
1202 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
1203 Error("AlidNdPtCutAnalysis::Analyse()", "cuts not available");\r
1204 return;\r
1205 }\r
1206\r
1207 //\r
1208 // set min and max values\r
1209 //\r
847e74b2 1210 //Double_t minPt = accCuts->GetMinPt();\r
1211 //Double_t maxPt = accCuts->GetMaxPt();\r
1212 //Double_t minEta = accCuts->GetMinEta();\r
1213 //Double_t maxEta = accCuts->GetMaxEta()-0.00001;\r
d269b0e6 1214 \r
1215\r
1216 //\r
1217 // cosmics background histo\r
1218 //\r
1219 h2D = fCosmicsHisto->Projection(0,1);\r
1220 h2D->SetName("deta_vs_dphi_cosmics");\r
1221 aFolderObj->Add(h2D);\r
0aaa8b91 1222\r
1223 //\r
1224 // pt profile\r
1225 //\r
bad4ba69 1226 char name[256];\r
1227 for(Int_t i=0; i<8; i++) {\r
1228 h2D = fPtvsPt[i]->Projection(1,0);\r
1229 sprintf(name,"PtvsMeanPt_%d",i);\r
d269b0e6 1230 h2D->SetName(name);\r
bad4ba69 1231 aFolderObj->Add(h2D);\r
1232 }\r
0aaa8b91 1233\r
1234 //\r
1235 // event level \r
1236 //\r
1237 h = fCorrRecEventHist1[0]->Projection(1);\r
1238 h->SetName("mult_event_not_corrected");\r
1239 aFolderObj->Add(h);\r
1240\r
1241 h = fCorrRecEventHist1[1]->Projection(1);\r
1242 h->SetName("mult_event_vertex_corrected");\r
1243 aFolderObj->Add(h);\r
1244\r
1245 h = fCorrRecEventHist1[2]->Projection(1);\r
1246 h->SetName("mult_trigger_vertex_corrected");\r
1247 aFolderObj->Add(h);\r
1248\r
1249 h = fCorrRecEventHist1[3]->Projection(1);\r
1250 h->SetName("mult_ND_trigger_vertex_corrected");\r
1251 aFolderObj->Add(h);\r
1252\r
1253 h = fCorrRecEventHist1[4]->Projection(1);\r
1254 h->SetName("mult_NSD_trigger_vertex_corrected");\r
1255 aFolderObj->Add(h);\r
1256\r
1257 // empty events\r
1258 h = fCorrRecEventHist2[0]->Projection(1);\r
1259 h->SetName("mult_empty_event_not_corrected");\r
1260 aFolderObj->Add(h);\r
1261\r
1262 h = fCorrRecEventHist2[1]->Projection(1);\r
1263 h->SetName("mult_empty_event_vertex_corrected");\r
1264 aFolderObj->Add(h);\r
1265\r
1266 h = fCorrRecEventHist2[2]->Projection(1);\r
1267 h->SetName("mult_empty_trigger_vertex_corrected");\r
1268 aFolderObj->Add(h);\r
1269\r
1270 h = fCorrRecEventHist2[3]->Projection(1);\r
1271 h->SetName("mult_empty_ND_trigger_vertex_corrected");\r
1272 aFolderObj->Add(h);\r
1273\r
1274 h = fCorrRecEventHist2[4]->Projection(1);\r
1275 h->SetName("mult_empty_NSD_trigger_vertex_corrected");\r
1276 aFolderObj->Add(h);\r
bad4ba69 1277 \r
1278 //\r
1279 // MC available\r
1280 //\r
1281 if(IsUseMCInfo()) {\r
0aaa8b91 1282\r
1283 // mc \r
1284 h = fMCAllEventMultHist1->Projection(1);\r
1285 h->SetName("mc_mult_event_acc_prim");\r
1286 aFolderObj->Add(h);\r
1287\r
1288 h = fMCAllNDEventMultHist1->Projection(1);\r
1289 h->SetName("mc_mult_ND_event_acc_prim");\r
1290 aFolderObj->Add(h);\r
1291\r
1292 h = fMCAllNSDEventMultHist1->Projection(1);\r
1293 h->SetName("mc_mult_NSD_event_acc_prim");\r
1294 aFolderObj->Add(h);\r
1295\r
1296 h = fMCTriggerMultHist1->Projection(1);\r
1297 h->SetName("mc_mult_trigger_acc_prim");\r
1298 aFolderObj->Add(h);\r
1299\r
1300 h = fMCEventMultHist1->Projection(1);\r
1301 h->SetName("mc_mult_trigger_event_acc_prim");\r
1302 aFolderObj->Add(h);\r
1303\r
1304\r
1305 //\r
1306 // track level\r
1307 //\r
1308 \r
1309 // limit eta range\r
1310 for(Int_t i=0;i<8;i++) { \r
3405c7c2 1311 //fCorrRecTrackMultHist1[i]->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
1312 //fCorrRecTrackMultHist1[i]->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 1313 }\r
3405c7c2 1314 //fMCAllPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
1315 //fMCAllPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 1316\r
3405c7c2 1317 //fMCNDEventAllPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
1318 //fMCNDEventAllPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 1319\r
3405c7c2 1320 //fMCNSDEventAllPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
1321 //fMCNSDEventAllPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 1322\r
3405c7c2 1323 //fMCTriggerPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
1324 //fMCTriggerPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 1325\r
3405c7c2 1326 //fMCEventPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
1327 //fMCEventPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
bad4ba69 1328\r
1329 } // end use MC info \r
0aaa8b91 1330 \r
1331 //\r
1332 h2D = fCorrRecTrackMultHist1[3]->Projection(1,0);\r
1333 h2D->SetName("pt_eta_rec_track_mult_eff_cont_corrected");\r
1334 aFolderObj->Add(h2D);\r
1335\r
1336 h2D = fCorrRecTrackMultHist1[4]->Projection(1,0);\r
1337 h2D->SetName("pt_eta_rec_event_track_mult_eff_cont_corrected");\r
1338 aFolderObj->Add(h2D);\r
1339\r
1340 h2D = fCorrRecTrackMultHist1[5]->Projection(1,0);\r
1341 h2D->SetName("pt_eta_rec_trig_event_track_mult_eff_cont_corrected");\r
1342 aFolderObj->Add(h2D);\r
1343\r
1344 h2D = fCorrRecTrackMultHist1[6]->Projection(1,0);\r
1345 h2D->SetName("pt_eta_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
1346 aFolderObj->Add(h2D);\r
1347\r
1348 h2D = fCorrRecTrackMultHist1[7]->Projection(1,0);\r
1349 h2D->SetName("pt_eta_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
1350 aFolderObj->Add(h2D);\r
1351\r
1352\r
1353 //\r
1354 h2D = fCorrRecTrackMultHist1[3]->Projection(2,0);\r
1355 h2D->SetName("pt_mult_rec_track_mult_eff_cont_corrected");\r
1356 aFolderObj->Add(h2D);\r
1357\r
1358 h2D = fCorrRecTrackMultHist1[4]->Projection(2,0);\r
1359 h2D->SetName("pt_mult_rec_event_track_mult_eff_cont_corrected");\r
1360 aFolderObj->Add(h2D);\r
1361\r
1362 h2D = fCorrRecTrackMultHist1[5]->Projection(2,0);\r
1363 h2D->SetName("pt_mult_rec_trig_event_track_mult_eff_cont_corrected");\r
1364 aFolderObj->Add(h2D);\r
1365\r
1366 h2D = fCorrRecTrackMultHist1[6]->Projection(2,0);\r
1367 h2D->SetName("pt_mult_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
1368 aFolderObj->Add(h2D);\r
1369\r
1370 h2D = fCorrRecTrackMultHist1[7]->Projection(2,0);\r
1371 h2D->SetName("pt_mult_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
1372 aFolderObj->Add(h2D);\r
1373\r
1374 // pt axis\r
1375\r
1376 h = fCorrRecTrackMultHist1[0]->Projection(0);\r
1377 h->SetName("pt_rec_track_not_corrected");\r
1378 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1379 hs->SetName("pt_rec_track_not_corrected_s");\r
1380 aFolderObj->Add(hs);\r
1381\r
1382 //\r
1383 h = fCorrRecTrackMultHist1[1]->Projection(0);\r
1384 h->SetName("pt_rec_track_cont_corrected");\r
1385 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1386 hs->SetName("pt_rec_track_cont_corrected_s");\r
1387 aFolderObj->Add(hs);\r
1388\r
1389 hsc = (TH1D*)hs->Clone("pt_rec_track_cont_corr_fact");\r
1390 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_not_corrected_s"));\r
1391 aFolderObj->Add(hsc);\r
1392\r
1393 //\r
1394 h = fCorrRecTrackMultHist1[2]->Projection(0);\r
1395 h->SetName("pt_rec_track_eff_cont_corrected");\r
1396 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1397 hs->SetName("pt_rec_track_eff_cont_corrected_s");\r
1398 aFolderObj->Add(hs);\r
1399\r
1400 hsc = (TH1D*)hs->Clone("pt_rec_track_eff_corr_fact");\r
1401 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_cont_corrected_s"));\r
1402 aFolderObj->Add(hsc);\r
1403\r
1404 //\r
1405 h = fCorrRecTrackMultHist1[3]->Projection(0);\r
1406 h->SetName("pt_rec_track_mult_eff_cont_corrected");\r
1407 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1408 hs->SetName("pt_rec_track_mult_eff_cont_corrected_s");\r
1409 aFolderObj->Add(hs);\r
1410\r
1411 hsc = (TH1D*)hs->Clone("pt_rec_track_mult_corr_fact");\r
1412 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_eff_cont_corrected_s"));\r
1413 aFolderObj->Add(hsc);\r
1414\r
1415 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1416 hsc = (TH1D*)hs->Clone("pt_rec_track_mult_eff_cont_corr_fact");\r
1417 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_not_corrected_s"));\r
1418 aFolderObj->Add(hsc);\r
1419\r
1420 hsc = (TH1D*)hs->Clone();\r
1421 hsc->SetName("pt_rec_track_mult_eff_cont_corrected_s_norm");\r
1422 hsc->Scale(1./(fCorrRecEventHist1[0]->Projection(1)->Integral()));\r
1423 aFolderObj->Add(hsc);\r
1424\r
1425 //\r
1426 h = fCorrRecTrackMultHist1[4]->Projection(0);\r
1427 h->SetName("pt_rec_event_track_mult_eff_cont_corrected");\r
1428 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1429 hs->SetName("pt_rec_event_track_mult_eff_cont_corrected_s");\r
1430 aFolderObj->Add(hs);\r
1431\r
1432 hsc = (TH1D*)hs->Clone();\r
1433 hsc->SetName("pt_rec_event_track_mult_eff_cont_corrected_s_norm");\r
1434 hsc->Scale(1./(fCorrRecEventHist1[1]->Projection(1)->Integral()+fCorrRecEventHist2[1]->Projection(1)->Integral()));\r
1435 aFolderObj->Add(hsc);\r
1436\r
1437 //\r
1438 h = fCorrRecTrackMultHist1[5]->Projection(0);\r
1439 h->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected");\r
1440 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1441 hs->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s");\r
1442 aFolderObj->Add(hs);\r
1443\r
1444 hsc = (TH1D*)hs->Clone();\r
1445 hsc->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s_norm");\r
1446 hsc->Scale(1./(fCorrRecEventHist1[2]->Projection(1)->Integral() + fCorrRecEventHist2[2]->Projection(1)->Integral()));\r
1447 aFolderObj->Add(hsc);\r
1448\r
1449 //\r
1450 h = fCorrRecTrackMultHist1[6]->Projection(0);\r
1451 h->SetName("pt_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
1452 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1453 hs->SetName("pt_rec_ND_trig_event_track_mult_eff_cont_corrected_s");\r
1454 aFolderObj->Add(hs);\r
1455\r
1456 hsc = (TH1D*)hs->Clone();\r
1457 hsc->SetName("pt_rec_ND_trig_event_track_mult_eff_cont_corrected_s_norm");\r
1458 hsc->Scale(1./(fCorrRecEventHist1[3]->Projection(1)->Integral()+fCorrRecEventHist2[3]->Projection(1)->Integral()));\r
1459 aFolderObj->Add(hsc);\r
1460\r
1461 //\r
1462 h = fCorrRecTrackMultHist1[7]->Projection(0);\r
1463 h->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
1464 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1465 hs->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s");\r
1466 aFolderObj->Add(hs);\r
1467\r
1468 hsc = (TH1D*)hs->Clone();\r
1469 hsc->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm");\r
1470 hsc->Scale(1./(fCorrRecEventHist1[4]->Projection(1)->Integral()+fCorrRecEventHist2[4]->Projection(1)->Integral()));\r
1471 aFolderObj->Add(hsc);\r
1472\r
1473 // eta axis\r
1474 h = fCorrRecTrackMultHist1[0]->Projection(1);\r
1475 h->SetName("eta_rec_track_not_corrected");\r
1476 aFolderObj->Add(h);\r
1477 \r
1478 h = fCorrRecTrackMultHist1[1]->Projection(1);\r
1479 h->SetName("eta_rec_track_cont_corrected");\r
1480 aFolderObj->Add(h);\r
1481\r
1482 h = fCorrRecTrackMultHist1[2]->Projection(1);\r
1483 h->SetName("eta_rec_track_eff_cont_corrected");\r
1484 aFolderObj->Add(h);\r
1485\r
1486 h = fCorrRecTrackMultHist1[3]->Projection(1);\r
1487 h->SetName("eta_rec_track_mult_eff_cont_corrected");\r
1488 aFolderObj->Add(h);\r
1489\r
1490 h = fCorrRecTrackMultHist1[4]->Projection(1);\r
1491 h->SetName("eta_rec_event_track_mult_eff_cont_corrected");\r
1492 aFolderObj->Add(h);\r
1493\r
1494 h = fCorrRecTrackMultHist1[5]->Projection(1);\r
1495 h->SetName("eta_rec_trig_event_track_mult_eff_cont_corrected");\r
1496 aFolderObj->Add(h);\r
1497\r
1498 h = fCorrRecTrackMultHist1[6]->Projection(1);\r
1499 h->SetName("eta_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
1500 aFolderObj->Add(h);\r
1501\r
1502 h = fCorrRecTrackMultHist1[7]->Projection(1);\r
1503 h->SetName("eta_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
1504 aFolderObj->Add(h);\r
1505\r
1506\r
bad4ba69 1507 //\r
1508 // MC available\r
1509 //\r
1510 if(IsUseMCInfo()) {\r
0aaa8b91 1511\r
1512 //\r
1513 h2D = fMCAllPrimTrackMultHist1->Projection(2,0);\r
1514 h2D->SetName("mc_all_pt_mult_acc_prim");\r
1515 aFolderObj->Add(h2D);\r
1516\r
1517 h2D = fMCAllPrimTrackMultHist1->Projection(1,0);\r
1518 h2D->SetName("mc_all_eta_pt_acc_prim");\r
1519 aFolderObj->Add(h2D);\r
1520\r
1521 h2D = fMCNDEventAllPrimTrackMultHist1->Projection(2,0);\r
1522 h2D->SetName("mc_ND_all_pt_mult_acc_prim");\r
1523 aFolderObj->Add(h2D);\r
1524\r
1525 h2D = fMCNDEventAllPrimTrackMultHist1->Projection(1,0);\r
1526 h2D->SetName("mc_ND_all_eta_pt_acc_prim");\r
1527 aFolderObj->Add(h2D);\r
1528\r
1529 h2D = fMCNSDEventAllPrimTrackMultHist1->Projection(2,0);\r
1530 h2D->SetName("mc_NSD_all_pt_mult_acc_prim");\r
1531 aFolderObj->Add(h2D);\r
1532\r
1533 h2D = fMCNSDEventAllPrimTrackMultHist1->Projection(1,0);\r
1534 h2D->SetName("mc_NSD_all_eta_pt_acc_prim");\r
1535 aFolderObj->Add(h2D);\r
1536\r
1537 //\r
1538\r
1539 h = fMCAllPrimTrackMultHist1->Projection(0);\r
1540 h->SetName("mc_all_pt_acc_prim");\r
1541 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1542 hs->SetName("mc_all_pt_acc_prim_s");\r
1543 aFolderObj->Add(hs);\r
1544\r
1545 hsc = (TH1D*)hs->Clone();\r
1546 hsc->SetName("mc_all_pt_acc_prim_s_norm");\r
1547 hsc->Scale(1./fMCAllEventMultHist1->Projection(1)->Integral());\r
1548 aFolderObj->Add(hsc);\r
1549\r
1550 h = fMCNDEventAllPrimTrackMultHist1->Projection(0);\r
1551 h->SetName("mc_ND_all_pt_acc_prim");\r
1552 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1553 hs->SetName("mc_ND_all_pt_acc_prim_s");\r
1554 aFolderObj->Add(hs);\r
1555\r
1556 hsc = (TH1D*)hs->Clone();\r
1557 hsc->SetName("mc_ND_all_pt_acc_prim_s_norm");\r
1558 hsc->Scale(1./fMCAllNDEventMultHist1->Projection(1)->Integral());\r
1559 aFolderObj->Add(hsc);\r
1560\r
1561 h = fMCNSDEventAllPrimTrackMultHist1->Projection(0);\r
1562 h->SetName("mc_NSD_all_pt_acc_prim");\r
1563 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1564 hs->SetName("mc_NSD_all_pt_acc_prim_s");\r
1565 aFolderObj->Add(hs);\r
1566\r
1567 hsc = (TH1D*)hs->Clone();\r
1568 hsc->SetName("mc_NSD_all_pt_acc_prim_s_norm");\r
1569 hsc->Scale(1./fMCAllNSDEventMultHist1->Projection(1)->Integral());\r
1570 aFolderObj->Add(hsc);\r
1571\r
1572 h = fMCTriggerPrimTrackMultHist1->Projection(0);\r
1573 h->SetName("mc_trigger_all_pt_acc_prim");\r
1574 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1575 hs->SetName("mc_trigger_all_pt_acc_prim_s");\r
1576 aFolderObj->Add(hs);\r
1577\r
1578 hsc = (TH1D*)hs->Clone();\r
1579 hsc->SetName("mc_trigger_all_pt_acc_prim_s_norm");\r
1580 hsc->Scale(1./fMCTriggerMultHist1->Projection(1)->Integral());\r
1581 aFolderObj->Add(hsc);\r
1582\r
1583 h = fMCEventPrimTrackMultHist1->Projection(0);\r
1584 h->SetName("mc_all_pt_acc_trig_event_prim");\r
1585 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
1586 hs->SetName("mc_all_pt_acc_trig_event_prim_s");\r
1587 aFolderObj->Add(hs);\r
1588\r
1589 hsc = (TH1D*)hs->Clone();\r
1590 hsc->SetName("mc_all_pt_acc_trig_event_prim_s_norm");\r
1591 hsc->Scale(1./fMCEventMultHist1->Projection(1)->Integral());\r
1592 aFolderObj->Add(hsc);\r
1593\r
1594 //\r
1595\r
1596 h = fMCAllPrimTrackMultHist1->Projection(1);\r
1597 h->SetName("mc_all_eta_acc_prim");\r
1598 aFolderObj->Add(h);\r
1599\r
1600 h = fMCNDEventAllPrimTrackMultHist1->Projection(1);\r
1601 h->SetName("mc_ND_all_eta_acc_prim");\r
1602 aFolderObj->Add(h);\r
1603\r
1604 h = fMCNSDEventAllPrimTrackMultHist1->Projection(1);\r
1605 h->SetName("mc_NSD_all_eta_acc_prim");\r
1606 aFolderObj->Add(h);\r
1607\r
1608 h = fMCTriggerPrimTrackMultHist1->Projection(1);\r
1609 h->SetName("mc_trigger_all_eta_acc_prim");\r
1610 aFolderObj->Add(h);\r
1611\r
1612 h = fMCEventPrimTrackMultHist1->Projection(1);\r
1613 h->SetName("mc_all_eta_acc_trig_event_prim");\r
1614 aFolderObj->Add(h);\r
1615\r
1616 //\r
1617 // calculate ratios (rec / mc)\r
1618 //\r
1619 \r
1620 hs = (TH1*)aFolderObj->FindObject("pt_rec_trig_event_track_mult_eff_cont_corrected_s_norm");\r
1621 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_trig_event_track_mult_eff_cont_corrected"); \r
1622 hsc->Sumw2();\r
1623 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_pt_acc_prim_s_norm"));\r
1624 aFolderObj->Add(hsc);\r
1625\r
1626 hs = (TH1*)aFolderObj->FindObject("eta_rec_trig_event_track_mult_eff_cont_corrected");\r
1627 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_trig_event_track_mult_eff_cont_corrected"); \r
1628 hsc->Sumw2();\r
1629 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_eta_acc_prim"));\r
1630 aFolderObj->Add(hsc);\r
1631\r
1632 //\r
1633 hs = (TH1*)aFolderObj->FindObject("pt_rec_ND_trig_event_track_mult_eff_cont_corrected_s_norm");\r
1634 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_ND_trig_event_track_mult_eff_cont_corrected"); \r
1635 hsc->Sumw2();\r
1636 hsc->Divide((TH1*)aFolderObj->FindObject("mc_ND_all_pt_acc_prim_s_norm"));\r
1637 aFolderObj->Add(hsc);\r
1638\r
1639 hs = (TH1*)aFolderObj->FindObject("eta_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
1640 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_ND_trig_event_track_mult_eff_cont_corrected"); \r
1641 hsc->Sumw2();\r
1642 hsc->Divide((TH1*)aFolderObj->FindObject("mc_ND_all_eta_acc_prim"));\r
1643 aFolderObj->Add(hsc);\r
1644\r
1645 //\r
1646 hs = (TH1*)aFolderObj->FindObject("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm");\r
1647 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_NSD_trig_event_track_mult_eff_cont_corrected"); \r
1648 hsc->Sumw2();\r
1649 hsc->Divide((TH1*)aFolderObj->FindObject("mc_NSD_all_pt_acc_prim_s_norm"));\r
1650 aFolderObj->Add(hsc);\r
1651\r
1652 hs = (TH1*)aFolderObj->FindObject("eta_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
1653 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_NSD_trig_event_track_mult_eff_cont_corrected"); \r
1654 hsc->Sumw2();\r
1655 hsc->Divide((TH1*)aFolderObj->FindObject("mc_NSD_all_eta_acc_prim"));\r
1656 aFolderObj->Add(hsc);\r
1657\r
1658 //\r
1659 hs = (TH1*)aFolderObj->FindObject("pt_rec_event_track_mult_eff_cont_corrected_s_norm");\r
1660 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_event_track_mult_eff_cont_corrected"); \r
1661 hsc->Sumw2();\r
1662 hsc->Divide((TH1*)aFolderObj->FindObject("mc_trigger_all_pt_acc_prim_s_norm"));\r
1663 aFolderObj->Add(hsc);\r
1664\r
1665 hs = (TH1*)aFolderObj->FindObject("eta_rec_event_track_mult_eff_cont_corrected");\r
1666 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_event_track_mult_eff_cont_corrected"); \r
1667 hsc->Sumw2();\r
1668 hsc->Divide((TH1*)aFolderObj->FindObject("mc_trigger_all_eta_acc_prim"));\r
1669 aFolderObj->Add(hsc);\r
1670\r
1671 // track level\r
1672 hs = (TH1*)aFolderObj->FindObject("pt_rec_track_mult_eff_cont_corrected_s_norm");\r
1673 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_track_mult_eff_cont_corrected"); \r
1674 hsc->Sumw2();\r
1675 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_pt_acc_trig_event_prim_s_norm"));\r
1676 aFolderObj->Add(hsc);\r
1677\r
1678 hs = (TH1*)aFolderObj->FindObject("eta_rec_track_mult_eff_cont_corrected");\r
1679 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_track_mult_eff_cont_corrected"); \r
1680 hsc->Sumw2();\r
1681 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_eta_acc_trig_event_prim"));\r
1682 aFolderObj->Add(hsc);\r
1683\r
bad4ba69 1684 } // end MC infor available\r
1685\r
0aaa8b91 1686 // export objects to analysis folder\r
1687 fCorrectionFolder = ExportToFolder(aFolderObj);\r
1688\r
1689 // delete only TObjArray\r
1690 if(aFolderObj) delete aFolderObj;\r
1691}\r
1692\r
1693//_____________________________________________________________________________\r
1694TFolder* AlidNdPtCorrection::ExportToFolder(TObjArray * array) \r
1695{\r
1696 // recreate folder avery time and export objects to new one\r
1697 //\r
1698 AlidNdPtCorrection * comp=this;\r
1699 TFolder *folder = comp->GetCorrectionFolder();\r
1700\r
1701 TString name, title;\r
1702 TFolder *newFolder = 0;\r
1703 Int_t i = 0;\r
1704 Int_t size = array->GetSize();\r
1705\r
1706 if(folder) { \r
1707 // get name and title from old folder\r
1708 name = folder->GetName(); \r
1709 title = folder->GetTitle(); \r
1710\r
1711 // delete old one\r
1712 delete folder;\r
1713\r
1714 // create new one\r
1715 newFolder = CreateFolder(name.Data(),title.Data());\r
1716 newFolder->SetOwner();\r
1717\r
1718 // add objects to folder\r
1719 while(i < size) {\r
1720 newFolder->Add(array->At(i));\r
1721 i++;\r
1722 }\r
1723 }\r
1724\r
1725return newFolder;\r
1726}\r
1727\r
1728//_____________________________________________________________________________\r
1729TFolder* AlidNdPtCorrection::CreateFolder(TString name,TString title) { \r
1730// create folder for analysed histograms\r
1731//\r
1732TFolder *folder = 0;\r
1733 folder = new TFolder(name.Data(),title.Data());\r
1734\r
1735 return folder;\r
1736}\r