LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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,
25  const SMatrixSym55& trackStateCov,
26  const Plane& plane,
27  bool trackAlongPlaneDir,
28  int pid)
29  : fTrackState(trackStatePar, trackStateCov, plane, trackAlongPlaneDir, pid)
30  {}
32 
34  bool updateWithHitState(const HitState& hitstate);
35 
37  bool combineWithTrackState(const TrackState& trackstate);
38 
40  const TrackState& trackState() const { return fTrackState; }
42  void setTrackState(TrackState&& s) { fTrackState = std::move(s); }
43  //
45  const SVector5& parameters() const { return fTrackState.parameters(); }
47  const SMatrixSym55& covariance() const { return fTrackState.covariance(); }
48  const Plane& plane() const { return fTrackState.plane(); }
49  const Point_t& position() const { return fTrackState.position(); }
50  const Vector_t& momentum() const { return fTrackState.momentum(); }
51  int pID() const { return fTrackState.pID(); }
52  double mass() const { return fTrackState.mass(); }
53  const SVector6 parameters6D() const { return fTrackState.parameters6D(); }
55  //
56  double residual(const HitState& hitstate) const { return fTrackState.residual(hitstate); }
57  double combinedError2(const HitState& hitstate) const
58  {
59  return fTrackState.combinedError2(hitstate);
60  }
61  double combinedError(const HitState& hitstate) const
62  {
63  return fTrackState.combinedError(hitstate);
64  }
65  double chi2(const HitState& hitstate) const { return fTrackState.chi2(hitstate); }
66  //
67  void setCovariance(const SMatrixSym55& trackStateCov)
68  {
69  fTrackState.setCovariance(trackStateCov);
70  }
71  void setParameters(const SVector5& trackStatePar) { fTrackState.setParameters(trackStatePar); }
73  //
75  std::ostream& dump(std::ostream& out = std::cout) const
76  {
77  out << "KFTrackState with pID=" << pID() << " mass=" << mass() << "\npars=" << parameters()
78  << " position=" << position() << " momentum=" << momentum() << "\ncov=\n"
79  << covariance() << "\non plane with pos=" << plane().position()
80  << " and dir=" << plane().direction() << " along=" << isTrackAlongPlaneDir() << "\n";
81  return out;
82  }
83  //
84  private:
86  };
87 
88 }
89 #endif
Class for track parameters (and errors) defined on a recob::tracking::Plane.
Definition: TrackState.h:93
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:71
const TrackState & trackState() const
Get the (const reference to the) TrackState.
Definition: KFTrackState.h:40
const SVector6 parameters6D() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:53
void setCovariance(const SMatrixSym55 &trackStateCov)
Set the covariance matrix of the TrackState.
Definition: TrackState.h:178
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:116
const SVector5 & parameters() const
track parameters defined on the plane
Definition: TrackState.h:108
recob::tracking::SMatrixSym55 SMatrixSym55
Definition: TrackState.h:15
bool isTrackAlongPlaneDir() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:54
TrackState fTrackState
Definition: KFTrackState.h:85
STL namespace.
const SVector5 & parameters() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:46
double combinedError(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:61
double chi2(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:65
double mass() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:52
double mass() const
mass hypthesis of the track
Definition: TrackState.h:120
void setCovariance(const SMatrixSym55 &trackStateCov)
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:67
const Point_t & position() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:49
const Point_t & position() const
position of the track
Definition: TrackState.h:114
void setTrackState(TrackState &&s)
Set the TrackState.
Definition: KFTrackState.h:42
double combinedError2(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:57
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:141
double residual(const HitState &hitstate) const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:56
recob::tracking::SVector5 SVector5
Definition: TrackState.h:12
int pID() const
particle id hypthesis of the track
Definition: TrackState.h:118
const SMatrixSym55 & covariance() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:47
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:181
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:172
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:166
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:130
KFTrackState(TrackState &&trackState)
Definition: KFTrackState.h:31
const SMatrixSym55 & covariance() const
track parameter covariance matrix on the plane
Definition: TrackState.h:110
const Plane & plane() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:48
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:154
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:50
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:75
const Plane & plane() const
plane where the parameters are defined
Definition: TrackState.h:112
int pID() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:51
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:160