3 //_________________________________________________________________________
4 ///////////////////////////////////////////////////////////////////////////
8 // class implements pair of particles and taking care of caluclation (almost)
9 // all of pair properties (Qinv, InvMass,...)
10 // more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
12 ////////////////////////////////////////////////////////////////////////////
15 #include "AliHBTParticle.h"
18 class AliHBTPair: public TObject
21 AliHBTPair(Bool_t rev = kFALSE); //contructor
22 AliHBTPair(AliHBTParticle* part1, AliHBTParticle* part2, Bool_t rev = kFALSE); //contructor
23 AliHBTPair(const AliHBTPair& in);
25 virtual ~AliHBTPair(){}
27 AliHBTPair& operator=(const AliHBTPair& in);
29 void SetParticles(AliHBTParticle* p1,AliHBTParticle* p2); //sets particles in the pair
30 AliHBTPair* GetSwapedPair() {return fSwapedPair;} //returns pair with swapped particles
32 AliHBTParticle* Particle1() const {return fPart1;} //returns pointer to first particle
33 AliHBTParticle* Particle2() const {return fPart2;} //returns pointer to decond particle
36 //Center Mass System - Longitudinally Comoving
38 virtual Double_t GetInvMass(); //returns invariant mass of the pair
39 virtual Double_t GetMt();
40 virtual Double_t GetQInv(); //returns Q invariant
41 virtual Double_t GetQSideCMSLC(); //returns Q Side CMS longitudionally co-moving
42 virtual Double_t GetQOutCMSLC(); //returns Q out CMS longitudionally co-moving
43 virtual Double_t GetQLongCMSLC(); //returns Q Long CMS longitudionally co-moving
46 virtual Double_t GetKt(); //returns K transverse
47 virtual Double_t GetKStar();
49 virtual Double_t GetDeltaP(); //return difference of momenta
50 virtual Double_t GetDeltaPt();
51 virtual Double_t GetDeltaPx();
52 virtual Double_t GetDeltaPy();
53 virtual Double_t GetDeltaPz();
55 virtual Double_t GetDeltaTheta();
56 virtual Double_t GetDeltaPhi();
58 virtual Double_t GetGammaToCMSLC();
61 AliHBTParticle* fPart1; //pointer to first particle
62 AliHBTParticle* fPart2; //pointer to second particle
64 AliHBTPair* fSwapedPair; //pointer to swapped pair
66 /************************************************************/
67 /************CMS (LC) Q's *********************************/
68 /************************************************************/
69 //Center Mass System - Longitudinally Comoving
71 Double_t fQSideCMSLC; //value of Q side CMS longitudially co-moving
72 Bool_t fQSideCMSLCNotCalc; //flag indicating if fQSideCMSLC is already calculated for this pair
74 Double_t fQOutCMSLC; //value of Q out CMS longitudially co-moving
75 Bool_t fQOutCMSLCNotCalc;//flag indicating if fQOutCMSLC is already calculated for this pair
77 Double_t fQLongCMSLC; //value of Q long CMS longitudially co-moving
78 Bool_t fQLongCMSLCNotCalc;//flag indicating if fQLongCMSLC is already calculated for this pair
79 /************************************************************/
80 /************************************************************/
81 Double_t fQInv; //half of differnece of 4-momenta
82 Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair
84 Double_t fInvMass; //invariant mass
85 Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair
87 Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component
88 Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair
90 Double_t fKStar; // KStar
91 Bool_t fKStarNotCalc;// flag indicating if fKStar is calculated
93 Double_t fPInv; //invariant momentum
95 Double_t fQSide; //Q Side
97 Double_t fQLong;//Q Long
99 Double_t fMt;//Transverse coordinate of Inv. Mass
100 Bool_t fMtNotCalc;//flag indicating if Mt is calculated for current pair
102 Double_t fInvMassSqr;//squre of invariant mass
103 Bool_t fMassSqrNotCalc; //flag indicating if fInvMassSqr for this pair
104 void CalculateInvMassSqr();
106 Double_t fQInvL; //Qinv in longitudional direction
107 Bool_t fQInvLNotCalc;//flag indicating if fQInvL is calculated for current pair
108 void CalculateQInvL();
110 Double_t fWeight;//Value of the weight
111 Bool_t fWeightNotCalc;//flag indicating if fWeight is calculated for current pair
113 Double_t fPxSum;// Sum of Px momenta
114 Double_t fPySum;// Sum of Py momenta
115 Double_t fPzSum;// Sum of Pz momenta
116 Double_t fESum;// Sum of energies
117 Bool_t fSumsNotCalc;//flag indicating if fPxSum,fPxSum,fPxSum and fESum is calculated for current pair
118 void CalculateSums();
120 Double_t fPxDiff;// Difference of Px momenta
121 Double_t fPyDiff;// Difference of Px momenta
122 Double_t fPzDiff;// Difference of Px momenta
123 Double_t fEDiff;// Difference of Px momenta
124 Bool_t fDiffsNotCalc;//flag indicating if fPxDiff,fPxDiff,fPxDiff and fEDiff is calculated for current pair
125 void CalculateDiffs();
127 Double_t fGammaCMSLC;//gamma of boost in CMSLC
128 Bool_t fGammaCMSLCNotCalc;//flag indicating if fGammaCMSLC is calculated for current pair
129 /***************************************************/
130 void CalculateBase();
131 Bool_t fChanged;//flag indicating if object has been changed
135 ClassDef(AliHBTPair,1)
137 /****************************************************************/
139 void AliHBTPair::SetParticles(AliHBTParticle* p1,AliHBTParticle* p2)
141 //sets the particle to the pair
145 if (fSwapedPair) //if we have Swaped (so we are not)
146 fSwapedPair->SetParticles(p2,p1); //set particles for him too
148 //and do nothing until will be asked for
150 /****************************************************************/
153 void AliHBTPair::Changed()
155 // Resel all calculations (flags)
157 fSumsNotCalc = kTRUE;
158 fDiffsNotCalc = kTRUE;
159 fMassSqrNotCalc = kTRUE;
160 fInvMassNotCalc = kTRUE;
161 fQInvNotCalc = kTRUE;
163 fQSideCMSLCNotCalc = kTRUE;
164 fQOutCMSLCNotCalc = kTRUE;
165 fQLongCMSLCNotCalc = kTRUE;
167 fKStarNotCalc = kTRUE;
168 fQInvLNotCalc = kTRUE;
169 fGammaCMSLCNotCalc = kTRUE;
170 fWeightNotCalc = kTRUE;
172 /****************************************************************/
174 void AliHBTPair::CalculateInvMassSqr()
176 //calculates square of qinv
181 Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum);
183 fInvMassSqr=fESum*fESum-fPart12s;
185 fMassSqrNotCalc = kFALSE;
188 /****************************************************************/
190 void AliHBTPair::CalculateQInvL()
192 //Calculates square root of Qinv
196 fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff );
197 fQInvLNotCalc = kFALSE;
200 /****************************************************************/
202 void AliHBTPair::CalculateSums()
204 //calculates momenta and energy sums
207 fPxSum = fPart1->Px()+fPart2->Px();
208 fPySum = fPart1->Py()+fPart2->Py();
209 fPzSum = fPart1->Pz()+fPart2->Pz();
210 fESum = fPart1->Energy() + fPart2->Energy();
211 fSumsNotCalc = kFALSE;
214 /****************************************************************/
216 void AliHBTPair::CalculateDiffs()
218 //calculates momenta and energy differences
221 fPxDiff = fPart1->Px()-fPart2->Px();
222 fPyDiff = fPart1->Py()-fPart2->Py();
223 fPzDiff = fPart1->Pz()-fPart2->Pz();
224 fEDiff = fPart1->Energy() - fPart2->Energy();
225 fDiffsNotCalc = kFALSE;
229 /****************************************************************/
231 Double_t AliHBTPair::GetDeltaP() //return difference of momenta
233 //returns difference of momenta (length of vector)
235 return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff);
237 /****************************************************************/
240 Double_t AliHBTPair::GetDeltaPt()
242 //returns difference of Pz
243 return fPart1->Pt()-fPart2->Pt();
245 /****************************************************************/
248 Double_t AliHBTPair::GetDeltaPx()
250 //returns difference of Pz
254 /****************************************************************/
256 Double_t AliHBTPair::GetDeltaPy()
258 //returns difference of Py
263 /****************************************************************/
265 Double_t AliHBTPair::GetDeltaPz()
267 //returns difference of Pz
271 /****************************************************************/
274 Double_t AliHBTPair::GetDeltaPhi()
276 //returns difference of Pz
277 return fPart1->Phi()-fPart2->Phi();
279 /****************************************************************/
282 Double_t AliHBTPair::GetDeltaTheta()
284 //returns difference of Pz
285 return fPart1->Theta()-fPart2->Theta();
287 /****************************************************************/