LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
KHitBase.h
Go to the documentation of this file.
1 
49 #ifndef KHITBASE_H
50 #define KHITBASE_H
51 
52 #include <iosfwd>
53 #include <memory>
54 
57 
58 namespace trkf {
59 
60  class Propagator;
61 
62  class KHitBase {
63  public:
65  KHitBase();
66 
68  KHitBase(const std::shared_ptr<const Surface>& psurf, int plane = -1);
69 
71  virtual ~KHitBase() = default;
72 
73  // Accessors.
74 
76  const std::shared_ptr<const Surface>& getPredSurface() const { return fPredSurf; }
77 
79  double getPredDistance() const { return fPredDist; }
80 
82  const std::shared_ptr<const Surface>& getMeasSurface() const { return fMeasSurf; }
83 
85  int getMeasPlane() const { return fMeasPlane; }
86 
88  int getID() const { return fID; }
89 
90  // Modifiers.
91 
93  void setMeasSurface(const std::shared_ptr<const Surface>& psurf) { fMeasSurf = psurf; }
94 
96  void setMeasPlane(int plane) { fMeasPlane = plane; }
97 
98  // Pure virtual methods.
99 
101  virtual bool predict(const KETrack& tre,
102  const Propagator& prop,
103  const KTrack* ref = 0) const = 0;
104 
106  virtual double getChisq() const = 0;
107 
109  virtual void update(KETrack& tre) const = 0;
110 
112  virtual std::ostream& Print(std::ostream& out, bool doTitle = true) const;
113 
114  // Attributes.
115 
116  protected:
117  mutable std::shared_ptr<const Surface> fPredSurf;
118  mutable double fPredDist;
119  int fID;
120 
121  private:
122  std::shared_ptr<const Surface> fMeasSurf;
124  };
125 
127  std::ostream& operator<<(std::ostream& out, const KHitBase& trk);
128 }
129 
130 #endif
void setMeasSurface(const std::shared_ptr< const Surface > &psurf)
Measurement surface.
Definition: KHitBase.h:93
double getPredDistance() const
Prediction distance.
Definition: KHitBase.h:79
int getMeasPlane() const
Measurement plane index.
Definition: KHitBase.h:85
std::shared_ptr< const Surface > fMeasSurf
Measurement surface.
Definition: KHitBase.h:122
int getID() const
Unique id.
Definition: KHitBase.h:88
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Definition: KHitBase.cxx:31
virtual ~KHitBase()=default
Destructor.
std::shared_ptr< const Surface > fPredSurf
Prediction surface.
Definition: KHitBase.h:117
std::ostream & operator<<(std::ostream &out, const KGTrack &trg)
Output operator.
Definition: KGTrack.cxx:300
Base class for Kalman filter surface.
KHitBase()
Default constructor.
Definition: KHitBase.cxx:18
int fID
Unique id.
Definition: KHitBase.h:119
double fPredDist
Prediction distance.
Definition: KHitBase.h:118
virtual void update(KETrack &tre) const =0
Update track method.
virtual double getChisq() const =0
Return incremental chisquare.
int fMeasPlane
Measurement plane index.
Definition: KHitBase.h:123
virtual bool predict(const KETrack &tre, const Propagator &prop, const KTrack *ref=0) const =0
Prediction method (return false if fail).
void setMeasPlane(int plane)
Measurement plane.
Definition: KHitBase.h:96
Basic Kalman filter track class, with error.
const std::shared_ptr< const Surface > & getMeasSurface() const
Measurement surface.
Definition: KHitBase.h:82
const std::shared_ptr< const Surface > & getPredSurface() const
Predition surface.
Definition: KHitBase.h:76