17 using namespace lcio ;
20 const static string testname=
"test_trackstate";
31 MYTEST.
LOG(
"testing TrackState" );
35 MYTEST.
LOG(
"test default constructor" );
39 MYTEST( a.getLocation(), TrackState::AtOther,
"getLocation" ) ;
40 MYTEST( a.getD0(), float( .0 ),
"getD0" ) ;
41 MYTEST( a.getPhi(), float( .0 ),
"getPhi" ) ;
42 MYTEST( a.getOmega(), float( .0 ),
"getOmega" ) ;
46 MYTEST.
LOG(
"test constructor with arguments" );
48 float cov[15] = { 1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15. } ;
49 float ref[3] = { 1. , 2. , 3. } ;
53 TrackState::AtLastHit,
63 MYTEST( b.getLocation(), TrackState::AtLastHit,
"getLocation" ) ;
64 MYTEST( b.getD0(), float( .1 ),
"getD0" ) ;
65 MYTEST( b.getPhi(), float( .2 ),
"getPhi" ) ;
66 MYTEST( b.getOmega(), float( .3 ),
"getOmega" ) ;
70 MYTEST.
LOG(
"test default copy constructor" );
74 MYTEST( c.getLocation(), TrackState::AtLastHit,
"getLocation" ) ;
75 MYTEST( c.getD0(), float( .1 ),
"getD0" ) ;
76 MYTEST( c.getPhi(), float( .2 ),
"getPhi" ) ;
77 MYTEST( c.getOmega(), float( .3 ),
"getOmega" ) ;
81 MYTEST.
LOG(
"test default assignment operator" );
85 MYTEST( d.getLocation(), TrackState::AtLastHit,
"getLocation" ) ;
86 MYTEST( d.getD0(), float( .1 ),
"getD0" ) ;
87 MYTEST( d.getPhi(), float( .2 ),
"getPhi" ) ;
88 MYTEST( d.getOmega(), float( .3 ),
"getOmega" ) ;
92 MYTEST.
LOG(
"test default copy constructor using EVENT::TrackState pointer" );
96 MYTEST( p->
getLocation(), TrackState::AtLastHit,
"getLocation" ) ;
97 MYTEST( p->
getD0(), float( .1 ),
"getD0" ) ;
98 MYTEST( p->
getPhi(), float( .2 ),
"getPhi" ) ;
99 MYTEST( p->
getOmega(), float( .3 ),
"getOmega" ) ;
104 for(
unsigned int i=0 ; i<covv.size() ; i++ ){
106 ss <<
" covv[" << i <<
"] " ;
107 MYTEST( covv[i] ,
float(i+1) , ss.
str() ) ;
112 for(
unsigned int i=0 ; i<3 ; i++ ){
114 ss <<
" refp[" << i <<
"] " ;
115 MYTEST( refp[i] ,
float(i+1) , ss.
str() ) ;
120 MYTEST.
LOG(
"test default copy constructor using two EVENT::TrackState pointers" );
123 const EVENT::TrackState * pp =
new TrackStateImpl(static_cast<const TrackStateImpl&>(*p)) ;
125 MYTEST( pp->
getLocation(), TrackState::AtLastHit,
"getLocation" ) ;
126 MYTEST( pp->
getD0(), float( .1 ),
"getD0" ) ;
127 MYTEST( pp->
getPhi(), float( .2 ),
"getPhi" ) ;
128 MYTEST( pp->
getOmega(), float( .3 ),
"getOmega" ) ;
135 MYTEST.
LOG(
"test default copy constructor using two EVENT::TrackState pointers" );
138 pp =
new TrackStateImpl( *p ) ;
140 MYTEST( pp->getLocation(), TrackState::AtLastHit,
"getLocation" ) ;
141 MYTEST( pp->getD0(), float( .1 ),
"getD0" ) ;
142 MYTEST( pp->getPhi(), float( .2 ),
"getPhi" ) ;
143 MYTEST( pp->getOmega(), float( .3 ),
"getOmega" ) ;
154 }
catch( Exception &e ){
155 MYTEST.
FAILED( e.what() );
virtual float getOmega() const =0
Omega is the signed curvature of the track in [1/mm].
virtual const FloatVec & getCovMatrix() const =0
Covariance matrix of the track parameters.
std::vector< float > FloatVec
Vector of floats.
static const string testname
The LCIO TrackState class.
virtual float getD0() const =0
Impact paramter of the track in (r-phi).
virtual int getLocation() const =0
The location of the track state.
void FAILED(const std::string &msg)
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
virtual const float * getReferencePoint() const =0
Reference point of the track parameters, e.g.
void LOG(const std::string &msg)
virtual float getPhi() const =0
Phi of the track at the reference point.