BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkLineRep.cxx
Go to the documentation of this file.
1// File and Version Information:
2// $Id
3//
4// Description:
5// Implements circle track representation
6//
7// Author(s): Steve Schaffner
8//------------------------------------------------------------------------
9#include "TrkFitter/TrkLineRep.h"
10#include "MdcGeom/BesAngle.h"
11#include "MdcRecoUtil/Pdt.h"
12#include "MdcRecoUtil/PdtEntry.h"
13#include "TrkBase/TrkExchangePar.h"
14#include "TrkBase/TrkRecoTrk.h"
15#include "TrkBase/TrkSimpTraj.h"
16using std::endl;
17using std::ostream;
18
19// Construct from exchange paramters
20
22 const TrkHotList* inHots )
23 : TrkSimpleRep( inHots, trk, hypo )
24 , _traj( inPar )
25
26{}
27
28// Construct from exchange paramters, no hits
30 int nact, int nsv, int ndc, double chi2, double stFndRng,
31 double endFndRng )
32 : TrkSimpleRep( trk, hypo, nact, nsv, ndc, chi2, stFndRng, endFndRng ), _traj( inPar ) {}
33
34// copy ctor
36 : TrkSimpleRep( right, trk, hypo ), _traj( right._traj ) {}
37
39
41 TrkLineRep* newRep = new TrkLineRep( *this, theTrack, this->particleType() );
42 newRep->setValid( fitValid() );
43 newRep->setCurrent( fitCurrent() );
44 return newRep;
45}
46
48 TrkLineRep* newRep = new TrkLineRep( *this, parentTrack(), hypo );
49 newRep->setValid( fitValid() );
50 newRep->setCurrent( fitCurrent() ); // true for lines, anyway
51 return newRep;
52}
53
55 TrkExchangePar localPar( _traj.d0(), BesAngle( _traj.phi0() ).rad(), 0.0, _traj.z0(),
56 _traj.tanDip() );
57 const HepSymMatrix& lineCov = _traj.parameters()->covariance();
58 HepSymMatrix& theCov = localPar.covariance();
59 int ex_d0 = TrkExchangePar::ex_d0 + 1;
60 int ex_phi0 = TrkExchangePar::ex_phi0 + 1;
61 int ex_z0 = TrkExchangePar::ex_z0 + 1;
62 int ex_tD = TrkExchangePar::ex_tanDip + 1;
63
64 int ln_d0 = TrkDifLineTraj::d0Ind + 1;
65 int ln_phi0 = TrkDifLineTraj::phi0Ind + 1;
66 int ln_z0 = TrkDifLineTraj::z0Ind + 1;
67 int ln_tD = TrkDifLineTraj::tanDipInd + 1;
68
69 theCov( ex_d0, ex_d0 ) = lineCov( ln_d0, ln_d0 );
70 theCov( ex_phi0, ex_d0 ) = lineCov( ln_phi0, ln_d0 );
71 theCov( ex_phi0, ex_phi0 ) = lineCov( ln_phi0, ln_phi0 );
72 theCov( ex_z0, ex_d0 ) = lineCov( ln_z0, ln_d0 );
73 theCov( ex_z0, ex_phi0 ) = lineCov( ln_z0, ln_phi0 );
74 theCov( ex_z0, ex_z0 ) = lineCov( ln_z0, ln_z0 );
75 theCov( ex_tD, ex_d0 ) = lineCov( ln_tD, ln_d0 );
76 theCov( ex_tD, ex_phi0 ) = lineCov( ln_tD, ln_phi0 );
77 theCov( ex_tD, ex_z0 ) = lineCov( ln_tD, ln_z0 );
78 theCov( ex_tD, ex_tD ) = lineCov( ln_tD, ln_tD );
79
80 return localPar;
81}
82
83void TrkLineRep::print( ostream& ostr ) const {
84 ostr << "TrkLineRep "
85 << "phi0: " << BesAngle( _traj.phi0() ).rad() << " om: " << 0.0 << " d0: " << _traj.d0()
86 << " z0: " << _traj.z0() << " tnDip: " << _traj.tanDip() << endl;
87}
88
89void TrkLineRep::printAll( ostream& ostr ) const { print( ostr ); }
90
92
93const TrkSimpTraj& TrkLineRep::simpTraj() const { return _traj; }
94
95TrkDifTraj& TrkLineRep::traj() { return _traj; }
96
97const TrkDifTraj& TrkLineRep::traj() const { return _traj; }
98
99double TrkLineRep::arrivalTime( double fltL ) const {
100 static double cinv = 1. / Constants::c;
101 double m_betainv = -9999.;
102 // Initialize cache
103 if ( m_betainv < 0.0 )
104 {
105 double mass2 = Pdt::lookup( PdtPid::muon )->mass();
106 mass2 = mass2 * mass2;
107 double ptot2 = 100.; // 10GeV;
108 // double ptot2 = momentum(0.).mag2();
109 assert( ptot2 != 0.0 );
110 m_betainv = sqrt( ( ptot2 + mass2 ) / ptot2 );
111 }
112 double tof = fltL * m_betainv * cinv;
113 return trackT0() + tof;
114}
static PdtEntry * lookup(const std::string &name)
Definition Pdt.cxx:183
double phi0() const
void setValid(bool v)
virtual TrkLineRep * clone(TrkRecoTrk *newTrack) const
virtual TrkExchangePar helix(double fltLen) const
virtual TrkDifTraj & traj()
double arrivalTime(double fltLen) const
virtual void printAll(std::ostream &ostr) const
virtual void print(std::ostream &ostr) const
virtual TrkLineRep * cloneNewHypo(PdtPid::PidType hypo)
TrkLineRep(const TrkExchangePar &inPar, TrkRecoTrk *myTrack, PdtPid::PidType hypo, const TrkHotList *=0)
virtual ~TrkLineRep()
virtual TrkSimpTraj & simpTraj()
double trackT0() const
Definition TrkRep.cxx:173
virtual PdtPid::PidType particleType() const
Definition TrkRep.cxx:249
TrkSimpleRep(const TrkHotList *, TrkRecoTrk *, PdtPid::PidType)