1 #include "AliHBTWeightFctn.h"
3 //_________________________________________________________________________
5 // class AliHBTWeightQInvFctn
7 // This class allows to obtain Q_inv correlation function with weights
8 // calculated by Lednicky's alghorithm.
9 // Numerator is filled with weighted events. Weights are attributed to reconstructed tracks.
10 // Weights are calculated with corresponding simulated particles momenta.
11 // Denominator is filled with mixing unweighted reconstructed tracks.
12 // One needs both pairs
13 // (simulated and recontructed), thus function is of class AliHBTTwoPairFctn1D.
14 // Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru)
16 ////////////////////////////////////////////////////////////////////////////////
18 ClassImp( AliHBTWeightQInvFctn )
21 /****************************************************************/
22 AliHBTWeightQInvFctn::AliHBTWeightQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
23 AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
26 fWriteNumAndDen = kTRUE;//change default behaviour
27 Rename("wqinvcf","Q_{inv} Weight Correlation Function");
29 /****************************************************************/
31 void AliHBTWeightQInvFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
33 //process particles from same events (fills numerator)
34 trackpair = CheckPair(trackpair);
35 // partpair = CheckPair(partpair);
36 if ( trackpair && partpair)
38 // Double_t weightPID=1.;
39 Double_t weight = 1.0;
40 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
41 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
43 weight=partpair->GetWeight();
45 // Double_t weight=weightHBT*weightPID;
46 fNumerator->Fill(trackpair->GetQInv(),weight);
49 /****************************************************************/
51 void AliHBTWeightQInvFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
53 // Fills the denominator using mixed pairs
54 trackpair = CheckPair(trackpair);
55 // partpair = CheckPair(partpair);
56 if ( trackpair && partpair)
58 fDenominator->Fill(trackpair->GetQInv());
61 /**************************************************************/
63 TH1* AliHBTWeightQInvFctn::GetResult()
65 //returns ratio of numerator and denominator
66 //returns the scaled ratio
68 fRatio = GetRatio(Scale());
72 /**************************************************************************************/
73 /**************************************************************************************/
74 /**************************************************************************************/
75 /**************************************************************************************/
77 ClassImp(AliHBTWeightQOutFctn)
79 AliHBTWeightQOutFctn::AliHBTWeightQOutFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
80 AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
83 fWriteNumAndDen = kTRUE;//change default behaviour
84 Rename("wqoutcf","Q_{out} Weight Correlation Function");
86 /****************************************************************/
88 void AliHBTWeightQOutFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
90 //process particles from same events (fills numerator)
91 trackpair = CheckPair(trackpair);
92 // partpair = CheckPair(partpair);
93 if ( trackpair && partpair)
95 // Double_t weightPID=1.;
96 Double_t weight = 1.0;
97 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
98 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
100 weight=partpair->GetWeight();
102 // Double_t weight=weightHBT*weightPID;
103 fNumerator->Fill(trackpair->GetQOutLCMS(),weight);
106 /****************************************************************/
108 void AliHBTWeightQOutFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
110 //process particles from diff events (fills denominator)
111 trackpair = CheckPair(trackpair);
112 // partpair = CheckPair(partpair);
113 if ( trackpair && partpair)
115 fDenominator->Fill(trackpair->GetQOutLCMS());
118 /**************************************************************/
120 TH1* AliHBTWeightQOutFctn::GetResult()
122 //returns the scaled ratio
124 fRatio = GetRatio(Scale());
128 /*************************************************************************************/
129 /*************************************************************************************/
130 /*************************************************************************************/
132 ClassImp(AliHBTWeightQLongFctn)
133 AliHBTWeightQLongFctn::AliHBTWeightQLongFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
134 AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
137 fWriteNumAndDen = kTRUE;//change default behaviour
138 Rename("wqlongcf","Q_{long} Weight Correlation Function");
140 /****************************************************************/
142 void AliHBTWeightQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
144 //process particles from same events (fills numerator)
145 trackpair = CheckPair(trackpair);
146 // partpair = CheckPair(partpair);
147 if ( trackpair && partpair)
149 // Double_t weightPID=1.;
150 Double_t weight = 1.0;
151 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
152 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
154 weight=partpair->GetWeight();
156 // Double_t weight=weightHBT*weightPID;
157 fNumerator->Fill(trackpair->GetQLongLCMS(),weight);
160 /****************************************************************/
162 void AliHBTWeightQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
164 //process particles from diff events (fills denominator)
165 trackpair = CheckPair(trackpair);
166 // partpair = CheckPair(partpair);
167 if ( trackpair && partpair)
169 fDenominator->Fill(trackpair->GetQLongLCMS());
172 /**************************************************************/
173 TH1* AliHBTWeightQLongFctn::GetResult()
175 //returns the scaled ratio
177 fRatio = GetRatio(Scale());
181 /*************************************************************************************/
182 /*************************************************************************************/
183 /*************************************************************************************/
185 ClassImp(AliHBTWeightQSideFctn)
186 /*************************************************************************************/
188 AliHBTWeightQSideFctn::AliHBTWeightQSideFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
189 AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
192 fWriteNumAndDen = kTRUE;//change default behaviour
193 Rename("wqsidecf","Q_{side} Weight Correlation Function");
195 /****************************************************************/
197 void AliHBTWeightQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
199 //process particles from same events (fills numerator)
200 trackpair = CheckPair(trackpair);
201 // partpair = CheckPair(partpair);
202 if ( trackpair && partpair)
204 // Double_t weightPID=1.;
205 Double_t weight = 1.0;
206 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
207 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
209 weight=partpair->GetWeight();
211 // Double_t weight=weightHBT*weightPID;
212 fNumerator->Fill(trackpair->GetQSideLCMS(),weight);
215 /****************************************************************/
217 void AliHBTWeightQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
219 //process particles from diff events (fills denominator)
220 trackpair = CheckPair(trackpair);
221 // partpair = CheckPair(partpair);
222 if ( trackpair && partpair)
224 fDenominator->Fill(trackpair->GetQSideLCMS());
227 /**************************************************************/
229 TH1* AliHBTWeightQSideFctn::GetResult()
231 //returns the scaled ratio
233 fRatio = GetRatio(Scale());
237 /*************************************************************************************/
238 /*************************************************************************************/
239 /*************************************************************************************/
241 ClassImp(AliHBTWeightTwoKStarFctn)
242 /*************************************************************************************/
243 AliHBTWeightTwoKStarFctn::AliHBTWeightTwoKStarFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
244 AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
247 fWriteNumAndDen = kTRUE;//change default behaviour
248 Rename("wtwokstarcf","2*K^{*} Weight Correlation Function");
250 /****************************************************************/
252 void AliHBTWeightTwoKStarFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
254 //process particles from same events (fills numerator)
255 trackpair = CheckPair(trackpair);
256 // partpair = CheckPair(partpair);
257 if ( trackpair && partpair)
259 // Double_t weightPID=1.;
260 Double_t weight = 1.0;
261 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
262 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
264 weight=partpair->GetWeight();
266 // Double_t weight=weightHBT*weightPID;
267 fNumerator->Fill(2.0*(trackpair->GetKStar()),weight);
270 /****************************************************************/
272 void AliHBTWeightTwoKStarFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
274 //process particles from diff events (fills denominator)
275 trackpair = CheckPair(trackpair);
276 // partpair = CheckPair(partpair);
277 if ( trackpair && partpair)
279 fDenominator->Fill(2.0*(trackpair->GetKStar()));
282 /**************************************************************/
283 TH1* AliHBTWeightTwoKStarFctn::GetResult()
286 //returns the scaled ratio
288 fRatio = GetRatio(Scale());
292 /*************************************************************************************/
293 /*************************************************************************************/
294 /*************************************************************************************/
296 ClassImp(AliHBTWeightQOutQSideFctn)
297 /*************************************************************************************/
299 AliHBTWeightQOutQSideFctn::AliHBTWeightQOutQSideFctn(Int_t nxbins, Double_t maxXval, Double_t minXval,
300 Int_t nybins, Double_t maxYval, Double_t minYval):
301 AliHBTTwoPairFctn2D(nxbins,maxXval,minXval,nybins,maxYval,minYval)
304 fWriteNumAndDen = kTRUE;//change default behaviour
305 Rename("wqoutqsidecf","Q_{out} Q_{side} Weight Correlation Function 2D");
307 /*************************************************************************************/
309 void AliHBTWeightQOutQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
311 //process particles from same events (fills numerator)
312 trackpair = CheckPair(trackpair);
313 // partpair = CheckPair(partpair);
314 if ( trackpair && partpair)
316 // Double_t weightPID=1.;
317 Double_t weight = 1.0;
318 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
319 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
321 weight=partpair->GetWeight();
323 // Double_t weight=weightHBT*weightPID;
324 fNumerator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQSideLCMS(),weight);
327 /****************************************************************/
329 void AliHBTWeightQOutQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
331 //process particles from diff events (fills denominator)
332 trackpair = CheckPair(trackpair);
333 // partpair = CheckPair(partpair);
334 if ( trackpair && partpair)
336 fDenominator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQSideLCMS());
339 /**************************************************************/
341 TH1* AliHBTWeightQOutQSideFctn::GetResult()
343 //returns the scaled ratio
345 fRatio = GetRatio(Scale());
349 /*************************************************************************************/
350 /*************************************************************************************/
351 /*************************************************************************************/
353 ClassImp(AliHBTWeightQOutQLongFctn)
354 /*************************************************************************************/
356 AliHBTWeightQOutQLongFctn::AliHBTWeightQOutQLongFctn(Int_t nxbins, Double_t maxXval, Double_t minXval,
357 Int_t nybins, Double_t maxYval, Double_t minYval):
358 AliHBTTwoPairFctn2D(nxbins,maxXval,minXval,nybins,maxYval,minYval)
361 fWriteNumAndDen = kTRUE;//change default behaviour
362 Rename("wqoutqlongcf","Q_{out} Q_{long} Weight Correlation Function 2D");
364 /*************************************************************************************/
366 void AliHBTWeightQOutQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
368 //process particles from same events (fills numerator)
369 trackpair = CheckPair(trackpair);
370 // partpair = CheckPair(partpair);
371 if ( trackpair && partpair)
373 // Double_t weightPID=1.;
374 Double_t weight = 1.0;
375 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
376 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
378 weight=partpair->GetWeight();
380 // Double_t weight=weightHBT*weightPID;
381 fNumerator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQLongLCMS(),weight);
384 /****************************************************************/
386 void AliHBTWeightQOutQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
388 //process particles from diff events (fills denominator)
389 trackpair = CheckPair(trackpair);
390 // partpair = CheckPair(partpair);
391 if ( trackpair && partpair)
393 fDenominator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQLongLCMS());
396 /**************************************************************/
398 TH1* AliHBTWeightQOutQLongFctn::GetResult()
400 //returns the scaled ratio
402 fRatio = GetRatio(Scale());
406 /*************************************************************************************/
407 /*************************************************************************************/
408 /*************************************************************************************/
410 ClassImp(AliHBTWeightQSideQLongFctn)
411 /*************************************************************************************/
413 AliHBTWeightQSideQLongFctn::AliHBTWeightQSideQLongFctn(Int_t nxbins, Double_t maxXval, Double_t minXval,
414 Int_t nybins, Double_t maxYval, Double_t minYval):
415 AliHBTTwoPairFctn2D(nxbins,maxXval,minXval,nybins,maxYval,minYval)
418 fWriteNumAndDen = kTRUE;//change default behaviour
419 Rename("wqsideqlongcf","Q_{side} Q_{long} Weight Correlation Function 2D");
421 /*************************************************************************************/
423 void AliHBTWeightQSideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
425 //process particles from same events (fills numerator)
426 trackpair = CheckPair(trackpair);
427 // partpair = CheckPair(partpair);
428 if ( trackpair && partpair)
430 // Double_t weightPID=1.;
431 Double_t weight = 1.0;
432 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
433 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
435 weight=partpair->GetWeight();
437 // Double_t weight=weightHBT*weightPID;
438 fNumerator->Fill(trackpair->GetQSideLCMS(),trackpair->GetQLongLCMS(),weight);
441 /****************************************************************/
443 void AliHBTWeightQSideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
445 //process particles from diff events (fills denominator)
446 trackpair = CheckPair(trackpair);
447 // partpair = CheckPair(partpair);
448 if ( trackpair && partpair)
450 fDenominator->Fill(trackpair->GetQSideLCMS(),trackpair->GetQLongLCMS());
453 /**************************************************************/
455 TH1* AliHBTWeightQSideQLongFctn::GetResult()
457 //returns the scaled ratio
459 fRatio = GetRatio(Scale());
462 /*************************************************************/
463 /*************************************************************/
464 /*************************************************************/
466 ClassImp(AliHBTWeightQOutSQideQLongFctn)
468 AliHBTWeightQOutSQideQLongFctn::AliHBTWeightQOutSQideQLongFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
469 Int_t nYbins, Double_t maxYval, Double_t minYval,
470 Int_t nZbins, Double_t maxZval, Double_t minZval):
471 AliHBTTwoPairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
474 fWriteNumAndDen = kTRUE;//change default behaviour
475 Rename("wqoslcf","Q_{out}-Q_{side}-Q_{long} Weight Correlation Fctn");
477 /*************************************************************/
479 void AliHBTWeightQOutSQideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
482 //process particles from same events (fills numerator)
483 trackpair = CheckPair(trackpair);
484 // partpair = CheckPair(partpair);
485 if ( trackpair && partpair)
487 // Double_t weightPID=1.;
488 Double_t weight = 1.0;
489 if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
490 ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode()) )
492 weight=partpair->GetWeight();//here we take weight from the particle pair
494 // Double_t weight=weightHBT*weightPID;
495 Double_t out = trackpair->GetQOutLCMS();
496 Double_t side = trackpair->GetQSideLCMS();
497 Double_t lon = trackpair->GetQLongLCMS();
501 out = TMath::Abs(out);
502 side = TMath::Abs(side);
503 lon = TMath::Abs(lon);
506 fNumerator->Fill(out,side,lon,weight);//here we fill in q's corresponding to track pair
507 //weight calculated for the simulated one
510 /*************************************************************/
512 void AliHBTWeightQOutSQideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
514 //process particles from diff events (fills denominator)
515 trackpair = CheckPair(trackpair);
516 // partpair = CheckPair(partpair);
517 if ( trackpair && partpair)
519 Double_t out = trackpair->GetQOutLCMS();
520 Double_t side = trackpair->GetQSideLCMS();
521 Double_t lon = trackpair->GetQLongLCMS();
525 out = TMath::Abs(out);
526 side = TMath::Abs(side);
527 lon = TMath::Abs(lon);
530 fDenominator->Fill(out,side,lon);
533 /*************************************************************/
535 TH1* AliHBTWeightQOutSQideQLongFctn::GetResult()
537 //returns the scaled ratio
539 fRatio = GetRatio(Scale());