All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFTrackState.h
Go to the documentation of this file.
1 #ifndef KFTRACKSTATE_H
2 #define KFTRACKSTATE_H
3 
5 
6 namespace trkf {
7 
8  /// \file lardata/RecoObjects/KFTrackState.h
9  /// \class KFTrackState
10  ///
11  /// \brief Extension of a TrackState to perform KalmanFilter calculations.
12  ///
13  /// \author G. Cerati (FNAL, MicroBooNE)
14  /// \date 2017
15  /// \version 1.0
16  ///
17  /// This class extends the concept of TrackState, providing functionalities for Kalman Filter-specific calculations such as 'update' and 'combine'.
18  /// It holds a TrackState by value, which is modified in place when updating or combining.
19  ///
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 
29  /// Update the TrackState given a HitState (they need to be on the same plane)
30  bool updateWithHitState(const HitState& hitstate);
31 
32  /// Combine the TrackState given another TrackState (they need to be on the same plane)
33  bool combineWithTrackState(const TrackState& trackstate);
34 
35  /// Get the (const reference to the) TrackState
36  const TrackState& trackState() const { return fTrackState; }
37  /// Set the TrackState
38  void setTrackState(TrackState&& s) { fTrackState = std::move(s); }
39  //
40  //@{
41  /// This function calls the homonymous function of the stored TrackState
42  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); }
59  //@}
60  //
61  /// Printout information
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
Vector_t const & direction() const
Reference direction orthogonal to the plane.
Definition: TrackingPlane.h:70
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
void setParameters(const SVector5 &trackStatePar)
Definition: KFTrackState.h:58
const TrackState & trackState() const
Get the (const reference to the) TrackState.
Definition: KFTrackState.h:36
const SVector6 parameters6D() const
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
Definition: KFTrackState.h:50
TrackState fTrackState
Definition: KFTrackState.h:71
const SVector5 & parameters() const
This function calls the homonymous function of the stored TrackState.
Definition: KFTrackState.h:42
double combinedError(const HitState &hitstate) const
Definition: KFTrackState.h:54
double chi2(const HitState &hitstate) const
Definition: KFTrackState.h:55
double mass() const
Definition: KFTrackState.h:48
double mass() const
mass hypthesis of the track
Definition: TrackState.h:102
void setCovariance(const SMatrixSym55 &trackStateCov)
Definition: KFTrackState.h:57
const Point_t & position() const
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
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
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
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
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
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
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
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
Definition: KFTrackState.h:47
BEGIN_PROLOG could also be cout
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