run locally the train with all tasks connected
[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
00b81913 15//------------------------------------------------------------------------------\r
16// AlidNdPtCorrection class:\r
17//\r
18// a. functionality:\r
19// - applies corrections on dNdPt spectra\r
20// - fills corrected dNdPt histograms\r
21// - fills correction control histograms \r
22//\r
23// b. data members:\r
24// - dNdPt spectra before and after correction procedure\r
25// - control histograms\r
26// - correction matrices (must be loaded)\r
27// \r
28// Author: J.Otwinowski 04/11/2008 \r
29//------------------------------------------------------------------------------\r
0aaa8b91 30\r
31#include "TFile.h"\r
0aaa8b91 32#include "TH1.h"\r
33#include "TH2.h"\r
34\r
35#include "AliHeader.h" \r
36#include "AliGenEventHeader.h" \r
37#include "AliStack.h" \r
38#include "AliESDEvent.h" \r
39#include "AliMCEvent.h" \r
40#include "AliESDtrackCuts.h" \r
41#include "AliLog.h" \r
15b7cc05 42#include "AliMultiplicity.h"\r
43#include "AliTracker.h"\r
0aaa8b91 44\r
45#include "AlidNdPtEventCuts.h"\r
46#include "AlidNdPtAcceptanceCuts.h"\r
d269b0e6 47#include "AliPhysicsSelection.h"\r
0aaa8b91 48\r
bad4ba69 49#include "AliPWG0Helper.h"\r
50#include "AlidNdPtHelper.h"\r
791aaf54 51#include "AlidNdPtAnalysis.h"\r
0aaa8b91 52#include "AlidNdPtCorrection.h"\r
53\r
54using namespace std;\r
55\r
56ClassImp(AlidNdPtCorrection)\r
57\r
58//_____________________________________________________________________________\r
59//AlidNdPtCorrection::AlidNdPtCorrection(): TNamed(),\r
60 AlidNdPtCorrection::AlidNdPtCorrection(): AlidNdPt(),\r
61 fCorrectionFolder(0),\r
62 fMCEventHist1(0),\r
63 fRecEventHist1(0),\r
3f87610e 64 fRecEventMultHist1(0),\r
0aaa8b91 65 fMCAllEventMultHist1(0),\r
66 fMCAllNDEventMultHist1(0),\r
67 fMCAllNSDEventMultHist1(0),\r
68 fMCTriggerMultHist1(0),\r
69 fMCEventMultHist1(0),\r
70 fMCAllPrimTrackMultHist1(0),\r
71 fMCNDEventAllPrimTrackMultHist1(0),\r
72 fMCNSDEventAllPrimTrackMultHist1(0),\r
73 fMCTriggerPrimTrackMultHist1(0),\r
74 fMCEventPrimTrackMultHist1(0),\r
15b7cc05 75 fMCAllPrimTrackTrueMultHist1(0),\r
76 fMCNDEventAllPrimTrackTrueMultHist1(0),\r
77 fMCNSDEventAllPrimTrackTrueMultHist1(0),\r
78 fMCTriggerPrimTrackTrueMultHist1(0),\r
79 fMCEventPrimTrackTrueMultHist1(0),\r
3f87610e 80 fMCAllPrimTrackTrueMultHist2(0),\r
81 fMCNDEventAllPrimTrackTrueMultHist2(0),\r
82 fMCNSDEventAllPrimTrackTrueMultHist2(0),\r
83 fMCTriggerPrimTrackTrueMultHist2(0),\r
84 fMCEventPrimTrackTrueMultHist2(0),\r
15b7cc05 85 fMCAllPrimTrackMeanPtMult1(0),\r
86 fMCNDEventAllPrimTrackMeanPtMult1(0),\r
87 fMCNSDEventAllPrimTrackMeanPtMult1(0),\r
88 fMCTriggerPrimTrackMeanPtMult1(0),\r
89 fMCEventPrimTrackMeanPtMult1(0),\r
90 fMCAllPrimTrackMeanPtTrueMult1(0),\r
91 fMCNDEventAllPrimTrackMeanPtTrueMult1(0),\r
92 fMCNSDEventAllPrimTrackMeanPtTrueMult1(0),\r
93 fMCTriggerPrimTrackMeanPtTrueMult1(0),\r
94 fMCEventPrimTrackMeanPtTrueMult1(0),\r
0aaa8b91 95 fEventMultCorrelationMatrix(0),\r
96 fZvNorm(0),\r
97 fZvEmptyEventsNorm(0),\r
791aaf54 98 fLHCBin0Background(0),\r
0aaa8b91 99 fCorrTriggerMBtoInelEventMatrix(0),\r
100 fCorrTriggerMBtoNDEventMatrix(0),\r
101 fCorrTriggerMBtoNSDEventMatrix(0),\r
102 fCorrEventMatrix(0),\r
103 fCorrTriggerMBtoInelTrackEventMatrix(0),\r
104 fCorrTriggerMBtoNDTrackEventMatrix(0),\r
105 fCorrTriggerMBtoNSDTrackEventMatrix(0),\r
106 fCorrTrackEventMatrix(0),\r
107 fCorrTrackMatrix(0),\r
15b7cc05 108 fCorrHighPtTrackMatrix(0),\r
0aaa8b91 109 fContTrackMatrix(0),\r
110 fContMultTrackMatrix(0),\r
d269b0e6 111 fCorrMatrixFileName(""),\r
17e8c701 112 fCosmicsHisto(0),\r
113 fEventCount(0)\r
0aaa8b91 114{\r
115 // default constructor\r
116 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
117 fRecTrackHist1[i]=0; \r
118 }\r
119\r
120 for(Int_t i=0; i<8; i++) { \r
121 fCorrRecTrackMultHist1[i] = 0;\r
15b7cc05 122 fCorrRecTrackTrueMultHist1[i] = 0;\r
3f87610e 123 fCorrRecTrackTrueMultHist2[i] = 0;\r
15b7cc05 124 fCorrRecTrackMeanPtMultHist1[i] = 0;\r
125 fCorrRecTrackMeanPtTrueMultHist1[i] = 0;\r
126 fCorrRecTrackPt1[i] = 0;\r
0aaa8b91 127 }\r
128\r
129 for(Int_t i=0; i<5; i++) { \r
130 fCorrRecEventHist1[i] = 0;\r
131 fCorrRecEventHist2[i] = 0;\r
132 }\r
133\r
134 Init();\r
135}\r
136\r
137//_____________________________________________________________________________\r
138AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corrMatrixFileName): AlidNdPt(name,title),\r
139 fCorrectionFolder(0),\r
140 fMCEventHist1(0),\r
141 fRecEventHist1(0),\r
3f87610e 142 fRecEventMultHist1(0),\r
0aaa8b91 143 fMCAllEventMultHist1(0),\r
144 fMCAllNDEventMultHist1(0),\r
145 fMCAllNSDEventMultHist1(0),\r
146 fMCTriggerMultHist1(0),\r
147 fMCEventMultHist1(0),\r
148 fMCAllPrimTrackMultHist1(0),\r
149 fMCNDEventAllPrimTrackMultHist1(0),\r
150 fMCNSDEventAllPrimTrackMultHist1(0),\r
151 fMCTriggerPrimTrackMultHist1(0),\r
152 fMCEventPrimTrackMultHist1(0),\r
15b7cc05 153 fMCAllPrimTrackTrueMultHist1(0),\r
154 fMCNDEventAllPrimTrackTrueMultHist1(0),\r
155 fMCNSDEventAllPrimTrackTrueMultHist1(0),\r
156 fMCTriggerPrimTrackTrueMultHist1(0),\r
157 fMCEventPrimTrackTrueMultHist1(0),\r
3f87610e 158 fMCAllPrimTrackTrueMultHist2(0),\r
159 fMCNDEventAllPrimTrackTrueMultHist2(0),\r
160 fMCNSDEventAllPrimTrackTrueMultHist2(0),\r
161 fMCTriggerPrimTrackTrueMultHist2(0),\r
162 fMCEventPrimTrackTrueMultHist2(0),\r
15b7cc05 163 fMCAllPrimTrackMeanPtMult1(0),\r
164 fMCNDEventAllPrimTrackMeanPtMult1(0),\r
165 fMCNSDEventAllPrimTrackMeanPtMult1(0),\r
166 fMCTriggerPrimTrackMeanPtMult1(0),\r
167 fMCEventPrimTrackMeanPtMult1(0),\r
168 fMCAllPrimTrackMeanPtTrueMult1(0),\r
169 fMCNDEventAllPrimTrackMeanPtTrueMult1(0),\r
170 fMCNSDEventAllPrimTrackMeanPtTrueMult1(0),\r
171 fMCTriggerPrimTrackMeanPtTrueMult1(0),\r
172 fMCEventPrimTrackMeanPtTrueMult1(0),\r
0aaa8b91 173 fEventMultCorrelationMatrix(0),\r
174 fZvNorm(0),\r
175 fZvEmptyEventsNorm(0),\r
791aaf54 176 fLHCBin0Background(0),\r
0aaa8b91 177 fCorrTriggerMBtoInelEventMatrix(0),\r
178 fCorrTriggerMBtoNDEventMatrix(0),\r
179 fCorrTriggerMBtoNSDEventMatrix(0),\r
180 fCorrEventMatrix(0),\r
181 fCorrTriggerMBtoInelTrackEventMatrix(0),\r
182 fCorrTriggerMBtoNDTrackEventMatrix(0),\r
183 fCorrTriggerMBtoNSDTrackEventMatrix(0),\r
184 fCorrTrackEventMatrix(0),\r
185 fCorrTrackMatrix(0),\r
15b7cc05 186 fCorrHighPtTrackMatrix(0),\r
0aaa8b91 187 fContTrackMatrix(0),\r
188 fContMultTrackMatrix(0),\r
d269b0e6 189 fCorrMatrixFileName(corrMatrixFileName),\r
17e8c701 190 fCosmicsHisto(0),\r
191 fEventCount(0)\r
0aaa8b91 192{\r
193 // constructor\r
194 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
195 fRecTrackHist1[i]=0; \r
196 }\r
197\r
198 for(Int_t i=0; i<8; i++) { \r
199 fCorrRecTrackMultHist1[i] = 0;\r
15b7cc05 200 fCorrRecTrackTrueMultHist1[i] = 0;\r
3f87610e 201 fCorrRecTrackTrueMultHist2[i] = 0;\r
15b7cc05 202 fCorrRecTrackMeanPtMultHist1[i] = 0;\r
203 fCorrRecTrackMeanPtTrueMultHist1[i] = 0;\r
204 fCorrRecTrackPt1[i] = 0;\r
0aaa8b91 205 }\r
206\r
207 for(Int_t i=0; i<5; i++) { \r
208 fCorrRecEventHist1[i] = 0;\r
209 fCorrRecEventHist2[i] = 0;\r
210 }\r
211\r
212 Init();\r
213}\r
214\r
215//_____________________________________________________________________________\r
216AlidNdPtCorrection::~AlidNdPtCorrection() {\r
217 // \r
218 // destructor\r
219 //\r
220 if(fMCEventHist1) delete fMCEventHist1; fMCEventHist1=0;\r
221 if(fRecEventHist1) delete fRecEventHist1; fRecEventHist1=0;\r
3f87610e 222 if(fRecEventMultHist1) delete fRecEventMultHist1; fRecEventMultHist1=0;\r
0aaa8b91 223\r
224 if(fMCAllEventMultHist1) delete fMCAllEventMultHist1; fMCAllEventMultHist1=0;\r
225 if(fMCAllNDEventMultHist1) delete fMCAllNDEventMultHist1; fMCAllNDEventMultHist1=0;\r
226 if(fMCAllNSDEventMultHist1) delete fMCAllNSDEventMultHist1; fMCAllNSDEventMultHist1=0;\r
227 if(fMCTriggerMultHist1) delete fMCTriggerMultHist1; fMCTriggerMultHist1=0;\r
228 if(fMCEventMultHist1) delete fMCEventMultHist1; fMCEventMultHist1=0;\r
229\r
230 if(fMCAllPrimTrackMultHist1) delete fMCAllPrimTrackMultHist1; fMCAllPrimTrackMultHist1=0;\r
231 if(fMCNDEventAllPrimTrackMultHist1) delete fMCNDEventAllPrimTrackMultHist1; fMCNDEventAllPrimTrackMultHist1=0;\r
232 if(fMCNSDEventAllPrimTrackMultHist1) delete fMCNSDEventAllPrimTrackMultHist1; fMCNSDEventAllPrimTrackMultHist1=0;\r
233 if(fMCTriggerPrimTrackMultHist1) delete fMCTriggerPrimTrackMultHist1; fMCTriggerPrimTrackMultHist1=0;\r
234 if(fMCEventPrimTrackMultHist1) delete fMCEventPrimTrackMultHist1; fMCEventPrimTrackMultHist1=0;\r
15b7cc05 235\r
236 if(fMCAllPrimTrackTrueMultHist1) delete fMCAllPrimTrackTrueMultHist1; fMCAllPrimTrackTrueMultHist1=0;\r
237 if(fMCNDEventAllPrimTrackTrueMultHist1) delete fMCNDEventAllPrimTrackTrueMultHist1; fMCNDEventAllPrimTrackTrueMultHist1=0;\r
238 if(fMCNSDEventAllPrimTrackTrueMultHist1) delete fMCNSDEventAllPrimTrackTrueMultHist1; fMCNSDEventAllPrimTrackTrueMultHist1=0;\r
239 if(fMCTriggerPrimTrackTrueMultHist1) delete fMCTriggerPrimTrackTrueMultHist1; fMCTriggerPrimTrackTrueMultHist1=0;\r
240 if(fMCEventPrimTrackTrueMultHist1) delete fMCEventPrimTrackTrueMultHist1; fMCEventPrimTrackTrueMultHist1=0;\r
241\r
3f87610e 242 if(fMCAllPrimTrackTrueMultHist2) delete fMCAllPrimTrackTrueMultHist2; fMCAllPrimTrackTrueMultHist2=0;\r
243 if(fMCNDEventAllPrimTrackTrueMultHist2) delete fMCNDEventAllPrimTrackTrueMultHist2; fMCNDEventAllPrimTrackTrueMultHist2=0;\r
244 if(fMCNSDEventAllPrimTrackTrueMultHist2) delete fMCNSDEventAllPrimTrackTrueMultHist2; fMCNSDEventAllPrimTrackTrueMultHist2=0;\r
245 if(fMCTriggerPrimTrackTrueMultHist2) delete fMCTriggerPrimTrackTrueMultHist2; fMCTriggerPrimTrackTrueMultHist2=0;\r
246 if(fMCEventPrimTrackTrueMultHist2) delete fMCEventPrimTrackTrueMultHist2; fMCEventPrimTrackTrueMultHist2=0;\r
247\r
248\r
249\r
250\r
15b7cc05 251 if(fMCAllPrimTrackMeanPtMult1) delete fMCAllPrimTrackMeanPtMult1; fMCAllPrimTrackMeanPtMult1=0;\r
252 if(fMCNDEventAllPrimTrackMeanPtMult1) delete fMCNDEventAllPrimTrackMeanPtMult1; fMCNDEventAllPrimTrackMeanPtMult1=0;\r
253 if(fMCNSDEventAllPrimTrackMeanPtMult1) delete fMCNSDEventAllPrimTrackMeanPtMult1; fMCNSDEventAllPrimTrackMeanPtMult1=0;\r
254 if(fMCTriggerPrimTrackMeanPtMult1) delete fMCTriggerPrimTrackMeanPtMult1; fMCTriggerPrimTrackMeanPtMult1=0;\r
255 if(fMCEventPrimTrackMeanPtMult1) delete fMCEventPrimTrackMeanPtMult1; fMCEventPrimTrackMeanPtMult1=0;\r
256\r
257 if(fMCAllPrimTrackMeanPtTrueMult1) delete fMCAllPrimTrackMeanPtTrueMult1; fMCAllPrimTrackMeanPtTrueMult1=0;\r
258 if(fMCNDEventAllPrimTrackMeanPtTrueMult1) delete fMCNDEventAllPrimTrackMeanPtTrueMult1; fMCNDEventAllPrimTrackMeanPtTrueMult1=0;\r
259 if(fMCNSDEventAllPrimTrackMeanPtTrueMult1) delete fMCNSDEventAllPrimTrackMeanPtTrueMult1; fMCNSDEventAllPrimTrackMeanPtTrueMult1=0;\r
260 if(fMCTriggerPrimTrackMeanPtTrueMult1) delete fMCTriggerPrimTrackMeanPtTrueMult1; fMCTriggerPrimTrackMeanPtTrueMult1=0;\r
261 if(fMCEventPrimTrackMeanPtTrueMult1) delete fMCEventPrimTrackMeanPtTrueMult1; fMCEventPrimTrackMeanPtTrueMult1=0;\r
262\r
d269b0e6 263 if(fCosmicsHisto) delete fCosmicsHisto; fCosmicsHisto=0;\r
17e8c701 264 if(fEventCount) delete fEventCount; fEventCount=0;\r
0aaa8b91 265\r
266 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
267 if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
268 }\r
269\r
270 for(Int_t i=0; i<8; i++) { \r
271 if(fCorrRecTrackMultHist1[i]) delete fCorrRecTrackMultHist1[i]; fCorrRecTrackMultHist1[i]=0;\r
15b7cc05 272 if(fCorrRecTrackTrueMultHist1[i]) delete fCorrRecTrackTrueMultHist1[i]; fCorrRecTrackTrueMultHist1[i]=0;\r
3f87610e 273 if(fCorrRecTrackTrueMultHist2[i]) delete fCorrRecTrackTrueMultHist2[i]; fCorrRecTrackTrueMultHist2[i]=0;\r
15b7cc05 274 if(fCorrRecTrackMeanPtMultHist1[i]) delete fCorrRecTrackMeanPtMultHist1[i]; fCorrRecTrackMeanPtMultHist1[i]=0;\r
275 if(fCorrRecTrackMeanPtTrueMultHist1[i]) delete fCorrRecTrackMeanPtTrueMultHist1[i]; fCorrRecTrackMeanPtTrueMultHist1[i]=0;\r
276 if(fCorrRecTrackPt1[i]) delete fCorrRecTrackPt1[i]; fCorrRecTrackPt1[i]=0;\r
0aaa8b91 277 }\r
278\r
279 for(Int_t i=0; i<5; i++) { \r
280 if(fCorrRecEventHist1[i]) delete fCorrRecEventHist1[i]; fCorrRecEventHist1[i]=0;\r
281 if(fCorrRecEventHist2[i]) delete fCorrRecEventHist2[i]; fCorrRecEventHist2[i]=0;\r
282 }\r
283\r
284 if(fCorrectionFolder) delete fCorrectionFolder; fCorrectionFolder=0;\r
0aaa8b91 285}\r
286\r
287//_____________________________________________________________________________\r
288void AlidNdPtCorrection::Init(){\r
289 //\r
290 // Init histograms\r
291 //\r
292 const Int_t etaNbins = 30; \r
293 const Int_t zvNbins = 12;\r
294\r
295 // UA1 bining\r
296 //const Int_t ptNbins = 52; \r
297 //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
298\r
791aaf54 299 /*\r
0aaa8b91 300 const Int_t ptNbins = 56; \r
301 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
302 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
303 Double_t binsZv[zvNbins+1] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
791aaf54 304 */\r
305\r
306 const Int_t ptNbins = 55; \r
307 Double_t binsPt[ptNbins+1] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0};\r
308 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
309 Double_t binsZv[zvNbins+1] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
0aaa8b91 310\r
0aaa8b91 311\r
312 //\r
313 Int_t binsMCEventHist1[3]={100,100,140};\r
314 Double_t minMCEventHist1[3]={-0.1,-0.1,-35.}; \r
315 Double_t maxMCEventHist1[3]={0.1,0.1,35.}; \r
316 fMCEventHist1 = new THnSparseF("fMCEventHist1","mcXv:mcYv:mcZv",3,binsMCEventHist1,minMCEventHist1,maxMCEventHist1);\r
317 fMCEventHist1->GetAxis(0)->SetTitle("mcXv (cm)");\r
318 fMCEventHist1->GetAxis(1)->SetTitle("mcYv (cm)");\r
319 fMCEventHist1->GetAxis(2)->SetTitle("mcZv (cm)");\r
320 fMCEventHist1->Sumw2();\r
321\r
322 //\r
323 Int_t binsRecEventHist1[3]={100,100,140};\r
324 Double_t minRecEventHist1[3]={-3.,-3.,-35.}; \r
325 Double_t maxRecEventHist1[3]={3.,3.,35.}; \r
326 fRecEventHist1 = new THnSparseF("fRecEventHist1","Xv:Yv:Zv",3,binsRecEventHist1,minRecEventHist1,maxRecEventHist1);\r
327 fRecEventHist1->GetAxis(0)->SetTitle("Xv (cm)");\r
328 fRecEventHist1->GetAxis(1)->SetTitle("Yv (cm)");\r
329 fRecEventHist1->GetAxis(2)->SetTitle("Zv (cm)");\r
330 fRecEventHist1->Sumw2();\r
331\r
332 //\r
3f87610e 333 Int_t binsRecEventMultHist1[2]={150,150};\r
334 Double_t minRecEventMultHist1[2]={-0.5,-0.5}; \r
335 Double_t maxRecEventMultHist1[2]={149.5,149.5}; \r
336 fRecEventMultHist1 = new THnSparseF("fRecEventMultHist1","track multiplicity:tracklet multiplicity",2,binsRecEventMultHist1,minRecEventMultHist1,maxRecEventMultHist1);\r
337 fRecEventMultHist1->GetAxis(0)->SetTitle("track_mult");\r
338 fRecEventMultHist1->GetAxis(1)->SetTitle("tracklet_mult");\r
339 fRecEventMultHist1->Sumw2();\r
340\r
341 //\r
0aaa8b91 342 char name[256];\r
343 char title[256];\r
344\r
345 Int_t binsMCAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
346 Double_t minMCAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
347 Double_t maxMCAllPrimTrackMultHist1[3]={20.,1.,149.5}; \r
348 sprintf(name,"fMCAllPrimTrackMultHist1");\r
349 sprintf(title,"mcPt:mcEta:multiplicity");\r
350 \r
351 fMCAllPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCAllPrimTrackMultHist1,minMCAllPrimTrackMultHist1,maxMCAllPrimTrackMultHist1);\r
352 fMCAllPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
353 fMCAllPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
354 fMCAllPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
355 fMCAllPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
356 fMCAllPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
357 fMCAllPrimTrackMultHist1->Sumw2();\r
358\r
359 Int_t binsMCNDEventAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
360 Double_t minMCNDEventAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
361 Double_t maxMCNDEventAllPrimTrackMultHist1[3]={20.,1.,149.5}; \r
362 sprintf(name,"fMCNDEventAllPrimTrackMultHist1");\r
363 sprintf(title,"mcPt:mcEta:multiplicity");\r
364 \r
365 fMCNDEventAllPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCNDEventAllPrimTrackMultHist1,minMCNDEventAllPrimTrackMultHist1,maxMCNDEventAllPrimTrackMultHist1);\r
366 fMCNDEventAllPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
367 fMCNDEventAllPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
368 fMCNDEventAllPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
369 fMCNDEventAllPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
370 fMCNDEventAllPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
371 fMCNDEventAllPrimTrackMultHist1->Sumw2();\r
372\r
373 Int_t binsMCNSDEventAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
374 Double_t minMCNSDEventAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
15b7cc05 375 Double_t maxMCNSDEventAllPrimTrackMultHist1[3]={20.,1.,149.5}; \r
0aaa8b91 376 sprintf(name,"fMCNSDEventAllPrimTrackMultHist1");\r
377 sprintf(title,"mcPt:mcEta:multiplicity");\r
378 \r
379 fMCNSDEventAllPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCNSDEventAllPrimTrackMultHist1,minMCNSDEventAllPrimTrackMultHist1,maxMCNSDEventAllPrimTrackMultHist1);\r
380 fMCNSDEventAllPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
381 fMCNSDEventAllPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
382 fMCNSDEventAllPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
383 fMCNSDEventAllPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
384 fMCNSDEventAllPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
385 fMCNSDEventAllPrimTrackMultHist1->Sumw2();\r
386\r
387 Int_t binsMCEventTriggerPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
388 Double_t minMCEventTriggerPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
389 Double_t maxMCEventTriggerPrimTrackMultHist1[3]={20.,1.,149.5}; \r
390 sprintf(name,"fMCTriggerPrimTrackMultHist1");\r
391 sprintf(title,"mcPt:mcEta:multiplicity");\r
392 \r
393 fMCTriggerPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCEventTriggerPrimTrackMultHist1,minMCEventTriggerPrimTrackMultHist1,maxMCEventTriggerPrimTrackMultHist1);\r
394 fMCTriggerPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
395 fMCTriggerPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
396 fMCTriggerPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
397 fMCTriggerPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
398 fMCTriggerPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
399 fMCTriggerPrimTrackMultHist1->Sumw2();\r
400\r
401 Int_t binsMCEventPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
402 Double_t minMCEventPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
403 Double_t maxMCEventPrimTrackMultHist1[3]={20.,1.,149.5}; \r
404 sprintf(name,"fMCEventPrimTrackMultHist1");\r
405 sprintf(title,"mcPt:mcEta:multiplicity");\r
406 \r
407 fMCEventPrimTrackMultHist1 = new THnSparseF(name,title,3,binsMCEventPrimTrackMultHist1,minMCEventPrimTrackMultHist1,maxMCEventPrimTrackMultHist1);\r
408 fMCEventPrimTrackMultHist1->SetBinEdges(0,binsPt);\r
409 fMCEventPrimTrackMultHist1->SetBinEdges(1,binsEta);\r
410 fMCEventPrimTrackMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
411 fMCEventPrimTrackMultHist1->GetAxis(1)->SetTitle("mcEta");\r
412 fMCEventPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
413 fMCEventPrimTrackMultHist1->Sumw2();\r
414\r
15b7cc05 415 //\r
416 // true multiplicity\r
417 //\r
418\r
419 Int_t binsMCAllPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
420 Double_t minMCAllPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
421 Double_t maxMCAllPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
422 sprintf(name,"fMCAllPrimTrackTrueMultHist1");\r
423 sprintf(title,"mcPt:mcEta:true_mult");\r
424 \r
425 fMCAllPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCAllPrimTrackTrueMultHist1,minMCAllPrimTrackTrueMultHist1,maxMCAllPrimTrackTrueMultHist1);\r
426 fMCAllPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
427 fMCAllPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
428 fMCAllPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
429 fMCAllPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
430 fMCAllPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
431 fMCAllPrimTrackTrueMultHist1->Sumw2();\r
432\r
433 Int_t binsMCNDEventAllPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
434 Double_t minMCNDEventAllPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
435 Double_t maxMCNDEventAllPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
436 sprintf(name,"fMCNDEventAllPrimTrackTrueMultHist1");\r
437 sprintf(title,"mcPt:mcEta:true_mult");\r
438 \r
439 fMCNDEventAllPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCNDEventAllPrimTrackTrueMultHist1,minMCNDEventAllPrimTrackTrueMultHist1,maxMCNDEventAllPrimTrackTrueMultHist1);\r
440 fMCNDEventAllPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
441 fMCNDEventAllPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
442 fMCNDEventAllPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
443 fMCNDEventAllPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
444 fMCNDEventAllPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
445 fMCNDEventAllPrimTrackTrueMultHist1->Sumw2();\r
446\r
447 Int_t binsMCNSDEventAllPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
448 Double_t minMCNSDEventAllPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
449 Double_t maxMCNSDEventAllPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
450 sprintf(name,"fMCNSDEventAllPrimTrackTrueMultHist1");\r
451 sprintf(title,"mcPt:mcEta:true_mult");\r
452 \r
453 fMCNSDEventAllPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCNSDEventAllPrimTrackTrueMultHist1,minMCNSDEventAllPrimTrackTrueMultHist1,maxMCNSDEventAllPrimTrackTrueMultHist1);\r
454 fMCNSDEventAllPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
455 fMCNSDEventAllPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
456 fMCNSDEventAllPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
457 fMCNSDEventAllPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
458 fMCNSDEventAllPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
459 fMCNSDEventAllPrimTrackTrueMultHist1->Sumw2();\r
460\r
461 Int_t binsMCEventTriggerPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
462 Double_t minMCEventTriggerPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
463 Double_t maxMCEventTriggerPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
464 sprintf(name,"fMCTriggerPrimTrackTrueMultHist1");\r
465 sprintf(title,"mcPt:mcEta:true_mult");\r
466 \r
467 fMCTriggerPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCEventTriggerPrimTrackTrueMultHist1,minMCEventTriggerPrimTrackTrueMultHist1,maxMCEventTriggerPrimTrackTrueMultHist1);\r
468 fMCTriggerPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
469 fMCTriggerPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
470 fMCTriggerPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
471 fMCTriggerPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
472 fMCTriggerPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
473 fMCTriggerPrimTrackTrueMultHist1->Sumw2();\r
474\r
475 Int_t binsMCEventPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
476 Double_t minMCEventPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
477 Double_t maxMCEventPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
478 sprintf(name,"fMCEventPrimTrackTrueMultHist1");\r
479 sprintf(title,"mcPt:mcEta:true_mult");\r
480 \r
481 fMCEventPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCEventPrimTrackTrueMultHist1,minMCEventPrimTrackTrueMultHist1,maxMCEventPrimTrackTrueMultHist1);\r
482 fMCEventPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
483 fMCEventPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
484 fMCEventPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
485 fMCEventPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
486 fMCEventPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
487 fMCEventPrimTrackTrueMultHist1->Sumw2();\r
488\r
489 //\r
3f87610e 490 // mcPT vs multiplicity vs true multiplicity\r
491 //\r
492\r
493 Int_t binsMCAllPrimTrackTrueMultHist2[3]={ptNbins,150,150};\r
494 Double_t minMCAllPrimTrackTrueMultHist2[3]={0.,-0.5,-0.5}; \r
495 Double_t maxMCAllPrimTrackTrueMultHist2[3]={20.,149.5,149.5}; \r
496 sprintf(name,"fMCAllPrimTrackTrueMultHist2");\r
497 sprintf(title,"mcPt:mult:true_mult");\r
498 \r
499 fMCAllPrimTrackTrueMultHist2 = new THnSparseF(name,title,3,binsMCAllPrimTrackTrueMultHist2,minMCAllPrimTrackTrueMultHist2,maxMCAllPrimTrackTrueMultHist2);\r
500 fMCAllPrimTrackTrueMultHist2->SetBinEdges(0,binsPt);\r
501 fMCAllPrimTrackTrueMultHist2->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
502 fMCAllPrimTrackTrueMultHist2->GetAxis(1)->SetTitle("mult");\r
503 fMCAllPrimTrackTrueMultHist2->GetAxis(2)->SetTitle("true_mult");\r
504 fMCAllPrimTrackTrueMultHist2->Sumw2();\r
505\r
506 Int_t binsMCNDEventAllPrimTrackTrueMultHist2[3]={ptNbins,150,150};\r
507 Double_t minMCNDEventAllPrimTrackTrueMultHist2[3]={0.,-0.5,-0.5}; \r
508 Double_t maxMCNDEventAllPrimTrackTrueMultHist2[3]={20.,149.5,149.5}; \r
509 sprintf(name,"fMCNDEventAllPrimTrackTrueMultHist2");\r
510 sprintf(title,"mcPt:mult:true_mult");\r
511 \r
512 fMCNDEventAllPrimTrackTrueMultHist2 = new THnSparseF(name,title,3,binsMCNDEventAllPrimTrackTrueMultHist2,minMCNDEventAllPrimTrackTrueMultHist2,maxMCNDEventAllPrimTrackTrueMultHist2);\r
513 fMCNDEventAllPrimTrackTrueMultHist2->SetBinEdges(0,binsPt);\r
514 fMCNDEventAllPrimTrackTrueMultHist2->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
515 fMCNDEventAllPrimTrackTrueMultHist2->GetAxis(1)->SetTitle("mult");\r
516 fMCNDEventAllPrimTrackTrueMultHist2->GetAxis(2)->SetTitle("true_mult");\r
517 fMCNDEventAllPrimTrackTrueMultHist2->Sumw2();\r
518\r
519 Int_t binsMCNSDEventAllPrimTrackTrueMultHist2[3]={ptNbins,150,150};\r
520 Double_t minMCNSDEventAllPrimTrackTrueMultHist2[3]={0.,-0.5,-0.5}; \r
521 Double_t maxMCNSDEventAllPrimTrackTrueMultHist2[3]={20.,149.5,149.5}; \r
522 sprintf(name,"fMCNSDEventAllPrimTrackTrueMultHist2");\r
523 sprintf(title,"mcPt:mult:true_mult");\r
524 \r
525 fMCNSDEventAllPrimTrackTrueMultHist2 = new THnSparseF(name,title,3,binsMCNSDEventAllPrimTrackTrueMultHist2,minMCNSDEventAllPrimTrackTrueMultHist2,maxMCNSDEventAllPrimTrackTrueMultHist2);\r
526 fMCNSDEventAllPrimTrackTrueMultHist2->SetBinEdges(0,binsPt);\r
527 fMCNSDEventAllPrimTrackTrueMultHist2->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
528 fMCNSDEventAllPrimTrackTrueMultHist2->GetAxis(1)->SetTitle("mult");\r
529 fMCNSDEventAllPrimTrackTrueMultHist2->GetAxis(2)->SetTitle("true_mult");\r
530 fMCNSDEventAllPrimTrackTrueMultHist2->Sumw2();\r
531\r
532 Int_t binsMCEventTriggerPrimTrackTrueMultHist2[3]={ptNbins,150,150};\r
533 Double_t minMCEventTriggerPrimTrackTrueMultHist2[3]={0.,-0.5,-0.5}; \r
534 Double_t maxMCEventTriggerPrimTrackTrueMultHist2[3]={20.,149.5,149.5}; \r
535 sprintf(name,"fMCTriggerPrimTrackTrueMultHist2");\r
536 sprintf(title,"mcPt:mult:true_mult");\r
537 \r
538 fMCTriggerPrimTrackTrueMultHist2 = new THnSparseF(name,title,3,binsMCEventTriggerPrimTrackTrueMultHist2,minMCEventTriggerPrimTrackTrueMultHist2,maxMCEventTriggerPrimTrackTrueMultHist2);\r
539 fMCTriggerPrimTrackTrueMultHist2->SetBinEdges(0,binsPt);\r
540 fMCTriggerPrimTrackTrueMultHist2->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
541 fMCTriggerPrimTrackTrueMultHist2->GetAxis(1)->SetTitle("mult");\r
542 fMCTriggerPrimTrackTrueMultHist2->GetAxis(2)->SetTitle("true_mult");\r
543 fMCTriggerPrimTrackTrueMultHist2->Sumw2();\r
544\r
545 Int_t binsMCEventPrimTrackTrueMultHist2[3]={ptNbins,150,150};\r
546 Double_t minMCEventPrimTrackTrueMultHist2[3]={0.,-0.5,-0.5}; \r
547 Double_t maxMCEventPrimTrackTrueMultHist2[3]={20.,149.5,149.5}; \r
548 sprintf(name,"fMCEventPrimTrackTrueMultHist2");\r
549 sprintf(title,"mcPt:mult:true_mult");\r
550 \r
551 fMCEventPrimTrackTrueMultHist2 = new THnSparseF(name,title,3,binsMCEventPrimTrackTrueMultHist2,minMCEventPrimTrackTrueMultHist2,maxMCEventPrimTrackTrueMultHist2);\r
552 fMCEventPrimTrackTrueMultHist2->SetBinEdges(0,binsPt);\r
553 fMCEventPrimTrackTrueMultHist2->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
554 fMCEventPrimTrackTrueMultHist2->GetAxis(1)->SetTitle("mult");\r
555 fMCEventPrimTrackTrueMultHist2->GetAxis(2)->SetTitle("true_mult");\r
556 fMCEventPrimTrackTrueMultHist2->Sumw2();\r
557\r
558\r
559 //\r
15b7cc05 560 // mean pt\r
561 //\r
562 Int_t binsMCAllPrimTrackMeanPtTrueMult1[2]={100,150};\r
563 Double_t minMCAllPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
564 Double_t maxMCAllPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
565 sprintf(name,"fMCAllPrimTrackMeanPtTrueMult1");\r
566 sprintf(title,"event <mcPt>:true_mult");\r
567 \r
568 fMCAllPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCAllPrimTrackMeanPtTrueMult1,minMCAllPrimTrackMeanPtTrueMult1,maxMCAllPrimTrackMeanPtTrueMult1);\r
569 fMCAllPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
570 fMCAllPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
571 fMCAllPrimTrackMeanPtTrueMult1->Sumw2();\r
572\r
573 Int_t binsMCAllPrimTrackMeanPtMult1[2]={100,150};\r
574 Double_t minMCAllPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
575 Double_t maxMCAllPrimTrackMeanPtMult1[2]={10.,149.5}; \r
576 sprintf(name,"fMCAllPrimTrackMeanPtMult1");\r
577 sprintf(title,"event <mcPt>:mult");\r
578 \r
579 fMCAllPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCAllPrimTrackMeanPtMult1,minMCAllPrimTrackMeanPtMult1,maxMCAllPrimTrackMeanPtMult1);\r
580 fMCAllPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
581 fMCAllPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
582 fMCAllPrimTrackMeanPtMult1->Sumw2();\r
583\r
584 //\r
585 Int_t binsMCNDEventAllPrimTrackMeanPtTrueMult1[2]={100,150};\r
586 Double_t minMCNDEventAllPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
587 Double_t maxMCNDEventAllPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
588 sprintf(name,"fMCNDEventAllPrimTrackMeanPtTrueMult1");\r
589 sprintf(title,"event <mcPt>:true_mult");\r
590 \r
591 fMCNDEventAllPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCNDEventAllPrimTrackMeanPtTrueMult1,minMCNDEventAllPrimTrackMeanPtTrueMult1,maxMCNDEventAllPrimTrackMeanPtTrueMult1);\r
592 fMCNDEventAllPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
593 fMCNDEventAllPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
594 fMCNDEventAllPrimTrackMeanPtTrueMult1->Sumw2();\r
595\r
596 Int_t binsMCNDEventAllPrimTrackMeanPtMult1[2]={100,150};\r
597 Double_t minMCNDEventAllPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
598 Double_t maxMCNDEventAllPrimTrackMeanPtMult1[2]={10.,149.5}; \r
599 sprintf(name,"fMCNDEventAllPrimTrackMeanPtMult1");\r
600 sprintf(title,"event <mcPt>:mult");\r
601 \r
602 fMCNDEventAllPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCNDEventAllPrimTrackMeanPtMult1,minMCNDEventAllPrimTrackMeanPtMult1,maxMCNDEventAllPrimTrackMeanPtMult1);\r
603 fMCNDEventAllPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
604 fMCNDEventAllPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
605 fMCNDEventAllPrimTrackMeanPtMult1->Sumw2();\r
606\r
607 //\r
608 Int_t binsMCNSDEventAllPrimTrackMeanPtTrueMult1[2]={100,150};\r
609 Double_t minMCNSDEventAllPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
610 Double_t maxMCNSDEventAllPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
611 sprintf(name,"fMCNSDEventAllPrimTrackMeanPtTrueMult1");\r
612 sprintf(title,"event <mcPt>:true_mult");\r
613 \r
614 fMCNSDEventAllPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCNSDEventAllPrimTrackMeanPtTrueMult1,minMCNSDEventAllPrimTrackMeanPtTrueMult1,maxMCNSDEventAllPrimTrackMeanPtTrueMult1);\r
615 fMCNSDEventAllPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
616 fMCNSDEventAllPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
617 fMCNSDEventAllPrimTrackMeanPtTrueMult1->Sumw2();\r
618\r
619 Int_t binsMCNSDEventAllPrimTrackMeanPtMult1[2]={100,150};\r
620 Double_t minMCNSDEventAllPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
621 Double_t maxMCNSDEventAllPrimTrackMeanPtMult1[2]={10.,149.5}; \r
622 sprintf(name,"fMCNSDEventAllPrimTrackMeanPtMult1");\r
623 sprintf(title,"event <mcPt>:mult");\r
624 \r
625 fMCNSDEventAllPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCNSDEventAllPrimTrackMeanPtMult1,minMCNSDEventAllPrimTrackMeanPtMult1,maxMCNSDEventAllPrimTrackMeanPtMult1);\r
626 fMCNSDEventAllPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
627 fMCNSDEventAllPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
628 fMCNSDEventAllPrimTrackMeanPtMult1->Sumw2();\r
629\r
630 //\r
631 Int_t binsMCTriggerPrimTrackMeanPtTrueMult1[2]={100,150};\r
632 Double_t minMCTriggerPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
633 Double_t maxMCTriggerPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
634 sprintf(name,"fMCTriggerPrimTrackMeanPtTrueMult1");\r
635 sprintf(title,"event <mcPt>:true_mult");\r
636 \r
637 fMCTriggerPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCTriggerPrimTrackMeanPtTrueMult1,minMCTriggerPrimTrackMeanPtTrueMult1,maxMCTriggerPrimTrackMeanPtTrueMult1);\r
638 fMCTriggerPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
639 fMCTriggerPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
640 fMCTriggerPrimTrackMeanPtTrueMult1->Sumw2();\r
641\r
642 Int_t binsMCTriggerPrimTrackMeanPtMult1[2]={100,150};\r
643 Double_t minMCTriggerPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
644 Double_t maxMCTriggerPrimTrackMeanPtMult1[2]={10.,149.5}; \r
645 sprintf(name,"fMCTriggerPrimTrackMeanPtMult1");\r
646 sprintf(title,"event <mcPt>:mult");\r
647 \r
648 fMCTriggerPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCTriggerPrimTrackMeanPtMult1,minMCTriggerPrimTrackMeanPtMult1,maxMCTriggerPrimTrackMeanPtMult1);\r
649 fMCTriggerPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
650 fMCTriggerPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
651 fMCTriggerPrimTrackMeanPtMult1->Sumw2();\r
652\r
653 //\r
654 Int_t binsMCEventPrimTrackMeanPtTrueMult1[2]={100,150};\r
655 Double_t minMCEventPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
656 Double_t maxMCEventPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
657 sprintf(name,"fMCEventPrimTrackMeanPtTrueMult1");\r
658 sprintf(title,"event <mcPt>:true_mult");\r
659 \r
660 fMCEventPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCEventPrimTrackMeanPtTrueMult1,minMCEventPrimTrackMeanPtTrueMult1,maxMCEventPrimTrackMeanPtTrueMult1);\r
661 fMCEventPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
662 fMCEventPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
663 fMCEventPrimTrackMeanPtTrueMult1->Sumw2();\r
664\r
665 Int_t binsMCEventPrimTrackMeanPtMult1[2]={100,150};\r
666 Double_t minMCEventPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
667 Double_t maxMCEventPrimTrackMeanPtMult1[2]={10.,149.5}; \r
668 sprintf(name,"fMCEventPrimTrackMeanPtMult1");\r
669 sprintf(title,"event <mcPt>:mult");\r
670 \r
671 fMCEventPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCEventPrimTrackMeanPtMult1,minMCEventPrimTrackMeanPtMult1,maxMCEventPrimTrackMeanPtMult1);\r
672 fMCEventPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
673 fMCEventPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
674 fMCEventPrimTrackMeanPtMult1->Sumw2();\r
675\r
676\r
677\r
678\r
679\r
680\r
681 //\r
0aaa8b91 682 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) \r
683 {\r
684 // THnSparse track histograms\r
685 //\r
686 Int_t binsRecTrackHist1[3]={ptNbins,etaNbins,90};\r
687 Double_t minRecTrackHist1[3]={0.,-1.,0.}; \r
688 Double_t maxRecTrackHist1[3]={10.,1.,2.*TMath::Pi()};\r
689 sprintf(name,"fRecTrackHist1_%d",i);\r
690 sprintf(title,"Pt:Eta:Phi");\r
691 \r
692 fRecTrackHist1[i] = new THnSparseF(name,title,3,binsRecTrackHist1,minRecTrackHist1,maxRecTrackHist1);\r
693 fRecTrackHist1[i]->SetBinEdges(0,binsPt);\r
694 fRecTrackHist1[i]->SetBinEdges(1,binsEta);\r
695 fRecTrackHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
696 fRecTrackHist1[i]->GetAxis(1)->SetTitle("Eta");\r
697 fRecTrackHist1[i]->GetAxis(2)->SetTitle("Phi (rad)");\r
698 fRecTrackHist1[i]->Sumw2();\r
699 }\r
700\r
15b7cc05 701 //\r
0aaa8b91 702 Int_t binsCorrRecTrackMultHist1[3]={ptNbins,etaNbins,150};\r
703 Double_t minCorrRecTrackMultHist1[3]={0.,-1.,-0.5}; \r
704 Double_t maxCorrRecTrackMultHist1[3]={20.,1.,149.5};\r
bad4ba69 705\r
15b7cc05 706 Int_t binsCorrRecTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
707 Double_t minCorrRecTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
708 Double_t maxCorrRecTrackTrueMultHist1[3]={20.,1.,149.5};\r
709\r
3f87610e 710 Int_t binsCorrRecTrackTrueMultHist2[3]={ptNbins,150,150};\r
711 Double_t minCorrRecTrackTrueMultHist2[3]={0.,-0.5,-0.5}; \r
712 Double_t maxCorrRecTrackTrueMultHist2[3]={20.,149.5,149.5};\r
713\r
15b7cc05 714 //\r
715 Int_t binsCorrRecTrackMeanPtMultHist1[2]={100,150};\r
716 Double_t minCorrRecTrackMeanPtMultHist1[2]={0.,-0.5}; \r
717 Double_t maxCorrRecTrackMeanPtMultHist1[2]={10.,149.5};\r
718\r
719 Int_t binsCorrRecTrackMeanPtTrueMultHist1[2]={100,150};\r
720 Double_t minCorrRecTrackMeanPtTrueMultHist1[2]={0.,-0.5}; \r
721 Double_t maxCorrRecTrackMeanPtTrueMultHist1[2]={10.,149.5};\r
722\r
723 Int_t binsCorrRecTrackPt1[1]={200};\r
724 Double_t minCorrRecTrackPt1[1]={0.}; \r
725 Double_t maxCorrRecTrackPt1[1]={10.};\r
bad4ba69 726\r
0aaa8b91 727 for(Int_t i=0; i<8; i++) \r
728 {\r
729 // THnSparse track histograms\r
730 sprintf(name,"fCorrRecTrackMultHist1_%d",i);\r
731 sprintf(title,"Pt:Eta:mult");\r
732 fCorrRecTrackMultHist1[i] = new THnSparseF(name,title,3,binsCorrRecTrackMultHist1,minCorrRecTrackMultHist1,maxCorrRecTrackMultHist1);\r
733 fCorrRecTrackMultHist1[i]->SetBinEdges(0,binsPt);\r
734 fCorrRecTrackMultHist1[i]->SetBinEdges(1,binsEta);\r
735 fCorrRecTrackMultHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
736 fCorrRecTrackMultHist1[i]->GetAxis(1)->SetTitle("Eta");\r
737 fCorrRecTrackMultHist1[i]->GetAxis(2)->SetTitle("multiplicity");\r
738 fCorrRecTrackMultHist1[i]->Sumw2();\r
bad4ba69 739\r
15b7cc05 740 // THnSparse track histograms\r
741 sprintf(name,"fCorrRecTrackTrueMultHist1_%d",i);\r
742 sprintf(title,"Pt:Eta:true_mult");\r
743 fCorrRecTrackTrueMultHist1[i] = new THnSparseF(name,title,3,binsCorrRecTrackTrueMultHist1,minCorrRecTrackTrueMultHist1,maxCorrRecTrackTrueMultHist1);\r
744 fCorrRecTrackTrueMultHist1[i]->SetBinEdges(0,binsPt);\r
745 fCorrRecTrackTrueMultHist1[i]->SetBinEdges(1,binsEta);\r
746 fCorrRecTrackTrueMultHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
747 fCorrRecTrackTrueMultHist1[i]->GetAxis(1)->SetTitle("Eta");\r
748 fCorrRecTrackTrueMultHist1[i]->GetAxis(2)->SetTitle("true multiplicity");\r
749 fCorrRecTrackTrueMultHist1[i]->Sumw2();\r
750\r
3f87610e 751 //\r
752 sprintf(name,"fCorrRecTrackTrueMultHist2_%d",i);\r
753 sprintf(title,"Pt:mult:true_mult");\r
754 fCorrRecTrackTrueMultHist2[i] = new THnSparseF(name,title,3,binsCorrRecTrackTrueMultHist2,minCorrRecTrackTrueMultHist2,maxCorrRecTrackTrueMultHist2);\r
755 fCorrRecTrackTrueMultHist2[i]->SetBinEdges(0,binsPt);\r
756 fCorrRecTrackTrueMultHist2[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
757 fCorrRecTrackTrueMultHist2[i]->GetAxis(1)->SetTitle("multiplicity");\r
758 fCorrRecTrackTrueMultHist2[i]->GetAxis(2)->SetTitle("true multiplicity");\r
759 fCorrRecTrackTrueMultHist2[i]->Sumw2();\r
15b7cc05 760\r
761 // THnSparse track histograms\r
762 sprintf(name,"fCorrRecTrackMeanPtMultHist1_%d",i);\r
763 sprintf(title,"<Pt>:mult");\r
764 fCorrRecTrackMeanPtMultHist1[i] = new THnSparseF(name,title,2,binsCorrRecTrackMeanPtMultHist1,minCorrRecTrackMeanPtMultHist1,maxCorrRecTrackMeanPtMultHist1);\r
765 fCorrRecTrackMeanPtMultHist1[i]->GetAxis(0)->SetTitle("<Pt> (GeV/c)");\r
766 fCorrRecTrackMeanPtMultHist1[i]->GetAxis(1)->SetTitle("multiplicity");\r
767 fCorrRecTrackMeanPtMultHist1[i]->Sumw2();\r
768\r
769 // THnSparse track histograms\r
770 sprintf(name,"fCorrRecTrackMeanPtTrueMultHist1_%d",i);\r
771 sprintf(title,"<Pt>:true_mult");\r
772 fCorrRecTrackMeanPtTrueMultHist1[i] = new THnSparseF(name,title,2,binsCorrRecTrackMeanPtTrueMultHist1,minCorrRecTrackMeanPtTrueMultHist1,maxCorrRecTrackMeanPtTrueMultHist1);\r
773 fCorrRecTrackMeanPtTrueMultHist1[i]->GetAxis(0)->SetTitle("<Pt> (GeV/c)");\r
774 fCorrRecTrackMeanPtTrueMultHist1[i]->GetAxis(1)->SetTitle("true multiplicity");\r
775 fCorrRecTrackMeanPtTrueMultHist1[i]->Sumw2();\r
776\r
777 sprintf(name,"fCorrRecTrackPt1_%d",i);\r
778 sprintf(title,"pt small bining");\r
779 fCorrRecTrackPt1[i] = new THnSparseF(name,title,1,binsCorrRecTrackPt1,minCorrRecTrackPt1,maxCorrRecTrackPt1);\r
780 fCorrRecTrackPt1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
781 fCorrRecTrackPt1[i]->Sumw2();\r
782\r
0aaa8b91 783 }\r
784\r
785 Int_t binsEventMatrix[2]={zvNbins,150};\r
786 Double_t minEventMatrix[2]={-25.,-0.5};\r
787 Double_t maxEventMatrix[2]={25.,149.5};\r
788\r
789 fMCAllEventMultHist1 = new THnSparseF("fMCAllEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
790 fMCAllEventMultHist1->SetBinEdges(0,binsZv);\r
791 fMCAllEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
792 fMCAllEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
793 fMCAllEventMultHist1->Sumw2();\r
794\r
795 fMCAllNDEventMultHist1 = new THnSparseF("fMCAllNDEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
796 fMCAllNDEventMultHist1->SetBinEdges(0,binsZv);\r
797 fMCAllNDEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
798 fMCAllNDEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
799 fMCAllNDEventMultHist1->Sumw2();\r
800\r
801 fMCAllNSDEventMultHist1 = new THnSparseF("fMCAllNSDEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
802 fMCAllNSDEventMultHist1->SetBinEdges(0,binsZv);\r
803 fMCAllNSDEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
804 fMCAllNSDEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
805 fMCAllNSDEventMultHist1->Sumw2();\r
806\r
807 fMCTriggerMultHist1 = new THnSparseF("fMCTriggerMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
808 fMCTriggerMultHist1->SetBinEdges(0,binsZv);\r
809 fMCTriggerMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
810 fMCTriggerMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
811 fMCTriggerMultHist1->Sumw2();\r
812\r
813 fMCEventMultHist1 = new THnSparseF("fMCEventMultHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
814 fMCEventMultHist1->SetBinEdges(0,binsZv);\r
815 fMCEventMultHist1->GetAxis(0)->SetTitle("mcZv (cm)");\r
816 fMCEventMultHist1->GetAxis(1)->SetTitle("multiplicity");\r
817 fMCEventMultHist1->Sumw2();\r
818\r
819 for(Int_t i=0; i<5; i++) \r
820 {\r
821 // event corrected histograms\r
822 sprintf(name,"fCorrRecEventHist1_%d",i);\r
823 sprintf(title,"mcZv:mult");\r
824 fCorrRecEventHist1[i] = new THnSparseF("fCorrRecEventHist1","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
825 fCorrRecEventHist1[i]->SetBinEdges(0,binsZv);\r
826 fCorrRecEventHist1[i]->GetAxis(0)->SetTitle("Zv (cm)");\r
827 fCorrRecEventHist1[i]->GetAxis(1)->SetTitle("multiplicity");\r
828 fCorrRecEventHist1[i]->Sumw2();\r
829\r
830 // empty event corrected histograms\r
831 sprintf(name,"fCorrRecEventHist2_%d",i);\r
832 sprintf(title,"mcZv:mult");\r
833 fCorrRecEventHist2[i] = new THnSparseF("fCorrRecEventHist2","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
834 fCorrRecEventHist2[i]->SetBinEdges(0,binsZv);\r
835 fCorrRecEventHist2[i]->GetAxis(0)->SetTitle("Zv (cm)");\r
836 fCorrRecEventHist2[i]->GetAxis(1)->SetTitle("multiplicity");\r
837 fCorrRecEventHist2[i]->Sumw2();\r
838 }\r
d269b0e6 839 \r
840 //\r
841 // cosmics histo\r
842 //\r
843 Int_t binsCosmicsHisto[3]= {151, 300, ptNbins};\r
844 Double_t minCosmicsHisto[3]={-1.5, -2.*TMath::Pi(), 0.0}; \r
845 Double_t maxCosmicsHisto[3]={ 1.5, 2.*TMath::Pi(), 16.0}; \r
846 sprintf(name,"fCosmicsHisto");\r
847 sprintf(title,"deta:dphi:pt");\r
848 \r
849 fCosmicsHisto = new THnSparseF(name,title,3,binsCosmicsHisto,minCosmicsHisto,maxCosmicsHisto);\r
850 fCosmicsHisto->SetBinEdges(2,binsPt);\r
851 fCosmicsHisto->GetAxis(0)->SetTitle("#Delta#eta");\r
852 fCosmicsHisto->GetAxis(1)->SetTitle("#Delta#phi (rad)");\r
853 fCosmicsHisto->GetAxis(2)->SetTitle("pt (GV/c)");\r
854 fCosmicsHisto->Sumw2();\r
0aaa8b91 855\r
17e8c701 856 //\r
857 Int_t binsEventCount[2]={2,2};\r
858 Double_t minEventCount[2]={0,0}; \r
859 Double_t maxEventCount[2]={2,2}; \r
860 fEventCount = new THnSparseF("fEventCount","trig vs trig+vertex",2,binsEventCount,minEventCount,maxEventCount);\r
861 fEventCount->GetAxis(0)->SetTitle("trig");\r
862 fEventCount->GetAxis(1)->SetTitle("trig+vert");\r
863 fEventCount->Sumw2();\r
864\r
865\r
866\r
867\r
868\r
0aaa8b91 869 // init output folder\r
870 fCorrectionFolder = CreateFolder("folderdNdPt","Correction dNdPt Folder");\r
871\r
872 // init correction matrices\r
873 TFile *file = (TFile *)TFile::Open(fCorrMatrixFileName.Data()); \r
874 if(!file) { \r
875 AliDebug(AliLog::kError, "file with efficiency matrices not available");\r
876 printf("file with efficiency matrices not available \n");\r
877 } else {\r
878 TFolder *folder = (TFolder *)file->FindObjectAny("folderdNdPt");\r
879 if(!folder) { \r
880 AliDebug(AliLog::kError, "file without folderdNdPt");\r
881 printf("file without folderdNdPt \n");\r
882 } else {\r
883 // rec. event mult vs true multiplicity \r
884 fEventMultCorrelationMatrix = (THnSparseF*)folder->FindObject("event_mult_correlation_matrix");\r
885 if(!fEventMultCorrelationMatrix) {\r
886 Printf("No %s matrix \n", "event_mult_correlation_matrix");\r
17e8c701 887 return;\r
0aaa8b91 888 }\r
889\r
890 //\r
891 // event level corrections (zv,mult_MB)\r
892 //\r
893 \r
894 // trigger bias correction (MBtoND) \r
895 fCorrTriggerMBtoNDEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoND_corr_matrix");\r
896 if(!fCorrTriggerMBtoNDEventMatrix) {\r
897 Printf("No %s matrix \n", "zv_mult_trig_MBtoND_corr_matrix");\r
17e8c701 898 return;\r
0aaa8b91 899 }\r
900\r
901 // trigger bias correction (MBtoNSD)\r
902 fCorrTriggerMBtoNSDEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoNSD_corr_matrix");\r
903 if(!fCorrTriggerMBtoNSDEventMatrix) {\r
904 Printf("No %s matrix \n", "zv_mult_trig_MBtoNSD_corr_matrix");\r
17e8c701 905 return;\r
0aaa8b91 906 }\r
907\r
908 // trigger bias correction (MBtoInel)\r
909 fCorrTriggerMBtoInelEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoInel_corr_matrix");\r
910 if(!fCorrTriggerMBtoInelEventMatrix) {\r
911 Printf("No %s matrix \n", "zv_mult_trig_MBtoInel_corr_matrix"); \r
17e8c701 912 return;\r
0aaa8b91 913 }\r
914 \r
915 // vertex reconstruction efficiency correction\r
916 fCorrEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_event_corr_matrix");\r
917 if(!fCorrEventMatrix) {\r
918 Printf("No %s matrix \n", "zv_mult_event_corr_matrix");\r
17e8c701 919 return;\r
0aaa8b91 920 }\r
921\r
922 //\r
923 // histogram needed for empty events corrections\r
924 //\r
925 fZvNorm = (TH1D*)folder->FindObject("zv_distribution_norm");\r
926 if(!fZvNorm) {\r
927 Printf("No %s matrix \n", "fZvNorm");\r
17e8c701 928 return;\r
0aaa8b91 929 }\r
930\r
931 fZvEmptyEventsNorm = (TH1D*)folder->FindObject("zv_empty_events_norm");\r
932 if(!fZvEmptyEventsNorm) {\r
933 Printf("No %s matrix \n", "fZvEmptyEventsNorm");\r
17e8c701 934 return;\r
0aaa8b91 935 }\r
936\r
791aaf54 937 fLHCBin0Background = (TH1D*)folder->FindObject("hLHCBin0Background");\r
938 if(!fLHCBin0Background) {\r
939 Printf("No %s matrix \n", "fLHCBin0Background");\r
17e8c701 940 return;\r
791aaf54 941 }\r
942\r
0aaa8b91 943 //\r
944 // track-event level corrections (zv,pt,eta)\r
945 //\r
946\r
947 // trigger bias correction (MBtoND) \r
948 fCorrTriggerMBtoNDTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
949 if(!fCorrTriggerMBtoNDTrackEventMatrix) {\r
950 Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
17e8c701 951 return;\r
0aaa8b91 952 }\r
953\r
954 // trigger bias correction (MBtoNSD)\r
955 fCorrTriggerMBtoNSDTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
956 if(!fCorrTriggerMBtoNSDTrackEventMatrix) {\r
957 Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
17e8c701 958 return;\r
0aaa8b91 959 }\r
960\r
961 // trigger bias correction (MBtoInel) \r
962 fCorrTriggerMBtoInelTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
963 if(!fCorrTriggerMBtoInelTrackEventMatrix) {\r
964 Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
17e8c701 965 return;\r
0aaa8b91 966 }\r
967 \r
968 // vertex reconstruction efficiency correction (zv,pt,eta)\r
969 fCorrTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_event_corr_matrix");\r
970 if(!fCorrTrackEventMatrix) {\r
971 Printf("No %s matrix \n", "zv_pt_eta_track_event_corr_matrix");\r
17e8c701 972 return;\r
0aaa8b91 973 }\r
974\r
975 // track reconstruction efficiency correction (zv,pt,eta)\r
976 fCorrTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_corr_matrix");\r
977 if(!fCorrTrackMatrix) {\r
978 Printf("No %s matrix \n", "zv_pt_eta_track_corr_matrix");\r
17e8c701 979 return;\r
0aaa8b91 980 }\r
981\r
15b7cc05 982 // high pt track reconstruction efficiency correction (zv,pt,eta)\r
983 fCorrHighPtTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_highPt_track_corr_matrix");\r
984 if(!fCorrHighPtTrackMatrix) {\r
985 Printf("No %s matrix \n", "zv_pt_eta_highPt_track_corr_matrix");\r
17e8c701 986 return;\r
15b7cc05 987 }\r
988\r
0aaa8b91 989 // secondary tracks contamination correction (zv,pt,eta)\r
990 fContTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_cont_matrix");\r
991 if(!fContTrackMatrix) {\r
992 Printf("No %s matrix \n", "zv_pt_eta_track_cont_matrix");\r
17e8c701 993 return;\r
0aaa8b91 994 }\r
995\r
996 // multiply reconstructed tracks correction\r
997 fContMultTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_mult_track_cont_matrix");\r
998 if(!fContMultTrackMatrix) {\r
999 Printf("No %s matrix \n", "zv_pt_eta_mult_track_cont_matrix");\r
17e8c701 1000 return;\r
0aaa8b91 1001 }\r
1002 }\r
1003 }\r
1004\r
1005}\r
1006\r
1007//_____________________________________________________________________________\r
1008void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)\r
1009{\r
1010 //\r
1011 // Process real and/or simulated events\r
1012 //\r
1013 if(!esdEvent) {\r
1014 AliDebug(AliLog::kError, "esdEvent not available");\r
1015 return;\r
1016 }\r
1017\r
bad4ba69 1018 // get selection cuts\r
0aaa8b91 1019 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
1020 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
1021 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
1022\r
bad4ba69 1023 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
0aaa8b91 1024 AliDebug(AliLog::kError, "cuts not available");\r
1025 return;\r
1026 }\r
1027\r
bad4ba69 1028 // trigger selection\r
1029 Bool_t isEventTriggered = kTRUE;\r
17e8c701 1030 AliPhysicsSelection *trigSel = NULL;\r
1031 AliTriggerAnalysis *trigAna = NULL; // needed for andV0\r
15b7cc05 1032 if(evtCuts->IsTriggerRequired()) \r
1033 {\r
17e8c701 1034 //\r
1035 trigSel = GetPhysicsTriggerSelection();\r
15b7cc05 1036 if(!trigSel) {\r
1037 AliDebug(AliLog::kError, "cannot get trigSel");\r
1038 return;\r
1039 }\r
17e8c701 1040 \r
f537848a 1041 if(IsUseMCInfo()) { \r
d269b0e6 1042 trigSel->SetAnalyzeMC();\r
1043 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
17e8c701 1044\r
1045 trigAna = trigSel->GetTriggerAnalysis();\r
1046 if(!trigAna) \r
1047 return;\r
1048\r
1049 if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
1050 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
f537848a 1051 }\r
1052 else {\r
17e8c701 1053 //\r
1054 // 0-multiplicity bin for LHC background correction\r
1055 //\r
1056 if(GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
1057 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
1058 {\r
1059 trigSel->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroTrackSPDvtx);\r
1060 } else {\r
1061 trigSel->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroSPDvtx);\r
1062 }\r
1063\r
d269b0e6 1064 isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
17e8c701 1065\r
1066 trigAna = trigSel->GetTriggerAnalysis();\r
1067 if(!trigAna) \r
1068 return;\r
1069\r
1070 if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
1071 isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
f537848a 1072 }\r
bad4ba69 1073 }\r
15b7cc05 1074 \r
bad4ba69 1075 // use MC information\r
0aaa8b91 1076 AliHeader* header = 0;\r
1077 AliGenEventHeader* genHeader = 0;\r
1078 AliStack* stack = 0;\r
1079 TArrayF vtxMC(3);\r
bad4ba69 1080 AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
0aaa8b91 1081 Int_t multMCTrueTracks = 0;\r
1082\r
1083 if(IsUseMCInfo())\r
1084 {\r
1085 if(!mcEvent) {\r
1086 AliDebug(AliLog::kError, "mcEvent not available");\r
1087 return;\r
1088 }\r
1089\r
1090 // get MC event header\r
1091 header = mcEvent->Header();\r
1092 if (!header) {\r
1093 AliDebug(AliLog::kError, "Header not available");\r
1094 return;\r
1095 }\r
1096 // MC particle stack\r
1097 stack = mcEvent->Stack();\r
1098 if (!stack) {\r
1099 AliDebug(AliLog::kError, "Stack not available");\r
1100 return;\r
1101 }\r
1102\r
1103 // get event type (ND=0x1, DD=0x2, SD=0x4)\r
bad4ba69 1104 evtType = AliPWG0Helper::GetEventProcessType(header);\r
0aaa8b91 1105 //Printf("evtType %d \n", evtType);\r
1106 AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
1107\r
1108 // get MC vertex\r
1109 genHeader = header->GenEventHeader();\r
1110 if (!genHeader) {\r
1111 AliDebug(AliLog::kError, "Could not retrieve genHeader from Header");\r
1112 return;\r
1113 }\r
1114 genHeader->PrimaryVertex(vtxMC);\r
1115\r
1116 // Fill MC event histogram\r
1117 Double_t vMCEventHist1[3]={vtxMC[0],vtxMC[1],vtxMC[2]};\r
1118 fMCEventHist1->Fill(vMCEventHist1);\r
1119\r
1120 // multipliticy of all MC primary tracks\r
791aaf54 1121 // in Zvtx, eta ranges\r
0aaa8b91 1122 multMCTrueTracks = AlidNdPtHelper::GetMCTrueTrackMult(mcEvent,evtCuts,accCuts);\r
1123\r
1124 } // end bUseMC\r
1125\r
1126 // get reconstructed vertex \r
1127 const AliESDVertex* vtxESD = 0; \r
1128 Bool_t isRecVertex = kFALSE;\r
1129 if(evtCuts->IsRecVertexRequired()) \r
1130 {\r
bad4ba69 1131 Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
1132 Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
1133 vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
791aaf54 1134 isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, esdEvent->GetPrimaryVertexSPD(), GetAnalysisMode(), kFALSE);\r
0aaa8b91 1135 }\r
791aaf54 1136\r
1137 if( IsUseMCInfo() && !evtCuts->IsRecVertexRequired() ) {\r
1138 vtxESD = new AliESDVertex(vtxMC[2],10.,genHeader->NProduced(),"smearMC");\r
0aaa8b91 1139 isRecVertex = kTRUE;\r
1140 }\r
791aaf54 1141\r
0aaa8b91 1142 Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex; \r
791aaf54 1143 //printf("isEventOK %d, isEventTriggered %d \n",isEventOK, isEventTriggered);\r
1144 //printf("GetAnalysisMode() %d \n",GetAnalysisMode());\r
0aaa8b91 1145\r
791aaf54 1146 // vertex contributors\r
0aaa8b91 1147 Int_t multMBTracks = 0; \r
791aaf54 1148 if(GetAnalysisMode() == AlidNdPtHelper::kTPC) \r
1149 { \r
1150 if(vtxESD->GetStatus() && isRecVertex)\r
1151 multMBTracks = AlidNdPtHelper::GetTPCMBTrackMult(esdEvent,evtCuts,accCuts,esdTrackCuts);\r
0aaa8b91 1152 } \r
791aaf54 1153 else if( GetAnalysisMode() == AlidNdPtHelper::kTPCITS || GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || \r
1154 GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate || GetAnalysisMode()==AlidNdPtHelper::kTPCITSHybrid ) \r
1155 {\r
1156 const AliMultiplicity* mult = esdEvent->GetMultiplicity();\r
1157 //if(mult && vtxESD->GetStatus() && isRecVertex)\r
1158 if(mult)\r
1159 multMBTracks = mult->GetNumberOfTracklets();\r
1160 \r
0aaa8b91 1161 } \r
791aaf54 1162 else if( GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
1163 GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt)\r
1164 {\r
1165 if(vtxESD->GetStatus() && isRecVertex)\r
1166 multMBTracks = vtxESD->GetNContributors();\r
1167\r
1168 }\r
0aaa8b91 1169 else {\r
1170 AliDebug(AliLog::kError, Form("Found analysis type %s", GetAnalysisMode()));\r
1171 return; \r
1172 }\r
1173\r
17e8c701 1174 Bool_t isTrigAndVertex = isEventTriggered && isEventOK;\r
1175 Double_t vEventCount[2] = { isEventTriggered, isTrigAndVertex};\r
1176 fEventCount->Fill(vEventCount);\r
791aaf54 1177\r
0aaa8b91 1178 //\r
1179 // correct event and track histograms\r
1180 //\r
1181 TObjArray *allChargedTracks=0;\r
1182 Int_t multRec=0, multRecTemp=0;\r
1183 Int_t *labelsRec=0;\r
a8ac5525 1184 Bool_t isCosmic = kFALSE;\r
0aaa8b91 1185\r
17e8c701 1186\r
0aaa8b91 1187 if(isEventOK && isEventTriggered)\r
1188 {\r
1189 // get all charged tracks\r
bad4ba69 1190 allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
0aaa8b91 1191 if(!allChargedTracks) return;\r
1192\r
1193 Int_t entries = allChargedTracks->GetEntries();\r
1194 labelsRec = new Int_t[entries];\r
1195\r
1196 // calculate mult of reconstructed tracks\r
15b7cc05 1197\r
0aaa8b91 1198 for(Int_t i=0; i<entries;++i) \r
1199 {\r
1200 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
1201 if(!track) continue;\r
847e74b2 1202 if(track->Charge()==0) continue;\r
1203\r
15b7cc05 1204\r
847e74b2 1205 // only postive charged \r
1206 if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
1207 continue;\r
1208 \r
1209 // only negative charged \r
1210 if(GetParticleMode() == AlidNdPtHelper::kMinus && track->Charge() > 0) \r
1211 continue;\r
1212\r
d269b0e6 1213 // cosmics analysis\r
a8ac5525 1214 isCosmic = kFALSE;\r
15b7cc05 1215 if( GetParticleMode()==AlidNdPtHelper::kCosmic )\r
d269b0e6 1216 {\r
1217 for(Int_t j=0; j<entries;++j) \r
1218 {\r
1219 AliESDtrack *track1 = (AliESDtrack*)allChargedTracks->At(j);\r
1220 if(!track1) continue;\r
1221 if(track1->Charge()==0) continue;\r
1222\r
1223 if( esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track) && \r
1224 esdTrackCuts->AcceptTrack(track1) && accCuts->AcceptTrack(track1) ) \r
1225 { \r
a8ac5525 1226 isCosmic = AlidNdPtHelper::IsCosmicTrack(track, track1);\r
d269b0e6 1227 }\r
1228 if(isCosmic) \r
1229 {\r
a8ac5525 1230 Double_t vCosmicsHisto[3] = { track->Eta()+track1->Eta(), track->Phi()-track1->Phi(), track1->Pt() };\r
d269b0e6 1231 fCosmicsHisto->Fill(vCosmicsHisto);\r
1232 }\r
1233 }\r
1234 \r
1235 if(!isCosmic) continue;\r
1236 }\r
1237\r
791aaf54 1238 if(esdTrackCuts->AcceptTrack(track)) \r
1239 {\r
1240 if(GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) {\r
1241 if(AlidNdPtHelper::IsGoodImpPar(track) && accCuts->AcceptTrack(track)) multRecTemp++;\r
1242 }\r
1243 else {\r
1244 if(accCuts->AcceptTrack(track)) multRecTemp++;\r
1245 }\r
1246 } \r
1247 }\r
1248\r
17e8c701 1249 /*\r
791aaf54 1250 // check multiplicity\r
1251 const AliMultiplicity* mult = esdEvent->GetMultiplicity();\r
1252 Int_t trackletMult = 0;\r
1253 if (mult) {\r
1254 for(Int_t i=0; i<mult->GetNumberOfTracklets(); i++) {\r
1255 if(TMath::Abs(mult->GetEta(i)) < accCuts->GetMaxEta() )\r
1256 trackletMult++;\r
1257 }\r
1258 }\r
1259 // use tracklet multiplicity\r
1260 multRecTemp = trackletMult;\r
17e8c701 1261 */\r
0aaa8b91 1262\r
847e74b2 1263 //\r
0aaa8b91 1264 for(Int_t i=0; i<entries;++i) \r
1265 {\r
1266 AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
1267 if(!track) continue;\r
847e74b2 1268 if(track->Charge()==0) continue;\r
1269\r
1270 // only postive charged \r
1271 if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
1272 continue;\r
1273 \r
1274 // only negative charged \r
1275 if(GetParticleMode() == AlidNdPtHelper::kMinus && track->Charge() > 0) \r
1276 continue;\r
0aaa8b91 1277 \r
847e74b2 1278 // track-level corrections\r
791aaf54 1279 if(!esdTrackCuts->AcceptTrack(track)) continue;\r
1280 if(GetAnalysisMode()==AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt && !AlidNdPtHelper::IsGoodImpPar(track)) continue;\r
1281\r
a8ac5525 1282 // cosmics analysis\r
1283 isCosmic = kFALSE;\r
15b7cc05 1284 if( GetParticleMode()==AlidNdPtHelper::kCosmic )\r
a8ac5525 1285 {\r
1286 for(Int_t j=0; j<entries;++j) \r
1287 {\r
1288 AliESDtrack *track1 = (AliESDtrack*)allChargedTracks->At(j);\r
1289 if(!track1) continue;\r
1290 if(track1->Charge()==0) continue;\r
1291\r
1292 if( esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track) && \r
1293 esdTrackCuts->AcceptTrack(track1) && accCuts->AcceptTrack(track1) ) \r
1294 { \r
1295 isCosmic = AlidNdPtHelper::IsCosmicTrack(track, track1);\r
1296 }\r
1297 }\r
1298 if(!isCosmic) continue;\r
1299 }\r
1300\r
15b7cc05 1301 Bool_t isOK = kFALSE;\r
1302 Double_t x[3]; track->GetXYZ(x);\r
1303 Double_t b[3]; AliTracker::GetBxByBz(x,b);\r
1304\r
1305 //\r
1306 // if TPC-ITS hybrid tracking (kTPCITSHybrid)\r
1307 // replace track parameters with TPC-ony track parameters\r
1308 //\r
791aaf54 1309 if( GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybrid || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
15b7cc05 1310 {\r
791aaf54 1311 // Relate TPC-only tracks to Tracks or SPD vertex\r
1312 isOK = track->RelateToVertexTPCBxByBz(vtxESD, b, kVeryBig);\r
15b7cc05 1313 if(!isOK) continue;\r
1314\r
1315 // replace esd track parameters with TPCinner\r
1316 AliExternalTrackParam *tpcTrack = new AliExternalTrackParam(*(track->GetTPCInnerParam()));\r
1317 if (!tpcTrack) return;\r
1318 track->Set(tpcTrack->GetX(),tpcTrack->GetAlpha(),tpcTrack->GetParameter(),tpcTrack->GetCovariance());\r
1319\r
1320 if(tpcTrack) delete tpcTrack; \r
1321 } \r
1322\r
1323 //\r
791aaf54 1324 if (GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate || GetAnalysisMode()==AlidNdPtHelper::kTPCTrackSPDvtxUpdate) \r
15b7cc05 1325 {\r
847e74b2 1326 //\r
1327 // update track parameters\r
1328 //\r
1329 AliExternalTrackParam cParam;\r
791aaf54 1330 isOK = track->RelateToVertexTPC(vtxESD,esdEvent->GetMagneticField(),kVeryBig,&cParam);\r
15b7cc05 1331 if(!isOK) continue;\r
847e74b2 1332 track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
1333\r
1334 if(accCuts->AcceptTrack(track)) { \r
15b7cc05 1335 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp,multMCTrueTracks); \r
847e74b2 1336 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
1337 multRec++;\r
1338 }\r
1339 }\r
1340 else if (GetAnalysisMode()==AlidNdPtHelper::kMCRec && IsUseMCInfo()) \r
1341 { \r
1342 //\r
1343 // Replace rec with MC\r
1344 //\r
1345 if(accCuts->AcceptTrack(track)) { \r
15b7cc05 1346 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxMC[2],multRecTemp, multMCTrueTracks); \r
847e74b2 1347 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
1348 multRec++;\r
1349 }\r
1350 } \r
1351 else {\r
1352 //\r
1353 // all the rest tracking scenarios\r
1354 //\r
1355 if(accCuts->AcceptTrack(track)) { \r
15b7cc05 1356 FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp, multMCTrueTracks); \r
847e74b2 1357 labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
1358 multRec++;\r
1359 }\r
1360 }\r
791aaf54 1361 }\r
1362\r
0aaa8b91 1363 // event-level corrections\r
791aaf54 1364 if(GetAnalysisMode()==AlidNdPtHelper::kMCRec && IsUseMCInfo()) \r
1365 { \r
0aaa8b91 1366 FillHistograms(AlidNdPtHelper::kRecEvents,vtxMC[2],multMBTracks);\r
1367 }\r
1368 else {\r
1369 FillHistograms(AlidNdPtHelper::kRecEvents,vtxESD->GetZv(),multMBTracks);\r
1370 }\r
1371\r
15b7cc05 1372 // calculate meanPt from the event\r
1373 Double_t meanPtMult[8] = {0}; \r
15b7cc05 1374 for (Int_t i = 0; i<8; i++) {\r
1375 if(!fCorrRecTrackMultHist1[i]) continue;\r
791aaf54 1376 TH1D *hp = (TH1D *)fCorrRecTrackPt1[i]->Projection(0);\r
1377 if(!hp) continue;\r
1378 meanPtMult[i] = hp->GetMean(); \r
15b7cc05 1379 Double_t vCorrRecTrackMeanPtMultHist1[2] = {meanPtMult[i],multRecTemp};\r
1380 fCorrRecTrackMeanPtMultHist1[i]->Fill(vCorrRecTrackMeanPtMultHist1); \r
1381 \r
1382 if( IsUseMCInfo() ) {\r
15b7cc05 1383 Double_t vCorrRecTrackMeanPtTrueMultHist1[2] = {meanPtMult[i],multMCTrueTracks};\r
1384 fCorrRecTrackMeanPtTrueMultHist1[i]->Fill(vCorrRecTrackMeanPtTrueMultHist1); \r
1385 }\r
1386\r
1387 // reset pt histo for the next event\r
1388 if(fCorrRecTrackPt1[i]) fCorrRecTrackPt1[i]->Reset();\r
791aaf54 1389 if(hp) delete hp;\r
15b7cc05 1390 }\r
1391\r
0aaa8b91 1392 // control event histograms\r
1393 Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
1394 fRecEventHist1->Fill(vRecEventHist1);\r
3f87610e 1395\r
17e8c701 1396 // correlation track multiplicity vs MB track multiplicity\r
791aaf54 1397 Double_t vRecEventMultHist1[3] = {multRec, multMBTracks};\r
3f87610e 1398 fRecEventMultHist1->Fill(vRecEventMultHist1);\r
791aaf54 1399 }\r
0aaa8b91 1400\r
1401 // empty events corrections\r
1402 // no reconstructed zv\r
791aaf54 1403 if( isEventTriggered && multMBTracks==0 ) \r
1404 {\r
1405 if(GetAnalysisMode()==AlidNdPtHelper::kMCRec && IsUseMCInfo()) \r
1406 {\r
0aaa8b91 1407 FillHistograms(AlidNdPtHelper::kTriggeredEvents,vtxMC[2],multMBTracks);\r
1408 }\r
1409 else {\r
1410 Double_t zv = fZvNorm->GetRandom();\r
791aaf54 1411 if(zv>evtCuts->GetMinZv() && zv<evtCuts->GetMaxZv())\r
1412 FillHistograms(AlidNdPtHelper::kTriggeredEvents,zv,multMBTracks);\r
0aaa8b91 1413 }\r
1414 }\r
1415\r
1416 if(IsUseMCInfo()) \r
1417 {\r
1418 // select MC events \r
1419 if(evtCuts->AcceptMCEvent(mcEvent))\r
1420 {\r
1421 //\r
1422 // event histograms\r
1423 //\r
1424 Double_t vMCEventMatrix[2] = {vtxMC[2],multMBTracks};\r
1425 fMCAllEventMultHist1->Fill(vMCEventMatrix);\r
791aaf54 1426\r
bad4ba69 1427 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 1428 fMCAllNDEventMultHist1->Fill(vMCEventMatrix);\r
1429 }\r
bad4ba69 1430 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 1431 fMCAllNSDEventMultHist1->Fill(vMCEventMatrix);\r
1432 }\r
791aaf54 1433 if(isEventTriggered) {\r
1434 fMCTriggerMultHist1->Fill(vMCEventMatrix);\r
1435 }\r
1436 if(isEventTriggered && isEventOK) {\r
1437 fMCEventMultHist1->Fill(vMCEventMatrix);\r
1438 }\r
0aaa8b91 1439\r
1440 //\r
1441 // MC histograms for efficiency studies\r
1442 //\r
15b7cc05 1443 Double_t sumPtMC = 0;\r
0aaa8b91 1444 Int_t nPart = stack->GetNtrack();\r
1445 for (Int_t iMc = 0; iMc < nPart; ++iMc) \r
1446 {\r
1447 // print MC stack info\r
1448 //AlidNdPtHelper::PrintMCInfo(stack,iMc);\r
1449\r
1450 TParticle* particle = stack->Particle(iMc);\r
1451 if (!particle)\r
1452 continue;\r
1453\r
1454 // only charged particles\r
1455 Double_t charge = particle->GetPDG()->Charge()/3.;\r
00b81913 1456 if (TMath::Abs(charge) < 0.001)\r
0aaa8b91 1457 continue;\r
847e74b2 1458\r
1459 // only postive charged \r
1460 if(GetParticleMode() == AlidNdPtHelper::kPlus && charge < 0.) \r
1461 continue;\r
1462 \r
1463 // only negative charged \r
1464 if(GetParticleMode() == AlidNdPtHelper::kMinus && charge > 0.) \r
1465 continue;\r
0aaa8b91 1466 \r
1467 // physical primary\r
1468 Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
15b7cc05 1469 if(!prim) continue;\r
0aaa8b91 1470\r
1471 // all primaries in acceptance\r
1472 if(!accCuts->AcceptTrack(particle)) continue;\r
0aaa8b91 1473\r
1474 Double_t gpt = particle->Pt();\r
1475 Double_t geta = particle->Eta();\r
1476\r
15b7cc05 1477 // sum up pt in the event\r
1478 sumPtMC +=gpt; \r
1479\r
791aaf54 1480 Double_t valMCAllTrackMultHist1[3] = {gpt,geta,multRecTemp}; \r
15b7cc05 1481 Double_t valMCAllTrackTrueMultHist1[3] = {gpt,geta,multMCTrueTracks}; \r
791aaf54 1482 Double_t valMCAllTrackTrueMultHist2[3] = {gpt,multRecTemp,multMCTrueTracks}; \r
15b7cc05 1483\r
0aaa8b91 1484 fMCAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
15b7cc05 1485 fMCAllPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
3f87610e 1486 fMCAllPrimTrackTrueMultHist2->Fill(valMCAllTrackTrueMultHist2);\r
15b7cc05 1487\r
bad4ba69 1488 if(evtType == AliPWG0Helper::kND) {\r
0aaa8b91 1489 fMCNDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
15b7cc05 1490 fMCNDEventAllPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
3f87610e 1491 fMCNDEventAllPrimTrackTrueMultHist2->Fill(valMCAllTrackTrueMultHist2);\r
0aaa8b91 1492 }\r
bad4ba69 1493 if(evtType != AliPWG0Helper::kSD) {\r
0aaa8b91 1494 fMCNSDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
15b7cc05 1495 fMCNSDEventAllPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
3f87610e 1496 fMCNSDEventAllPrimTrackTrueMultHist2->Fill(valMCAllTrackTrueMultHist2);\r
0aaa8b91 1497 }\r
15b7cc05 1498 if(isEventTriggered) { \r
1499 fMCTriggerPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
1500 fMCTriggerPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
3f87610e 1501 fMCTriggerPrimTrackTrueMultHist2->Fill(valMCAllTrackTrueMultHist2);\r
15b7cc05 1502 }\r
1503 if(isEventTriggered && isEventOK) { \r
1504 fMCEventPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
1505 fMCEventPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
3f87610e 1506 fMCEventPrimTrackTrueMultHist2->Fill(valMCAllTrackTrueMultHist2);\r
15b7cc05 1507 }\r
0aaa8b91 1508 }\r
15b7cc05 1509\r
1510 //\r
1511 // calculate <pt> in the event\r
1512 //\r
1513 Double_t meanPtMCMult = 0;\r
1514 Double_t meanPtMCTrueMult = 0;\r
791aaf54 1515 if(multRecTemp) { \r
1516 meanPtMCMult = sumPtMC/multRecTemp; \r
1517 }\r
1518 if(multMCTrueTracks) { \r
1519 meanPtMCTrueMult = sumPtMC/multMCTrueTracks; \r
1520 }\r
15b7cc05 1521\r
791aaf54 1522 Double_t valMCMeanPtMult[2] = {meanPtMCMult,multRecTemp}; \r
15b7cc05 1523 Double_t valMCMeanPtTrueMult[2] = {meanPtMCTrueMult,multMCTrueTracks}; \r
1524\r
1525 fMCAllPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
1526 fMCAllPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
1527\r
1528 if(evtType == AliPWG0Helper::kND) {\r
1529 fMCNDEventAllPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
1530 fMCNDEventAllPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
1531 }\r
1532 if(evtType != AliPWG0Helper::kSD) {\r
1533 fMCNSDEventAllPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
1534 fMCNSDEventAllPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
1535 }\r
1536 if(isEventTriggered) { \r
1537 fMCTriggerPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
1538 fMCTriggerPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
1539 }\r
1540 if(isEventTriggered && isEventOK) { \r
1541 fMCEventPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
1542 fMCEventPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
1543 }\r
0aaa8b91 1544 }\r
1545 } // end bUseMC\r
1546\r
1547 if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
1548 if(labelsRec) delete [] labelsRec; labelsRec = 0;\r
1549\r
f537848a 1550 if(!evtCuts->IsRecVertexRequired() && vtxESD != NULL) delete vtxESD;\r
0aaa8b91 1551}\r
1552\r
1553//_____________________________________________________________________________\r
00b81913 1554void AlidNdPtCorrection::FillHistograms(AlidNdPtHelper::EventObject eventObj, Double_t zv, Int_t multMBTracks) const\r
0aaa8b91 1555{\r
1556 //\r
1557 // Fill corrected histograms\r
1558 //\r
1559\r
1560 Double_t vEventMatrix[2] = {zv,multMBTracks};\r
1561 //\r
1562 // Correct for efficiency \r
1563 //\r
1564 if(eventObj == AlidNdPtHelper::kRecEvents && multMBTracks>0) \r
1565 {\r
1566 Double_t corrToMBF = GetCorrFactZvMult(fCorrEventMatrix,zv,multMBTracks);\r
1567 Double_t corrToInelF = GetCorrFactZvMult(fCorrTriggerMBtoInelEventMatrix,zv,multMBTracks);\r
1568 Double_t corrToNDF = GetCorrFactZvMult(fCorrTriggerMBtoNDEventMatrix,zv,multMBTracks);\r
1569 Double_t corrToNSDF = GetCorrFactZvMult(fCorrTriggerMBtoNSDEventMatrix,zv,multMBTracks);\r
1570 //printf("corrToMBF %f, corrToInelF %f, corrToNDF %f corrToNSDF %f \n",corrToMBF,corrToInelF,corrToNDF,corrToNSDF);\r
1571\r
1572 fCorrRecEventHist1[0]->Fill(vEventMatrix);\r
1573 fCorrRecEventHist1[1]->Fill(vEventMatrix,corrToMBF);\r
1574 fCorrRecEventHist1[2]->Fill(vEventMatrix,corrToMBF*corrToInelF);\r
1575 fCorrRecEventHist1[3]->Fill(vEventMatrix,corrToMBF*corrToNDF);\r
1576 fCorrRecEventHist1[4]->Fill(vEventMatrix,corrToMBF*corrToNSDF);\r
1577 }\r
1578\r
1579 if(eventObj==AlidNdPtHelper::kTriggeredEvents && multMBTracks==0) // empty triggered events\r
1580 {\r
791aaf54 1581 Double_t factLHCBack = 1.;\r
1582 if(!IsUseMCInfo()) factLHCBack = fLHCBin0Background->GetBinContent(1); \r
1583\r
1584\r
0aaa8b91 1585 Int_t bin = fZvEmptyEventsNorm->FindBin(zv);\r
00b81913 1586 Double_t factZ = fZvEmptyEventsNorm->GetBinContent(bin);\r
791aaf54 1587\r
0aaa8b91 1588 Double_t corrToInelF0 = GetCorrFactZvMult(fCorrTriggerMBtoInelEventMatrix,zv,multMBTracks);\r
1589 Double_t corrToNDF0 = GetCorrFactZvMult(fCorrTriggerMBtoNDEventMatrix,zv,multMBTracks);\r
1590 Double_t corrToNSDF0 = GetCorrFactZvMult(fCorrTriggerMBtoNSDEventMatrix,zv,multMBTracks);\r
17e8c701 1591 //printf("factLHCBack %f, factZ %f, corrToInelF0 %f, corrToNDF0 %f, corrToNSDF0 %f \n",factLHCBack,factZ,corrToInelF0,corrToNDF0,corrToNSDF0);\r
0aaa8b91 1592\r
1593 fCorrRecEventHist2[0]->Fill(vEventMatrix);\r
791aaf54 1594 fCorrRecEventHist2[1]->Fill(vEventMatrix,factLHCBack*factZ);\r
1595 fCorrRecEventHist2[2]->Fill(vEventMatrix,factLHCBack*factZ*corrToInelF0);\r
1596 fCorrRecEventHist2[3]->Fill(vEventMatrix,factLHCBack*factZ*corrToNDF0);\r
1597 fCorrRecEventHist2[4]->Fill(vEventMatrix,factLHCBack*factZ*corrToNSDF0);\r
0aaa8b91 1598 }\r
1599}\r
1600\r
1601//_____________________________________________________________________________\r
15b7cc05 1602void AlidNdPtCorrection::FillHistograms(AliESDtrack * const esdTrack, AliStack * const stack, AlidNdPtHelper::TrackObject trackObj, Double_t zv, Int_t mult, Int_t trueMult) const\r
0aaa8b91 1603{\r
1604 //\r
1605 // Fill ESD track and MC histograms \r
1606 //\r
1607 if(!esdTrack) return;\r
1608\r
1609 //Float_t q = esdTrack->Charge();\r
1610 Float_t pt = esdTrack->Pt();\r
1611 Float_t eta = esdTrack->Eta();\r
1612 Float_t phi = esdTrack->Phi();\r
1613\r
1614 if(stack && GetAnalysisMode() == AlidNdPtHelper::kMCRec) \r
1615 {\r
1616 Int_t label = TMath::Abs(esdTrack->GetLabel());\r
1617 \r
1618 TParticle* particle = stack->Particle(label);\r
1619 if(!particle) return;\r
1620 \r
1621 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3\r
00b81913 1622 if(TMath::Abs(gq)<0.001) return;\r
0aaa8b91 1623 Float_t gpt = particle->Pt();\r
1624 Float_t geta = particle->Eta();\r
1625 Float_t gphi = particle->Phi();\r
1626\r
1627 // replace reconstructed values with MC\r
1628 pt = gpt;\r
1629 eta = geta;\r
1630 phi = gphi;\r
1631 }\r
1632\r
1633 //\r
1634 // Fill histograms\r
1635 //\r
1636 Double_t values[3] = {pt,eta,phi}; \r
1637 fRecTrackHist1[trackObj]->Fill(values);\r
1638\r
1639 //\r
1640 // Correct for contamination and efficiency \r
1641 //\r
1642 if(trackObj == AlidNdPtHelper::kRecTracks || GetAnalysisMode() == AlidNdPtHelper::kMCRec) \r
1643 {\r
1644 // track level corrections\r
15b7cc05 1645 Double_t trackEffF = 1.0; \r
791aaf54 1646 if(pt < 2.6) trackEffF = GetCorrFactZvPtEta(fCorrTrackMatrix,zv,pt,eta);\r
15b7cc05 1647 else trackEffF = GetCorrFactZvPtEta(fCorrHighPtTrackMatrix,zv,pt,eta);\r
1648\r
0aaa8b91 1649 Double_t trackContF = GetContFactZvPtEta(fContTrackMatrix,zv,pt,eta);\r
1650 Double_t multTrackContF = GetContFactZvPtEta(fContMultTrackMatrix,zv,pt,eta);\r
1651 //printf("zv %f, pt %f, eta %f \n",zv,pt,eta);\r
1652 //printf("trackEffF %f, trackContF %f, multTrackContF %f \n", trackEffF, trackContF, multTrackContF);\r
1653 \r
1654 // track-event level corrections\r
1655 Double_t vertexEffF = GetCorrFactZvPtEta(fCorrTrackEventMatrix,zv,pt,eta);\r
1656 Double_t trigMBToInel = GetCorrFactZvPtEta(fCorrTriggerMBtoInelTrackEventMatrix,zv,pt,eta); \r
1657 Double_t trigMBToND = GetCorrFactZvPtEta(fCorrTriggerMBtoNDTrackEventMatrix,zv,pt,eta);\r
1658 Double_t trigMBToNSD = GetCorrFactZvPtEta(fCorrTriggerMBtoNSDTrackEventMatrix,zv,pt,eta);\r
1659 //printf("vertexEffF %f, trigMBToInel %f, trigMBToNSD %f \n", vertexEffF, trigMBToInel, trigMBToNSD);\r
bad4ba69 1660 \r
1661 Double_t corrF[8] = { 1.0, \r
1662 trackContF,\r
1663 trackContF*trackEffF,\r
1664 trackContF*trackEffF*multTrackContF,\r
1665 trackContF*trackEffF*multTrackContF*vertexEffF,\r
1666 trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToInel,\r
1667 trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToND,\r
1668 trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToNSD\r
1669 }; \r
1670 \r
1671 // Fill histograms\r
0aaa8b91 1672 Double_t valCorrRecTrackMultHist1[3] = {pt,eta,mult}; \r
15b7cc05 1673 Double_t valCorrRecTrackPt1[1] = {pt}; \r
bad4ba69 1674 for(Int_t i=0; i<8; i++) {\r
1675 fCorrRecTrackMultHist1[i]->Fill(valCorrRecTrackMultHist1,corrF[i]);\r
15b7cc05 1676 fCorrRecTrackPt1[i]->Fill(valCorrRecTrackPt1,corrF[i]);\r
1677\r
1678 if( IsUseMCInfo() ) {\r
1679 Double_t valCorrRecTrackTrueMultHist1[3] = {pt,eta,trueMult}; \r
3f87610e 1680 Double_t valCorrRecTrackTrueMultHist2[3] = {pt,mult,trueMult}; \r
1681\r
15b7cc05 1682 fCorrRecTrackTrueMultHist1[i]->Fill(valCorrRecTrackTrueMultHist1,corrF[i]);\r
3f87610e 1683 fCorrRecTrackTrueMultHist2[i]->Fill(valCorrRecTrackTrueMultHist2,corrF[i]);\r
15b7cc05 1684 } \r
bad4ba69 1685 }\r
0aaa8b91 1686 }\r
1687}\r
1688\r
00b81913 1689void AlidNdPtCorrection::FillHistograms(AliStack * const stack, Int_t /*label*/, AlidNdPtHelper::TrackObject /*trackObj*/, Int_t /*mult*/) const\r
0aaa8b91 1690{\r
1691 // Fill MC histograms\r
1692 if(!stack) return;\r
1693\r
1694 /*\r
1695 TParticle* particle = stack->Particle(label);\r
1696 if(!particle) return;\r
1697\r
1698 Int_t mother_pdg = -1;\r
1699 TParticle* mother = 0;\r
1700\r
1701 //TParticle* prim_mother = AlidNdPtHelper::FindPrimaryMother(stack,label);\r
1702 Int_t motherLabel = particle->GetMother(0); \r
1703 if(motherLabel>0) mother = stack->Particle(motherLabel);\r
1704 if(mother) mother_pdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only\r
1705 Int_t mech = particle->GetUniqueID(); // production mechanism\r
1706\r
1707 Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
1708 Float_t gpt = particle->Pt();\r
1709 Float_t qgpt = particle->Pt() * gq;\r
1710 Float_t geta = particle->Eta();\r
1711 Float_t gphi = particle->Phi();\r
1712 Float_t gpz = particle->Pz();\r
1713\r
1714 Bool_t prim = stack->IsPhysicalPrimary(label);\r
1715 Float_t vx = particle->Vx(); Float_t vy = particle->Vy(); Float_t vz = particle->Vz();\r
1716\r
1717 Int_t pid=-1;\r
1718 if (TMath::Abs(particle->GetPdgCode()) == kElectron) { pid = 0; }\r
1719 else if (TMath::Abs(particle->GetPdgCode()) == kMuonMinus) { pid = 1; }\r
1720 else if (TMath::Abs(particle->GetPdgCode()) == kPiPlus) { pid = 2; }\r
1721 else if (TMath::Abs(particle->GetPdgCode()) == kKPlus) { pid = 3; }\r
1722 else if (TMath::Abs(particle->GetPdgCode()) == kProton) { pid = 4; }\r
1723 else { pid = 5; }\r
1724 */\r
1725\r
1726 //if(!prim) printf("prim_mother %d, mother %d, particle %d, production mech %d\n",prim_mother->GetPdgCode(),mother->GetPdgCode(), particle->GetPdgCode(),mech);\r
1727 \r
1728}\r
1729\r
1730//_____________________________________________________________________________\r
00b81913 1731Double_t AlidNdPtCorrection::GetCorrFactZvPtEta(THnSparse * const hist, Double_t zv, Double_t pt, Double_t eta) const {\r
0aaa8b91 1732// return correction factor F(zv,pt,eta)\r
1733\r
1734 if(!hist) return 1.;\r
1735\r
1736 //\r
1737 TAxis *ax = hist->GetAxis(0);\r
1738 TAxis *ay = hist->GetAxis(1);\r
1739 TAxis *az = hist->GetAxis(2);\r
1740\r
1741 Int_t binx = ax->FindBin(zv);\r
1742 Int_t biny = ay->FindBin(pt);\r
1743 Int_t binz = az->FindBin(eta);\r
1744 Int_t dim[3] = {binx,biny,binz};\r
1745\r
1746 Double_t fact = hist->GetBinContent(dim); \r
1747\r
1748return fact;\r
1749}\r
1750\r
1751//_____________________________________________________________________________\r
00b81913 1752Double_t AlidNdPtCorrection::GetContFactZvPtEta(THnSparse * const hist, Double_t zv, Double_t pt, Double_t eta) const {\r
0aaa8b91 1753// return contamination correction factor F(zv,pt,eta)\r
1754\r
1755 if(!hist) return 1.0;\r
1756\r
1757 //\r
1758 TAxis *ax = hist->GetAxis(0);\r
1759 TAxis *ay = hist->GetAxis(1);\r
1760 TAxis *az = hist->GetAxis(2);\r
1761\r
1762 Int_t binx = ax->FindBin(zv);\r
1763 Int_t biny = ay->FindBin(pt);\r
1764 Int_t binz = az->FindBin(eta);\r
1765 Int_t dim[3] = {binx,biny,binz};\r
1766\r
791aaf54 1767 //\r
1768 // additional correction for secondary \r
1769 // particles with strangeness (data driven)\r
1770 // \r
1771 Double_t corrFact = 1.;\r
1772 if(!IsUseMCInfo()) corrFact = AlidNdPtHelper::GetStrangenessCorrFactor(pt);\r
1773 //printf("pt %f, corrFact %f \n", pt, corrFact);\r
1774\r
1775 Double_t fact = 1.0 - corrFact*hist->GetBinContent(dim); \r
0aaa8b91 1776 //Double_t fact = hist->GetBinContent(dim); \r
1777\r
1778return fact;\r
1779}\r
1780\r
1781//_____________________________________________________________________________\r
00b81913 1782Double_t AlidNdPtCorrection::GetCorrFactZvMult(THnSparse * const hist, Double_t zv, Int_t mult) const {\r
0aaa8b91 1783// return correction factor F(zv,mult)\r
1784\r
1785 if(!hist) return 1.;\r
1786\r
1787 TAxis *ax = hist->GetAxis(0);\r
1788 TAxis *ay = hist->GetAxis(1);\r
1789 Int_t binx = ax->FindBin(zv);\r
1790 Int_t biny = ay->FindBin(mult);\r
1791 Int_t dim[2] = {binx,biny};\r
1792\r
1793 Double_t fact = hist->GetBinContent(dim); \r
1794\r
1795\r
1796return fact;\r
1797}\r
1798\r
1799//_____________________________________________________________________________\r
00b81913 1800Double_t AlidNdPtCorrection::GetContFactZvMult(THnSparse * const hist, Double_t zv, Int_t mult) const {\r
0aaa8b91 1801// return contamination correction factor F(zv,mult)\r
1802\r
1803 if(!hist) return 1.;\r
1804\r
1805 TAxis *ax = hist->GetAxis(0);\r
1806 TAxis *ay = hist->GetAxis(1);\r
1807 Int_t binx = ax->FindBin(zv);\r
1808 Int_t biny = ay->FindBin(mult);\r
1809 Int_t dim[2] = {binx,biny};\r
1810 Double_t fact = 1.0-hist->GetBinContent(dim); \r
1811\r
1812return fact;\r
1813}\r
1814\r
1815//_____________________________________________________________________________\r
00b81913 1816Long64_t AlidNdPtCorrection::Merge(TCollection* const list) \r
0aaa8b91 1817{\r
1818 // Merge list of objects (needed by PROOF)\r
1819\r
1820 if (!list)\r
1821 return 0;\r
1822\r
1823 if (list->IsEmpty())\r
1824 return 1;\r
1825\r
1826 TIterator* iter = list->MakeIterator();\r
1827 TObject* obj = 0;\r
1828\r
1829 // collection of generated histograms\r
1830\r
17e8c701 1831 // physics selection\r
1832 TList *collPhysSelection = new TList;\r
1833\r
0aaa8b91 1834 Int_t count=0;\r
1835 while((obj = iter->Next()) != 0) {\r
1836 AlidNdPtCorrection* entry = dynamic_cast<AlidNdPtCorrection*>(obj);\r
1837 if (entry == 0) continue; \r
1838 \r
17e8c701 1839 collPhysSelection->Add(entry->GetPhysicsTriggerSelection());\r
1840\r
1841 fEventCount->Add(entry->fEventCount);\r
1842\r
0aaa8b91 1843 fMCEventHist1->Add(entry->fMCEventHist1);\r
1844 fRecEventHist1->Add(entry->fRecEventHist1);\r
3f87610e 1845 fRecEventMultHist1->Add(entry->fRecEventMultHist1);\r
0aaa8b91 1846\r
1847 fMCAllEventMultHist1->Add(entry->fMCAllEventMultHist1);\r
1848 fMCAllNDEventMultHist1->Add(entry->fMCAllNDEventMultHist1);\r
1849 fMCAllNSDEventMultHist1->Add(entry->fMCAllNSDEventMultHist1);\r
1850 fMCTriggerMultHist1->Add(entry->fMCTriggerMultHist1);\r
1851 fMCEventMultHist1->Add(entry->fMCEventMultHist1);\r
1852\r
1853 fMCAllPrimTrackMultHist1->Add(entry->fMCAllPrimTrackMultHist1);\r
1854 fMCNDEventAllPrimTrackMultHist1->Add(entry->fMCNDEventAllPrimTrackMultHist1);\r
1855 fMCNSDEventAllPrimTrackMultHist1->Add(entry->fMCNSDEventAllPrimTrackMultHist1);\r
1856 fMCTriggerPrimTrackMultHist1->Add(entry->fMCTriggerPrimTrackMultHist1);\r
1857 fMCEventPrimTrackMultHist1->Add(entry->fMCEventPrimTrackMultHist1);\r
15b7cc05 1858\r
1859 fMCAllPrimTrackTrueMultHist1->Add(entry->fMCAllPrimTrackTrueMultHist1);\r
1860 fMCNDEventAllPrimTrackTrueMultHist1->Add(entry->fMCNDEventAllPrimTrackTrueMultHist1);\r
1861 fMCNSDEventAllPrimTrackTrueMultHist1->Add(entry->fMCNSDEventAllPrimTrackTrueMultHist1);\r
1862 fMCTriggerPrimTrackTrueMultHist1->Add(entry->fMCTriggerPrimTrackTrueMultHist1);\r
1863 fMCEventPrimTrackTrueMultHist1->Add(entry->fMCEventPrimTrackTrueMultHist1);\r
1864\r
3f87610e 1865 fMCAllPrimTrackTrueMultHist2->Add(entry->fMCAllPrimTrackTrueMultHist2);\r
1866 fMCNDEventAllPrimTrackTrueMultHist2->Add(entry->fMCNDEventAllPrimTrackTrueMultHist2);\r
1867 fMCNSDEventAllPrimTrackTrueMultHist2->Add(entry->fMCNSDEventAllPrimTrackTrueMultHist2);\r
1868 fMCTriggerPrimTrackTrueMultHist2->Add(entry->fMCTriggerPrimTrackTrueMultHist2);\r
1869 fMCEventPrimTrackTrueMultHist2->Add(entry->fMCEventPrimTrackTrueMultHist2);\r
1870\r
15b7cc05 1871 fMCAllPrimTrackMeanPtMult1->Add(entry->fMCAllPrimTrackMeanPtMult1);\r
1872 fMCNDEventAllPrimTrackMeanPtMult1->Add(entry->fMCNDEventAllPrimTrackMeanPtMult1);\r
1873 fMCNSDEventAllPrimTrackMeanPtMult1->Add(entry->fMCNSDEventAllPrimTrackMeanPtMult1);\r
1874 fMCTriggerPrimTrackMeanPtMult1->Add(entry->fMCTriggerPrimTrackMeanPtMult1);\r
1875 fMCEventPrimTrackMeanPtMult1->Add(entry->fMCEventPrimTrackMeanPtMult1);\r
1876\r
1877 fMCAllPrimTrackMeanPtTrueMult1->Add(entry->fMCAllPrimTrackMeanPtTrueMult1);\r
1878 fMCNDEventAllPrimTrackMeanPtTrueMult1->Add(entry->fMCNDEventAllPrimTrackMeanPtTrueMult1);\r
1879 fMCNSDEventAllPrimTrackMeanPtTrueMult1->Add(entry->fMCNSDEventAllPrimTrackMeanPtTrueMult1);\r
1880 fMCTriggerPrimTrackMeanPtTrueMult1->Add(entry->fMCTriggerPrimTrackMeanPtTrueMult1);\r
1881 fMCEventPrimTrackMeanPtTrueMult1->Add(entry->fMCEventPrimTrackMeanPtTrueMult1);\r
1882\r
d269b0e6 1883 fCosmicsHisto->Add(entry->fCosmicsHisto);\r
0aaa8b91 1884\r
1885 for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) {\r
1886 fRecTrackHist1[i]->Add(entry->fRecTrackHist1[i]);\r
1887 }\r
1888\r
1889 for(Int_t i=0; i<8; i++) {\r
1890 fCorrRecTrackMultHist1[i]->Add(entry->fCorrRecTrackMultHist1[i]);\r
15b7cc05 1891 fCorrRecTrackTrueMultHist1[i]->Add(entry->fCorrRecTrackTrueMultHist1[i]);\r
3f87610e 1892 fCorrRecTrackTrueMultHist2[i]->Add(entry->fCorrRecTrackTrueMultHist2[i]);\r
15b7cc05 1893\r
1894 fCorrRecTrackMeanPtMultHist1[i]->Add(entry->fCorrRecTrackMeanPtMultHist1[i]);\r
1895 fCorrRecTrackMeanPtTrueMultHist1[i]->Add(entry->fCorrRecTrackMeanPtTrueMultHist1[i]);\r
1896\r
1897 fCorrRecTrackPt1[i]->Add(entry->fCorrRecTrackPt1[i]);\r
0aaa8b91 1898 }\r
1899\r
1900 for(Int_t i=0; i<5; i++) {\r
1901 fCorrRecEventHist1[i]->Add(entry->fCorrRecEventHist1[i]);\r
1902 fCorrRecEventHist2[i]->Add(entry->fCorrRecEventHist2[i]);\r
1903 }\r
1904\r
0aaa8b91 1905 count++;\r
1906 }\r
1907\r
17e8c701 1908 //\r
1909 AliPhysicsSelection *trigSelection = GetPhysicsTriggerSelection();\r
1910 trigSelection->Merge(collPhysSelection);\r
1911 if(collPhysSelection) delete collPhysSelection;\r
1912\r
0aaa8b91 1913return count;\r
1914}\r
1915 \r
00b81913 1916//____________________________________________________________________________\r
1917Int_t AlidNdPtCorrection::GetTrueMult(THnSparse * const hist, Int_t mult) const\r
0aaa8b91 1918{\r
00b81913 1919//\r
1920// get multiplicity of primary particles\r
1921//\r
0aaa8b91 1922 if(!hist) return 0;\r
00b81913 1923 Int_t trueMult = 0;\r
0aaa8b91 1924\r
1925 // 0 bins exluded\r
1926 TAxis *ax = hist->GetAxis(0);\r
1927 TAxis *ay = hist->GetAxis(1);\r
1928 ax->SetRange(1,ax->GetNbins());\r
1929 ay->SetRange(1,ay->GetNbins());\r
1930\r
1931 // measured mult\r
1932 ax->SetRangeUser((Float_t)mult,(Float_t)mult); \r
1933\r
1934 // get true multiplicity\r
1935 TH1D *h1 = (TH1D *)hist->Projection(1);\r
00b81913 1936 trueMult = (Int_t)h1->GetMean();\r
0aaa8b91 1937\r
00b81913 1938 return trueMult;\r
0aaa8b91 1939}\r
1940\r
1941//_____________________________________________________________________________\r
1942void AlidNdPtCorrection::Analyse() \r
1943{\r
1944 // Analyse histograms\r
1945 //\r
1946 TH1::AddDirectory(kFALSE);\r
1947 TH1 *h = 0, *hs=0, *hsc=0; \r
1948 TH2 *h2D = 0; \r
1949\r
1950 TObjArray *aFolderObj = new TObjArray;\r
1951\r
1952 //\r
1953 // get cuts\r
1954 //\r
1955 AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
1956 AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
1957 AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
1958\r
1959 if(!evtCuts || !accCuts || !esdTrackCuts) {\r
1960 Error("AlidNdPtCutAnalysis::Analyse()", "cuts not available");\r
1961 return;\r
1962 }\r
1963\r
1964 //\r
1965 // set min and max values\r
1966 //\r
847e74b2 1967 //Double_t minPt = accCuts->GetMinPt();\r
1968 //Double_t maxPt = accCuts->GetMaxPt();\r
00b81913 1969 Double_t minEta = accCuts->GetMinEta();\r
1970 Double_t maxEta = accCuts->GetMaxEta()-0.00001;\r
d269b0e6 1971 \r
00b81913 1972 printf("minEta %f, maxEta %f \n",minEta, maxEta);\r
d269b0e6 1973\r
1974 //\r
363d22ac 1975 // LHC backgraund in all and 0-bins\r
1976 //\r
1977 AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
1978 trigSel->SaveHistograms("physics_selection");\r
1979\r
1980 //\r
d269b0e6 1981 // cosmics background histo\r
1982 //\r
1983 h2D = fCosmicsHisto->Projection(0,1);\r
1984 h2D->SetName("deta_vs_dphi_cosmics");\r
1985 aFolderObj->Add(h2D);\r
0aaa8b91 1986\r
1987 //\r
0aaa8b91 1988 // event level \r
1989 //\r
1990 h = fCorrRecEventHist1[0]->Projection(1);\r
1991 h->SetName("mult_event_not_corrected");\r
1992 aFolderObj->Add(h);\r
1993\r
1994 h = fCorrRecEventHist1[1]->Projection(1);\r
1995 h->SetName("mult_event_vertex_corrected");\r
1996 aFolderObj->Add(h);\r
1997\r
1998 h = fCorrRecEventHist1[2]->Projection(1);\r
1999 h->SetName("mult_trigger_vertex_corrected");\r
2000 aFolderObj->Add(h);\r
2001\r
2002 h = fCorrRecEventHist1[3]->Projection(1);\r
2003 h->SetName("mult_ND_trigger_vertex_corrected");\r
2004 aFolderObj->Add(h);\r
2005\r
2006 h = fCorrRecEventHist1[4]->Projection(1);\r
2007 h->SetName("mult_NSD_trigger_vertex_corrected");\r
2008 aFolderObj->Add(h);\r
2009\r
2010 // empty events\r
2011 h = fCorrRecEventHist2[0]->Projection(1);\r
2012 h->SetName("mult_empty_event_not_corrected");\r
2013 aFolderObj->Add(h);\r
2014\r
2015 h = fCorrRecEventHist2[1]->Projection(1);\r
2016 h->SetName("mult_empty_event_vertex_corrected");\r
2017 aFolderObj->Add(h);\r
2018\r
2019 h = fCorrRecEventHist2[2]->Projection(1);\r
2020 h->SetName("mult_empty_trigger_vertex_corrected");\r
2021 aFolderObj->Add(h);\r
2022\r
2023 h = fCorrRecEventHist2[3]->Projection(1);\r
2024 h->SetName("mult_empty_ND_trigger_vertex_corrected");\r
2025 aFolderObj->Add(h);\r
2026\r
2027 h = fCorrRecEventHist2[4]->Projection(1);\r
2028 h->SetName("mult_empty_NSD_trigger_vertex_corrected");\r
2029 aFolderObj->Add(h);\r
bad4ba69 2030 \r
2031 //\r
2032 // MC available\r
2033 //\r
2034 if(IsUseMCInfo()) {\r
0aaa8b91 2035\r
2036 // mc \r
2037 h = fMCAllEventMultHist1->Projection(1);\r
2038 h->SetName("mc_mult_event_acc_prim");\r
2039 aFolderObj->Add(h);\r
2040\r
2041 h = fMCAllNDEventMultHist1->Projection(1);\r
2042 h->SetName("mc_mult_ND_event_acc_prim");\r
2043 aFolderObj->Add(h);\r
2044\r
2045 h = fMCAllNSDEventMultHist1->Projection(1);\r
2046 h->SetName("mc_mult_NSD_event_acc_prim");\r
2047 aFolderObj->Add(h);\r
2048\r
2049 h = fMCTriggerMultHist1->Projection(1);\r
2050 h->SetName("mc_mult_trigger_acc_prim");\r
2051 aFolderObj->Add(h);\r
2052\r
2053 h = fMCEventMultHist1->Projection(1);\r
2054 h->SetName("mc_mult_trigger_event_acc_prim");\r
2055 aFolderObj->Add(h);\r
2056\r
2057\r
2058 //\r
2059 // track level\r
2060 //\r
2061 \r
2062 // limit eta range\r
2063 for(Int_t i=0;i<8;i++) { \r
3405c7c2 2064 //fCorrRecTrackMultHist1[i]->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
2065 //fCorrRecTrackMultHist1[i]->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 2066 }\r
3405c7c2 2067 //fMCAllPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
2068 //fMCAllPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 2069\r
3405c7c2 2070 //fMCNDEventAllPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
2071 //fMCNDEventAllPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 2072\r
3405c7c2 2073 //fMCNSDEventAllPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
2074 //fMCNSDEventAllPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 2075\r
3405c7c2 2076 //fMCTriggerPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
2077 //fMCTriggerPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
0aaa8b91 2078\r
3405c7c2 2079 //fMCEventPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
2080 //fMCEventPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
bad4ba69 2081\r
2082 } // end use MC info \r
0aaa8b91 2083 \r
2084 //\r
2085 h2D = fCorrRecTrackMultHist1[3]->Projection(1,0);\r
2086 h2D->SetName("pt_eta_rec_track_mult_eff_cont_corrected");\r
2087 aFolderObj->Add(h2D);\r
2088\r
2089 h2D = fCorrRecTrackMultHist1[4]->Projection(1,0);\r
2090 h2D->SetName("pt_eta_rec_event_track_mult_eff_cont_corrected");\r
2091 aFolderObj->Add(h2D);\r
2092\r
2093 h2D = fCorrRecTrackMultHist1[5]->Projection(1,0);\r
2094 h2D->SetName("pt_eta_rec_trig_event_track_mult_eff_cont_corrected");\r
2095 aFolderObj->Add(h2D);\r
2096\r
2097 h2D = fCorrRecTrackMultHist1[6]->Projection(1,0);\r
2098 h2D->SetName("pt_eta_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
2099 aFolderObj->Add(h2D);\r
2100\r
2101 h2D = fCorrRecTrackMultHist1[7]->Projection(1,0);\r
2102 h2D->SetName("pt_eta_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
2103 aFolderObj->Add(h2D);\r
2104\r
2105\r
2106 //\r
2107 h2D = fCorrRecTrackMultHist1[3]->Projection(2,0);\r
2108 h2D->SetName("pt_mult_rec_track_mult_eff_cont_corrected");\r
2109 aFolderObj->Add(h2D);\r
2110\r
2111 h2D = fCorrRecTrackMultHist1[4]->Projection(2,0);\r
2112 h2D->SetName("pt_mult_rec_event_track_mult_eff_cont_corrected");\r
2113 aFolderObj->Add(h2D);\r
2114\r
2115 h2D = fCorrRecTrackMultHist1[5]->Projection(2,0);\r
2116 h2D->SetName("pt_mult_rec_trig_event_track_mult_eff_cont_corrected");\r
2117 aFolderObj->Add(h2D);\r
2118\r
2119 h2D = fCorrRecTrackMultHist1[6]->Projection(2,0);\r
2120 h2D->SetName("pt_mult_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
2121 aFolderObj->Add(h2D);\r
2122\r
2123 h2D = fCorrRecTrackMultHist1[7]->Projection(2,0);\r
2124 h2D->SetName("pt_mult_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
2125 aFolderObj->Add(h2D);\r
2126\r
2127 // pt axis\r
2128\r
2129 h = fCorrRecTrackMultHist1[0]->Projection(0);\r
2130 h->SetName("pt_rec_track_not_corrected");\r
2131 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2132 hs->SetName("pt_rec_track_not_corrected_s");\r
2133 aFolderObj->Add(hs);\r
2134\r
2135 //\r
2136 h = fCorrRecTrackMultHist1[1]->Projection(0);\r
2137 h->SetName("pt_rec_track_cont_corrected");\r
2138 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2139 hs->SetName("pt_rec_track_cont_corrected_s");\r
2140 aFolderObj->Add(hs);\r
2141\r
2142 hsc = (TH1D*)hs->Clone("pt_rec_track_cont_corr_fact");\r
2143 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_not_corrected_s"));\r
2144 aFolderObj->Add(hsc);\r
2145\r
2146 //\r
2147 h = fCorrRecTrackMultHist1[2]->Projection(0);\r
2148 h->SetName("pt_rec_track_eff_cont_corrected");\r
2149 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2150 hs->SetName("pt_rec_track_eff_cont_corrected_s");\r
2151 aFolderObj->Add(hs);\r
2152\r
2153 hsc = (TH1D*)hs->Clone("pt_rec_track_eff_corr_fact");\r
2154 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_cont_corrected_s"));\r
2155 aFolderObj->Add(hsc);\r
2156\r
2157 //\r
2158 h = fCorrRecTrackMultHist1[3]->Projection(0);\r
2159 h->SetName("pt_rec_track_mult_eff_cont_corrected");\r
2160 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2161 hs->SetName("pt_rec_track_mult_eff_cont_corrected_s");\r
2162 aFolderObj->Add(hs);\r
2163\r
2164 hsc = (TH1D*)hs->Clone("pt_rec_track_mult_corr_fact");\r
2165 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_eff_cont_corrected_s"));\r
2166 aFolderObj->Add(hsc);\r
2167\r
2168 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2169 hsc = (TH1D*)hs->Clone("pt_rec_track_mult_eff_cont_corr_fact");\r
2170 hsc->Divide((TH1D*)aFolderObj->FindObject("pt_rec_track_not_corrected_s"));\r
2171 aFolderObj->Add(hsc);\r
2172\r
2173 hsc = (TH1D*)hs->Clone();\r
2174 hsc->SetName("pt_rec_track_mult_eff_cont_corrected_s_norm");\r
2175 hsc->Scale(1./(fCorrRecEventHist1[0]->Projection(1)->Integral()));\r
2176 aFolderObj->Add(hsc);\r
2177\r
2178 //\r
2179 h = fCorrRecTrackMultHist1[4]->Projection(0);\r
2180 h->SetName("pt_rec_event_track_mult_eff_cont_corrected");\r
2181 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2182 hs->SetName("pt_rec_event_track_mult_eff_cont_corrected_s");\r
2183 aFolderObj->Add(hs);\r
2184\r
2185 hsc = (TH1D*)hs->Clone();\r
2186 hsc->SetName("pt_rec_event_track_mult_eff_cont_corrected_s_norm");\r
2187 hsc->Scale(1./(fCorrRecEventHist1[1]->Projection(1)->Integral()+fCorrRecEventHist2[1]->Projection(1)->Integral()));\r
2188 aFolderObj->Add(hsc);\r
2189\r
2190 //\r
2191 h = fCorrRecTrackMultHist1[5]->Projection(0);\r
2192 h->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected");\r
2193 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2194 hs->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s");\r
2195 aFolderObj->Add(hs);\r
2196\r
2197 hsc = (TH1D*)hs->Clone();\r
2198 hsc->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s_norm");\r
2199 hsc->Scale(1./(fCorrRecEventHist1[2]->Projection(1)->Integral() + fCorrRecEventHist2[2]->Projection(1)->Integral()));\r
2200 aFolderObj->Add(hsc);\r
2201\r
00b81913 2202 // positive eta\r
2203 fCorrRecTrackMultHist1[5]->GetAxis(1)->SetRangeUser(0., maxEta);\r
2204\r
2205 h = fCorrRecTrackMultHist1[5]->Projection(0);\r
2206 h->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_posEta");\r
2207 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2208 hs->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s_posEta");\r
2209 aFolderObj->Add(hs);\r
2210\r
2211 hsc = (TH1D*)hs->Clone();\r
2212 hsc->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s_norm_posEta");\r
2213 hsc->Scale(1./(fCorrRecEventHist1[2]->Projection(1)->Integral()+fCorrRecEventHist2[2]->Projection(1)->Integral()));\r
2214 aFolderObj->Add(hsc);\r
2215\r
2216 // negative eta\r
2217 fCorrRecTrackMultHist1[5]->GetAxis(1)->SetRangeUser(minEta, -0.00001);\r
2218\r
2219 h = fCorrRecTrackMultHist1[5]->Projection(0);\r
2220 h->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_negEta");\r
2221 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2222 hs->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s_negEta");\r
2223 aFolderObj->Add(hs);\r
2224\r
2225 hsc = (TH1D*)hs->Clone();\r
2226 hsc->SetName("pt_rec_trig_event_track_mult_eff_cont_corrected_s_norm_negEta");\r
2227 hsc->Scale(1./(fCorrRecEventHist1[2]->Projection(1)->Integral()+fCorrRecEventHist2[2]->Projection(1)->Integral()));\r
2228 aFolderObj->Add(hsc);\r
2229\r
2230 fCorrRecTrackMultHist1[5]->GetAxis(1)->SetRange(1, fCorrRecTrackMultHist1[5]->GetAxis(1)->GetNbins());\r
2231\r
0aaa8b91 2232 //\r
2233 h = fCorrRecTrackMultHist1[6]->Projection(0);\r
2234 h->SetName("pt_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
2235 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2236 hs->SetName("pt_rec_ND_trig_event_track_mult_eff_cont_corrected_s");\r
2237 aFolderObj->Add(hs);\r
2238\r
2239 hsc = (TH1D*)hs->Clone();\r
2240 hsc->SetName("pt_rec_ND_trig_event_track_mult_eff_cont_corrected_s_norm");\r
2241 hsc->Scale(1./(fCorrRecEventHist1[3]->Projection(1)->Integral()+fCorrRecEventHist2[3]->Projection(1)->Integral()));\r
2242 aFolderObj->Add(hsc);\r
2243\r
2244 //\r
2245 h = fCorrRecTrackMultHist1[7]->Projection(0);\r
2246 h->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
2247 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2248 hs->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s");\r
2249 aFolderObj->Add(hs);\r
2250\r
2251 hsc = (TH1D*)hs->Clone();\r
2252 hsc->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm");\r
15b7cc05 2253 hsc->Scale(1./(fCorrRecEventHist1[4]->Projection(1)->Integral() + fCorrRecEventHist2[4]->Projection(1)->Integral()));\r
0aaa8b91 2254 aFolderObj->Add(hsc);\r
2255\r
00b81913 2256 //\r
2257 // positive eta\r
2258 //\r
2259 fCorrRecTrackMultHist1[7]->GetAxis(1)->SetRangeUser(0., maxEta);\r
2260\r
2261 h = fCorrRecTrackMultHist1[7]->Projection(0);\r
2262 h->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_posEta");\r
2263 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2264 hs->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_posEta");\r
2265 aFolderObj->Add(hs);\r
2266\r
2267 hsc = (TH1D*)hs->Clone();\r
2268 hsc->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm_posEta");\r
2269 hsc->Scale(1./(fCorrRecEventHist1[4]->Projection(1)->Integral()+fCorrRecEventHist2[4]->Projection(1)->Integral()));\r
2270 aFolderObj->Add(hsc);\r
2271\r
2272 //\r
2273 // negative eta\r
2274 //\r
2275 fCorrRecTrackMultHist1[7]->GetAxis(1)->SetRangeUser(minEta, -0.00001);\r
2276\r
2277 h = fCorrRecTrackMultHist1[7]->Projection(0);\r
2278 h->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_negEta");\r
2279 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2280 hs->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_negEta");\r
2281 aFolderObj->Add(hs);\r
2282\r
2283 hsc = (TH1D*)hs->Clone();\r
2284 hsc->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm_negEta");\r
2285 hsc->Scale(1./(fCorrRecEventHist1[4]->Projection(1)->Integral()+fCorrRecEventHist2[4]->Projection(1)->Integral()));\r
2286 aFolderObj->Add(hsc);\r
2287\r
2288 fCorrRecTrackMultHist1[7]->GetAxis(1)->SetRange(1, fCorrRecTrackMultHist1[7]->GetAxis(1)->GetNbins());\r
2289\r
0aaa8b91 2290 // eta axis\r
2291 h = fCorrRecTrackMultHist1[0]->Projection(1);\r
2292 h->SetName("eta_rec_track_not_corrected");\r
2293 aFolderObj->Add(h);\r
2294 \r
2295 h = fCorrRecTrackMultHist1[1]->Projection(1);\r
2296 h->SetName("eta_rec_track_cont_corrected");\r
2297 aFolderObj->Add(h);\r
2298\r
2299 h = fCorrRecTrackMultHist1[2]->Projection(1);\r
2300 h->SetName("eta_rec_track_eff_cont_corrected");\r
2301 aFolderObj->Add(h);\r
2302\r
2303 h = fCorrRecTrackMultHist1[3]->Projection(1);\r
2304 h->SetName("eta_rec_track_mult_eff_cont_corrected");\r
2305 aFolderObj->Add(h);\r
2306\r
2307 h = fCorrRecTrackMultHist1[4]->Projection(1);\r
2308 h->SetName("eta_rec_event_track_mult_eff_cont_corrected");\r
2309 aFolderObj->Add(h);\r
2310\r
2311 h = fCorrRecTrackMultHist1[5]->Projection(1);\r
2312 h->SetName("eta_rec_trig_event_track_mult_eff_cont_corrected");\r
2313 aFolderObj->Add(h);\r
2314\r
2315 h = fCorrRecTrackMultHist1[6]->Projection(1);\r
2316 h->SetName("eta_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
2317 aFolderObj->Add(h);\r
2318\r
2319 h = fCorrRecTrackMultHist1[7]->Projection(1);\r
2320 h->SetName("eta_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
2321 aFolderObj->Add(h);\r
2322\r
2323\r
bad4ba69 2324 //\r
2325 // MC available\r
2326 //\r
2327 if(IsUseMCInfo()) {\r
0aaa8b91 2328\r
2329 //\r
2330 h2D = fMCAllPrimTrackMultHist1->Projection(2,0);\r
2331 h2D->SetName("mc_all_pt_mult_acc_prim");\r
2332 aFolderObj->Add(h2D);\r
2333\r
2334 h2D = fMCAllPrimTrackMultHist1->Projection(1,0);\r
2335 h2D->SetName("mc_all_eta_pt_acc_prim");\r
2336 aFolderObj->Add(h2D);\r
2337\r
2338 h2D = fMCNDEventAllPrimTrackMultHist1->Projection(2,0);\r
2339 h2D->SetName("mc_ND_all_pt_mult_acc_prim");\r
2340 aFolderObj->Add(h2D);\r
2341\r
2342 h2D = fMCNDEventAllPrimTrackMultHist1->Projection(1,0);\r
2343 h2D->SetName("mc_ND_all_eta_pt_acc_prim");\r
2344 aFolderObj->Add(h2D);\r
2345\r
2346 h2D = fMCNSDEventAllPrimTrackMultHist1->Projection(2,0);\r
2347 h2D->SetName("mc_NSD_all_pt_mult_acc_prim");\r
2348 aFolderObj->Add(h2D);\r
2349\r
2350 h2D = fMCNSDEventAllPrimTrackMultHist1->Projection(1,0);\r
2351 h2D->SetName("mc_NSD_all_eta_pt_acc_prim");\r
2352 aFolderObj->Add(h2D);\r
2353\r
2354 //\r
2355\r
2356 h = fMCAllPrimTrackMultHist1->Projection(0);\r
2357 h->SetName("mc_all_pt_acc_prim");\r
2358 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2359 hs->SetName("mc_all_pt_acc_prim_s");\r
2360 aFolderObj->Add(hs);\r
2361\r
2362 hsc = (TH1D*)hs->Clone();\r
2363 hsc->SetName("mc_all_pt_acc_prim_s_norm");\r
2364 hsc->Scale(1./fMCAllEventMultHist1->Projection(1)->Integral());\r
2365 aFolderObj->Add(hsc);\r
2366\r
2367 h = fMCNDEventAllPrimTrackMultHist1->Projection(0);\r
2368 h->SetName("mc_ND_all_pt_acc_prim");\r
2369 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2370 hs->SetName("mc_ND_all_pt_acc_prim_s");\r
2371 aFolderObj->Add(hs);\r
2372\r
2373 hsc = (TH1D*)hs->Clone();\r
2374 hsc->SetName("mc_ND_all_pt_acc_prim_s_norm");\r
2375 hsc->Scale(1./fMCAllNDEventMultHist1->Projection(1)->Integral());\r
2376 aFolderObj->Add(hsc);\r
2377\r
2378 h = fMCNSDEventAllPrimTrackMultHist1->Projection(0);\r
2379 h->SetName("mc_NSD_all_pt_acc_prim");\r
2380 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2381 hs->SetName("mc_NSD_all_pt_acc_prim_s");\r
2382 aFolderObj->Add(hs);\r
2383\r
2384 hsc = (TH1D*)hs->Clone();\r
2385 hsc->SetName("mc_NSD_all_pt_acc_prim_s_norm");\r
2386 hsc->Scale(1./fMCAllNSDEventMultHist1->Projection(1)->Integral());\r
2387 aFolderObj->Add(hsc);\r
2388\r
2389 h = fMCTriggerPrimTrackMultHist1->Projection(0);\r
2390 h->SetName("mc_trigger_all_pt_acc_prim");\r
2391 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2392 hs->SetName("mc_trigger_all_pt_acc_prim_s");\r
2393 aFolderObj->Add(hs);\r
2394\r
2395 hsc = (TH1D*)hs->Clone();\r
2396 hsc->SetName("mc_trigger_all_pt_acc_prim_s_norm");\r
2397 hsc->Scale(1./fMCTriggerMultHist1->Projection(1)->Integral());\r
2398 aFolderObj->Add(hsc);\r
2399\r
2400 h = fMCEventPrimTrackMultHist1->Projection(0);\r
2401 h->SetName("mc_all_pt_acc_trig_event_prim");\r
2402 hs = AlidNdPtHelper::ScaleByBinWidth(h);\r
2403 hs->SetName("mc_all_pt_acc_trig_event_prim_s");\r
2404 aFolderObj->Add(hs);\r
2405\r
2406 hsc = (TH1D*)hs->Clone();\r
2407 hsc->SetName("mc_all_pt_acc_trig_event_prim_s_norm");\r
2408 hsc->Scale(1./fMCEventMultHist1->Projection(1)->Integral());\r
2409 aFolderObj->Add(hsc);\r
2410\r
2411 //\r
2412\r
2413 h = fMCAllPrimTrackMultHist1->Projection(1);\r
2414 h->SetName("mc_all_eta_acc_prim");\r
2415 aFolderObj->Add(h);\r
2416\r
2417 h = fMCNDEventAllPrimTrackMultHist1->Projection(1);\r
2418 h->SetName("mc_ND_all_eta_acc_prim");\r
2419 aFolderObj->Add(h);\r
2420\r
2421 h = fMCNSDEventAllPrimTrackMultHist1->Projection(1);\r
2422 h->SetName("mc_NSD_all_eta_acc_prim");\r
2423 aFolderObj->Add(h);\r
2424\r
2425 h = fMCTriggerPrimTrackMultHist1->Projection(1);\r
2426 h->SetName("mc_trigger_all_eta_acc_prim");\r
2427 aFolderObj->Add(h);\r
2428\r
2429 h = fMCEventPrimTrackMultHist1->Projection(1);\r
2430 h->SetName("mc_all_eta_acc_trig_event_prim");\r
2431 aFolderObj->Add(h);\r
2432\r
2433 //\r
2434 // calculate ratios (rec / mc)\r
2435 //\r
2436 \r
2437 hs = (TH1*)aFolderObj->FindObject("pt_rec_trig_event_track_mult_eff_cont_corrected_s_norm");\r
2438 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_trig_event_track_mult_eff_cont_corrected"); \r
2439 hsc->Sumw2();\r
2440 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_pt_acc_prim_s_norm"));\r
2441 aFolderObj->Add(hsc);\r
2442\r
2443 hs = (TH1*)aFolderObj->FindObject("eta_rec_trig_event_track_mult_eff_cont_corrected");\r
2444 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_trig_event_track_mult_eff_cont_corrected"); \r
2445 hsc->Sumw2();\r
2446 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_eta_acc_prim"));\r
2447 aFolderObj->Add(hsc);\r
2448\r
2449 //\r
2450 hs = (TH1*)aFolderObj->FindObject("pt_rec_ND_trig_event_track_mult_eff_cont_corrected_s_norm");\r
2451 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_ND_trig_event_track_mult_eff_cont_corrected"); \r
2452 hsc->Sumw2();\r
2453 hsc->Divide((TH1*)aFolderObj->FindObject("mc_ND_all_pt_acc_prim_s_norm"));\r
2454 aFolderObj->Add(hsc);\r
2455\r
2456 hs = (TH1*)aFolderObj->FindObject("eta_rec_ND_trig_event_track_mult_eff_cont_corrected");\r
2457 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_ND_trig_event_track_mult_eff_cont_corrected"); \r
2458 hsc->Sumw2();\r
2459 hsc->Divide((TH1*)aFolderObj->FindObject("mc_ND_all_eta_acc_prim"));\r
2460 aFolderObj->Add(hsc);\r
2461\r
2462 //\r
2463 hs = (TH1*)aFolderObj->FindObject("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm");\r
2464 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_NSD_trig_event_track_mult_eff_cont_corrected"); \r
2465 hsc->Sumw2();\r
2466 hsc->Divide((TH1*)aFolderObj->FindObject("mc_NSD_all_pt_acc_prim_s_norm"));\r
2467 aFolderObj->Add(hsc);\r
2468\r
2469 hs = (TH1*)aFolderObj->FindObject("eta_rec_NSD_trig_event_track_mult_eff_cont_corrected");\r
2470 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_NSD_trig_event_track_mult_eff_cont_corrected"); \r
2471 hsc->Sumw2();\r
2472 hsc->Divide((TH1*)aFolderObj->FindObject("mc_NSD_all_eta_acc_prim"));\r
2473 aFolderObj->Add(hsc);\r
2474\r
2475 //\r
2476 hs = (TH1*)aFolderObj->FindObject("pt_rec_event_track_mult_eff_cont_corrected_s_norm");\r
2477 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_event_track_mult_eff_cont_corrected"); \r
2478 hsc->Sumw2();\r
2479 hsc->Divide((TH1*)aFolderObj->FindObject("mc_trigger_all_pt_acc_prim_s_norm"));\r
2480 aFolderObj->Add(hsc);\r
2481\r
2482 hs = (TH1*)aFolderObj->FindObject("eta_rec_event_track_mult_eff_cont_corrected");\r
2483 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_event_track_mult_eff_cont_corrected"); \r
2484 hsc->Sumw2();\r
2485 hsc->Divide((TH1*)aFolderObj->FindObject("mc_trigger_all_eta_acc_prim"));\r
2486 aFolderObj->Add(hsc);\r
2487\r
2488 // track level\r
2489 hs = (TH1*)aFolderObj->FindObject("pt_rec_track_mult_eff_cont_corrected_s_norm");\r
2490 hsc = (TH1D*)hs->Clone("ratio_pt_rec_to_mc_track_mult_eff_cont_corrected"); \r
2491 hsc->Sumw2();\r
2492 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_pt_acc_trig_event_prim_s_norm"));\r
2493 aFolderObj->Add(hsc);\r
2494\r
2495 hs = (TH1*)aFolderObj->FindObject("eta_rec_track_mult_eff_cont_corrected");\r
2496 hsc = (TH1D*)hs->Clone("ratio_eta_rec_to_mc_track_mult_eff_cont_corrected"); \r
2497 hsc->Sumw2();\r
2498 hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_eta_acc_trig_event_prim"));\r
2499 aFolderObj->Add(hsc);\r
2500\r
bad4ba69 2501 } // end MC infor available\r
2502\r
0aaa8b91 2503 // export objects to analysis folder\r
2504 fCorrectionFolder = ExportToFolder(aFolderObj);\r
2505\r
2506 // delete only TObjArray\r
2507 if(aFolderObj) delete aFolderObj;\r
2508}\r
2509\r
2510//_____________________________________________________________________________\r
c931948b 2511TFolder* AlidNdPtCorrection::ExportToFolder(TObjArray * const array) \r
0aaa8b91 2512{\r
2513 // recreate folder avery time and export objects to new one\r
2514 //\r
2515 AlidNdPtCorrection * comp=this;\r
2516 TFolder *folder = comp->GetCorrectionFolder();\r
2517\r
2518 TString name, title;\r
2519 TFolder *newFolder = 0;\r
2520 Int_t i = 0;\r
2521 Int_t size = array->GetSize();\r
2522\r
2523 if(folder) { \r
2524 // get name and title from old folder\r
2525 name = folder->GetName(); \r
2526 title = folder->GetTitle(); \r
2527\r
2528 // delete old one\r
2529 delete folder;\r
2530\r
2531 // create new one\r
2532 newFolder = CreateFolder(name.Data(),title.Data());\r
2533 newFolder->SetOwner();\r
2534\r
2535 // add objects to folder\r
2536 while(i < size) {\r
2537 newFolder->Add(array->At(i));\r
2538 i++;\r
2539 }\r
2540 }\r
2541\r
2542return newFolder;\r
2543}\r
2544\r
2545//_____________________________________________________________________________\r
2546TFolder* AlidNdPtCorrection::CreateFolder(TString name,TString title) { \r
2547// create folder for analysed histograms\r
2548//\r
2549TFolder *folder = 0;\r
2550 folder = new TFolder(name.Data(),title.Data());\r
2551\r
2552 return folder;\r
2553}\r