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 ////////////////////////////////////////////////////////////////////////////
17 #include "AliHBTParticle.h"
20 class AliHBTPair: public TObject
23 AliHBTPair(Bool_t rev = kFALSE); //contructor
24 AliHBTPair(AliHBTParticle* part1, AliHBTParticle* part2, Bool_t rev = kFALSE); //contructor
25 virtual ~AliHBTPair(){}
26 void SetParticles(AliHBTParticle*,AliHBTParticle*); //sets particles in the pair
27 AliHBTPair* GetSwapedPair() {return fSwapedPair;} //returns pair with swapped particles
29 AliHBTParticle* Particle1() const {return fPart1;} //returns pointer to first particle
30 AliHBTParticle* Particle2() const {return fPart2;} //returns pointer to decond particle
33 //Center Mass System - Longitudinally Comoving
35 virtual Double_t GetInvMass(); //returns invariant mass of the pair
36 virtual Double_t GetMt();
37 virtual Double_t GetQInv(); //returns Q invariant
38 virtual Double_t GetQSideCMSLC(); //returns Q Side CMS longitudionally co-moving
39 virtual Double_t GetQOutCMSLC(); //returns Q out CMS longitudionally co-moving
40 virtual Double_t GetQLongCMSLC(); //returns Q Long CMS longitudionally co-moving
43 virtual Double_t GetKt(); //returns K transverse
44 virtual Double_t GetKStar();
46 virtual Double_t GetDeltaP(); //return difference of momenta
47 virtual Double_t GetDeltaPx();
48 virtual Double_t GetDeltaPy();
49 virtual Double_t GetDeltaPz();
51 virtual Double_t GetGammaToCMSLC();
54 AliHBTParticle* fPart1; //pointer to first particle
55 AliHBTParticle* fPart2; //pointer to second particle
57 AliHBTPair* fSwapedPair; //pointer to swapped pair
59 /************************************************************/
60 /************CMS (LC) Q's *********************************/
61 /************************************************************/
62 //Center Mass System - Longitudinally Comoving
64 Double_t fQSideCMSLC; //value of Q side CMS longitudially co-moving
65 Bool_t fQSideCMSLCNotCalc; //flag indicating if fQSideCMSLC is already calculated for this pair
67 Double_t fQOutCMSLC; //value of Q out CMS longitudially co-moving
68 Bool_t fQOutCMSLCNotCalc;//flag indicating if fQOutCMSLC is already calculated for this pair
70 Double_t fQLongCMSLC; //value of Q long CMS longitudially co-moving
71 Bool_t fQLongCMSLCNotCalc;//flag indicating if fQLongCMSLC is already calculated for this pair
72 /************************************************************/
73 /************************************************************/
74 Double_t fQInv; //half of differnece of 4-momenta
75 Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair
77 Double_t fInvMass; //invariant mass
78 Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair
80 Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component
81 Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair
86 Double_t fPInv; //invariant momentum
88 Double_t fQSide; //Q Side
90 Double_t fQLong;//Q Long
92 Double_t fMt;//Transverse coordinate of Inv. Mass
93 Bool_t fMtNotCalc;//flag indicating if Mt is calculated for current pair
95 Double_t fInvMassSqr;//squre of invariant mass
96 Bool_t fMassSqrNotCalc; //
97 void CalculateInvMassSqr();
99 Double_t fQInvL; //Qinv in longitudional direction
100 Bool_t fQInvLNotCalc;//flag indicating if fQInvL is calculated for current pair
101 void CalculateQInvL();
103 Double_t fWeight;//Value of the weight
104 Bool_t fWeightNotCalc;//flag indicating if fWeight is calculated for current pair
106 Double_t fPxSum;// Sum of Px momenta
107 Double_t fPySum;// Sum of Py momenta
108 Double_t fPzSum;// Sum of Pz momenta
109 Double_t fESum;// Sum of energies
110 Bool_t fSumsNotCalc;//flag indicating if fPxSum,fPxSum,fPxSum and fESum is calculated for current pair
111 void CalculateSums();
113 Double_t fPxDiff;// Difference of Px momenta
114 Double_t fPyDiff;// Difference of Px momenta
115 Double_t fPzDiff;// Difference of Px momenta
116 Double_t fEDiff;// Difference of Px momenta
117 Bool_t fDiffsNotCalc;//flag indicating if fPxDiff,fPxDiff,fPxDiff and fEDiff is calculated for current pair
118 void CalculateDiffs();
120 Double_t fGammaCMSLC;//gamma of boost in CMSLC
121 Bool_t fGammaCMSLCNotCalc;//flag indicating if fGammaCMSLC is calculated for current pair
122 /***************************************************/
123 void CalculateBase();
124 Bool_t fChanged;//flag indicating if object has been changed
128 ClassDef(AliHBTPair,1)
130 /****************************************************************/
132 void AliHBTPair::SetParticles(AliHBTParticle* p1,AliHBTParticle* p2)
134 //sets the particle to the pair
138 if (fSwapedPair) //if we have Swaped (so we are not)
139 fSwapedPair->SetParticles(p2,p1); //set particles for him too
141 //and do nothing until will be asked for
143 /****************************************************************/
146 void AliHBTPair::Changed()
148 // Resel all calculations (flags)
150 fSumsNotCalc = kTRUE;
151 fDiffsNotCalc = kTRUE;
152 fMassSqrNotCalc = kTRUE;
153 fInvMassNotCalc = kTRUE;
154 fQInvNotCalc = kTRUE;
156 fQSideCMSLCNotCalc = kTRUE;
157 fQOutCMSLCNotCalc = kTRUE;
158 fQLongCMSLCNotCalc = kTRUE;
160 fKStarNotCalc = kTRUE;
161 fQInvLNotCalc = kTRUE;
162 fGammaCMSLCNotCalc = kTRUE;
163 fWeightNotCalc = kTRUE;
165 /****************************************************************/
167 void AliHBTPair::CalculateInvMassSqr()
169 //calculates square of qinv
174 Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum);
176 fInvMassSqr=fESum*fESum-fPart12s;
178 fMassSqrNotCalc = kFALSE;
181 /****************************************************************/
183 void AliHBTPair::CalculateQInvL()
185 //Calculates square root of Qinv
189 fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff );
190 fQInvLNotCalc = kFALSE;
193 /****************************************************************/
195 void AliHBTPair::CalculateSums()
197 //calculates momenta and energy sums
200 fPxSum = fPart1->Px()+fPart2->Px();
201 fPySum = fPart1->Py()+fPart2->Py();
202 fPzSum = fPart1->Pz()+fPart2->Pz();
203 fESum = fPart1->Energy() + fPart2->Energy();
204 fSumsNotCalc = kFALSE;
207 /****************************************************************/
209 void AliHBTPair::CalculateDiffs()
211 //calculates momenta and energy differences
214 fPxDiff = fPart1->Px()-fPart2->Px();
215 fPyDiff = fPart1->Py()-fPart2->Py();
216 fPzDiff = fPart1->Pz()-fPart2->Pz();
217 fEDiff = fPart1->Energy() - fPart2->Energy();
218 fDiffsNotCalc = kFALSE;
222 /****************************************************************/
224 Double_t AliHBTPair::GetDeltaP() //return difference of momenta
226 //returns difference of momenta
228 return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff);
230 /****************************************************************/
232 Double_t AliHBTPair::GetDeltaPx()
234 //returns difference of Pz
238 /****************************************************************/
240 Double_t AliHBTPair::GetDeltaPy()
242 //returns difference of Py
247 /****************************************************************/
249 Double_t AliHBTPair::GetDeltaPz()
251 //returns difference of Pz