1 #include "AliHBTPair.h"
2 #include "AliHBTParticle.h"
3 #include "AliHBTWeights.h"
7 /************************************************************************/
8 AliHBTPair::AliHBTPair(Bool_t rev):
13 fQSideCMSLCNotCalc(kTRUE),
15 fQOutCMSLCNotCalc(kTRUE),
17 fQLongCMSLCNotCalc(kTRUE),
21 fInvMassNotCalc(kTRUE),
33 fMassSqrNotCalc(kTRUE),
37 fWeightNotCalc(kTRUE),
49 fGammaCMSLCNotCalc(kTRUE),
52 //value of rev defines if it is Swaped
53 //if you pass kTRUE swpaped pair will NOT be created
54 //though you wont be able to get the swaped pair from this pair
56 if(!rev) fSwapedPair = new AliHBTPair(kTRUE); //if false create swaped pair
59 /************************************************************************/
61 AliHBTPair::AliHBTPair(AliHBTParticle* part1, AliHBTParticle* part2, Bool_t rev):
66 fQSideCMSLCNotCalc(kTRUE),
68 fQOutCMSLCNotCalc(kTRUE),
70 fQLongCMSLCNotCalc(kTRUE),
74 fInvMassNotCalc(kTRUE),
86 fMassSqrNotCalc(kTRUE),
90 fWeightNotCalc(kTRUE),
100 fDiffsNotCalc(kTRUE),
102 fGammaCMSLCNotCalc(kTRUE),
105 //value of rev defines if it is Swaped
106 //if you pass kTRUE swpaped pair will NOT be created
107 //though you wont be able to get the swaped pair from this pair
109 if(!rev) fSwapedPair = new AliHBTPair(part2,part1,kTRUE); //if false create swaped pair
112 /************************************************************************/
114 Double_t AliHBTPair::GetInvMass()
116 //Returns qinv value for a pair
119 CalculateInvMassSqr(); //method is inline so we not waste th time for jumping into method
121 if(fInvMassSqr<0) fInvMass = TMath::Sqrt(-fInvMassSqr);
122 else fInvMass = TMath::Sqrt(fInvMassSqr);
124 fInvMassNotCalc = kFALSE;
128 /************************************************************************/
129 Double_t AliHBTPair::GetQSideCMSLC()
131 //return Q Side in Central Of Mass System in Longitudialy Comoving Frame
133 if (fQSideCMSLCNotCalc)
135 fQSideCMSLC = (fPart1->Px()*fPart2->Py()-fPart2->Px()*fPart1->Py())/GetKt();
136 fQSideCMSLCNotCalc = kFALSE;
140 /************************************************************************/
141 Double_t AliHBTPair::GetQOutCMSLC()
143 if(fQOutCMSLCNotCalc)
148 if (fPart1->GetMass() != fPart2->GetMass())
152 Double_t beta = fPzSum/fESum;
153 Double_t gamma = GetGammaToCMSLC();
154 Double_t el = gamma * (fPart1->Energy() - beta * fPart1->Pz());
155 Double_t x = ( fPart1->Px()*fPxSum + fPart1->Py()*fPySum) / ( 2.0*GetKt() );
156 beta = 2.0*GetKt()/GetMt();
157 gamma = GetMt()/GetQInv();
158 fQOutCMSLC = gamma * (x - beta * el);
161 //beta=fPzSum/fESum; // Longit. V == beta
162 Double_t beta=fPzSum/fESum;
163 Double_t gamma = GetGammaToCMSLC();
165 Double_t cosphi=fPxSum/(2.0*GetKt()); // cos(phi)
166 Double_t sinphi=fPySum/(2.0*GetKt()); // sin(phi)
168 // ROTATE(part1Px,part1Py,SPHI,CPHI,part1Px,part1Py);//ROT8
169 // ROTATE(part2Px,part2Py,SPHI,CPHI,part2Px,part2Py);//ROT8
171 tmp = fPart1->Px()*cosphi + fPart1->Py()*sinphi;
172 Double_t part1Py = fPart1->Py()*cosphi - fPart1->Px()*sinphi;
173 Double_t part1Px = tmp;
175 tmp = fPart2->Px()*cosphi + fPart2->Py()*sinphi;
176 Double_t part2Py = fPart2->Py()*cosphi - fPart2->Px()*sinphi;
177 Double_t part2Px = tmp;
180 // LTR(part1Pz,E1,beta,GetGammaToCMSLC(),part1Pz,E1a);
181 // LTR(part2Pz,E2,beta,GetGammaToCMSLC(),part2Pz,E2a);
182 Double_t part1Pz=gamma*(fPart1->Pz()-beta*fPart1->Energy());
183 Double_t part2Pz=gamma*(fPart2->Pz()-beta*fPart2->Energy());
185 Double_t part1P2=part1Px*part1Px+part1Py*part1Py+part1Pz*part1Pz;
186 Double_t part2P2=part2Px*part2Px+part2Py*part2Py+part2Pz*part2Pz;
187 Double_t part1E=TMath::Sqrt(fPart1->GetMass()*fPart1->GetMass()+part1P2);
188 Double_t part2E=TMath::Sqrt(fPart2->GetMass()*fPart2->GetMass()+part2P2);
189 Double_t sumE=part1E+part2E;
190 Double_t sumPx=part1Px+part2Px;
191 Double_t sumPy=part1Py+part2Py;
192 Double_t sumPZ=part1Pz+part2Pz;
193 Double_t sumP2=sumPx*sumPx+sumPy*sumPy+sumPZ*sumPZ;
195 Double_t relmass=TMath::Sqrt(sumE*sumE-sumP2);
196 Double_t hf = (fPart1->GetMass()*fPart1->GetMass() - fPart2->GetMass()*fPart2->GetMass())/(relmass*relmass);
197 fQOutCMSLC=(part1Px-part2Px);//== id
198 fQOutCMSLC=fQOutCMSLC-sumPx*hf; //sumPx == fPxSum ale po rotacji i transf
202 Double_t k2 = fPxSum*fPxDiff+fPySum*fPyDiff;
203 fQOutCMSLC = 0.5*k2/GetKt();
204 // if (non-id) fQOutCMSLC=fQOutCMSLC - sumPx*HF;
208 fQOutCMSLCNotCalc = kFALSE;
212 /************************************************************************/
213 Double_t AliHBTPair::GetQLongCMSLC()
215 if (fQLongCMSLCNotCalc)
219 Double_t beta = fPzSum/fESum;
220 fQLongCMSLC = GetGammaToCMSLC() * ( fPzDiff - beta*fEDiff );
221 fQLongCMSLCNotCalc = kFALSE;
225 /************************************************************************/
226 Double_t AliHBTPair::GetKt()
231 fKt = 0.5*TMath::Hypot(fPxSum,fPySum);
236 /************************************************************************/
238 Double_t AliHBTPair::GetKStar()
244 Double_t Ptrans = fPxSum*fPxSum + fPySum*fPySum;
245 Double_t Mtrans = fESum*fESum - fPzSum*fPzSum;
246 Double_t Pinv = TMath::Sqrt(Mtrans - Ptrans);
248 Double_t Q = (fPart1->GetMass()*fPart1->GetMass() - fPart2->GetMass()*fPart2->GetMass())/Pinv;
255 Info("GetKStar","Q = %f",Q);
263 fKStarNotCalc = kFALSE;
267 /************************************************************************/
269 Double_t AliHBTPair::GetQInv()
272 //warning for non-id particles you want to use 2*KStar
276 fQInv = TMath::Sqrt(TMath::Abs(fQInvL));
277 fQInvNotCalc = kFALSE;
281 /************************************************************************/
283 Double_t AliHBTPair::GetGammaToCMSLC()
285 if(fGammaCMSLCNotCalc)
288 Double_t beta = fPzSum/fESum;
289 fGammaCMSLC = 1.0/TMath::Sqrt(1.0 - beta*beta);
290 fGammaCMSLCNotCalc = kFALSE;
294 /************************************************************************/
296 Double_t AliHBTPair::GetMt()
301 fMt = TMath::Sqrt(fESum*fESum - fPzSum*fPzSum);
306 /************************************************************************/
308 Double_t AliHBTPair::GetWeight()
312 fWeight = AliHBTWeights::Weight(this);
313 fWeightNotCalc = kFALSE;