MarlinTrk  02.08
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MarlinDDKalTestTrack.h
Go to the documentation of this file.
1 #ifndef MarlinDDKalTestTrack_h
2 #define MarlinDDKalTestTrack_h
3 
4 #include "IMarlinTrack.h"
5 #include "IMarlinTrkSystem.h"
6 
7 #include <TObjArray.h>
8 
9 #include <cmath>
10 
11 #include "TMatrixD.h"
12 
13 
14 class TKalTrack ;
15 class THelicalTrack ;
16 class TKalTrackSite ;
17 class DDVTrackHit ;
18 class DDVMeasLayer ;
19 
20 namespace MarlinTrk {
21  class MarlinDDKalTest;
22 }
23 
24 namespace EVENT{
25  class TrackerHit ;
26 }
27 
28 
29 
37 namespace MarlinTrk{
38 
40 
41 public:
42 
43 #ifdef MARLINTRK_DIAGNOSTICS_ON
44  friend class DiagnosticsController;
45 #endif
46 
48 
50 
51 protected:
52 
53 private:
54 
55  MarlinDDKalTestTrack(const MarlinDDKalTestTrack&) ; // Prevent copy-construction
56  MarlinDDKalTestTrack& operator=(const MarlinDDKalTestTrack&) ; // Prevent assignment
57 
58  // make member functions private to force use through interface
59 
63  void setMass(double mass) ;
64 
67  double getMass() ;
68 
72  int addHit(EVENT::TrackerHit* hit) ;
73 
77  int addHit(EVENT::TrackerHit* trkhit, const DDVMeasLayer* ml) ;
78 
82  int addHit( EVENT::TrackerHit* trkhit, DDVTrackHit* kalhit, const DDVMeasLayer* ml) ;
83 
88  int initialise( bool fitDirection );
89 
98  int initialise( const EVENT::TrackState& ts, double /*bfield_z*/, bool fitDirection ) ;
99 
100 
105  int fit( double maxChi2Increment=DBL_MAX ) ;
106 
107 
110  int smooth() ;
111 
112 
115  int smooth( EVENT::TrackerHit* hit ) ;
116 
117 
121  int addAndFit( EVENT::TrackerHit* hit, double& chi2increment, double maxChi2Increment=DBL_MAX ) ;
122 
126  int addAndFit( DDVTrackHit* kalhit, double& chi2increment, TKalTrackSite*& site, double maxChi2Increment=DBL_MAX ) ;
127 
128 
131  int testChi2Increment( EVENT::TrackerHit* hit, double& chi2increment ) ;
132 
133 
134  // Track State Accessesors
135 
138  int getTrackState( IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
139 
140 
143  int getTrackState( EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
144 
145 
152 
159 
160 
163  int getNDF( int& ndf ) ;
164 
168 
169  // PROPAGATORS
170 
173  int propagate( const Vector3D& point, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
174 
175 
179  int propagate( const Vector3D& point, EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
180 
181 
185  int propagate( const Vector3D& point, const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, const DDVMeasLayer* ml = 0 ) ;
186 
187 
190  int propagateToLayer( int layerID, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int& detElementID, int mode=modeClosest ) ;
191 
195  int propagateToLayer( int layerID, EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int& detElementID, int mode=modeClosest ) ;
196 
200  int propagateToLayer( int layerID, const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int& detElementID, int mode=modeClosest ) ;
201 
204  int propagateToDetElement( int detElementID, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int mode=modeClosest ) ;
205 
209  int propagateToDetElement( int detEementID, EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int mode=modeClosest ) ;
210 
214  int propagateToDetElement( int detEementID, const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int mode=modeClosest ) ;
215 
216 
217 
218  // EXTRAPOLATORS
219 
222  int extrapolate( const Vector3D& point, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
223 
227  int extrapolate( const Vector3D& point, EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
228 
232  int extrapolate( const Vector3D& point, const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) ;
233 
236  int extrapolateToLayer( int layerID, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int& detElementID, int mode=modeClosest ) ;
237 
241  int extrapolateToLayer( int layerID, EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int& detElementID, int mode=modeClosest ) ;
242 
246  int extrapolateToLayer( int layerID, const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int& detElementID, int mode=modeClosest ) ;
247 
250  int extrapolateToDetElement( int detElementID, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int mode=modeClosest ) ;
251 
255  int extrapolateToDetElement( int detEementID, EVENT::TrackerHit* hit, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int mode=modeClosest ) ;
256 
260  int extrapolateToDetElement( int detEementID, const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf, int mode=modeClosest ) ;
261 
262 
266 
267  // INTERSECTORS
268 
269 
273  int intersectionWithLayer( int layerID, Vector3D& point, int& detElementID, int mode=modeClosest ) ;
274 
278  int intersectionWithLayer( int layerID, EVENT::TrackerHit* hit, Vector3D& point, int& detElementID, int mode=modeClosest ) ;
279 
283  int intersectionWithLayer( int layerID, const TKalTrackSite& site, Vector3D& point, int& detElementID, const DDVMeasLayer*& ml, int mode=modeClosest ) ;
284 
285 
288  int intersectionWithDetElement( int detElementID, Vector3D& point, int mode=modeClosest ) ;
289 
293  int intersectionWithDetElement( int detElementID, EVENT::TrackerHit* hit, Vector3D& point, int mode=modeClosest ) ;
294 
298  int intersectionWithDetElement( int detElementID, const TKalTrackSite& site, Vector3D& point, const DDVMeasLayer*& ml, int mode=modeClosest ) ;
299 
303  int findIntersection( std::vector<DDVMeasLayer const*>& meas_modules, const TKalTrackSite& site, Vector3D& point, int& detElementID, const DDVMeasLayer*& ml, int mode=modeClosest ) ;
304 
308  int findIntersection( const DDVMeasLayer& meas_module, const TKalTrackSite& site, Vector3D& point, double& dphi, int& detElementIDconst, int mode=modeClosest ) ;
309 
310 
311 
312 
313  //** end of memeber functions from IMarlinTrack interface
314 
317  void ToLCIOTrackState( const TKalTrackSite& site, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) const ;
318 
321  void ToLCIOTrackState( const THelicalTrack& helix, const TMatrixD& cov, IMPL::TrackStateImpl& ts, double& chi2, int& ndf ) const ;
322 
325  int getSiteFromLCIOHit( EVENT::TrackerHit* trkhit, TKalTrackSite*& site ) const ;
326 
327 
328 
330  inline double toBaseRange( double phi) const {
331  while( phi <= -M_PI ){ phi += 2. * M_PI ; }
332  while( phi > M_PI ){ phi -= 2. * M_PI ; }
333  return phi ;
334  }
335 
336 
337 
338  // memeber variables
339 
340  TKalTrack* _kaltrack=nullptr;
341 
343 
344  TObjArray* _kalhits=nullptr;
345 
347 
350 
353  bool _initialised=false;
354 
357  bool _fitDirection=false;
358 
359 
362  bool _smoothed=false;
363 
367 
371 
375 
379 
383 
384 
385 } ;
386 
387 } // end of namespace MarlinTrk
388 
389 #endif
int getHitsInFit(std::vector< std::pair< EVENT::TrackerHit *, double > > &hits)
get the list of hits included in the fit, together with the chi2 contributions of the hits...
MarlinDDKalTestTrack(MarlinDDKalTest *ktest)
int intersectionWithDetElement(int detElementID, Vector3D &point, int mode=modeClosest)
extrapolate the fit to numbered sensitive detector element, returning intersection point in global co...
int getSiteFromLCIOHit(EVENT::TrackerHit *trkhit, TKalTrackSite *&site) const
get the measurement site associated with the given lcio TrackerHit trkhit
std::string toString()
Dump this track to a string for debugging.
MarlinDDKalTestTrack & operator=(const MarlinDDKalTestTrack &)
int propagateToLayer(int layerID, IMPL::TrackStateImpl &ts, double &chi2, int &ndf, int &detElementID, int mode=modeClosest)
propagate the fit to the numbered sensitive layer, returning TrackState, chi2, ndf and integer ID of ...
int findIntersection(std::vector< DDVMeasLayer const * > &meas_modules, const TKalTrackSite &site, Vector3D &point, int &detElementID, const DDVMeasLayer *&ml, int mode=modeClosest)
extrapolate the fit at the measurement site, to sensitive detector elements contained in the std::vec...
#define M_PI
std::map< EVENT::TrackerHit *, DDVTrackHit * > _lcio_hits_to_kaltest_hits
map to store relation between lcio hits kaltest hits
int extrapolate(const Vector3D &point, IMPL::TrackStateImpl &ts, double &chi2, int &ndf)
extrapolate the fit to the point of closest approach to the given point, returning TrackState...
bool _fitDirection
used to store the fit direction supplied to intialise
void ToLCIOTrackState(const TKalTrackSite &site, IMPL::TrackStateImpl &ts, double &chi2, int &ndf) const
fill LCIO Track State with parameters from helix and cov matrix
int getNDF(int &ndf)
get the current number of degrees of freedom for the fit.
static const int modeClosest
Definition: IMarlinTrack.h:49
int fit(double maxChi2Increment=DBL_MAX)
perform the fit of all current hits, returns error code ( IMarlinTrack::success if no error ) ...
int addHit(EVENT::TrackerHit *hit)
add hit to track - the hits have to be added ordered in time ( i.e.
std::map< EVENT::TrackerHit *, TKalTrackSite * > _hit_used_for_sites
map to store relation between lcio hits and measurement sites
void setMass(double mass)
set the mass of the charged particle (GeV) that is used for energy loss and multiple scattering - def...
bool _initialised
used to store whether initial track state has been supplied or created
STL class.
int testChi2Increment(EVENT::TrackerHit *hit, double &chi2increment)
obtain the chi2 increment which would result in adding the hit to the fit.
int extrapolateToDetElement(int detElementID, IMPL::TrackStateImpl &ts, double &chi2, int &ndf, int mode=modeClosest)
extrapolate the fit to sensitive detector element, returning TrackState, chi2 and ndf via reference ...
Interface for generic tracks in MarlinTrk.
Definition: IMarlinTrack.h:36
double getMass()
return the of the charged particle (GeV) that is used for energy loss and multiple scattering...
int initialise(bool fitDirection)
initialise the fit using the hits added up to this point - the fit direction has to be specified usin...
int getTrackerHitAtPositiveNDF(EVENT::TrackerHit *&trkhit)
get TrackeHit at which fit became constrained, i.e.
STL class.
EVENT::TrackerHit * _trackHitAtPositiveNDF
std::vector< std::pair< EVENT::TrackerHit *, double > > _outlier_chi2_values
vector to store the chi-sqaure increment for measurement sites
double toBaseRange(double phi) const
helper function to restrict the range of the azimuthal angle to ]-pi,pi]
int propagate(const Vector3D &point, IMPL::TrackStateImpl &ts, double &chi2, int &ndf)
propagate the fit to the point of closest approach to the given point, returning TrackState, chi2 and ndf via reference
Interface to KaltTest Kalman fitter - instantiates and holds the detector geometry.
int propagateToDetElement(int detElementID, IMPL::TrackStateImpl &ts, double &chi2, int &ndf, int mode=modeClosest)
propagate the fit to sensitive detector element, returning TrackState, chi2 and ndf via reference ...
int smooth()
smooth all track states
int getOutliers(std::vector< std::pair< EVENT::TrackerHit *, double > > &hits)
get the list of hits which have been rejected by from the fit due to the a chi2 increment greater tha...
int addAndFit(EVENT::TrackerHit *hit, double &chi2increment, double maxChi2Increment=DBL_MAX)
update the current fit using the supplied hit, return code via int.
std::vector< EVENT::TrackerHit * > _hit_not_used_for_sites
vector to store lcio hits rejected for measurement sites
std::vector< std::pair< EVENT::TrackerHit *, double > > _hit_chi2_values
vector to store the chi-sqaure increment for measurement sites
int extrapolateToLayer(int layerID, IMPL::TrackStateImpl &ts, double &chi2, int &ndf, int &detElementID, int mode=modeClosest)
extrapolate the fit to numbered sensitive layer, returning TrackState via provided reference ...
bool _smoothed
used to store whether smoothing has been performed
int getTrackState(IMPL::TrackStateImpl &ts, double &chi2, int &ndf)
get track state, returning TrackState, chi2 and ndf via reference
int intersectionWithLayer(int layerID, Vector3D &point, int &detElementID, int mode=modeClosest)
extrapolate the fit to numbered sensitive layer, returning intersection point in global coordinates a...