]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTPair.h
const X& X::operator=(const X&) --> X& X::operator=(const X&)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPair.h
CommitLineData
1b446896 1#ifndef ALIHBTPAIR_H
2#define ALIHBTPAIR_H
58ee8590 3//_________________________________________________________________________
4///////////////////////////////////////////////////////////////////////////
5//
6// class AliHBTPair
7//
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
11//
12////////////////////////////////////////////////////////////////////////////
1b446896 13
14#include <TObject.h>
1b446896 15#include "AliHBTParticle.h"
58ee8590 16
1b446896 17
18class AliHBTPair: public TObject
19{
20 public:
21 AliHBTPair(Bool_t rev = kFALSE); //contructor
ec6e4013 22 AliHBTPair(AliHBTParticle* part1, AliHBTParticle* part2, Bool_t rev = kFALSE); //contructor
d012b7d0 23 AliHBTPair(const AliHBTPair& in);
24
4ca0f301 25 virtual ~AliHBTPair(){}
d012b7d0 26
34914285 27 AliHBTPair& operator=(const AliHBTPair& in);
d012b7d0 28
29 void SetParticles(AliHBTParticle* p1,AliHBTParticle* p2); //sets particles in the pair
1b446896 30 AliHBTPair* GetSwapedPair() {return fSwapedPair;} //returns pair with swapped particles
31
32 AliHBTParticle* Particle1() const {return fPart1;} //returns pointer to first particle
33 AliHBTParticle* Particle2() const {return fPart2;} //returns pointer to decond particle
34
ec6e4013 35 void Changed();
1b446896 36 //Center Mass System - Longitudinally Comoving
37
951aadb9 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
1b446896 44
45
951aadb9 46 virtual Double_t GetKt(); //returns K transverse
47 virtual Double_t GetKStar();
1b446896 48
951aadb9 49 virtual Double_t GetDeltaP(); //return difference of momenta
50 virtual Double_t GetDeltaPx();
51 virtual Double_t GetDeltaPy();
52 virtual Double_t GetDeltaPz();
1b446896 53
951aadb9 54 virtual Double_t GetGammaToCMSLC();
dd82cadc 55 Double_t GetWeight();
1b446896 56 protected:
57 AliHBTParticle* fPart1; //pointer to first particle
58 AliHBTParticle* fPart2; //pointer to second particle
59
60 AliHBTPair* fSwapedPair; //pointer to swapped pair
61
62/************************************************************/
63/************CMS (LC) Q's *********************************/
64/************************************************************/
65 //Center Mass System - Longitudinally Comoving
66
67 Double_t fQSideCMSLC; //value of Q side CMS longitudially co-moving
68 Bool_t fQSideCMSLCNotCalc; //flag indicating if fQSideCMSLC is already calculated for this pair
69
70 Double_t fQOutCMSLC; //value of Q out CMS longitudially co-moving
71 Bool_t fQOutCMSLCNotCalc;//flag indicating if fQOutCMSLC is already calculated for this pair
72
73 Double_t fQLongCMSLC; //value of Q long CMS longitudially co-moving
74 Bool_t fQLongCMSLCNotCalc;//flag indicating if fQLongCMSLC is already calculated for this pair
75/************************************************************/
76/************************************************************/
77 Double_t fQInv; //half of differnece of 4-momenta
78 Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair
79
80 Double_t fInvMass; //invariant mass
81 Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair
82
83 Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component
84 Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair
85
d012b7d0 86 Double_t fKStar; // KStar
87 Bool_t fKStarNotCalc;// flag indicating if fKStar is calculated
1b446896 88
89 Double_t fPInv; //invariant momentum
951aadb9 90
1b446896 91 Double_t fQSide; //Q Side
92 Double_t fOut;//Q Out
93 Double_t fQLong;//Q Long
94
951aadb9 95 Double_t fMt;//Transverse coordinate of Inv. Mass
58ee8590 96 Bool_t fMtNotCalc;//flag indicating if Mt is calculated for current pair
951aadb9 97
1b446896 98 Double_t fInvMassSqr;//squre of invariant mass
d012b7d0 99 Bool_t fMassSqrNotCalc; //flag indicating if fInvMassSqr for this pair
1b446896 100 void CalculateInvMassSqr();
101
58ee8590 102 Double_t fQInvL; //Qinv in longitudional direction
103 Bool_t fQInvLNotCalc;//flag indicating if fQInvL is calculated for current pair
1b446896 104 void CalculateQInvL();
47d9a058 105
58ee8590 106 Double_t fWeight;//Value of the weight
107 Bool_t fWeightNotCalc;//flag indicating if fWeight is calculated for current pair
108
109 Double_t fPxSum;// Sum of Px momenta
110 Double_t fPySum;// Sum of Py momenta
111 Double_t fPzSum;// Sum of Pz momenta
112 Double_t fESum;// Sum of energies
113 Bool_t fSumsNotCalc;//flag indicating if fPxSum,fPxSum,fPxSum and fESum is calculated for current pair
1b446896 114 void CalculateSums();
115
58ee8590 116 Double_t fPxDiff;// Difference of Px momenta
117 Double_t fPyDiff;// Difference of Px momenta
118 Double_t fPzDiff;// Difference of Px momenta
119 Double_t fEDiff;// Difference of Px momenta
120 Bool_t fDiffsNotCalc;//flag indicating if fPxDiff,fPxDiff,fPxDiff and fEDiff is calculated for current pair
1b446896 121 void CalculateDiffs();
122
58ee8590 123 Double_t fGammaCMSLC;//gamma of boost in CMSLC
124 Bool_t fGammaCMSLCNotCalc;//flag indicating if fGammaCMSLC is calculated for current pair
1b446896 125 /***************************************************/
126 void CalculateBase();
58ee8590 127 Bool_t fChanged;//flag indicating if object has been changed
1b446896 128
129
130 private:
1b446896 131 ClassDef(AliHBTPair,1)
132};
133/****************************************************************/
134inline
135void AliHBTPair::SetParticles(AliHBTParticle* p1,AliHBTParticle* p2)
136{
137 //sets the particle to the pair
138
139 fPart1 = p1;
140 fPart2 = p2;
141 if (fSwapedPair) //if we have Swaped (so we are not)
142 fSwapedPair->SetParticles(p2,p1); //set particles for him too
ec6e4013 143 Changed();
144 //and do nothing until will be asked for
145}
146/****************************************************************/
1b446896 147
ec6e4013 148inline
149void AliHBTPair::Changed()
150{
151 // Resel all calculations (flags)
1b446896 152 fChanged = kTRUE;
153 fSumsNotCalc = kTRUE;
154 fDiffsNotCalc = kTRUE;
155 fMassSqrNotCalc = kTRUE;
156 fInvMassNotCalc = kTRUE;
157 fQInvNotCalc = kTRUE;
951aadb9 158 fMtNotCalc = kTRUE;
1b446896 159 fQSideCMSLCNotCalc = kTRUE;
160 fQOutCMSLCNotCalc = kTRUE;
161 fQLongCMSLCNotCalc = kTRUE;
162 fKtNotCalc = kTRUE;
163 fKStarNotCalc = kTRUE;
164 fQInvLNotCalc = kTRUE;
951aadb9 165 fGammaCMSLCNotCalc = kTRUE;
dd82cadc 166 fWeightNotCalc = kTRUE;
1b446896 167}
168/****************************************************************/
1b446896 169inline
170void AliHBTPair::CalculateInvMassSqr()
171 {
58ee8590 172 //calculates square of qinv
1b446896 173 if (fMassSqrNotCalc)
174 {
175 CalculateSums();
176
177 Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum);
178
179 fInvMassSqr=fESum*fESum-fPart12s;
180
181 fMassSqrNotCalc = kFALSE;
182 }
183 }
184/****************************************************************/
185inline
186void AliHBTPair::CalculateQInvL()
187 {
7836ee94 188 //Calculates square root of Qinv
1b446896 189 if (fQInvLNotCalc)
190 {
191 CalculateDiffs();
192 fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff );
193 fQInvLNotCalc = kFALSE;
194 }
195 }
196/****************************************************************/
197inline
198void AliHBTPair::CalculateSums()
199 {
58ee8590 200 //calculates momenta and energy sums
1b446896 201 if(fSumsNotCalc)
202 {
203 fPxSum = fPart1->Px()+fPart2->Px();
204 fPySum = fPart1->Py()+fPart2->Py();
205 fPzSum = fPart1->Pz()+fPart2->Pz();
206 fESum = fPart1->Energy() + fPart2->Energy();
207 fSumsNotCalc = kFALSE;
208 }
209 }
210/****************************************************************/
211inline
212void AliHBTPair::CalculateDiffs()
213 {
58ee8590 214 //calculates momenta and energy differences
1b446896 215 if(fDiffsNotCalc)
216 {
217 fPxDiff = fPart1->Px()-fPart2->Px();
218 fPyDiff = fPart1->Py()-fPart2->Py();
219 fPzDiff = fPart1->Pz()-fPart2->Pz();
220 fEDiff = fPart1->Energy() - fPart2->Energy();
221 fDiffsNotCalc = kFALSE;
222 }
223 }
224
7836ee94 225/****************************************************************/
226inline
227Double_t AliHBTPair::GetDeltaP() //return difference of momenta
228{
58ee8590 229 //returns difference of momenta
7836ee94 230 CalculateDiffs();
231 return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff);
232}
233/****************************************************************/
234inline
235Double_t AliHBTPair::GetDeltaPx()
236 {
58ee8590 237 //returns difference of Pz
7836ee94 238 CalculateDiffs();
239 return fPxDiff;
240 }
241/****************************************************************/
242inline
243Double_t AliHBTPair::GetDeltaPy()
244 {
58ee8590 245 //returns difference of Py
7836ee94 246 CalculateDiffs();
247 return fPyDiff;
248 }
249
250/****************************************************************/
251inline
252Double_t AliHBTPair::GetDeltaPz()
253 {
58ee8590 254 //returns difference of Pz
7836ee94 255 CalculateDiffs();
256 return fPzDiff;
257 }
258
259
1b446896 260#endif