BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TMdcTrack.cxx
Go to the documentation of this file.
1#include "RootEventData/TMdcTrack.h"
2#include <cmath>
3
4using namespace std;
5
7
8//************************************************
9//
11//************************************************
12//
14Int_t TMdcTrack::charge() const {
15 Int_t charge;
16 Double_t temp = m_helix[2];
17 if ( temp > 0.0000000001 ) charge = 1;
18 else if ( temp < -0.0000000001 ) charge = -1;
19 else charge = 0;
20 return charge;
21}
22
23Double_t TMdcTrack::x() const { return m_helix[0] * cos( m_helix[1] ); }
24
25Double_t TMdcTrack::y() const { return m_helix[0] * sin( m_helix[1] ); }
26
27Double_t TMdcTrack::z() const { return m_helix[3]; }
28
29Double_t TMdcTrack::r() const {
30 // return sqrt(x()*x()+y()*y());
31 return fabs( m_helix[0] );
32}
33
34Double_t TMdcTrack::pxy() const {
35 if ( m_helix[2] != 0 ) return 1. / fabs( m_helix[2] );
36 else return 0.;
37}
38
39Double_t TMdcTrack::px() const { return pxy() * ( -sin( m_helix[1] ) ); }
40
41Double_t TMdcTrack::py() const { return pxy() * cos( m_helix[1] ); }
42
43Double_t TMdcTrack::pz() const { return pxy() * m_helix[4]; }
44
45Double_t TMdcTrack::p() const {
46 // return sqrt(px()*px() + py()*py() + pz()*pz());
47 return pxy() * sqrt( 1. + m_helix[4] * m_helix[4] );
48}
49
50Double_t TMdcTrack::theta() const { return acos( pz() / p() ); }
51
52Double_t TMdcTrack::phi() const { return atan2( py(), px() ); }
53
54void TMdcTrack::setHelix( const Double_t helix[5] ) {
55 for ( Int_t i = 0; i < 5; i++ ) { m_helix[i] = helix[i]; }
56}
57
58void TMdcTrack::setErr( const Double_t er[15] ) {
59 for ( Int_t i = 0; i < 15; i++ ) { m_err[i] = er[i]; }
60}
ClassImp(TMdcTrack)
Double_t pxy() const
Definition TMdcTrack.cxx:34
Int_t charge() const
Definition TMdcTrack.cxx:14
Double_t pz() const
Definition TMdcTrack.cxx:43
Double_t phi() const
Definition TMdcTrack.cxx:52
Double_t x() const
Definition TMdcTrack.cxx:23
Double_t py() const
Definition TMdcTrack.cxx:41
Double_t px() const
Definition TMdcTrack.cxx:39
Double_t z() const
Definition TMdcTrack.cxx:27
Double_t p() const
Definition TMdcTrack.cxx:45
Double_t y() const
Definition TMdcTrack.cxx:25
Double_t theta() const
Definition TMdcTrack.cxx:50
void setErr(const Double_t err[15])
Definition TMdcTrack.cxx:58
void setHelix(const Double_t helix[5])
Definition TMdcTrack.cxx:54
Double_t r() const
Definition TMdcTrack.cxx:29