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