Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoPairKinematics.cxx
1/*
2 * FemtoPair.cxx
3 *
4 * Created on: 30-08-2013
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FemtoPairKinematics.h"
11
12#include "Track.h"
13
14#include <TLorentzVector.h>
15#include <TMathBase.h>
16#include <TVector3.h>
17
18
19//----------------HAL FEMTO KINEMATICS
20namespace Hal {
22 Double_t tPx = fpx1 + fpx2;
23 Double_t tPy = fpy1 + fpy2;
24 Double_t tPz = fpz1 + fpz2;
25 Double_t tE = fe1 + fe2;
26 Double_t tPt = tPx * tPx + tPy * tPy;
27 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
28 Double_t tM = TMath::Sqrt(tMt - tPt);
29 tMt = TMath::Sqrt(tMt);
30 tPt = TMath::Sqrt(tPt);
31
32 // mBetat = tPt/tMt;
33
34 // if ((mBetat > btmin) && (mBetat < btmax))
35 // {
36 // Boost to LCMS
37 Double_t tBeta = tPz / tE;
38 Double_t tGamma = tE / tMt;
39 fZ = tGamma * (fpz1 - tBeta * fe1);
40 Double_t tE1L = tGamma * (fe1 - tBeta * fpz1);
41
42 // Transform to LCMS
43
44 // Double_t particle1lcms_pz = tGamma * (FalsePz1() - tBeta * FalseE1());
45 // Double_t particle1prf_pz = particle1lcms_pz;
46
47 // Double_t particle1lcms_e = tGamma * (FalseE1() - tBeta * FalsePz1());
48 // Double_t particle2lcms_pz = tGamma * (FalsePz2() - tBeta * FalseE2());
49 // Double_t particle2prf_pz = particle2lcms_pz;
50 // Double_t particle2lcms_e = tGamma * (FalseE2() - tBeta * FalsePz2());
51
52 // Rotate in transverse plane
53 fX = (fpx1 * tPx + fpy1 * tPy) / tPt;
54 fY = (-fpx1 * tPy + fpy1 * tPx) / tPt;
55
56 // Double_t particle2lcms_px = (FalsePx2()*tPx + FalsePy2()*tPy)/tPt;
57 // Double_t particle2lcms_py = (FalsePy2()*tPx - FalsePx2()*tPy)/tPt;;
58
59 // save the rotated coordinates in LCMS variables
60
61 // Boost to pair cms
62 fX = tMt / tM * (fX - tPt / tMt * tE1L);
63
64 // Double_t tBetat = tPt/tMt;
65 // Double_t tGammat = 1.0/TMath::Sqrt(1.0-tBetat*tBetat);
66
67 fT = fX > 0. ? 1. : -1.;
68 fT *= TMath::Sqrt(fY * fY + fX * fX + fZ * fZ);
69 }
70
72 Double_t tPx = fpx1 - fpx2; // reversed
73 Double_t tPy = fpy1 - fpy2; // reversed
74 Double_t tPz = fpz1 + fpz2;
75 Double_t tE = fe1 + fe2;
76 Double_t tPt = tPx * tPx + tPy * tPy;
77 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
78 Double_t tM = TMath::Sqrt(tMt - tPt);
79 tMt = TMath::Sqrt(tMt);
80 tPt = TMath::Sqrt(tPt);
81
82 Double_t tBeta = tPz / tE;
83 Double_t tGamma = tE / tMt;
84 fZ = tGamma * (fpz1 - tBeta * fe1);
85 Double_t tE1L = tGamma * (fe1 - tBeta * fpz1);
86
87 // Rotate in transverse plane
88 fX = (fpx1 * tPx + fpy1 * tPy) / tPt;
89 fY = (-fpx1 * tPy + fpy1 * tPx) / tPt;
90 fX = tMt / tM * (fX - tPt / tMt * tE1L);
91 fT = fX > 0. ? 1. : -1.;
92 fT *= TMath::Sqrt(fY * fY + fX * fX + fZ * fZ);
93 }
94
96 Double_t tPx = fpx1 - fpx2; // reversed
97 Double_t tPy = fpy1 - fpy2; // reversed
98 Double_t tPz = fpz1 - fpz2; // reversed
99 Double_t tE = fe1 + fe2;
100 Double_t tPt = tPx * tPx + tPy * tPy;
101 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
102 Double_t tM = TMath::Sqrt(tMt - tPt);
103 tMt = TMath::Sqrt(tMt);
104 tPt = TMath::Sqrt(tPt);
105
106 Double_t tBeta = tPz / tE;
107 Double_t tGamma = tE / tMt;
108 fZ = tGamma * (fpz1 - tBeta * fe1);
109 Double_t tE1L = tGamma * (fe1 - tBeta * fpz1);
110
111 // Rotate in transverse plane
112 fX = (fpx1 * tPx + fpy1 * tPy) / tPt;
113 fY = (-fpx1 * tPy + fpy1 * tPx) / tPt;
114 fX = tMt / tM * (fX - tPt / tMt * tE1L);
115 fT = fX > 0. ? 1. : -1.;
116 fT *= TMath::Sqrt(fY * fY + fX * fX + fZ * fZ);
117 }
118
120 Double_t tPx = fpx1 + fpx2;
121 Double_t tPy = fpy1 + fpy2;
122 Double_t tPz = fpz1 + fpz2;
123 Double_t tE = fe1 + fe2;
124 Double_t tPt = tPx * tPx + tPy * tPy;
125 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
126 tMt = TMath::Sqrt(tMt);
127 tPt = TMath::Sqrt(tPt);
128 Double_t tBeta = tPz / tE;
129 Double_t tGamma = tE / tMt;
130
131 // Transform to LCMS
132
133 Double_t particle1lcms_pz = tGamma * (fpz1 - tBeta * fe1);
134 Double_t particle1lcms_e = tGamma * (fe1 - tBeta * fpz1);
135 Double_t particle2lcms_pz = tGamma * (fpz2 - tBeta * fe2);
136 Double_t particle2lcms_e = tGamma * (fe2 - tBeta * fpz2);
137
138 // Rotate in transverse plane
139
140 Double_t particle1lcms_px = (fpx1 * tPx + fpy1 * tPy) / tPt;
141 Double_t particle1lcms_py = (-fpx1 * tPy + fpy1 * tPx) / tPt;
142
143 Double_t particle2lcms_px = (fpx2 * tPx + fpy2 * tPy) / tPt;
144 Double_t particle2lcms_py = (-fpx2 * tPy + fpy2 * tPx) / tPt;
145
146 fX = particle1lcms_px - particle2lcms_px;
147 fY = particle1lcms_py - particle2lcms_py;
148 fZ = particle1lcms_pz - particle2lcms_pz;
149 Double_t mDE = particle1lcms_e - particle2lcms_e;
150 fT = TMath::Sqrt(TMath::Abs(fX * fX + fY * fY + fZ * fZ - mDE * mDE));
151 // Z = fpz1-fpz2;
152 }
153
155 Double_t tPx = fpx1 - fpx2; // reversed
156 Double_t tPy = fpy1 - fpy2; // reversed
157 Double_t tPz = fpz1 + fpz2;
158 Double_t tE = fe1 + fe2;
159 Double_t tPt = tPx * tPx + tPy * tPy;
160 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
161 tMt = TMath::Sqrt(tMt);
162 tPt = TMath::Sqrt(tPt);
163 Double_t tBeta = tPz / tE;
164 Double_t tGamma = tE / tMt;
165
166 // Transform to LCMS
167
168 Double_t particle1lcms_pz = tGamma * (fpz1 - tBeta * fe1);
169 Double_t particle1lcms_e = tGamma * (fe1 - tBeta * fpz1);
170 Double_t particle2lcms_pz = tGamma * (fpz2 - tBeta * fe2);
171 Double_t particle2lcms_e = tGamma * (fe2 - tBeta * fpz2);
172
173 // Rotate in transverse plane
174
175 Double_t particle1lcms_px = (fpx1 * tPx + fpy1 * tPy) / tPt;
176 Double_t particle1lcms_py = (-fpx1 * tPy + fpy1 * tPx) / tPt;
177
178 Double_t particle2lcms_px = (-fpx2 * tPx - fpy2 * tPy) / tPt; // reversed
179 Double_t particle2lcms_py = (+fpx2 * tPy - fpy2 * tPx) / tPt; // reversed
180
181 fX = particle1lcms_px - particle2lcms_px;
182 fY = particle1lcms_py - particle2lcms_py;
183 fZ = particle1lcms_pz - particle2lcms_pz;
184 // Z = fpz1-fpz2;
185 Double_t mDE = particle1lcms_e - particle2lcms_e;
186 fT = TMath::Sqrt(TMath::Abs(fX * fX + fY * fY + fZ * fZ - mDE * mDE));
187 }
188
190 Double_t tPx = fpx1 - fpx2; // reversed
191 Double_t tPy = fpy1 - fpy2; // reversed
192 Double_t tPz = fpz1 - fpz2; // reversed
193 Double_t tE = fe1 + fe2;
194 Double_t tPt = tPx * tPx + tPy * tPy;
195 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
196 tMt = TMath::Sqrt(tMt);
197 tPt = TMath::Sqrt(tPt);
198 Double_t tBeta = tPz / tE;
199 Double_t tGamma = tE / tMt;
200
201 // Transform to LCMS
202
203 Double_t particle1lcms_pz = tGamma * (fpz1 - tBeta * fe1);
204 Double_t particle1lcms_e = tGamma * (fe1 - tBeta * fpz1);
205 Double_t particle2lcms_pz = tGamma * (-fpz2 - tBeta * fe2); // reversed
206 Double_t particle2lcms_e = tGamma * (fe2 + tBeta * fpz2); // reversed
207
208 // Rotate in transverse plane
209
210 Double_t particle1lcms_px = (fpx1 * tPx + fpy1 * tPy) / tPt;
211 Double_t particle1lcms_py = (-fpx1 * tPy + fpy1 * tPx) / tPt;
212
213 Double_t particle2lcms_px = (-fpx2 * tPx - fpy2 * tPy) / tPt; // reversed
214 Double_t particle2lcms_py = (+fpx2 * tPy - fpy2 * tPx) / tPt; // reversed
215
216
217 fX = particle1lcms_px - particle2lcms_px;
218 fY = particle1lcms_py - particle2lcms_py;
219 fZ = particle1lcms_pz - particle2lcms_pz;
220 // Z = fpz1-fpz2;
221 Double_t mDE = particle1lcms_e - particle2lcms_e;
222 fT = TMath::Sqrt(TMath::Abs(fX * fX + fY * fY + fZ * fZ - mDE * mDE));
223 }
224
226 Double_t tPx = fpx1 + fpx2;
227 Double_t tPy = fpy1 + fpy2;
228 Double_t tPz = fpz1 + fpz2;
229 Double_t tE = fe1 + fe2;
230 Double_t tPt = tPx * tPx + tPy * tPy;
231 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
232 Double_t tM = TMath::Sqrt(tMt - tPt);
233 tMt = TMath::Sqrt(tMt);
234 tPt = TMath::Sqrt(tPt);
235
236 Double_t tBeta = tPz / tE;
237 Double_t tGamma = tE / tMt;
238 fZ = tGamma * (fpz1 - tBeta * fe1);
239 Double_t tE1L = tGamma * (fe1 - tBeta * fpz1);
240
241 fX = (fpx1 * tPx + fpy1 * tPy) / tPt;
242 fY = (-fpx1 * tPy + fpy1 * tPx) / tPt;
243 fX = tMt / tM * (fX - tPt / tMt * tE1L);
244 // fT = fX>0.? 1. : -1.;
245 // fT *= TMath::Sqrt(fY*fY + fX*fX + fZ*fZ);
246 ConvertToSh();
247 }
248
250 Double_t tPx = fpx1 - fpx2; // reversed
251 Double_t tPy = fpy1 - fpy2; // reversed
252 Double_t tPz = fpz1 + fpz2;
253 Double_t tE = fe1 + fe2;
254 Double_t tPt = tPx * tPx + tPy * tPy;
255 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
256 Double_t tM = TMath::Sqrt(tMt - tPt);
257 tMt = TMath::Sqrt(tMt);
258 tPt = TMath::Sqrt(tPt);
259
260 Double_t tBeta = tPz / tE;
261 Double_t tGamma = tE / tMt;
262 fZ = tGamma * (fpz1 - tBeta * fe1);
263 Double_t tE1L = tGamma * (fe1 - tBeta * fpz1);
264
265 // Rotate in transverse plane
266 fX = (fpx1 * tPx + fpy1 * tPy) / tPt;
267 fY = (-fpx1 * tPy + fpy1 * tPx) / tPt;
268 fX = tMt / tM * (fX - tPt / tMt * tE1L);
269 fT = fX > 0. ? 1. : -1.;
270 fT *= TMath::Sqrt(fY * fY + fX * fX + fZ * fZ);
271 ConvertToSh();
272 }
273
275 Double_t tPx = fpx1 - fpx2; // reversed
276 Double_t tPy = fpy1 - fpy2; // reversed
277 Double_t tPz = fpz1 - fpz2; // reversed
278 Double_t tE = fe1 + fe2;
279 Double_t tPt = tPx * tPx + tPy * tPy;
280 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
281 Double_t tM = TMath::Sqrt(tMt - tPt);
282 tMt = TMath::Sqrt(tMt);
283 tPt = TMath::Sqrt(tPt);
284
285 Double_t tBeta = tPz / tE;
286 Double_t tGamma = tE / tMt;
287 fZ = tGamma * (fpz1 - tBeta * fe1);
288 Double_t tE1L = tGamma * (fe1 - tBeta * fpz1);
289
290 // Rotate in transverse plane
291 fX = (fpx1 * tPx + fpy1 * tPy) / tPt;
292 fY = (-fpx1 * tPy + fpy1 * tPx) / tPt;
293 fX = tMt / tM * (fX - tPt / tMt * tE1L);
294 fT = fX > 0. ? 1. : -1.;
295 fT *= TMath::Sqrt(fY * fY + fX * fX + fZ * fZ);
296 ConvertToSh();
297 }
298
300 Double_t tPx = fpx1 + fpx2;
301 Double_t tPy = fpy1 + fpy2;
302 Double_t tPz = fpz1 + fpz2;
303 Double_t tE = fe1 + fe2;
304 Double_t tPt = tPx * tPx + tPy * tPy;
305 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
306 tMt = TMath::Sqrt(tMt);
307 tPt = TMath::Sqrt(tPt);
308 Double_t tBeta = tPz / tE;
309 Double_t tGamma = tE / tMt;
310
311 // Transform to LCMS
312
313 Double_t particle1lcms_pz = tGamma * (fpz1 - tBeta * fe1);
314 Double_t particle2lcms_pz = tGamma * (fpz2 - tBeta * fe2);
315
316 // Rotate in transverse plane
317
318 Double_t particle1lcms_px = (fpx1 * tPx + fpy1 * tPy) / tPt;
319 Double_t particle1lcms_py = (-fpx1 * tPy + fpy1 * tPx) / tPt;
320
321 Double_t particle2lcms_px = (fpx2 * tPx + fpy2 * tPy) / tPt;
322 Double_t particle2lcms_py = (-fpx2 * tPy + fpy2 * tPx) / tPt;
323 ;
324 fX = particle1lcms_px - particle2lcms_px;
325 fY = particle1lcms_py - particle2lcms_py;
326 fZ = particle1lcms_pz - particle2lcms_pz;
327 // Z = fpz1-fpz2;
328 // fT=TMath::Sqrt(TMath::Abs(fX*fX+fY*fY+fZ*fZ-mDE*mDE));
329 ConvertToSh();
330 }
331
333 Double_t tPx = fpx1 - fpx2; // reversed
334 Double_t tPy = fpy1 - fpy2; // reversed
335 Double_t tPz = fpz1 + fpz2;
336 Double_t tE = fe1 + fe2;
337 Double_t tPt = tPx * tPx + tPy * tPy;
338 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
339 tMt = TMath::Sqrt(tMt);
340 tPt = TMath::Sqrt(tPt);
341 Double_t tBeta = tPz / tE;
342 Double_t tGamma = tE / tMt;
343
344 // Transform to LCMS
345
346 Double_t particle1lcms_pz = tGamma * (fpz1 - tBeta * fe1);
347 Double_t particle2lcms_pz = tGamma * (fpz2 - tBeta * fe2);
348
349 // Rotate in transverse plane
350
351 Double_t particle1lcms_px = (fpx1 * tPx + fpy1 * tPy) / tPt;
352 Double_t particle1lcms_py = (-fpx1 * tPy + fpy1 * tPx) / tPt;
353
354 Double_t particle2lcms_px = (-fpx2 * tPx - fpy2 * tPy) / tPt; // reversed
355 Double_t particle2lcms_py = (+fpx2 * tPy - fpy2 * tPx) / tPt;
356 ; // reversed
357
358 fX = particle1lcms_px - particle2lcms_px;
359 fY = particle1lcms_py - particle2lcms_py;
360 fZ = particle1lcms_pz - particle2lcms_pz;
361 ConvertToSh();
362 }
363
365 Double_t tPx = fpx1 - fpx2; // reversed
366 Double_t tPy = fpy1 - fpy2; // reversed
367 Double_t tPz = fpz1 - fpz2; // reversed
368 Double_t tE = fe1 + fe2;
369 Double_t tPt = tPx * tPx + tPy * tPy;
370 Double_t tMt = tE * tE - tPz * tPz; // mCVK;
371 tMt = TMath::Sqrt(tMt);
372 tPt = TMath::Sqrt(tPt);
373 Double_t tBeta = tPz / tE;
374 Double_t tGamma = tE / tMt;
375
376 // Transform to LCMS
377
378 Double_t particle1lcms_pz = tGamma * (fpz1 - tBeta * fe1);
379 Double_t particle2lcms_pz = tGamma * (-fpz2 - tBeta * fe2); // reversed
380
381 // Rotate in transverse plane
382
383 Double_t particle1lcms_px = (fpx1 * tPx + fpy1 * tPy) / tPt;
384 Double_t particle1lcms_py = (-fpx1 * tPy + fpy1 * tPx) / tPt;
385
386 Double_t particle2lcms_px = (-fpx2 * tPx - fpy2 * tPy) / tPt; // reversed
387 Double_t particle2lcms_py = (+fpx2 * tPy - fpy2 * tPx) / tPt;
388 ; // reversed
389
390 fX = particle1lcms_px - particle2lcms_px;
391 fY = particle1lcms_py - particle2lcms_py;
392 fZ = particle1lcms_pz - particle2lcms_pz;
393 ConvertToSh();
394 }
395
397 fX = GetPhi1() - GetPhi2();
398 fY = GetTrack1()->GetMomentum().Eta() - GetTrack2()->GetMomentum().Eta();
399 while (fX < fPhiMin)
400 fX += fPI2;
401 while (fX > fPhiMax)
402 fX -= fPI2;
403 }
404
406 fX = GetPhi1() - GetPhi2() + TMath::Pi();
407 fY = GetTrack1()->GetMomentum().Eta() - GetTrack2()->GetMomentum().Eta();
408 while (fX < fPhiMin)
409 fX += fPI2;
410 while (fX > fPhiMax)
411 fX -= fPI2;
412 }
413
415 fX = GetPhi1() - GetPhi2() + TMath::Pi();
416 fY = GetTrack1()->GetMomentum().Eta() + GetTrack2()->GetMomentum().Eta();
417 while (fX < fPhiMin)
418 fX += fPI2;
419 while (fX > fPhiMax)
420 fX -= fPI2;
421 }
422
423 FemtoPairDPhiDEta::FemtoPairDPhiDEta(Bool_t use_mc, Double_t phi_min) : FemtoPair(use_mc) {
424 if ((phi_min > (-TMath::Pi() * 2.0)) && (phi_min < TMath::Pi() * 2.0)) {
425 fPhiMin = phi_min;
426 fPhiMax = fPhiMin + 2.0 * TMath::Pi();
427 } else {
428 fPhiMin = 0;
429 fPhiMax = TMath::Pi() * 2.0;
430 }
431 fPI2 = TMath::Pi() * 2.0;
432 }
433
435 TVector3 vec;
436 vec.SetXYZ(fX, fY, fZ);
437 fX = vec.Mag();
438 fY = vec.Phi();
439 fZ = vec.Theta();
440 }
441
443 TLorentzVector p1, sum;
444 p1.SetXYZT(fpx1, fpy1, fpz1, fe1);
445 sum.SetXYZT(fpx2, fpy2, fpz2, fe2);
446 sum += p1;
447 TVector3 boost = sum.BoostVector();
448 Double_t phi = sum.Phi();
449 p1.Boost(-boost);
450 p1.RotateZ(-phi);
451 fX = p1.Px();
452 fY = p1.Py();
453 fZ = p1.Pz();
454 fT = p1.Rho();
455 }
456
458 TLorentzVector p1, sum;
459 p1.SetXYZT(fpx1, fpy1, fpz1, fe1);
460 sum.SetXYZT(-fpx2, -fpy2, fpz2, fe2);
461 sum += p1;
462 TVector3 boost = sum.BoostVector();
463 Double_t phi = sum.Phi();
464 p1.Boost(-boost);
465 p1.RotateZ(-phi);
466 fX = p1.Px();
467 fY = p1.Py();
468 fZ = p1.Pz();
469 fT = p1.Rho();
470 }
471
473 TLorentzVector p1, sum;
474 p1.SetXYZT(fpx1, fpy1, fpz1, fe1);
475 sum.SetXYZT(-fpx2, -fpy2, -fpz2, fe2);
476 sum += p1;
477 TVector3 boost = sum.BoostVector();
478 Double_t phi = sum.Phi();
479 p1.Boost(-boost);
480 p1.RotateZ(-phi);
481 fX = p1.Px();
482 fY = p1.Py();
483 fZ = p1.Pz();
484 fT = p1.Rho();
485 }
486} // namespace Hal
487//---------------- HAL FEMTO KINEMATICS LCMS - COMPUTE LCMS WITHOUTH WEIGHT
FemtoPairDPhiDEta(Bool_t use_mc=kFALSE, Double_t phi_min=-TMath::Pi() *0.5)
Double_t fZ
Definition FemtoPair.h:84
Double_t fpx1
Definition FemtoPair.h:49
Double_t fT
Definition FemtoPair.h:88
Double_t fpx2
Definition FemtoPair.h:53
Double_t fX
Definition FemtoPair.h:76
Double_t fY
Definition FemtoPair.h:80
Track * GetTrack2() const
Definition FemtoPair.h:342
Double_t GetPhi1() const
Definition FemtoPair.h:252
Track * GetTrack1() const
Definition FemtoPair.h:337
Double_t GetPhi2() const
Definition FemtoPair.h:277
const TLorentzVector & GetMomentum() const
Definition Track.h:118