]>
Commit | Line | Data |
---|---|---|
cbcc22b0 | 1 | #include "AliHBTWeightNonId3DCorrFctn.h" |
2 | #include <TH1.h> | |
3 | #include <Riostream.h> | |
4 | ||
5 | /////////////////////////////////////////////////////// | |
6 | // // | |
7 | // AliHBTWeightNonId3DCorrFctn.h // | |
8 | // // | |
9 | // Class for calculating 3D non-id correlation // | |
10 | // functions using methods of weights // | |
11 | // // | |
12 | /////////////////////////////////////////////////////// | |
13 | ||
14 | ClassImp(AliHBTWeightNonId3DCorrFctn) | |
15 | ||
16 | AliHBTWeightNonId3DCorrFctn::AliHBTWeightNonId3DCorrFctn(const char* name, const char* title): | |
17 | AliHBTTwoPairFctn1D(name,title), | |
18 | fWeightNumOutP(0x0), | |
19 | fWeightDenOutP(0x0), | |
20 | fWeightRatOutP(0x0), | |
21 | fWeightNumOutN(0x0), | |
22 | fWeightDenOutN(0x0), | |
23 | fWeightRatOutN(0x0), | |
24 | fWeightRatOut(0x0), | |
25 | fWeightRatOutNOverP(0x0), | |
26 | fWeightNumSideP(0x0), | |
27 | fWeightDenSideP(0x0), | |
28 | fWeightRatSideP(0x0), | |
29 | fWeightNumSideN(0x0), | |
30 | fWeightDenSideN(0x0), | |
31 | fWeightRatSideN(0x0), | |
32 | fWeightRatSide(0x0), | |
33 | fWeightRatSideNOverP(0x0), | |
34 | fWeightNumLongP(0x0), | |
35 | fWeightDenLongP(0x0), | |
36 | fWeightRatLongP(0x0), | |
37 | fWeightNumLongN(0x0), | |
38 | fWeightDenLongN(0x0), | |
39 | fWeightRatLongN(0x0), | |
40 | fWeightRatLong(0x0), | |
41 | fWeightRatLongNOverP(0x0) | |
42 | { | |
43 | //ctor | |
44 | } | |
45 | /******************************************************************/ | |
46 | AliHBTWeightNonId3DCorrFctn::AliHBTWeightNonId3DCorrFctn(const char* name, const char* title, | |
47 | Int_t nbinsX, Float_t maxXval, Float_t minXval): | |
48 | AliHBTTwoPairFctn1D(name,title,nbinsX,maxXval,minXval), | |
49 | fWeightNumOutP(0x0), | |
50 | fWeightDenOutP(0x0), | |
51 | fWeightRatOutP(0x0), | |
52 | fWeightNumOutN(0x0), | |
53 | fWeightDenOutN(0x0), | |
54 | fWeightRatOutN(0x0), | |
55 | fWeightRatOut(0x0), | |
56 | fWeightRatOutNOverP(0x0), | |
57 | fWeightNumSideP(0x0), | |
58 | fWeightDenSideP(0x0), | |
59 | fWeightRatSideP(0x0), | |
60 | fWeightNumSideN(0x0), | |
61 | fWeightDenSideN(0x0), | |
62 | fWeightRatSideN(0x0), | |
63 | fWeightRatSide(0x0), | |
64 | fWeightRatSideNOverP(0x0), | |
65 | fWeightNumLongP(0x0), | |
66 | fWeightDenLongP(0x0), | |
67 | fWeightRatLongP(0x0), | |
68 | fWeightNumLongN(0x0), | |
69 | fWeightDenLongN(0x0), | |
70 | fWeightRatLongN(0x0), | |
71 | fWeightRatLong(0x0), | |
72 | fWeightRatLongNOverP(0x0) | |
73 | { | |
74 | //ctor | |
75 | } | |
76 | ||
77 | /******************************************************************/ | |
78 | AliHBTWeightNonId3DCorrFctn::AliHBTWeightNonId3DCorrFctn(const AliHBTWeightNonId3DCorrFctn& in): | |
79 | AliHBTTwoPairFctn1D(in), | |
80 | fWeightNumOutP(0x0), | |
81 | fWeightDenOutP(0x0), | |
82 | fWeightRatOutP(0x0), | |
83 | fWeightNumOutN(0x0), | |
84 | fWeightDenOutN(0x0), | |
85 | fWeightRatOutN(0x0), | |
86 | fWeightRatOut(0x0), | |
87 | fWeightRatOutNOverP(0x0), | |
88 | fWeightNumSideP(0x0), | |
89 | fWeightDenSideP(0x0), | |
90 | fWeightRatSideP(0x0), | |
91 | fWeightNumSideN(0x0), | |
92 | fWeightDenSideN(0x0), | |
93 | fWeightRatSideN(0x0), | |
94 | fWeightRatSide(0x0), | |
95 | fWeightRatSideNOverP(0x0), | |
96 | fWeightNumLongP(0x0), | |
97 | fWeightDenLongP(0x0), | |
98 | fWeightRatLongP(0x0), | |
99 | fWeightNumLongN(0x0), | |
100 | fWeightDenLongN(0x0), | |
101 | fWeightRatLongN(0x0), | |
102 | fWeightRatLong(0x0), | |
103 | fWeightRatLongNOverP(0x0) | |
104 | { | |
105 | //ctor | |
106 | } | |
107 | ||
108 | /******************************************************************/ | |
109 | ||
110 | AliHBTWeightNonId3DCorrFctn::~AliHBTWeightNonId3DCorrFctn() | |
111 | { | |
112 | //dtor | |
113 | delete fWeightNumOutP; | |
114 | delete fWeightDenOutP; | |
115 | delete fWeightRatOutP; | |
116 | delete fWeightNumOutN; | |
117 | delete fWeightDenOutN; | |
118 | delete fWeightRatOutN; | |
119 | delete fWeightRatOut; | |
120 | delete fWeightRatOutNOverP; | |
121 | delete fWeightNumSideP; | |
122 | delete fWeightDenSideP; | |
123 | delete fWeightRatSideP; | |
124 | delete fWeightNumSideN; | |
125 | delete fWeightDenSideN; | |
126 | delete fWeightRatSideN; | |
127 | delete fWeightRatSide; | |
128 | delete fWeightRatSideNOverP; | |
129 | delete fWeightNumLongP; | |
130 | delete fWeightDenLongP; | |
131 | delete fWeightRatLongP; | |
132 | delete fWeightNumLongN; | |
133 | delete fWeightDenLongN; | |
134 | delete fWeightRatLongN; | |
135 | delete fWeightRatLong; | |
136 | delete fWeightRatLongNOverP; | |
137 | ||
138 | } | |
139 | ||
140 | //------------------------------------- | |
141 | void AliHBTWeightNonId3DCorrFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) | |
142 | { | |
143 | //Fills the numerator using pair from the same event | |
55d46048 | 144 | |
145 | // partpair = CheckPair(partpair);//why checking cuts on simulated? | |
146 | ||
cbcc22b0 | 147 | trackpair = CheckPair(trackpair); |
148 | if(partpair == 0x0) return; | |
149 | if(trackpair == 0x0) return; | |
150 | ||
31aae134 | 151 | double tKStar = TMath::Abs(trackpair->GetKStar()); |
cbcc22b0 | 152 | double tKStarOut = trackpair->GetKStarOut(); |
153 | double tKStarSide = trackpair->GetKStarSide(); | |
154 | double tKStarLong = trackpair->GetKStarLong(); | |
155 | ||
156 | Double_t weight = 1.0; | |
157 | ||
158 | if ( trackpair && partpair) | |
159 | { | |
160 | if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) && | |
161 | ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) ) | |
162 | { | |
163 | weight=partpair->GetWeight(); | |
164 | } | |
165 | ||
166 | if(tKStarOut>0.) | |
167 | { | |
168 | fWeightNumOutP->Fill(tKStar,weight); | |
169 | } | |
170 | else | |
171 | { | |
172 | fWeightNumOutN->Fill(tKStar,weight); | |
173 | } | |
174 | ||
175 | if(tKStarSide>0.) | |
176 | { | |
177 | fWeightNumSideP->Fill(tKStar,weight); | |
178 | } | |
179 | else | |
180 | { | |
181 | fWeightNumSideN->Fill(tKStar,weight); | |
182 | } | |
183 | ||
184 | if(tKStarLong>0.) | |
185 | { | |
186 | fWeightNumLongP->Fill(tKStar,weight); | |
187 | } | |
188 | else | |
189 | { | |
190 | fWeightNumLongN->Fill(tKStar,weight); | |
191 | } | |
192 | } | |
193 | ||
194 | } | |
195 | ||
196 | /****************************************************************/ | |
197 | ||
198 | ||
199 | void AliHBTWeightNonId3DCorrFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) | |
200 | { | |
201 | ||
202 | trackpair = CheckPair(trackpair); | |
55d46048 | 203 | // partpair = CheckPair(partpair); |
cbcc22b0 | 204 | |
31aae134 | 205 | double tKStar = TMath::Abs(partpair->GetKStar()); |
cbcc22b0 | 206 | double tKStarOut = trackpair->GetKStarOut(); |
207 | double tKStarSide = trackpair->GetKStarSide(); | |
208 | double tKStarLong = trackpair->GetKStarLong(); | |
209 | ||
210 | if ( trackpair && partpair) | |
211 | { | |
212 | if(tKStarOut>0.) | |
213 | { | |
214 | fWeightDenOutP->Fill(tKStar); | |
215 | } | |
216 | else | |
217 | { | |
218 | fWeightDenOutN->Fill(tKStar); | |
219 | } | |
220 | ||
221 | if(tKStarSide>0.) | |
222 | { | |
223 | fWeightDenSideP->Fill(tKStar); | |
224 | } | |
225 | else | |
226 | { | |
227 | fWeightDenSideN->Fill(tKStar); | |
228 | } | |
229 | ||
230 | if(tKStarLong>0.) | |
231 | { | |
232 | fWeightDenLongP->Fill(tKStar); | |
233 | } | |
234 | else | |
235 | { | |
236 | fWeightDenLongN->Fill(tKStar); | |
237 | } | |
238 | } | |
239 | ||
240 | } | |
241 | ||
242 | ||
243 | /****************************************************************/ | |
244 | void AliHBTWeightNonId3DCorrFctn::Init() | |
245 | { | |
246 | AliHBTTwoPairFctn1D::Init(); | |
247 | fWeightNumOutP->Reset(); | |
248 | fWeightDenOutP->Reset(); | |
249 | fWeightRatOutP->Reset(); | |
250 | fWeightNumOutN->Reset(); | |
251 | fWeightDenOutN->Reset(); | |
252 | fWeightRatOutN->Reset(); | |
253 | fWeightRatOut->Reset(); | |
254 | fWeightRatOutNOverP->Reset(); | |
255 | ||
256 | fWeightNumSideP->Reset(); | |
257 | fWeightDenSideP->Reset(); | |
258 | fWeightRatSideP->Reset(); | |
259 | fWeightNumSideN->Reset(); | |
260 | fWeightDenSideN->Reset(); | |
261 | fWeightRatSideN->Reset(); | |
262 | fWeightRatSide->Reset(); | |
263 | fWeightRatSideNOverP->Reset(); | |
264 | ||
265 | fWeightNumLongP->Reset(); | |
266 | fWeightDenLongP->Reset(); | |
267 | fWeightRatLongP->Reset(); | |
268 | fWeightNumLongN->Reset(); | |
269 | fWeightDenLongN->Reset(); | |
270 | fWeightRatLongN->Reset(); | |
271 | fWeightRatLong->Reset(); | |
272 | fWeightRatLongNOverP->Reset(); | |
273 | } | |
274 | /******************************************************************/ | |
275 | ||
276 | void AliHBTWeightNonId3DCorrFctn::BuildHistos(Int_t nbins, Float_t max, Float_t min) | |
277 | { | |
278 | ||
279 | AliHBTFunction1D::BuildHistos(nbins,max,min); | |
280 | ||
281 | TString nameNumOutP = "WeightNumOutP"; | |
282 | TString nameDenOutP = "WeightDenOutP"; | |
283 | TString nameRatOutP = "WeightRatOutP"; | |
284 | TString nameNumOutN = "WeightNumOutN"; | |
285 | TString nameDenOutN = "WeightDenOutN"; | |
286 | TString nameRatOutN = "WeightRatOutN"; | |
287 | TString nameRatOut = "WeightRatOut"; | |
288 | TString nameRatOutNOverP = "WeightRatOutNOverP"; | |
289 | TString nameNumSideP = "WeightNumSideP"; | |
290 | TString nameDenSideP = "WeightDenSideP"; | |
291 | TString nameRatSideP = "WeightRatSideP"; | |
292 | TString nameNumSideN = "WeightNumSideN"; | |
293 | TString nameDenSideN = "WeightDenSideN"; | |
294 | TString nameRatSideN = "WeightRatSideN"; | |
295 | TString nameRatSide = "WeightRatSide"; | |
296 | TString nameRatSideNOverP = "WeightRatSideNOverP"; | |
297 | TString nameNumLongP = "WeightNumLongP"; | |
298 | TString nameDenLongP = "WeightDenLongP"; | |
299 | TString nameRatLongP = "WeightRatLongP"; | |
300 | TString nameNumLongN = "WeightNumLongN"; | |
301 | TString nameDenLongN = "WeightDenLongN"; | |
302 | TString nameRatLongN = "WeightRatLongN"; | |
303 | TString nameRatLong = "WeightRatLong"; | |
304 | TString nameRatLongNOverP = "WeightRatLongNOverP"; | |
305 | ||
306 | fWeightNumOutP = new TH1D(nameNumOutP.Data(),nameNumOutP.Data(),nbins,min,max); | |
307 | fWeightDenOutP = new TH1D(nameDenOutP.Data(),nameDenOutP.Data(),nbins,min,max); | |
308 | fWeightRatOutP = new TH1D(nameRatOutP.Data(),nameRatOutP.Data(),nbins,min,max); | |
309 | ||
310 | fWeightNumOutN = new TH1D(nameNumOutN.Data(),nameNumOutN.Data(),nbins,min,max); | |
311 | fWeightDenOutN = new TH1D(nameDenOutN.Data(),nameDenOutN.Data(),nbins,min,max); | |
312 | fWeightRatOutN = new TH1D(nameRatOutN.Data(),nameRatOutN.Data(),nbins,min,max); | |
313 | ||
314 | fWeightRatOut = new TH1D(nameRatOut.Data(),nameRatOut.Data(),nbins,min,max); | |
315 | fWeightRatOutNOverP = new TH1D(nameRatOutNOverP.Data(),nameRatOutNOverP.Data(),nbins,min,max); | |
316 | ||
317 | fWeightNumSideP = new TH1D(nameNumSideP.Data(),nameNumSideP.Data(),nbins,min,max); | |
318 | fWeightDenSideP = new TH1D(nameDenSideP.Data(),nameDenSideP.Data(),nbins,min,max); | |
319 | fWeightRatSideP = new TH1D(nameRatSideP.Data(),nameRatSideP.Data(),nbins,min,max); | |
320 | ||
321 | fWeightNumSideN = new TH1D(nameNumSideN.Data(),nameNumSideN.Data(),nbins,min,max); | |
322 | fWeightDenSideN = new TH1D(nameDenSideN.Data(),nameDenSideN.Data(),nbins,min,max); | |
323 | fWeightRatSideN = new TH1D(nameRatSideN.Data(),nameRatSideN.Data(),nbins,min,max); | |
324 | ||
325 | fWeightRatSide = new TH1D(nameRatSide.Data(),nameRatSide.Data(),nbins,min,max); | |
326 | fWeightRatSideNOverP = new TH1D(nameRatSideNOverP.Data(),nameRatSideNOverP.Data(),nbins,min,max); | |
327 | ||
328 | fWeightNumLongP = new TH1D(nameNumLongP.Data(),nameNumLongP.Data(),nbins,min,max); | |
329 | fWeightDenLongP = new TH1D(nameDenLongP.Data(),nameDenLongP.Data(),nbins,min,max); | |
330 | fWeightRatLongP = new TH1D(nameRatLongP.Data(),nameRatLongP.Data(),nbins,min,max); | |
331 | ||
332 | fWeightNumLongN = new TH1D(nameNumLongN.Data(),nameNumLongN.Data(),nbins,min,max); | |
333 | fWeightDenLongN = new TH1D(nameDenLongN.Data(),nameDenLongN.Data(),nbins,min,max); | |
334 | fWeightRatLongN = new TH1D(nameRatLongN.Data(),nameRatLongN.Data(),nbins,min,max); | |
335 | ||
336 | fWeightRatLong = new TH1D(nameRatLong.Data(),nameRatLong.Data(),nbins,min,max); | |
337 | fWeightRatLongNOverP = new TH1D(nameRatLongNOverP.Data(),nameRatLongNOverP.Data(),nbins,min,max); | |
338 | ||
339 | ||
340 | fWeightNumOutP->Sumw2(); | |
341 | fWeightDenOutP->Sumw2(); | |
342 | fWeightRatOutP->Sumw2(); | |
343 | fWeightNumOutN->Sumw2(); | |
344 | fWeightDenOutN->Sumw2(); | |
345 | fWeightRatOutN->Sumw2(); | |
346 | fWeightRatOut->Sumw2(); | |
347 | fWeightRatOutNOverP->Sumw2(); | |
348 | fWeightNumSideP->Sumw2(); | |
349 | fWeightDenSideP->Sumw2(); | |
350 | fWeightRatSideP->Sumw2(); | |
351 | fWeightNumSideN->Sumw2(); | |
352 | fWeightDenSideN->Sumw2(); | |
353 | fWeightRatSideN->Sumw2(); | |
354 | fWeightRatSide->Sumw2(); | |
355 | fWeightRatSideNOverP->Sumw2(); | |
356 | fWeightNumLongP->Sumw2(); | |
357 | fWeightDenLongP->Sumw2(); | |
358 | fWeightRatLongP->Sumw2(); | |
359 | fWeightNumLongN->Sumw2(); | |
360 | fWeightDenLongN->Sumw2(); | |
361 | fWeightRatLongN->Sumw2(); | |
362 | fWeightRatLong->Sumw2(); | |
363 | fWeightRatLongNOverP->Sumw2(); | |
364 | } | |
365 | ||
366 | /******************************************************************/ | |
367 | ||
368 | TH1* AliHBTWeightNonId3DCorrFctn::GetResult() | |
369 | { | |
370 | return fWeightRatOutN; | |
371 | } | |
372 | ||
373 | /******************************************************************/ | |
374 | ||
375 | void AliHBTWeightNonId3DCorrFctn::WriteFunction() | |
376 | { | |
377 | ||
378 | Double_t outPscale = Scale(fWeightNumOutP,fWeightDenOutP); | |
379 | cout<<"WoutPscale = "<<outPscale<<endl; | |
380 | fWeightRatOutP->Divide(fWeightNumOutP,fWeightDenOutP,outPscale); | |
381 | ||
382 | Double_t outNscale = Scale(fWeightNumOutN,fWeightDenOutN); | |
383 | cout<<"WoutNscale = "<<outNscale<<endl; | |
384 | fWeightRatOutN->Divide(fWeightNumOutN,fWeightDenOutN,outNscale); | |
385 | ||
386 | fWeightRatOutNOverP->Divide(fWeightRatOutN,fWeightRatOutP); | |
387 | ||
388 | ||
389 | Double_t sidePscale = Scale(fWeightNumSideP,fWeightDenSideP); | |
390 | fWeightRatSideP->Divide(fWeightNumSideP,fWeightDenSideP,sidePscale); | |
391 | ||
392 | Double_t sideNscale = Scale(fWeightNumSideN,fWeightDenSideN); | |
393 | fWeightRatSideN->Divide(fWeightNumSideN,fWeightDenSideN,sideNscale); | |
394 | ||
395 | fWeightRatSideNOverP->Divide(fWeightRatSideN,fWeightRatSideP); | |
396 | ||
397 | ||
398 | Double_t longPscale = Scale(fWeightNumLongP,fWeightDenLongP); | |
399 | fWeightRatLongP->Divide(fWeightNumLongP,fWeightDenLongP,longPscale); | |
400 | ||
401 | Double_t longNscale = Scale(fWeightNumLongN,fWeightDenLongN); | |
402 | fWeightRatLongN->Divide(fWeightNumLongN,fWeightDenLongN,longNscale); | |
403 | ||
404 | fWeightRatLongNOverP->Divide(fWeightRatLongN,fWeightRatLongP); | |
405 | ||
406 | fWeightNumOutP->Write(); | |
407 | fWeightDenOutP->Write(); | |
408 | fWeightRatOutP->Write(); | |
409 | fWeightNumOutN->Write(); | |
410 | fWeightDenOutN->Write(); | |
411 | fWeightRatOutN->Write(); | |
412 | fWeightRatOut->Write(); | |
413 | fWeightRatOutNOverP->Write(); | |
414 | ||
415 | fWeightNumSideP->Write(); | |
416 | fWeightDenSideP->Write(); | |
417 | fWeightRatSideP->Write(); | |
418 | fWeightNumSideN->Write(); | |
419 | fWeightDenSideN->Write(); | |
420 | fWeightRatSideN->Write(); | |
421 | fWeightRatSide->Write(); | |
422 | fWeightRatSideNOverP->Write(); | |
423 | ||
424 | fWeightNumLongP->Write(); | |
425 | fWeightDenLongP->Write(); | |
426 | fWeightRatLongP->Write(); | |
427 | fWeightNumLongN->Write(); | |
428 | fWeightDenLongN->Write(); | |
429 | fWeightRatLongN->Write(); | |
430 | fWeightRatLong->Write(); | |
431 | fWeightRatLongNOverP->Write(); | |
432 | ||
433 | } | |
434 |