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