00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "TrkFitter/TrkCircleRep.h"
00011 #include "TrkBase/TrkSimpTraj.h"
00012 #include "TrkBase/TrkRecoTrk.h"
00013 #include "TrkBase/TrkExchangePar.h"
00014 #include "MdcGeom/BesAngle.h"
00015 using std::endl;
00016 using std::ostream;
00017
00018
00019 TrkCircleRep::TrkCircleRep(const TrkExchangePar& inPar,
00020 TrkRecoTrk* trk,
00021 PdtPid::PidType hypo,
00022 const TrkHotList *inHots):
00023 TrkSimpleRep(inHots, trk, hypo),
00024 _traj(inPar)
00025 {
00026 set2d(true);
00027 }
00028
00029
00030 TrkCircleRep::TrkCircleRep(const TrkExchangePar& inPar, TrkRecoTrk* trk,
00031 PdtPid::PidType hypo, int nact, int nsv, int ndc, double chi2,
00032 double stFndRng, double endFndRng) :
00033 TrkSimpleRep(trk, hypo, nact, nsv, ndc, chi2, stFndRng, endFndRng),
00034 _traj(inPar)
00035 {
00036 set2d(true);
00037 }
00038
00039
00040 TrkCircleRep::TrkCircleRep(const TrkCircleRep& right, TrkRecoTrk* trk,
00041 PdtPid::PidType hypo) :
00042 TrkSimpleRep(right, trk, hypo), _traj(right._traj)
00043 {
00044 set2d(true);
00045 }
00046
00047 TrkCircleRep::~TrkCircleRep()
00048 {}
00049
00050 TrkCircleRep*
00051 TrkCircleRep::clone(TrkRecoTrk* theTrack) const
00052 {
00053 TrkCircleRep* newRep = new TrkCircleRep(*this, theTrack, this->particleType());
00054 newRep->setValid(fitValid());
00055 newRep->setCurrent(fitCurrent());
00056 return newRep;
00057
00058 }
00059
00060 TrkCircleRep*
00061 TrkCircleRep::cloneNewHypo(PdtPid::PidType hypo)
00062 {
00063 TrkCircleRep* newRep = new TrkCircleRep(*this, parentTrack(), hypo);
00064 newRep->setValid(fitValid());
00065 newRep->setCurrent(fitCurrent());
00066 return newRep;
00067 }
00068
00069 TrkExchangePar
00070 TrkCircleRep::helix(double ) const
00071 {
00072 TrkExchangePar localPar(_traj.d0(), BesAngle(_traj.phi0()).rad(),
00073 _traj.omega(), 0.0, 0.0);
00074 HepSymMatrix& theCov = localPar.covariance();
00075 for (int i = 1; i < 4; i++) {
00076 for (int j = 1; j < 4; j++) {
00077 theCov(i,j) = _traj.parameters()->covariance()(i,j);
00078 }
00079 }
00080 return localPar;
00081 }
00082
00083 void
00084 TrkCircleRep::print(ostream& ostr) const
00085 {
00086 ostr << "TrkCircleRep "
00087 << " q: "<<charge()
00088 << " phi0: " << BesAngle(_traj.phi0()).rad()
00089 << " om: "<<_traj.omega()
00090 << " pt: "<<pt()
00091 << " p: "<<momentum()
00092 << " d0: " << _traj.d0()
00093 << " parent track:"<<parentTrack()->id()
00094 << endl;
00095
00096 }
00097
00098 void
00099 TrkCircleRep::printAll(ostream& ostr) const
00100 {
00101 print(ostr);
00102 }
00103
00104 TrkSimpTraj&
00105 TrkCircleRep::simpTraj()
00106 {
00107 return _traj;
00108 }
00109
00110 const TrkSimpTraj&
00111 TrkCircleRep::simpTraj() const
00112 {
00113 return _traj;
00114 }
00115
00116 TrkDifTraj&
00117 TrkCircleRep::traj()
00118 {
00119 return _traj;
00120 }
00121 const TrkDifTraj&
00122 TrkCircleRep::traj() const
00123 {
00124 return _traj;
00125 }