]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTPair.h
Scaling to tail implemented
[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
16 ~AliHBTPair(){}
17 void SetParticles(AliHBTParticle*,AliHBTParticle*); //sets particles in the pair
18 AliHBTPair* GetSwapedPair() {return fSwapedPair;} //returns pair with swapped particles
19
20 AliHBTParticle* Particle1() const {return fPart1;} //returns pointer to first particle
21 AliHBTParticle* Particle2() const {return fPart2;} //returns pointer to decond particle
22
23 //Center Mass System - Longitudinally Comoving
24
25 Double_t GetInvMass(); //returns invariant mass of the pair
26
27 Double_t GetQSideCMSLC(); //returns Q Side CMS longitudionally co-moving
28 Double_t GetQOutCMSLC(); //returns Q out CMS longitudionally co-moving
29 Double_t GetQLongCMSLC(); //returns Q Long CMS longitudionally co-moving
30
31
32 Double_t GetKt(); //returns K transverse
33 Double_t GetKStar();
34
35 Double_t GetQInv(); //returns Q invariant
36 Double_t GetQSide(); //returns Q side
37 Double_t GetQLong(); //returns Q long
38 Double_t GetQOut(); //returns Q out
39
40
41 protected:
42 AliHBTParticle* fPart1; //pointer to first particle
43 AliHBTParticle* fPart2; //pointer to second particle
44
45 AliHBTPair* fSwapedPair; //pointer to swapped pair
46
47/************************************************************/
48/************CMS (LC) Q's *********************************/
49/************************************************************/
50 //Center Mass System - Longitudinally Comoving
51
52 Double_t fQSideCMSLC; //value of Q side CMS longitudially co-moving
53 Bool_t fQSideCMSLCNotCalc; //flag indicating if fQSideCMSLC is already calculated for this pair
54
55 Double_t fQOutCMSLC; //value of Q out CMS longitudially co-moving
56 Bool_t fQOutCMSLCNotCalc;//flag indicating if fQOutCMSLC is already calculated for this pair
57
58 Double_t fQLongCMSLC; //value of Q long CMS longitudially co-moving
59 Bool_t fQLongCMSLCNotCalc;//flag indicating if fQLongCMSLC is already calculated for this pair
60/************************************************************/
61/************************************************************/
62 Double_t fQInv; //half of differnece of 4-momenta
63 Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair
64
65 Double_t fInvMass; //invariant mass
66 Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair
67
68 Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component
69 Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair
70
71 Double_t fKStar;
72 Bool_t fKStarNotCalc;
73
74 Double_t fPInv; //invariant momentum
75 Double_t fQSide; //Q Side
76 Double_t fOut;//Q Out
77 Double_t fQLong;//Q Long
78
79
80 Double_t fInvMassSqr;//squre of invariant mass
81 Bool_t fMassSqrNotCalc; //
82 void CalculateInvMassSqr();
83
84 Double_t fQInvL;
85 Bool_t fQInvLNotCalc;
86 void CalculateQInvL();
87
88 Double_t fPxSum;
89 Double_t fPySum;
90 Double_t fPzSum;
91 Double_t fESum;
92 Bool_t fSumsNotCalc;
93 void CalculateSums();
94
95 Double_t fPxDiff;
96 Double_t fPyDiff;
97 Double_t fPzDiff;
98 Double_t fEDiff;
99 Bool_t fDiffsNotCalc;
100 void CalculateDiffs();
101
102
103 /***************************************************/
104 void CalculateBase();
105 Bool_t fChanged;
106
107
108 private:
109 public:
110 ClassDef(AliHBTPair,1)
111};
112/****************************************************************/
113inline
114void AliHBTPair::SetParticles(AliHBTParticle* p1,AliHBTParticle* p2)
115{
116 //sets the particle to the pair
117
118 fPart1 = p1;
119 fPart2 = p2;
120 if (fSwapedPair) //if we have Swaped (so we are not)
121 fSwapedPair->SetParticles(p2,p1); //set particles for him too
122
123 // Resel all calculations (flags)
124
125 fChanged = kTRUE;
126 fSumsNotCalc = kTRUE;
127 fDiffsNotCalc = kTRUE;
128 fMassSqrNotCalc = kTRUE;
129 fInvMassNotCalc = kTRUE;
130 fQInvNotCalc = kTRUE;
131 fQSideCMSLCNotCalc = kTRUE;
132 fQOutCMSLCNotCalc = kTRUE;
133 fQLongCMSLCNotCalc = kTRUE;
134 fKtNotCalc = kTRUE;
135 fKStarNotCalc = kTRUE;
136 fQInvLNotCalc = kTRUE;
137
138 //and do nothing until will be asked for
139}
140/****************************************************************/
141inline
142Double_t AliHBTPair::GetQSide()
143{
144 return 0.0;
145}
146/****************************************************************/
147inline
148void AliHBTPair::CalculateInvMassSqr()
149 {
150 if (fMassSqrNotCalc)
151 {
152 CalculateSums();
153
154 Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum);
155
156 fInvMassSqr=fESum*fESum-fPart12s;
157
158 fMassSqrNotCalc = kFALSE;
159 }
160 }
161/****************************************************************/
162inline
163void AliHBTPair::CalculateQInvL()
164 {
165 if (fQInvLNotCalc)
166 {
167 CalculateDiffs();
168 fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff );
169 fQInvLNotCalc = kFALSE;
170 }
171 }
172/****************************************************************/
173inline
174void AliHBTPair::CalculateSums()
175 {
176 if(fSumsNotCalc)
177 {
178 fPxSum = fPart1->Px()+fPart2->Px();
179 fPySum = fPart1->Py()+fPart2->Py();
180 fPzSum = fPart1->Pz()+fPart2->Pz();
181 fESum = fPart1->Energy() + fPart2->Energy();
182 fSumsNotCalc = kFALSE;
183 }
184 }
185/****************************************************************/
186inline
187void AliHBTPair::CalculateDiffs()
188 {
189 if(fDiffsNotCalc)
190 {
191 fPxDiff = fPart1->Px()-fPart2->Px();
192 fPyDiff = fPart1->Py()-fPart2->Py();
193 fPzDiff = fPart1->Pz()-fPart2->Pz();
194 fEDiff = fPart1->Energy() - fPart2->Energy();
195 fDiffsNotCalc = kFALSE;
196 }
197 }
198
199#endif