]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTPair.cxx
Bug correction: uninitialized fPartX
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPair.cxx
1 #include "AliHBTPair.h"
2 #include "AliHBTParticle.h"
3
4 ClassImp(AliHBTPair)
5
6 /************************************************************************/
7 AliHBTPair::AliHBTPair(Bool_t rev):
8  fPart1(0x0),
9  fPart2(0x0)
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 /************************************************************************/
20
21 AliHBTPair::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
35 Double_t AliHBTPair::GetInvMass()
36 {
37 //Returns qinv value for a pair
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 /************************************************************************/
50 Double_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 /************************************************************************/
62 Double_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 /************************************************************************/
75 Double_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 /************************************************************************/
89 Double_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
101 Double_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);
117     fKStar = Q/2.;
118     fKStarNotCalc = kFALSE;
119    }
120   return fKStar;
121 }
122 /************************************************************************/
123
124 Double_t AliHBTPair::GetQInv()
125 {
126   if(fQInvNotCalc)
127    {
128     CalculateQInvL();
129     fQInv = TMath::Sqrt(TMath::Abs(fQInvL));
130     fQInvNotCalc = kFALSE;
131    }
132   return fQInv;
133 }
134
135 /************************************************************************/
136 /************************************************************************/
137
138 /************************************************************************/
139
140
141
142
143
144
145