00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "TrkBase/TrkExchangePar.h"
00014 #include "MdcGeom/BesAngle.h"
00015 #include <assert.h>
00016 #include <iostream>
00017 using std::endl;
00018 using std::ostream;
00019
00020
00021 TrkExchangePar::TrkExchangePar(const HepVector& inV, const HepMatrix& inErr)
00022 : paramVec(inV) {
00023
00024 assert(paramVec.num_row() == nParam);
00025 assert(inErr.num_row() == nParam);
00026 assert(inErr.num_col() == nParam);
00027 paramErr.assign(inErr);
00028 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
00029 }
00030
00031
00032 TrkExchangePar::TrkExchangePar(const HepVector& inV, const HepSymMatrix& err)
00033 : paramVec(inV), paramErr(err) {
00034
00035 assert(paramVec.num_row() == nParam);
00036 assert(paramErr.num_row() == nParam);
00037 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
00038 }
00039
00040
00041 TrkExchangePar::TrkExchangePar(const HepVector& inV)
00042 : paramVec(inV), paramErr(nParam, 1) {
00043
00044 assert(paramVec.num_row() == nParam);
00045 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
00046 }
00047
00048
00049 TrkExchangePar::TrkExchangePar(double d0In, double phi0In, double omegaIn,
00050 double z0In, double tanDipIn)
00051 : paramVec(nParam), paramErr(nParam, 1) {
00052
00053 paramVec[ex_d0] = d0In;
00054 paramVec[ex_phi0] = phi0In;
00055 paramVec[ex_omega] = omegaIn;
00056 paramVec[ex_z0] = z0In;
00057 paramVec[ex_tanDip] = tanDipIn;
00058 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
00059 }
00060
00061
00062 TrkExchangePar::~TrkExchangePar(){}
00063
00064
00065
00066
00067 void TrkExchangePar::print(ostream& o) const {
00068 o << "d0=" << d0() << " phi0=" << phi0() << " omega=" << omega()
00069 << " z0=" << z0() << " tanDip=" << tanDip();
00070 }
00071
00072 void TrkExchangePar::printAll(ostream& o) const {
00073 print(o);
00074 o << endl << covariance() << endl;
00075 }
00076
00077
00078
00079 ostream& operator<<(ostream& o, const TrkExchangePar& helix) {
00080 helix.print(o);
00081 return o;
00082 }
00083