Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
V0Track.cxx
1/*
2 * V0Track.cxx
3 *
4 * Created on: 26 mar 2020
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "V0Track.h"
10
11#include "ExpEvent.h"
12#include "Track.h"
13
14namespace Hal {
15 V0Track::V0Track() :
16 fTrackId(-1),
17 fPosId(-1),
18 fNegId(-1),
19 fAssumedPdg(0),
20 fAssumedPdgPos(0),
21 fAssumedPdgNeg(0),
22 fS1(0),
23 fS2(0),
24 fAlpha(0),
25 fPtArm(0),
26 fDauDist(0),
27 fDecLenght(0),
28 fCosAngle(0) {}
29
30 V0Track::~V0Track() {}
31
32 Double_t V0Track::GetHypoMass(Double_t m_dau1, Double_t m_dau2) const {
33 Double_t tPx = fMomPos.X() + fMomNeg.X();
34 Double_t tPy = fMomPos.Y() + fMomNeg.Y();
35 Double_t tPz = fMomPos.Z() + fMomNeg.Z();
36 Double_t e1 = TMath::Sqrt(fMomPos.Mag2() + m_dau1 * m_dau1);
37 Double_t e2 = TMath::Sqrt(fMomNeg.Mag2() + m_dau2 * m_dau2);
38 Double_t tE = e1 + e2;
39 return TMath::Sqrt(tE * tE - tPx * tPx - tPy * tPy - tPz * tPz);
40 }
41
42 void V0Track::SetDecayPos(Double_t x, Double_t y, Double_t z) { fDecay.SetXYZ(x, y, z); }
43
44 TVector3 V0Track::Recalc(const Track& track) {
45 const TVector3 Mom(track.GetPx(), track.GetPy(), track.GetPz());
46
47 Double_t Ptot = Mom.Mag();
48 Double_t pPosTot = fMomPos.Mag();
49 Double_t MomPosAlongV0 = fMomPos * Mom / Ptot;
50 Double_t MomNegALongV0 = fMomNeg * Mom / Ptot;
51
52 SetAlphaArm((MomPosAlongV0 - MomNegALongV0) / (MomPosAlongV0 + MomNegALongV0));
53 SetPtArm(TMath::Sqrt(pPosTot * pPosTot - MomPosAlongV0 * MomPosAlongV0));
54 TVector3 vertex = track.GetEvent()->GetVertex()->Vect();
55 TVector3 pozV0 = fDecay - vertex;
56
57 Double_t t = -(pozV0 * Mom) / (Ptot * Ptot);
58 TVector3 dca;
59 dca.SetXYZ(pozV0.X() + t * Mom.X(), pozV0.Y() + t * Mom.Y(), pozV0.Z() + t * Mom.Z());
60 TVector3 dca_rel = dca - pozV0;
61 fCosAngle = pozV0 * Mom / (Ptot * pozV0.Mag());
62 SetDecLenght(dca_rel.Mag());
63 return dca;
64 }
65
66 void V0Track::SetMomPos(Double_t px, Double_t py, Double_t pz) { fMomPos.SetXYZ(px, py, pz); }
67
68 void V0Track::SetMomNeg(Double_t px, Double_t py, Double_t pz) { fMomNeg.SetXYZ(px, py, pz); }
69
70 void V0Track::CopyData(V0Track* v) {
71 fTrackId = v->fTrackId;
72 fPosId = v->fPosId;
73 fNegId = v->fNegId;
74 fS1 = v->fS1;
75 fS2 = v->fS2;
76 fAlpha = v->fAlpha;
77 fPtArm = v->fPtArm;
78 fDauDist = v->fDauDist;
79 fDecLenght = v->fDecLenght;
80 fCosAngle = v->fCosAngle;
81 fAssumedPdg = v->fAssumedPdg;
82 fAssumedPdgPos = v->fAssumedPdgPos;
83 fAssumedPdgNeg = v->fAssumedPdgNeg;
84 fDecay = v->fDecay;
85 fMomPos = v->fMomPos;
86 fMomNeg = v->fMomNeg;
87 }
88
89 void V0Track::RotateZ(Double_t angle) {
90 fDecay.RotateZ(angle);
91 fMomNeg.RotateZ(angle);
92 fMomPos.RotateZ(angle);
93 }
94
95} // namespace Hal
TLorentzVector * GetVertex() const
Definition Event.h:261
Double_t GetPz() const
Definition Track.h:109
Event * GetEvent() const
Definition Track.h:315
Double_t GetPx() const
Definition Track.h:99
Double_t GetPy() const
Definition Track.h:104