]>
Commit | Line | Data |
---|---|---|
cbcc22b0 | 1 | #include "AliHBTWeightNonId3DTheorCorrFctn.h" |
2 | #include <TH1.h> | |
3 | #include <Riostream.h> | |
4 | ||
5 | /////////////////////////////////////////////////////// | |
6 | // // | |
7 | // AliHBTWeightNonId3DTheorCorrFctn.h // | |
8 | // // | |
9 | // Class for calculating 3D non-id correlation // | |
10 | // functions using methods of weights // | |
11 | // // | |
12 | /////////////////////////////////////////////////////// | |
13 | ||
14 | ClassImp(AliHBTWeightNonId3DTheorCorrFctn) | |
15 | ||
16 | AliHBTWeightNonId3DTheorCorrFctn::AliHBTWeightNonId3DTheorCorrFctn(const char* name, const char* title): | |
17 | AliHBTOnePairFctn1D(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 | AliHBTWeightNonId3DTheorCorrFctn::AliHBTWeightNonId3DTheorCorrFctn(const char* name, const char* title, | |
47 | Int_t nbinsX, Float_t maxXval, Float_t minXval): | |
48 | AliHBTOnePairFctn1D(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 | AliHBTWeightNonId3DTheorCorrFctn::AliHBTWeightNonId3DTheorCorrFctn(const AliHBTWeightNonId3DTheorCorrFctn& in): | |
79 | AliHBTOnePairFctn1D(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 | AliHBTWeightNonId3DTheorCorrFctn::~AliHBTWeightNonId3DTheorCorrFctn() | |
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 AliHBTWeightNonId3DTheorCorrFctn::ProcessSameEventParticles(AliHBTPair* partpair) | |
142 | { | |
143 | //Fills the numerator using pair from the same event | |
144 | partpair = CheckPair(partpair); | |
145 | if(partpair == 0x0) return; | |
146 | ||
31aae134 | 147 | double tKStar = TMath::Abs(partpair->GetKStar()); |
cbcc22b0 | 148 | double tKStarOut = partpair->GetKStarOut(); |
149 | double tKStarSide = partpair->GetKStarSide(); | |
150 | double tKStarLong = partpair->GetKStarLong(); | |
151 | ||
152 | Double_t weight = 1.0; | |
153 | ||
154 | if (partpair) | |
155 | { | |
156 | weight=partpair->GetWeight(); | |
157 | ||
158 | if(tKStarOut>0.) | |
159 | { | |
160 | fWeightNumOutP->Fill(tKStar,weight); | |
161 | } | |
162 | else | |
163 | { | |
164 | fWeightNumOutN->Fill(tKStar,weight); | |
165 | } | |
166 | ||
167 | if(tKStarSide>0.) | |
168 | { | |
169 | fWeightNumSideP->Fill(tKStar,weight); | |
170 | } | |
171 | else | |
172 | { | |
173 | fWeightNumSideN->Fill(tKStar,weight); | |
174 | } | |
175 | ||
176 | if(tKStarLong>0.) | |
177 | { | |
178 | fWeightNumLongP->Fill(tKStar,weight); | |
179 | } | |
180 | else | |
181 | { | |
182 | fWeightNumLongN->Fill(tKStar,weight); | |
183 | } | |
184 | } | |
185 | ||
186 | } | |
187 | ||
188 | /****************************************************************/ | |
189 | ||
190 | ||
191 | void AliHBTWeightNonId3DTheorCorrFctn::ProcessDiffEventParticles(AliHBTPair* partpair) | |
192 | { | |
193 | ||
194 | partpair = CheckPair(partpair); | |
195 | ||
31aae134 | 196 | double tKStar = TMath::Abs(partpair->GetKStar()); |
cbcc22b0 | 197 | double tKStarOut = partpair->GetKStarOut(); |
198 | double tKStarSide = partpair->GetKStarSide(); | |
199 | double tKStarLong = partpair->GetKStarLong(); | |
200 | ||
201 | if (partpair) | |
202 | { | |
203 | if(tKStarOut>0.) | |
204 | { | |
205 | fWeightDenOutP->Fill(tKStar); | |
206 | } | |
207 | else | |
208 | { | |
209 | fWeightDenOutN->Fill(tKStar); | |
210 | } | |
211 | ||
212 | if(tKStarSide>0.) | |
213 | { | |
214 | fWeightDenSideP->Fill(tKStar); | |
215 | } | |
216 | else | |
217 | { | |
218 | fWeightDenSideN->Fill(tKStar); | |
219 | } | |
220 | ||
221 | if(tKStarLong>0.) | |
222 | { | |
223 | fWeightDenLongP->Fill(tKStar); | |
224 | } | |
225 | else | |
226 | { | |
227 | fWeightDenLongN->Fill(tKStar); | |
228 | } | |
229 | } | |
230 | ||
231 | } | |
232 | ||
233 | ||
234 | /****************************************************************/ | |
235 | void AliHBTWeightNonId3DTheorCorrFctn::Init() | |
236 | { | |
237 | AliHBTOnePairFctn1D::Init(); | |
238 | fWeightNumOutP->Reset(); | |
239 | fWeightDenOutP->Reset(); | |
240 | fWeightRatOutP->Reset(); | |
241 | fWeightNumOutN->Reset(); | |
242 | fWeightDenOutN->Reset(); | |
243 | fWeightRatOutN->Reset(); | |
244 | fWeightRatOut->Reset(); | |
245 | fWeightRatOutNOverP->Reset(); | |
246 | ||
247 | fWeightNumSideP->Reset(); | |
248 | fWeightDenSideP->Reset(); | |
249 | fWeightRatSideP->Reset(); | |
250 | fWeightNumSideN->Reset(); | |
251 | fWeightDenSideN->Reset(); | |
252 | fWeightRatSideN->Reset(); | |
253 | fWeightRatSide->Reset(); | |
254 | fWeightRatSideNOverP->Reset(); | |
255 | ||
256 | fWeightNumLongP->Reset(); | |
257 | fWeightDenLongP->Reset(); | |
258 | fWeightRatLongP->Reset(); | |
259 | fWeightNumLongN->Reset(); | |
260 | fWeightDenLongN->Reset(); | |
261 | fWeightRatLongN->Reset(); | |
262 | fWeightRatLong->Reset(); | |
263 | fWeightRatLongNOverP->Reset(); | |
264 | } | |
265 | /******************************************************************/ | |
266 | ||
267 | void AliHBTWeightNonId3DTheorCorrFctn::BuildHistos(Int_t nbins, Float_t max, Float_t min) | |
268 | { | |
269 | ||
270 | AliHBTFunction1D::BuildHistos(nbins,max,min); | |
271 | ||
272 | TString nameNumOutP = "WeightNumOutP"; | |
273 | TString nameDenOutP = "WeightDenOutP"; | |
274 | TString nameRatOutP = "WeightRatOutP"; | |
275 | TString nameNumOutN = "WeightNumOutN"; | |
276 | TString nameDenOutN = "WeightDenOutN"; | |
277 | TString nameRatOutN = "WeightRatOutN"; | |
278 | TString nameRatOut = "WeightRatOut"; | |
279 | TString nameRatOutNOverP = "WeightRatOutNOverP"; | |
280 | TString nameNumSideP = "WeightNumSideP"; | |
281 | TString nameDenSideP = "WeightDenSideP"; | |
282 | TString nameRatSideP = "WeightRatSideP"; | |
283 | TString nameNumSideN = "WeightNumSideN"; | |
284 | TString nameDenSideN = "WeightDenSideN"; | |
285 | TString nameRatSideN = "WeightRatSideN"; | |
286 | TString nameRatSide = "WeightRatSide"; | |
287 | TString nameRatSideNOverP = "WeightRatSideNOverP"; | |
288 | TString nameNumLongP = "WeightNumLongP"; | |
289 | TString nameDenLongP = "WeightDenLongP"; | |
290 | TString nameRatLongP = "WeightRatLongP"; | |
291 | TString nameNumLongN = "WeightNumLongN"; | |
292 | TString nameDenLongN = "WeightDenLongN"; | |
293 | TString nameRatLongN = "WeightRatLongN"; | |
294 | TString nameRatLong = "WeightRatLong"; | |
295 | TString nameRatLongNOverP = "WeightRatLongNOverP"; | |
296 | ||
297 | fWeightNumOutP = new TH1D(nameNumOutP.Data(),nameNumOutP.Data(),nbins,min,max); | |
298 | fWeightDenOutP = new TH1D(nameDenOutP.Data(),nameDenOutP.Data(),nbins,min,max); | |
299 | fWeightRatOutP = new TH1D(nameRatOutP.Data(),nameRatOutP.Data(),nbins,min,max); | |
300 | ||
301 | fWeightNumOutN = new TH1D(nameNumOutN.Data(),nameNumOutN.Data(),nbins,min,max); | |
302 | fWeightDenOutN = new TH1D(nameDenOutN.Data(),nameDenOutN.Data(),nbins,min,max); | |
303 | fWeightRatOutN = new TH1D(nameRatOutN.Data(),nameRatOutN.Data(),nbins,min,max); | |
304 | ||
305 | fWeightRatOut = new TH1D(nameRatOut.Data(),nameRatOut.Data(),nbins,min,max); | |
306 | fWeightRatOutNOverP = new TH1D(nameRatOutNOverP.Data(),nameRatOutNOverP.Data(),nbins,min,max); | |
307 | ||
308 | fWeightNumSideP = new TH1D(nameNumSideP.Data(),nameNumSideP.Data(),nbins,min,max); | |
309 | fWeightDenSideP = new TH1D(nameDenSideP.Data(),nameDenSideP.Data(),nbins,min,max); | |
310 | fWeightRatSideP = new TH1D(nameRatSideP.Data(),nameRatSideP.Data(),nbins,min,max); | |
311 | ||
312 | fWeightNumSideN = new TH1D(nameNumSideN.Data(),nameNumSideN.Data(),nbins,min,max); | |
313 | fWeightDenSideN = new TH1D(nameDenSideN.Data(),nameDenSideN.Data(),nbins,min,max); | |
314 | fWeightRatSideN = new TH1D(nameRatSideN.Data(),nameRatSideN.Data(),nbins,min,max); | |
315 | ||
316 | fWeightRatSide = new TH1D(nameRatSide.Data(),nameRatSide.Data(),nbins,min,max); | |
317 | fWeightRatSideNOverP = new TH1D(nameRatSideNOverP.Data(),nameRatSideNOverP.Data(),nbins,min,max); | |
318 | ||
319 | fWeightNumLongP = new TH1D(nameNumLongP.Data(),nameNumLongP.Data(),nbins,min,max); | |
320 | fWeightDenLongP = new TH1D(nameDenLongP.Data(),nameDenLongP.Data(),nbins,min,max); | |
321 | fWeightRatLongP = new TH1D(nameRatLongP.Data(),nameRatLongP.Data(),nbins,min,max); | |
322 | ||
323 | fWeightNumLongN = new TH1D(nameNumLongN.Data(),nameNumLongN.Data(),nbins,min,max); | |
324 | fWeightDenLongN = new TH1D(nameDenLongN.Data(),nameDenLongN.Data(),nbins,min,max); | |
325 | fWeightRatLongN = new TH1D(nameRatLongN.Data(),nameRatLongN.Data(),nbins,min,max); | |
326 | ||
327 | fWeightRatLong = new TH1D(nameRatLong.Data(),nameRatLong.Data(),nbins,min,max); | |
328 | fWeightRatLongNOverP = new TH1D(nameRatLongNOverP.Data(),nameRatLongNOverP.Data(),nbins,min,max); | |
329 | ||
330 | ||
331 | fWeightNumOutP->Sumw2(); | |
332 | fWeightDenOutP->Sumw2(); | |
333 | fWeightRatOutP->Sumw2(); | |
334 | fWeightNumOutN->Sumw2(); | |
335 | fWeightDenOutN->Sumw2(); | |
336 | fWeightRatOutN->Sumw2(); | |
337 | fWeightRatOut->Sumw2(); | |
338 | fWeightRatOutNOverP->Sumw2(); | |
339 | fWeightNumSideP->Sumw2(); | |
340 | fWeightDenSideP->Sumw2(); | |
341 | fWeightRatSideP->Sumw2(); | |
342 | fWeightNumSideN->Sumw2(); | |
343 | fWeightDenSideN->Sumw2(); | |
344 | fWeightRatSideN->Sumw2(); | |
345 | fWeightRatSide->Sumw2(); | |
346 | fWeightRatSideNOverP->Sumw2(); | |
347 | fWeightNumLongP->Sumw2(); | |
348 | fWeightDenLongP->Sumw2(); | |
349 | fWeightRatLongP->Sumw2(); | |
350 | fWeightNumLongN->Sumw2(); | |
351 | fWeightDenLongN->Sumw2(); | |
352 | fWeightRatLongN->Sumw2(); | |
353 | fWeightRatLong->Sumw2(); | |
354 | fWeightRatLongNOverP->Sumw2(); | |
355 | } | |
356 | ||
357 | /******************************************************************/ | |
358 | ||
359 | TH1* AliHBTWeightNonId3DTheorCorrFctn::GetResult() | |
360 | { | |
361 | return fWeightRatOutN; | |
362 | } | |
363 | ||
364 | /******************************************************************/ | |
365 | ||
366 | void AliHBTWeightNonId3DTheorCorrFctn::WriteFunction() | |
367 | { | |
368 | ||
369 | Double_t outPscale = Scale(fWeightNumOutP,fWeightDenOutP); | |
370 | cout<<"WoutPscale = "<<outPscale<<endl; | |
371 | fWeightRatOutP->Divide(fWeightNumOutP,fWeightDenOutP,outPscale); | |
372 | ||
373 | Double_t outNscale = Scale(fWeightNumOutN,fWeightDenOutN); | |
374 | cout<<"WoutNscale = "<<outNscale<<endl; | |
375 | fWeightRatOutN->Divide(fWeightNumOutN,fWeightDenOutN,outNscale); | |
376 | ||
377 | fWeightRatOutNOverP->Divide(fWeightRatOutN,fWeightRatOutP); | |
378 | ||
379 | ||
380 | Double_t sidePscale = Scale(fWeightNumSideP,fWeightDenSideP); | |
381 | fWeightRatSideP->Divide(fWeightNumSideP,fWeightDenSideP,sidePscale); | |
382 | ||
383 | Double_t sideNscale = Scale(fWeightNumSideN,fWeightDenSideN); | |
384 | fWeightRatSideN->Divide(fWeightNumSideN,fWeightDenSideN,sideNscale); | |
385 | ||
386 | fWeightRatSideNOverP->Divide(fWeightRatSideN,fWeightRatSideP); | |
387 | ||
388 | ||
389 | Double_t longPscale = Scale(fWeightNumLongP,fWeightDenLongP); | |
390 | fWeightRatLongP->Divide(fWeightNumLongP,fWeightDenLongP,longPscale); | |
391 | ||
392 | Double_t longNscale = Scale(fWeightNumLongN,fWeightDenLongN); | |
393 | fWeightRatLongN->Divide(fWeightNumLongN,fWeightDenLongN,longNscale); | |
394 | ||
395 | fWeightRatLongNOverP->Divide(fWeightRatLongN,fWeightRatLongP); | |
396 | ||
397 | fWeightNumOutP->Write(); | |
398 | fWeightDenOutP->Write(); | |
399 | fWeightRatOutP->Write(); | |
400 | fWeightNumOutN->Write(); | |
401 | fWeightDenOutN->Write(); | |
402 | fWeightRatOutN->Write(); | |
403 | fWeightRatOut->Write(); | |
404 | fWeightRatOutNOverP->Write(); | |
405 | ||
406 | fWeightNumSideP->Write(); | |
407 | fWeightDenSideP->Write(); | |
408 | fWeightRatSideP->Write(); | |
409 | fWeightNumSideN->Write(); | |
410 | fWeightDenSideN->Write(); | |
411 | fWeightRatSideN->Write(); | |
412 | fWeightRatSide->Write(); | |
413 | fWeightRatSideNOverP->Write(); | |
414 | ||
415 | fWeightNumLongP->Write(); | |
416 | fWeightDenLongP->Write(); | |
417 | fWeightRatLongP->Write(); | |
418 | fWeightNumLongN->Write(); | |
419 | fWeightDenLongN->Write(); | |
420 | fWeightRatLongN->Write(); | |
421 | fWeightRatLong->Write(); | |
422 | fWeightRatLongNOverP->Write(); | |
423 | ||
424 | } | |
425 |