]>
Commit | Line | Data |
---|---|---|
78d7c6d3 | 1 | #ifndef AliAODPair_H |
2 | #define AliAODPair_H | |
3 | //_________________________________________________________________________ | |
4 | /////////////////////////////////////////////////////////////////////////// | |
5 | // | |
6 | // class AliAODPair | |
7 | // | |
8 | // class implements pair of particles and taking care of caluclation (almost) | |
9 | // all of pair properties (Qinv, InvMass,...) | |
c7ffd78f | 10 | // more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html |
78d7c6d3 | 11 | // |
12 | //////////////////////////////////////////////////////////////////////////// | |
13 | ||
14 | #include <TObject.h> | |
15 | #include "AliVAODParticle.h" | |
16 | ||
17 | ||
18 | class AliAODPair: public TObject | |
19 | { | |
20 | public: | |
21 | AliAODPair(Bool_t rev = kFALSE); //contructor | |
22 | AliAODPair(AliVAODParticle* part1, AliVAODParticle* part2, Bool_t rev = kFALSE); //contructor | |
23 | AliAODPair(const AliAODPair& in); | |
24 | ||
25 | virtual ~AliAODPair(){} | |
26 | ||
27 | AliAODPair& operator=(const AliAODPair& in); | |
28 | ||
29 | void SetParticles(AliVAODParticle* p1,AliVAODParticle* p2); //sets particles in the pair | |
30 | AliAODPair* GetSwappedPair() {return fSwappedPair;} //returns pair with swapped particles | |
31 | ||
32 | AliVAODParticle* Particle1() const {return fPart1;} //returns pointer to first particle | |
33 | AliVAODParticle* Particle2() const {return fPart2;} //returns pointer to decond particle | |
34 | ||
35 | virtual void Changed(); | |
36 | //Center Mass System - Longitudinally Comoving | |
37 | ||
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 GetQSideLCMS(); //returns Q Side CMS longitudionally co-moving | |
42 | virtual Double_t GetQOutLCMS(); //returns Q out CMS longitudionally co-moving | |
43 | virtual Double_t GetQLongLCMS(); //returns Q Long CMS longitudionally co-moving | |
f422a7da | 44 | virtual Double_t GetQtLCMS(); //returns Q transverse CMS longitudionally co-moving |
45 | ||
fb629e2d | 46 | virtual Double_t GetQt(); //returns Q transverse to Kt |
78d7c6d3 | 47 | |
48 | ||
49 | virtual Double_t GetKt(); //returns K transverse | |
50 | virtual Double_t GetKStar(); | |
a40c0433 | 51 | virtual Double_t GetKStarOut(); //z.ch. |
52 | virtual Double_t GetKStarSide(); //z.ch. | |
53 | virtual Double_t GetKStarLong(); //z.ch. | |
78d7c6d3 | 54 | |
a40c0433 | 55 | |
78d7c6d3 | 56 | virtual Double_t GetAvarageDistance();//returns avarage distnace between two tracks |
57 | ||
b327f095 | 58 | virtual Double_t GetDeltaE(); //return difference of Energies |
59 | virtual Double_t GetDeltaP(); //return difference of momenta (scalar difference) | |
60 | virtual Double_t GetDeltaPvector(); //return legth of difference vector of momenta | |
78d7c6d3 | 61 | virtual Double_t GetDeltaPt(); |
62 | virtual Double_t GetDeltaPx(); | |
63 | virtual Double_t GetDeltaPy(); | |
64 | virtual Double_t GetDeltaPz(); | |
65 | ||
66 | virtual Double_t GetDeltaTheta(); | |
67 | virtual Double_t GetDeltaPhi(); | |
68 | ||
69 | virtual Double_t GetGammaToLCMS(); | |
fe3f2f54 | 70 | virtual Double_t GetGammaToTransverse(); |
78d7c6d3 | 71 | virtual Double_t GetPIDProb() const {return fPart1->GetPidProb()*fPart2->GetPidProb();} |
72 | ||
8ea30edc | 73 | virtual Double_t GetRStar() ; |
74 | virtual Double_t GetR() ;//returns distance between particle production points | |
75 | ||
af2872da | 76 | void MirrorSecond(); |
77 | void DeleteSecond(); | |
fe3f2f54 | 78 | |
201c7e13 | 79 | void Print(const Option_t* option ) const {TObject::Print(option);} |
80 | void Print() ; | |
fe3f2f54 | 81 | |
78d7c6d3 | 82 | protected: |
83 | AliVAODParticle* fPart1; //pointer to first particle | |
84 | AliVAODParticle* fPart2; //pointer to second particle | |
85 | ||
86 | AliAODPair* fSwappedPair; //pointer to swapped pair | |
87 | ||
88 | /************************************************************/ | |
89 | /************CMS (LC) Q's *********************************/ | |
90 | /************************************************************/ | |
91 | //Center Mass System - Longitudinally Comoving | |
92 | ||
93 | Double_t fQSideLCMS; //value of Q side CMS longitudially co-moving | |
94 | Bool_t fQSideLCMSNotCalc; //flag indicating if fQSideLCMS is already calculated for this pair | |
95 | ||
96 | Double_t fQOutLCMS; //value of Q out CMS longitudially co-moving | |
97 | Bool_t fQOutLCMSNotCalc;//flag indicating if fQOutLCMS is already calculated for this pair | |
98 | ||
99 | Double_t fQLongLCMS; //value of Q long CMS longitudially co-moving | |
100 | Bool_t fQLongLCMSNotCalc;//flag indicating if fQLongLCMS is already calculated for this pair | |
f422a7da | 101 | |
fb629e2d | 102 | Double_t fQtLCMS; //value of Qt CMS longitudially co-moving (hypot(qsidelcms,qoutlcms)) |
f422a7da | 103 | Bool_t fQtLCMSNotCalc;//flag indicating if fQLongLCMS is already calculated for this pair |
fb629e2d | 104 | |
105 | Double_t fQt; //value of Qt, projection of 3-mom diff to Kt | |
106 | Bool_t fQtNotCalc;//flag indicating if fQt is already calculated for this pair | |
107 | ||
78d7c6d3 | 108 | /************************************************************/ |
109 | /************************************************************/ | |
110 | Double_t fQInv; //half of differnece of 4-momenta | |
111 | Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair | |
112 | ||
113 | Double_t fInvMass; //invariant mass | |
114 | Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair | |
115 | ||
116 | Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component | |
117 | Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair | |
118 | ||
119 | Double_t fKStar; // KStar | |
120 | Bool_t fKStarNotCalc;// flag indicating if fKStar is calculated | |
a40c0433 | 121 | Double_t fKStarOut; // KStarOut z.ch. |
122 | Double_t fKStarSide;// KStarSide z.ch. | |
123 | Double_t fKStarLong;// KStarLong z.ch. | |
124 | ||
125 | Bool_t fKStarCompNotCalc; // flag indicating if CalcuteKStarComp() is calculated z.ch. | |
126 | ||
78d7c6d3 | 127 | Double_t fPInv; //invariant momentum |
128 | ||
129 | Double_t fQSide; //Q Side | |
130 | Double_t fOut;//Q Out | |
131 | Double_t fQLong;//Q Long | |
132 | ||
133 | Double_t fMt;//Transverse coordinate of Inv. Mass | |
134 | Bool_t fMtNotCalc;//flag indicating if Mt is calculated for current pair | |
135 | ||
136 | Double_t fInvMassSqr;//squre of invariant mass | |
137 | Bool_t fMassSqrNotCalc; //flag indicating if fInvMassSqr for this pair | |
138 | void CalculateInvMassSqr(); | |
139 | ||
140 | Double_t fQInvL; //Qinv in longitudional direction | |
141 | Bool_t fQInvLNotCalc;//flag indicating if fQInvL is calculated for current pair | |
142 | void CalculateQInvL(); | |
143 | ||
144 | Double_t fAvarageDistance;//value of the avarage distance calculated out of track points | |
145 | Bool_t fAvarageDistanceNotCalc;//flag indicating if the avarage distance is calculated | |
146 | ||
147 | Double_t fPxSum;// Sum of Px momenta | |
148 | Double_t fPySum;// Sum of Py momenta | |
149 | Double_t fPzSum;// Sum of Pz momenta | |
150 | Double_t fESum;// Sum of energies | |
151 | Bool_t fSumsNotCalc;//flag indicating if fPxSum,fPxSum,fPxSum and fESum is calculated for current pair | |
152 | void CalculateSums(); | |
a40c0433 | 153 | void CalculateKStarComp(); |
78d7c6d3 | 154 | |
155 | Double_t fPxDiff;// Difference of Px momenta | |
156 | Double_t fPyDiff;// Difference of Px momenta | |
157 | Double_t fPzDiff;// Difference of Px momenta | |
158 | Double_t fEDiff;// Difference of Px momenta | |
159 | Bool_t fDiffsNotCalc;//flag indicating if fPxDiff,fPxDiff,fPxDiff and fEDiff is calculated for current pair | |
160 | void CalculateDiffs(); | |
161 | ||
162 | Double_t fGammaLCMS;//gamma of boost in LCMS | |
163 | Bool_t fGammaLCMSNotCalc;//flag indicating if fGammaLCMS is calculated for current pair | |
164 | /***************************************************/ | |
165 | Bool_t fChanged;//flag indicating if object has been changed | |
166 | ||
167 | void CalculateBase(); | |
168 | Double_t AvDistance(); | |
169 | ||
170 | ||
171 | private: | |
172 | ClassDef(AliAODPair,1) | |
173 | }; | |
174 | /****************************************************************/ | |
175 | inline | |
176 | void AliAODPair::SetParticles(AliVAODParticle* p1,AliVAODParticle* p2) | |
177 | { | |
178 | //sets the particle to the pair | |
179 | ||
af2872da | 180 | fPart1 = p1; |
78d7c6d3 | 181 | fPart2 = p2; |
182 | if (fSwappedPair) //if we have Swapped (so we are not) | |
af2872da | 183 | fSwappedPair->SetParticles(fPart2,p1); //set particles for him too |
78d7c6d3 | 184 | Changed(); |
185 | //and do nothing until will be asked for | |
186 | } | |
187 | /****************************************************************/ | |
188 | ||
189 | inline | |
190 | void AliAODPair::Changed() | |
191 | { | |
192 | // Resel all calculations (flags) | |
193 | fChanged = kTRUE; | |
194 | fSumsNotCalc = kTRUE; | |
195 | fDiffsNotCalc = kTRUE; | |
196 | fMassSqrNotCalc = kTRUE; | |
197 | fInvMassNotCalc = kTRUE; | |
198 | fQInvNotCalc = kTRUE; | |
199 | fMtNotCalc = kTRUE; | |
200 | fQSideLCMSNotCalc = kTRUE; | |
201 | fQOutLCMSNotCalc = kTRUE; | |
202 | fQLongLCMSNotCalc = kTRUE; | |
fb629e2d | 203 | fQtLCMSNotCalc = kTRUE; |
204 | fQtNotCalc = kTRUE; | |
78d7c6d3 | 205 | fKtNotCalc = kTRUE; |
206 | fKStarNotCalc = kTRUE; | |
a40c0433 | 207 | fKStarCompNotCalc = kTRUE; |
78d7c6d3 | 208 | fQInvLNotCalc = kTRUE; |
209 | fGammaLCMSNotCalc = kTRUE; | |
210 | fAvarageDistanceNotCalc = kTRUE; | |
211 | } | |
212 | /****************************************************************/ | |
213 | inline | |
214 | void AliAODPair::CalculateInvMassSqr() | |
215 | { | |
216 | //calculates square of qinv | |
217 | if (fMassSqrNotCalc) | |
218 | { | |
219 | CalculateSums(); | |
220 | ||
221 | Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum); | |
222 | ||
223 | fInvMassSqr=fESum*fESum-fPart12s; | |
224 | ||
225 | fMassSqrNotCalc = kFALSE; | |
226 | } | |
227 | } | |
228 | /****************************************************************/ | |
229 | inline | |
230 | void AliAODPair::CalculateQInvL() | |
231 | { | |
232 | //Calculates square root of Qinv | |
233 | if (fQInvLNotCalc) | |
234 | { | |
235 | CalculateDiffs(); | |
236 | fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff ); | |
237 | fQInvLNotCalc = kFALSE; | |
238 | } | |
239 | } | |
240 | /****************************************************************/ | |
241 | inline | |
242 | void AliAODPair::CalculateSums() | |
243 | { | |
244 | //calculates momenta and energy sums | |
245 | if(fSumsNotCalc) | |
246 | { | |
247 | fPxSum = fPart1->Px()+fPart2->Px(); | |
248 | fPySum = fPart1->Py()+fPart2->Py(); | |
249 | fPzSum = fPart1->Pz()+fPart2->Pz(); | |
250 | fESum = fPart1->E() + fPart2->E(); | |
251 | fSumsNotCalc = kFALSE; | |
252 | } | |
253 | } | |
a40c0433 | 254 | /****************************************************************/ |
255 | inline | |
256 | void AliAODPair::CalculateKStarComp() | |
257 | { | |
258 | ||
259 | if (fKStarCompNotCalc) | |
260 | { | |
261 | CalculateSums(); | |
262 | ||
263 | Double_t ptrans = fPxSum*fPxSum + fPySum*fPySum; | |
264 | Double_t mtrans = fESum*fESum - fPzSum*fPzSum; | |
265 | Double_t pinv = TMath::Sqrt(mtrans - ptrans); | |
266 | ptrans = TMath::Sqrt(ptrans); | |
267 | mtrans = TMath::Sqrt(mtrans); | |
268 | ||
269 | Double_t px1 = fPart1->Px(); | |
270 | Double_t py1 = fPart1->Py(); | |
271 | Double_t pz1 = fPart1->Pz(); | |
272 | Double_t pE1 = fPart1->E(); | |
273 | ||
274 | // boost to LCMS | |
275 | Double_t beta = fPzSum / fESum; | |
276 | Double_t gamma = fESum / mtrans; | |
277 | ||
278 | fKStarLong = gamma * (pz1 - beta * pE1); | |
279 | double temp = gamma * (pE1 - beta * pz1); | |
280 | ||
281 | // rotate in transverse plane | |
282 | fKStarSide = (-px1*fPySum + py1*fPxSum)/ptrans; | |
283 | fKStarOut = ( px1*fPxSum + py1*fPySum)/ptrans; | |
284 | ||
285 | // go from LCMS to CMS | |
286 | gamma = mtrans/pinv; | |
287 | beta = ptrans/mtrans; | |
288 | fKStarOut = gamma * (fKStarOut - beta * temp); | |
289 | ||
290 | fKStarCompNotCalc = kFALSE; | |
291 | } | |
292 | } | |
293 | ||
78d7c6d3 | 294 | /****************************************************************/ |
295 | inline | |
296 | void AliAODPair::CalculateDiffs() | |
297 | { | |
298 | //calculates momenta and energy differences | |
299 | if(fDiffsNotCalc) | |
300 | { | |
301 | fPxDiff = fPart1->Px()-fPart2->Px(); | |
302 | fPyDiff = fPart1->Py()-fPart2->Py(); | |
303 | fPzDiff = fPart1->Pz()-fPart2->Pz(); | |
304 | fEDiff = fPart1->E() - fPart2->E(); | |
305 | fDiffsNotCalc = kFALSE; | |
306 | } | |
307 | } | |
308 | ||
309 | /****************************************************************/ | |
b327f095 | 310 | |
311 | inline | |
312 | Double_t AliAODPair::GetDeltaE() | |
313 | { | |
314 | //returns difference of energies | |
315 | return fPart1->E() - fPart2->E(); | |
316 | } | |
317 | /****************************************************************/ | |
318 | ||
319 | inline | |
320 | Double_t AliAODPair::GetDeltaP() | |
321 | { | |
322 | //returns difference of momenta (scalars) | |
323 | return fPart1->P() - fPart2->P(); | |
324 | } | |
325 | /****************************************************************/ | |
326 | ||
78d7c6d3 | 327 | inline |
b327f095 | 328 | Double_t AliAODPair::GetDeltaPvector() //return difference of momenta |
78d7c6d3 | 329 | { |
b327f095 | 330 | //returns legth of the momenta difference vector |
78d7c6d3 | 331 | CalculateDiffs(); |
332 | return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff); | |
333 | } | |
334 | /****************************************************************/ | |
335 | ||
336 | inline | |
337 | Double_t AliAODPair::GetDeltaPt() | |
338 | { | |
339 | //returns difference of Pz | |
340 | return fPart1->Pt()-fPart2->Pt(); | |
341 | } | |
342 | /****************************************************************/ | |
343 | ||
344 | inline | |
345 | Double_t AliAODPair::GetDeltaPx() | |
346 | { | |
347 | //returns difference of Pz | |
348 | CalculateDiffs(); | |
349 | return fPxDiff; | |
350 | } | |
351 | /****************************************************************/ | |
352 | inline | |
353 | Double_t AliAODPair::GetDeltaPy() | |
354 | { | |
355 | //returns difference of Py | |
356 | CalculateDiffs(); | |
357 | return fPyDiff; | |
358 | } | |
359 | ||
360 | /****************************************************************/ | |
361 | inline | |
362 | Double_t AliAODPair::GetDeltaPz() | |
363 | { | |
364 | //returns difference of Pz | |
365 | CalculateDiffs(); | |
366 | return fPzDiff; | |
367 | } | |
368 | /****************************************************************/ | |
369 | ||
370 | inline | |
371 | Double_t AliAODPair::GetDeltaPhi() | |
372 | { | |
373 | //returns difference of Phi | |
374 | Double_t phi1 = fPart1->Phi(); | |
375 | Double_t phi2 = fPart2->Phi(); | |
376 | Double_t diff = phi1-phi2; | |
377 | if (TMath::Abs(diff) > TMath::Pi()) | |
378 | { | |
379 | if (phi1 > TMath::Pi()) | |
380 | { | |
381 | phi1-=TMath::TwoPi(); | |
382 | } | |
383 | else | |
384 | { | |
385 | phi2-=TMath::TwoPi(); | |
386 | } | |
387 | diff = phi1-phi2; | |
388 | } | |
389 | return diff; | |
390 | } | |
391 | /****************************************************************/ | |
392 | ||
393 | inline | |
394 | Double_t AliAODPair::GetDeltaTheta() | |
395 | { | |
396 | //returns difference of Theta | |
397 | return fPart1->Theta()-fPart2->Theta(); | |
398 | } | |
399 | /****************************************************************/ | |
400 | ||
401 | ||
402 | #endif |