00001
00002 #include "DstEvent/DstMdcTrack.h"
00003
00004 DstMdcTrack::DstMdcTrack()
00005 : m_trackId(0),
00006 m_charge(0),
00007 m_poca3D(0,0,0),
00008 m_a(5,0),
00009 m_Ea(5,0),
00010 m_stat(0),
00011 m_chi2(0),
00012 m_ndof(0),
00013 m_nster(0),
00014 m_nlayer(0),
00015 m_firstLayer(0),
00016 m_lastLayer(42),
00017 m_pxy(0),
00018 m_px(0),
00019 m_py(0),
00020 m_pz(0),
00021 m_p(0),
00022 m_theta(0),
00023 m_phi(0),
00024 m_x(0),
00025 m_y(0),
00026 m_z(0),
00027 m_r(0)
00028 {
00029 for(int i=0;i<5;i++) m_helix[i] = 0;
00030 for(int j=0;j<15;j++) m_err[j] = 999;
00031 for(int k=0;k<3;k++) m_poca[k] = 0;
00032 }
00033
00034 DstMdcTrack::DstMdcTrack( const DstMdcTrack& other)
00035 : m_trackId(other.m_trackId),
00036 m_charge(other.m_charge),
00037 m_poca3D(other.m_poca3D),
00038 m_a(other.m_a),
00039 m_Ea(other.m_Ea),
00040 m_stat(other.m_stat),
00041 m_chi2(other.m_chi2),
00042 m_ndof(other.m_ndof),
00043 m_nster(other.m_nster),
00044 m_nlayer(other.m_nlayer),
00045 m_firstLayer(other.m_firstLayer),
00046 m_lastLayer(other.m_lastLayer),
00047 m_pxy(other.m_pxy),
00048 m_px(other.m_px),
00049 m_py(other.m_py),
00050 m_pz(other.m_pz),
00051 m_p(other.m_p),
00052 m_theta(other.m_theta),
00053 m_phi(other.m_phi),
00054 m_x(other.m_x),
00055 m_y(other.m_y),
00056 m_z(other.m_z),
00057 m_r(other.m_r)
00058 {
00059 for(int i=0;i<5;i++) m_helix[i] = (other.m_helix)[i];
00060 for(int j=0;j<15;j++) m_err[j] = (other.m_err)[j];
00061 for(int k=0;k<3;k++) m_poca[k] = (other.m_poca)[k];
00062 }
00063
00064
00065 DstMdcTrack& DstMdcTrack::operator=(const DstMdcTrack& h){
00066 if( &h != this ){
00067 m_trackId = h.m_trackId;
00068 m_charge = h.m_charge;
00069 m_poca3D = h.m_poca3D;
00070 m_a = h.m_a;
00071 m_Ea = h.m_Ea;
00072 m_stat = h.m_stat;
00073 m_chi2 = h.m_chi2;
00074 m_ndof = h.m_ndof;
00075 m_nster = h.m_nster;
00076 m_nlayer = h.m_nlayer;
00077 m_firstLayer = h.m_firstLayer;
00078 m_lastLayer = h.m_lastLayer;
00079 m_pxy = h.m_pxy;
00080 m_px = h.m_px;
00081 m_py = h.m_py;
00082 m_pz = h.m_pz;
00083 m_p = h.m_p;
00084 m_theta = h.m_theta;
00085 m_phi = h.m_phi;
00086 m_x = h.m_x;
00087 m_y = h.m_y;
00088 m_z = h.m_z;
00089 m_r = h.m_r;
00090
00091 for(int i=0;i<5;i++) m_helix[i] = (h.m_helix)[i];
00092 for(int j=0;j<15;j++) m_err[j] = (h.m_err)[j];
00093 for(int k=0;k<3;k++) m_poca[k] = (h.m_poca)[k];
00094 }
00095 return *this;
00096 }
00097
00098 void DstMdcTrack::setHelix(double helix[5]) {
00099 for(int i=0; i<5; i++){
00100 m_helix[i] = helix[i];
00101 m_a[i] = helix[i];
00102 }
00103 }
00104
00105 void DstMdcTrack::setPoca(double poca[3]){
00106 for(int i=0; i<3; i++){
00107 m_poca[i] = poca[i];
00108 m_poca3D[i] = poca[i];
00109 }
00110 }
00111
00112 void DstMdcTrack::setError( double err[15]) {
00113 for (int i1=0; i1<15; i1++) {
00114 m_err[i1] = err[i1];
00115 }
00116 for(int i=0, k=0; i<5; i++) {
00117 for(int j=i; j<5; j++) {
00118 m_Ea[i][j] = m_err[k++];
00119 m_Ea[j][i] = m_Ea[i][j];
00120 }
00121 }
00122 }
00123
00124
00125 void DstMdcTrack::setHelix(const HepVector& helix){
00126 for(int i=0; i<5; i++){
00127 m_helix[i] = helix[i];
00128 }
00129 m_a = helix;
00130 }
00131
00132 void DstMdcTrack::setPoca(const HepPoint3D& poca){
00133 for(int i=0; i<3; i++){
00134 m_poca[i] = poca[i];
00135 }
00136 m_poca3D = poca;
00137 }
00138
00139 void DstMdcTrack::setError(const HepSymMatrix& err){
00140 int k = 0;
00141 for (int i=0; i<5; i++){
00142 for (int j=i; j<5; j++)
00143 {
00144 m_err[k] = err[i][j];
00145 k++;
00146 }
00147 }
00148 m_Ea = err;
00149 }
00150
00151 const HepVector DstMdcTrack::helix() const{
00152 return m_a;
00153 }
00154
00155 const HepSymMatrix DstMdcTrack::err() const{
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 return m_Ea;
00167 }
00168
00169 const HepLorentzVector DstMdcTrack::p4(const double mass) const{
00170 return HepLorentzVector(p3(),sqrt(p3()*p3()+mass*mass));
00171 }
00172
00173