LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
TrackImpl.h
1 #ifndef IMPL_TRACKIMPL_H
2 #define IMPL_TRACKIMPL_H 1
3 
4 
5 #include "EVENT/Track.h"
6 #include "EVENT/TrackState.h"
7 #include "AccessChecked.h"
8 #include <map>
9 #include <bitset>
10 
11 
12 #define BIT_ISREFERENCEPOINTDCA 31
13 
14 typedef std::map< std::string , EVENT::IntVec* > IndexMap ;
15 
16 //#define TRKNCOVMATRIX 15 // defined in TrackState
17 
18 namespace IMPL {
19 
29  class TrackImpl : public EVENT::Track, public AccessChecked {
30 
31  public:
32 
35  TrackImpl() ;
36 
40  TrackImpl( const TrackImpl& ) ;
41  const TrackImpl& operator = ( const TrackImpl& o ) ; // operator =
42 
43 
45  virtual ~TrackImpl() ;
46 
47  virtual int id() const { return simpleUID() ; }
48 
49 // /** Type of track, i.e. the subdetector(s) used to derive the track paramters, e.g. "TPC", "COMB", etc.
50 // * In order to save disc space working groups should try and define three to four letter acronyms for
51 // * their tracking detectors.
52 // */
53 // virtual const std::string & getType() const ;
54 
55 
56 
61  virtual int getType() const ;
62 
63 // /** Returns true if the corresponding bit in the type word is set.
64 // */
65 // virtual bool testType(int bitIndex) const ;
66 
70  virtual float getD0() const ;
71 
75  virtual float getPhi() const ;
76 
81  virtual float getOmega() const ;
82 
86  virtual float getZ0() const ;
87 
91  virtual float getTanLambda() const ;
92 
98  virtual const EVENT::FloatVec & getCovMatrix() const ;
99 
104  virtual const float* getReferencePoint() const ;
105 
107  // */
108  //virtual bool isReferencePointPCA() const ;
109 
112  virtual float getChi2() const ;
113 
116  virtual int getNdf() const ;
117 
120  virtual float getdEdx() const;
121 
124  virtual float getdEdxError() const;
125 
131  virtual float getRadiusOfInnermostHit() const ;
132 
139  virtual const EVENT::IntVec & getSubdetectorHitNumbers() const ;
140 
141 
144  virtual const EVENT::TrackVec & getTracks() const ;
145 
146 
149  virtual const EVENT::TrackStateVec & getTrackStates() const ;
150 
151 
154  virtual const EVENT::TrackState* getClosestTrackState( float x, float y, float z ) const ;
155 
156 
160  virtual const EVENT::TrackState* getTrackState( int location ) const ;
161 
162 
166  virtual const EVENT::TrackerHitVec & getTrackerHits() const ;
167 
168 
169  // setters
170  virtual void setTypeBit( int index , bool val=true) ;
171 
172  virtual void setD0( float d0 ) ; // stored in TrackState
173  virtual void setPhi( float phi ) ; // stored in TrackState
174  virtual void setOmega( float omega ) ; // stored in TrackState
175  virtual void setZ0( float z0 ) ; // stored in TrackState
176  virtual void setTanLambda( float tanLambda ) ; // stored in TrackState
177  virtual void setCovMatrix( const float* cov ) ; // stored in TrackState
178  virtual void setCovMatrix( const EVENT::FloatVec& cov ) ; // stored in TrackState
179  virtual void setReferencePoint( const float* rPnt) ; // stored in TrackState
180 
181  //virtual void setIsReferencePointPCA( bool val ) ;
182 
183  virtual void setChi2( float chi2 ) ;
184  virtual void setNdf( int ndf ) ;
185  virtual void setdEdx( float dEdx ) ;
186  virtual void setdEdxError( float dEdxError ) ;
187 
188  virtual void addTrack( EVENT::Track* trk ) ;
189  virtual void addTrackState( EVENT::TrackState* trkstate ) ;
190  virtual void addHit( EVENT::TrackerHit* hit) ;
191 
192  // direct access to the track state vector
193  virtual EVENT::TrackStateVec & trackStates() ;
194 
195 
196  virtual void setRadiusOfInnermostHit( float r ) ;
197 
203 
204  protected:
205 
206  virtual void setType( int type ) ;
207 
208  // std::string _type ;
209  std::bitset<32> _type ;
210 
211 
212  //float _d0 ; // stored in TrackState
213  //float _phi ; // stored in TrackState
214  //float _omega ; // stored in TrackState
215  //float _z0 ; // stored in TrackState
216  //float _tanLambda ; // stored in TrackState
217  //EVENT::FloatVec _covMatrix ; // stored in TrackState
218  //float _reference[3] ; // stored in TrackState
219 
220 
221  //bool _isReferencePointPCA ;
222 
223  float _chi2 ;
224  int _ndf ;
225  float _dEdx ;
226  float _dEdxError ;
227  float _radiusOfInnermostHit ;
228  EVENT::IntVec _subdetectorHitNumbers ;
229 
230  EVENT::TrackVec _tracks ;
231  EVENT::TrackerHitVec _hits ;
232 
233  EVENT::TrackStateVec _trackStates ;
234 
235 
236 
237 }; // class
238 
239 
240 
241 } // namespace IMPL
242 #endif /* ifndef IMPL_TRACKIMLP_H */
virtual float getRadiusOfInnermostHit() const
The radius of the innermost hit that has been used in the track fit.
Definition: TrackImpl.cc:120
A generic tracker hit to be used by pattern recognition.
Definition: TrackerHit.h:26
virtual const EVENT::TrackState * getTrackState(int location) const
Returns track state for the given location - or NULL if not found.
Definition: TrackImpl.cc:156
std::vector< TrackerHit * > TrackerHitVec
Vector of (pointers to) TrackerHits.
Definition: TrackerHit.h:17
virtual const EVENT::FloatVec & getCovMatrix() const
Covariance matrix of the track parameters.
Definition: TrackImpl.cc:99
virtual const EVENT::TrackVec & getTracks() const
The tracks (as Track objects) that have been combined to this track.
Definition: TrackImpl.cc:131
virtual EVENT::IntVec & subdetectorHitNumbers()
Allows modification of the subdetectorHitNumbers, e.g.
Definition: TrackImpl.cc:372
Implementation of the LCIO track class.
Definition: TrackImpl.h:29
std::vector< Track * > TrackVec
Vector of (pointers to) Tracks.
Definition: Track.h:22
std::vector< float > FloatVec
Vector of floats.
Definition: LCIOSTLTypes.h:18
The LCIO TrackState class.
Definition: TrackState.h:26
virtual int getType() const
Type of track, i.e.
Definition: TrackImpl.cc:80
virtual float getOmega() const
Omega is the signed curvature of the track in [1/mm].
Definition: TrackImpl.cc:96
std::vector< TrackState * > TrackStateVec
Vector of (pointers to) TrackStates.
Definition: TrackState.h:17
virtual int getNdf() const
Number of degrees of freedom of the track fit.
Definition: TrackImpl.cc:115
virtual float getdEdx() const
dEdx of the track.
Definition: TrackImpl.cc:116
virtual const EVENT::IntVec & getSubdetectorHitNumbers() const
A vector that holds the number of hits in particular subdetectors.
Definition: TrackImpl.cc:124
TrackImpl()
Default constructor, initializes values to 0.
Definition: TrackImpl.cc:11
virtual float getChi2() const
True if the reference point is the point of closest approach.
Definition: TrackImpl.cc:114
virtual float getZ0() const
Impact paramter of the track in (r-z).
Definition: TrackImpl.cc:97
virtual int id() const
Returns an object id for internal (debugging) use in LCIO.
Definition: TrackImpl.h:47
The LCIO track class.
Definition: Track.h:33
virtual const EVENT::TrackerHitVec & getTrackerHits() const
Optionaly ( check/set flag(LCIO::TRBIT_HITS)==1) return the hits that have been used to create this t...
Definition: TrackImpl.cc:127
std::vector< int > IntVec
Vector of ints.
Definition: LCIOSTLTypes.h:22
virtual ~TrackImpl()
Destructor.
Definition: TrackImpl.cc:59
virtual float getTanLambda() const
Lambda is the dip angle of the track in r-z at the reference point.
Definition: TrackImpl.cc:98
Controls access to objects.
Definition: AccessChecked.h:17
virtual const EVENT::TrackState * getClosestTrackState(float x, float y, float z) const
Returns track state closest to the given point.
Definition: TrackImpl.cc:139
virtual const EVENT::TrackStateVec & getTrackStates() const
Returns track states associtated with this track.
Definition: TrackImpl.cc:135
virtual float getD0() const
Returns true if the corresponding bit in the type word is set.
Definition: TrackImpl.cc:94
virtual float getdEdxError() const
Error of dEdx.
Definition: TrackImpl.cc:117
virtual float getPhi() const
Phi of the track at reference point.
Definition: TrackImpl.cc:95
virtual const float * getReferencePoint() const
Reference point of the track parameters.
Definition: TrackImpl.cc:103