00001 #include "RootEventData/TRecMdcTrack.h" 00002 #include <cmath> 00003 00004 ClassImp(TRecMdcTrack) 00005 00006 //************************************************ 00007 // 00008 TRecMdcTrack::TRecMdcTrack() { 00009 Clear(); 00010 } 00011 //************************************************ 00012 // 00013 TRecMdcTrack::~TRecMdcTrack (){ 00014 Clear(); 00015 } 00016 00017 00018 const Int_t TRecMdcTrack::charge() const { 00019 Int_t charge; 00020 Double_t temp = m_helix[2]; 00021 if (temp >0.0000000001) 00022 charge = 1 ; 00023 else if (temp < -0.0000000001) 00024 charge = -1; 00025 else 00026 charge = 0; 00027 return charge; 00028 } 00029 00030 const Double_t TRecMdcTrack::x() const { 00031 return m_helix[0]*cos(m_helix[1]); 00032 } 00033 00034 const Double_t TRecMdcTrack::y() const { 00035 return m_helix[0]*sin(m_helix[1]); 00036 } 00037 00038 const Double_t TRecMdcTrack::z() const { 00039 return m_helix[3]; 00040 } 00041 00042 const Double_t TRecMdcTrack::r() const { 00043 return sqrt(x()*x()+y()*y()); 00044 } 00045 00046 const Double_t TRecMdcTrack::pxy() const { 00047 if(m_helix[2] != 0) 00048 return 1./fabs(m_helix[2]); 00049 else return 0.; 00050 } 00051 00052 const Double_t TRecMdcTrack::px() const { 00053 return pxy()*(-sin(m_helix[1])); 00054 } 00055 00056 const Double_t TRecMdcTrack::py() const { 00057 return pxy()*cos(m_helix[1]); 00058 } 00059 00060 const Double_t TRecMdcTrack::pz() const { 00061 return pxy()*m_helix[4]; 00062 } 00063 00064 const Double_t TRecMdcTrack::p() const { 00065 return sqrt(px()*px() + py()*py() + pz()*pz()); 00066 } 00067 00068 const Double_t TRecMdcTrack::theta() const { 00069 return acos(pz()/p()); 00070 } 00071 00072 const Double_t TRecMdcTrack::phi() const { 00073 return atan2(py(),px()); 00074 } 00075