lacking declarations for 3d functions for Lednicky's alg. implementations
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPair.cxx
CommitLineData
1b446896 1#include "AliHBTPair.h"
2#include "AliHBTParticle.h"
3
4ClassImp(AliHBTPair)
5
1b446896 6/************************************************************************/
ec6e4013 7AliHBTPair::AliHBTPair(Bool_t rev):
8 fPart1(0x0),
9 fPart2(0x0)
1b446896 10 {
11//value of rev defines if it is Swaped
12//if you pass kTRUE swpaped pair will NOT be created
13//though you wont be able to get the swaped pair from this pair
14
15 if(!rev) fSwapedPair = new AliHBTPair(kTRUE); //if false create swaped pair
16 else fSwapedPair = 0x0; //if true set the pointer to NULL
17
18 }
19/************************************************************************/
ec6e4013 20
21AliHBTPair::AliHBTPair(AliHBTParticle* part1, AliHBTParticle* part2, Bool_t rev):
22 fPart1(part1),
23 fPart2(part2)
24 {
25//value of rev defines if it is Swaped
26//if you pass kTRUE swpaped pair will NOT be created
27//though you wont be able to get the swaped pair from this pair
28
29 if(!rev) fSwapedPair = new AliHBTPair(part2,part1,kTRUE); //if false create swaped pair
30 else fSwapedPair = 0x0; //if true set the pointer to NULL
31
32 }
33/************************************************************************/
34
1b446896 35Double_t AliHBTPair::GetInvMass()
36{
b928db6c 37//Returns qinv value for a pair
1b446896 38 if(fInvMassNotCalc)
39 {
40 CalculateInvMassSqr(); //method is inline so we not waste th time for jumping into method
41
42 if(fInvMassSqr<0) fInvMass = TMath::Sqrt(-fInvMassSqr);
43 else fInvMass = TMath::Sqrt(fInvMassSqr);
44
45 fInvMassNotCalc = kFALSE;
46 }
47 return fInvMass;
48}
49/************************************************************************/
50Double_t AliHBTPair::GetQSideCMSLC()
51{
52 //return Q Side in Central Of Mass System in Longitudialy Comoving Frame
53
54 if (fQSideCMSLCNotCalc)
55 {
56 fQSideCMSLC = (fPart1->Px()*fPart2->Py()-fPart2->Px()*fPart1->Py())/GetKt();
57 fQSideCMSLCNotCalc = kFALSE;
58 }
59 return fQSideCMSLC;
60}
61/************************************************************************/
62Double_t AliHBTPair::GetQOutCMSLC()
63{
64 if(fQOutCMSLCNotCalc)
65 {
66 CalculateSums();
67 CalculateDiffs();
68 Double_t k2 = fPxSum*fPxDiff+fPySum*fPyDiff;
69 fQOutCMSLC = 0.5*k2/GetKt();
70 fQOutCMSLCNotCalc = kFALSE;
71 }
72 return fQOutCMSLC;
73}
74/************************************************************************/
75Double_t AliHBTPair::GetQLongCMSLC()
76{
77 if (fQLongCMSLCNotCalc)
78 {
79 CalculateSums();
80 CalculateDiffs();
81 Double_t beta = fPzSum/fESum;
82 Double_t gamma = 1.0/TMath::Sqrt(1.0 - beta*beta);
83 fQLongCMSLC = gamma*( fPzDiff - beta*fEDiff );
84 fQLongCMSLCNotCalc = kFALSE;
85 }
86 return fQLongCMSLC;
87}
88/************************************************************************/
89Double_t AliHBTPair::GetKt()
90{
91 if(fKtNotCalc)
92 {
93 CalculateSums();
94 fKt = 0.5*TMath::Hypot(fPxSum,fPySum);
95 fKtNotCalc = kFALSE;
96 }
97 return fKt;
98}
99/************************************************************************/
100
101Double_t AliHBTPair::GetKStar()
102{
103 if (fKStarNotCalc)
104 {
105
106 CalculateSums();
107
108 Double_t Ptrans = fPxSum*fPxSum + fPySum*fPySum;
109 Double_t Mtrans = fESum*fESum - fPzSum*fPzSum;
110 Double_t Pinv = TMath::Sqrt(Mtrans - Ptrans);
111
112 Double_t Q = ( fPart1->GetMass()*fPart1->GetMass() - fPart2->GetMass()*fPart2->GetMass())/Pinv;
113
114 CalculateQInvL();
115
116 Q = TMath::Sqrt( Q*Q - fQInvL);
7836ee94 117 fKStar = Q/2.;
1b446896 118 fKStarNotCalc = kFALSE;
119 }
120 return fKStar;
121}
122/************************************************************************/
123
124Double_t AliHBTPair::GetQInv()
125{
126 if(fQInvNotCalc)
127 {
128 CalculateQInvL();
30025bb4 129 fQInv = TMath::Sqrt(TMath::Abs(fQInvL));
1b446896 130 fQInvNotCalc = kFALSE;
131 }
1b446896 132 return fQInv;
133}
134
30025bb4 135/************************************************************************/
30025bb4 136/************************************************************************/
137
138/************************************************************************/
1b446896 139
140
141
142
143
144
145