BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
TMdcTrack.cxx
Go to the documentation of this file.
2#include <cmath>
3
4using namespace std;
5
7
8//************************************************
9 //
11 Clear();
12 }
13//************************************************
14//
16 Clear();
17 }
18 Int_t TMdcTrack::charge() const {
19 Int_t charge;
20 Double_t temp = m_helix[2];
21 if (temp >0.0000000001)
22 charge = 1 ;
23 else if (temp < -0.0000000001)
24 charge = -1;
25 else
26 charge = 0;
27 return charge;
28 }
29
30 Double_t TMdcTrack::x() const {
31 return m_helix[0]*cos(m_helix[1]);
32 }
33
34 Double_t TMdcTrack::y() const {
35 return m_helix[0]*sin(m_helix[1]);
36 }
37
38 Double_t TMdcTrack::z() const {
39 return m_helix[3];
40 }
41
42 Double_t TMdcTrack::r() const {
43// return sqrt(x()*x()+y()*y());
44 return fabs(m_helix[0]);
45 }
46
47 Double_t TMdcTrack::pxy() const {
48 if(m_helix[2] != 0)
49 return 1./fabs(m_helix[2]);
50 else return 0.;
51 }
52
53 Double_t TMdcTrack::px() const {
54 return pxy()*(-sin(m_helix[1]));
55 }
56
57 Double_t TMdcTrack::py() const {
58 return pxy()*cos(m_helix[1]);
59 }
60
61 Double_t TMdcTrack::pz() const {
62 return pxy()*m_helix[4];
63 }
64
65 Double_t TMdcTrack::p() const {
66// return sqrt(px()*px() + py()*py() + pz()*pz());
67 return pxy()*sqrt(1. + m_helix[4]*m_helix[4]);
68 }
69
70 Double_t TMdcTrack::theta() const {
71 return acos(pz()/p());
72 }
73
74 Double_t TMdcTrack::phi() const {
75 return atan2(py(),px());
76 }
77
78 void TMdcTrack::setHelix(const Double_t helix[5]) {
79 for(Int_t i=0; i<5; i++) {
80 m_helix[i] = helix[i];
81 }
82 }
83
84 void TMdcTrack::setErr(const Double_t er[15] ) {
85 for (Int_t i=0;i<15;i++) {
86 m_err[i] = er[i];
87 }
88 }
89
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213
ClassImp(TMdcTrack) TMdcTrack
Definition TMdcTrack.cxx:6
Double_t pxy() const
Definition TMdcTrack.cxx:47
Int_t charge() const
Definition TMdcTrack.cxx:18
Double_t pz() const
Definition TMdcTrack.cxx:61
Double_t phi() const
Definition TMdcTrack.cxx:74
Double_t x() const
Definition TMdcTrack.cxx:30
Double_t py() const
Definition TMdcTrack.cxx:57
Double_t px() const
Definition TMdcTrack.cxx:53
Double_t z() const
Definition TMdcTrack.cxx:38
Double_t p() const
Definition TMdcTrack.cxx:65
Double_t helix(Int_t i) const
Definition TMdcTrack.h:14
Double_t y() const
Definition TMdcTrack.cxx:34
Double_t theta() const
Definition TMdcTrack.cxx:70
void setErr(const Double_t err[15])
Definition TMdcTrack.cxx:84
void setHelix(const Double_t helix[5])
Definition TMdcTrack.cxx:78
Double_t r() const
Definition TMdcTrack.cxx:42