LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
KFTrackState.h
Go to the documentation of this file.
1 #ifndef KFTRACKSTATE_H
2 #define KFTRACKSTATE_H
3 
5 
6 namespace trkf {
7 
20 
21  class KFTrackState {
22  public:
23  //
24  KFTrackState(const SVector5& trackStatePar, const SMatrixSym55& trackStateCov, const Plane& plane, bool trackAlongPlaneDir, int pid)
25  : fTrackState(trackStatePar, trackStateCov, plane, trackAlongPlaneDir, pid) {}
27  : fTrackState(std::move(trackState)) { }
28 
30  bool updateWithHitState(const HitState& hitstate);
31 
33  bool combineWithTrackState(const TrackState& trackstate);
34 
36  const TrackState& trackState() const { return fTrackState; }
38  void setTrackState(TrackState&& s) { fTrackState = std::move(s); }
39  //
41  const SVector5& parameters() const { return fTrackState.parameters(); }
43  const SMatrixSym55& covariance() const { return fTrackState.covariance(); }
44  const Plane& plane() const { return fTrackState.plane(); }
45  const Point_t& position() const { return fTrackState.position(); }
46  const Vector_t& momentum() const { return fTrackState.momentum(); }
47  int pID() const { return fTrackState.pID(); }
48  double mass() const { return fTrackState.mass(); }
49  const SVector6 parameters6D() const { return fTrackState.parameters6D(); }
51  //
52  double residual (const HitState& hitstate) const { return fTrackState.residual(hitstate); }
53  double combinedError2(const HitState& hitstate) const { return fTrackState.combinedError2(hitstate); }
54  double combinedError (const HitState& hitstate) const { return fTrackState.combinedError(hitstate); }
55  double chi2 (const HitState& hitstate) const { return fTrackState.chi2(hitstate); }
56  //
57  void setCovariance (const SMatrixSym55& trackStateCov) { fTrackState.setCovariance(trackStateCov); }
58  void setParameters (const SVector5& trackStatePar) { fTrackState.setParameters(trackStatePar); }
60  //
62  std::ostream& dump(std::ostream& out = std::cout) const {
63  out << "KFTrackState with pID=" << pID() << " mass=" << mass()
64  << "\npars=" << parameters() << " position=" << position() << " momentum=" << momentum()
65  << "\ncov=\n" << covariance()
66  << "\non plane with pos=" << plane().position() << " and dir=" << plane().direction() << " along=" << isTrackAlongPlaneDir() << "\n";
67  return out;
68  }
69  //
70  private:
72  };
73 
74 }
75 #endif
Class for track parameters (and errors) defined on a recob::tracking::Plane.
Definition: TrackState.h:79
Float_t s
Definition: plot.C:23
Vector_t const & direction() const
Reference direction orthogonal to the plane.
Definition: TrackingPlane.h:70
void setParameters(const SVector5 &trackStatePar)
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:58
const TrackState & trackState() const
Get the (const reference to the) TrackState.
Definition: KFTrackState.h:36
const SVector6 parameters6D() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:49
void setCovariance(const SMatrixSym55 &trackStateCov)
Set the covariance matrix of the TrackState.
Definition: TrackState.h:140
recob::tracking::Point_t Point_t
Definition: TrackState.h:18
recob::tracking::Vector_t Vector_t
Definition: TrackState.h:19
const Vector_t & momentum() const
momentum of the track
Definition: TrackState.h:98
const SVector5 & parameters() const
track parameters defined on the plane
Definition: TrackState.h:90
recob::tracking::SMatrixSym55 SMatrixSym55
Definition: TrackState.h:15
bool isTrackAlongPlaneDir() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:50
TrackState fTrackState
Definition: KFTrackState.h:71
STL namespace.
const SVector5 & parameters() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:42
double combinedError(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:54
double chi2(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:55
double mass() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:48
double mass() const
mass hypthesis of the track
Definition: TrackState.h:102
void setCovariance(const SMatrixSym55 &trackStateCov)
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:57
const Point_t & position() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:45
const Point_t & position() const
position of the track
Definition: TrackState.h:96
void setTrackState(TrackState &&s)
Set the TrackState.
Definition: KFTrackState.h:38
double combinedError2(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:53
bool combineWithTrackState(const TrackState &trackstate)
Combine the TrackState given another TrackState (they need to be on the same plane) ...
Extension of a TrackState to perform KalmanFilter calculations.
Definition: KFTrackState.h:21
bool isTrackAlongPlaneDir() const
is the track momentum along the plane direction?
Definition: TrackState.h:116
double residual(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:52
recob::tracking::SVector5 SVector5
Definition: TrackState.h:12
int pID() const
particle id hypthesis of the track
Definition: TrackState.h:100
const SMatrixSym55 & covariance() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:43
Point_t const & position() const
Reference position on the plane.
Definition: TrackingPlane.h:66
void setParameters(const SVector5 &trackStatePar)
Set the parameters of the TrackState; also update the global position and momentum accordingly...
Definition: TrackState.h:143
bool updateWithHitState(const HitState &hitstate)
Update the TrackState given a HitState (they need to be on the same plane)
Definition: KFTrackState.cxx:5
Class defining a plane for tracking. It provides various functionalities to convert track parameters ...
Definition: TrackingPlane.h:37
double chi2(const HitState &hitstate) const
Chi2 of the TrackState with respect to a HitState. The two states must be on the same plane; it is re...
Definition: TrackState.h:137
double combinedError(const HitState &hitstate) const
Combined error of the TrackState with respect to a HitState. The two states must be on the same plane...
Definition: TrackState.h:134
KFTrackState(const SVector5 &trackStatePar, const SMatrixSym55 &trackStateCov, const Plane &plane, bool trackAlongPlaneDir, int pid)
Definition: KFTrackState.h:24
SVector6 parameters6D() const
track parameters in global cartesian coordinates
Definition: TrackState.h:111
KFTrackState(TrackState &&trackState)
Definition: KFTrackState.h:26
const SMatrixSym55 & covariance() const
track parameter covariance matrix on the plane
Definition: TrackState.h:92
const Plane & plane() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:44
double residual(const HitState &hitstate) const
Residual of the TrackState with respect to a HitState. The two states must be on the same plane; it i...
Definition: TrackState.h:128
recob::tracking::SVector6 SVector6
Definition: TrackState.h:13
const Vector_t & momentum() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:46
Class for a measurement on a recob::tracking::Plane (plane defined by a wire and the drift direction)...
Definition: TrackState.h:42
std::ostream & dump(std::ostream &out=std::cout) const
Printout information.
Definition: KFTrackState.h:62
const Plane & plane() const
plane where the parameters are defined
Definition: TrackState.h:94
int pID() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:47
double combinedError2(const HitState &hitstate) const
Combined squared error of the TrackState with respect to a HitState. The two states must be on the sa...
Definition: TrackState.h:131