]>
Commit | Line | Data |
---|---|---|
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 | ||
12 | class 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 | ||
7836ee94 | 40 | Double_t GetDeltaP(); //return difference of momenta |
41 | Double_t GetDeltaPx(); | |
42 | Double_t GetDeltaPy(); | |
43 | Double_t GetDeltaPz(); | |
1b446896 | 44 | |
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 | |
79 | Double_t fQSide; //Q Side | |
80 | Double_t fOut;//Q Out | |
81 | Double_t fQLong;//Q Long | |
82 | ||
83 | ||
84 | Double_t fInvMassSqr;//squre of invariant mass | |
85 | Bool_t fMassSqrNotCalc; // | |
86 | void CalculateInvMassSqr(); | |
87 | ||
88 | Double_t fQInvL; | |
89 | Bool_t fQInvLNotCalc; | |
90 | void CalculateQInvL(); | |
91 | ||
92 | Double_t fPxSum; | |
93 | Double_t fPySum; | |
94 | Double_t fPzSum; | |
95 | Double_t fESum; | |
96 | Bool_t fSumsNotCalc; | |
97 | void CalculateSums(); | |
98 | ||
99 | Double_t fPxDiff; | |
100 | Double_t fPyDiff; | |
101 | Double_t fPzDiff; | |
102 | Double_t fEDiff; | |
103 | Bool_t fDiffsNotCalc; | |
104 | void CalculateDiffs(); | |
105 | ||
106 | ||
107 | /***************************************************/ | |
108 | void CalculateBase(); | |
109 | Bool_t fChanged; | |
110 | ||
111 | ||
112 | private: | |
113 | public: | |
114 | ClassDef(AliHBTPair,1) | |
115 | }; | |
116 | /****************************************************************/ | |
117 | inline | |
118 | void AliHBTPair::SetParticles(AliHBTParticle* p1,AliHBTParticle* p2) | |
119 | { | |
120 | //sets the particle to the pair | |
121 | ||
122 | fPart1 = p1; | |
123 | fPart2 = p2; | |
124 | if (fSwapedPair) //if we have Swaped (so we are not) | |
125 | fSwapedPair->SetParticles(p2,p1); //set particles for him too | |
126 | ||
127 | // Resel all calculations (flags) | |
128 | ||
129 | fChanged = kTRUE; | |
130 | fSumsNotCalc = kTRUE; | |
131 | fDiffsNotCalc = kTRUE; | |
132 | fMassSqrNotCalc = kTRUE; | |
133 | fInvMassNotCalc = kTRUE; | |
134 | fQInvNotCalc = kTRUE; | |
135 | fQSideCMSLCNotCalc = kTRUE; | |
136 | fQOutCMSLCNotCalc = kTRUE; | |
137 | fQLongCMSLCNotCalc = kTRUE; | |
138 | fKtNotCalc = kTRUE; | |
139 | fKStarNotCalc = kTRUE; | |
140 | fQInvLNotCalc = kTRUE; | |
141 | ||
142 | //and do nothing until will be asked for | |
143 | } | |
144 | /****************************************************************/ | |
1b446896 | 145 | /****************************************************************/ |
146 | inline | |
147 | void AliHBTPair::CalculateInvMassSqr() | |
148 | { | |
149 | if (fMassSqrNotCalc) | |
150 | { | |
151 | CalculateSums(); | |
152 | ||
153 | Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum); | |
154 | ||
155 | fInvMassSqr=fESum*fESum-fPart12s; | |
156 | ||
157 | fMassSqrNotCalc = kFALSE; | |
158 | } | |
159 | } | |
160 | /****************************************************************/ | |
161 | inline | |
162 | void AliHBTPair::CalculateQInvL() | |
163 | { | |
7836ee94 | 164 | //Calculates square root of Qinv |
1b446896 | 165 | if (fQInvLNotCalc) |
166 | { | |
167 | CalculateDiffs(); | |
168 | fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff ); | |
169 | fQInvLNotCalc = kFALSE; | |
170 | } | |
171 | } | |
172 | /****************************************************************/ | |
173 | inline | |
174 | void 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 | /****************************************************************/ | |
186 | inline | |
187 | void 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 | ||
7836ee94 | 199 | /****************************************************************/ |
200 | inline | |
201 | Double_t AliHBTPair::GetDeltaP() //return difference of momenta | |
202 | { | |
203 | CalculateDiffs(); | |
204 | return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff); | |
205 | } | |
206 | /****************************************************************/ | |
207 | inline | |
208 | Double_t AliHBTPair::GetDeltaPx() | |
209 | { | |
210 | CalculateDiffs(); | |
211 | return fPxDiff; | |
212 | } | |
213 | /****************************************************************/ | |
214 | inline | |
215 | Double_t AliHBTPair::GetDeltaPy() | |
216 | { | |
217 | CalculateDiffs(); | |
218 | return fPyDiff; | |
219 | } | |
220 | ||
221 | /****************************************************************/ | |
222 | inline | |
223 | Double_t AliHBTPair::GetDeltaPz() | |
224 | { | |
225 | CalculateDiffs(); | |
226 | return fPzDiff; | |
227 | } | |
228 | ||
229 | ||
1b446896 | 230 | #endif |