LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TrackStateImpl.cc
Go to the documentation of this file.
1 #include "IMPL/TrackStateImpl.h"
2 
3 
4 namespace EVENT{
5  // the standard requires static const ints to be defined aoutside the class declaration
6  // so we do this here :
7  const int TrackState::AtOther ;
8  const int TrackState::AtIP ;
9  const int TrackState::AtFirstHit ;
10  const int TrackState::AtLastHit ;
11  const int TrackState::AtCalorimeter ;
12  const int TrackState::AtVertex ;
13  const int TrackState::LastLocation ;
14 }
15 
16 
17 using namespace EVENT ;
18 
19 namespace IMPL {
20 
21  TrackStateImpl::TrackStateImpl() :
22  _location(0),
23  _d0(0),
24  _phi(0),
25  _omega(0),
26  _z0(0),
27  _tanLambda(0),
28  _covMatrix(TRKSTATENCOVMATRIX)
29  {
30  for(int i=0 ; i < TRKSTATENREFSIZE ; ++i ) {
31  _reference[i] = 0.0 ;
32  }
33 
34  }
35 
36  TrackStateImpl::TrackStateImpl(int location, float d0, float phi, float omega, float z0, float tanLambda, const float* covMatrix, const float* reference) :
37  _d0(d0),
38  _phi(phi),
39  _omega(omega),
40  _z0(z0),
41  _tanLambda(tanLambda),
42  _covMatrix(TRKSTATENCOVMATRIX)
43  {
44 
45  setLocation( location );
46 
47  for(int i=0 ; i < TRKSTATENCOVMATRIX ; ++i ) {
48  _covMatrix[i] = covMatrix[i] ;
49  }
50 
51  setReferencePoint(reference);
52  }
53 
54 
55  TrackStateImpl::TrackStateImpl(int location, float d0, float phi, float omega, float z0, float tanLambda, const FloatVec& covMatrix, const float* reference) :
56  _d0(d0),
57  _phi(phi),
58  _omega(omega),
59  _z0(z0),
60  _tanLambda(tanLambda),
61  _covMatrix(covMatrix)
62  {
63 
64  setLocation( location );
65 
66  setReferencePoint(reference);
67  }
68 
70  //_location(p->getLocation()),
71  _d0(p.getD0()),
72  _phi(p.getPhi()),
73  _omega(p.getOmega()),
74  _z0(p.getZ0()),
75  _tanLambda(p.getTanLambda()),
76  _covMatrix(p.getCovMatrix())
77  {
78 
79  setLocation( p.getLocation() );
80 
82  }
83 
84 
85 
86 
88 
89  int TrackStateImpl::getLocation() const { return _location ;}
90  float TrackStateImpl::getD0() const { return _d0 ;}
91  float TrackStateImpl::getPhi() const { return _phi ; }
92  float TrackStateImpl::getOmega() const { return _omega ; }
93  float TrackStateImpl::getZ0() const { return _z0 ;}
94  float TrackStateImpl::getTanLambda() const { return _tanLambda ;}
95 
96  const FloatVec& TrackStateImpl::getCovMatrix() const { return _covMatrix ; }
97  const float* TrackStateImpl::getReferencePoint() const { return _reference ; }
98 
99 
100  void TrackStateImpl::setLocation( int location ){
101  checkAccess("TrackStateImpl::setLocation") ;
102 
103  // if( location < 0 || location >= TrackState::Location::size() ){
104  // throw( Exception( " TrackStateImpl::setLocation called with an undefined Location" )) ;
105  // }
106 
107  _location = location ;
108  }
109  void TrackStateImpl::setD0( float d0 ){
110  checkAccess("TrackStateImpl::setD0") ;
111  _d0 = d0 ;
112  }
113  void TrackStateImpl::setPhi( float phi ){
114  checkAccess("TrackStateImpl::setPhi") ;
115  _phi = phi ;
116  }
117  void TrackStateImpl::setOmega( float omega ) {
118  checkAccess("TrackStateImpl::setOmega") ;
119  _omega = omega ;
120  }
121  void TrackStateImpl::setZ0( float z0 ){
122  checkAccess("TrackStateImpl::setZ0") ;
123  _z0 = z0 ;
124  }
125  void TrackStateImpl::setTanLambda( float tanLambda ){
126  checkAccess("TrackStateImpl::setTanLambda") ;
127  _tanLambda = tanLambda ;
128  }
129  void TrackStateImpl::setCovMatrix( const float* cov ){
130  checkAccess("TrackStateImpl::setCovMatrix") ;
131  for( int i=0 ; i<TRKSTATENCOVMATRIX ; i++ ){
132  _covMatrix[i] = cov[i] ;
133  }
134  }
136  checkAccess("TrackStateImpl::setCovMatrix") ;
137  for( int i=0 ; i<TRKSTATENCOVMATRIX ; i++ ){
138  _covMatrix[i] = cov[i] ;
139  }
140  }
141 
142  void TrackStateImpl::setReferencePoint( const float* rPnt ){
143  checkAccess("TrackStateImpl::setReferencePoint") ;
144  for( int i=0 ; i<TRKSTATENREFSIZE ; i++ ){
145  _reference[i] = rPnt[i] ;
146  }
147  }
148 
149 } // namespace IMPL
150 
151 
static const int LastLocation
Definition: TrackState.h:43
virtual float getZ0() const
Impact paramter of the track in (r-z).
virtual void setD0(float d0)
static const int AtVertex
Definition: TrackState.h:42
static const int AtIP
Definition: TrackState.h:38
virtual float getOmega() const
Omega is the signed curvature of the track in [1/mm].
virtual void setTanLambda(float tanLambda)
The LCIO TrackState class.
Definition: TrackState.h:26
virtual void setReferencePoint(const float *rPnt)
virtual int getLocation() const
The location of the track state.
static const int AtFirstHit
Definition: TrackState.h:39
virtual void setLocation(int location)
virtual int getLocation() const =0
The location of the track state.
virtual void setCovMatrix(const float *cov)
virtual float getTanLambda() const
Lambda is the dip angle of the track in r-z at the reference point.
virtual float getD0() const
Impact paramter of the track in (r-phi).
virtual const float * getReferencePoint() const =0
Reference point of the track parameters, e.g.
virtual void setZ0(float z0)
virtual const float * getReferencePoint() const
Reference point of the track parameters, e.g.
virtual ~TrackStateImpl()
Destructor.
virtual void setPhi(float phi)
virtual const EVENT::FloatVec & getCovMatrix() const
Covariance matrix of the track parameters.
TrackStateImpl()
Default constructor, initializes values to 0.
#define TRKSTATENCOVMATRIX
#define TRKSTATENREFSIZE
static const int AtLastHit
Definition: TrackState.h:40
virtual void setOmega(float omega)
static const int AtOther
Definition: TrackState.h:37
float _reference[TRKSTATENREFSIZE]
static const int AtCalorimeter
Definition: TrackState.h:41
virtual float getPhi() const
Phi of the track at reference point.
EVENT::FloatVec _covMatrix