LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Surface.h
Go to the documentation of this file.
1 
43 #ifndef SURFACE_H
44 #define SURFACE_H
45 
47 #include <iosfwd>
48 
49 namespace trkf {
50 
51  class Surface {
52  public:
55 
57  Surface();
58 
60  virtual ~Surface();
61 
62  // Virtual methods.
63 
65  virtual Surface* clone() const = 0;
66 
68  virtual bool isTrackValid(const TrackVector& vec) const = 0;
69 
71  virtual void toLocal(const double xyz[3], double uvw[3]) const = 0;
72 
74  virtual void toGlobal(const double uvw[3], double xyz[3]) const = 0;
75 
77  virtual TrackVector getDiff(const TrackVector& vec1, const TrackVector& vec2) const;
78 
80  virtual void getPosition(const TrackVector& vec, double xyz[3]) const = 0;
81 
83  virtual TrackDirection getDirection(const TrackVector& /* vec */,
84  TrackDirection dir = UNKNOWN) const
85  {
86  return dir;
87  }
88 
90  virtual void getMomentum(const TrackVector& vec,
91  double mom[3],
92  TrackDirection dir = UNKNOWN) const = 0;
93 
95  virtual double PointingError(const TrackVector& vec, const TrackError& err) const = 0;
96 
98  virtual void getStartingError(TrackError& err) const = 0;
99 
101  virtual bool isParallel(const Surface& surf) const = 0;
102 
104  virtual double distanceTo(const Surface& surf) const = 0;
105 
107  virtual bool isEqual(const Surface& surf) const = 0;
108 
110  virtual std::ostream& Print(std::ostream& out) const = 0;
111  };
112 
114  std::ostream& operator<<(std::ostream& out, const Surface& surf);
115 }
116 
117 #endif
virtual void getStartingError(TrackError &err) const =0
Get starting error matrix for Kalman filter.
TrackDirection
Track direction enum.
Definition: Surface.h:54
virtual std::ostream & Print(std::ostream &out) const =0
Printout.
virtual double PointingError(const TrackVector &vec, const TrackError &err) const =0
Get pointing error of track.
KSymMatrix< 5 >::type TrackError
Track error matrix, dimension 5x5.
virtual bool isTrackValid(const TrackVector &vec) const =0
Surface-specific tests of validity of track parameters.
virtual Surface * clone() const =0
Clone method.
virtual bool isEqual(const Surface &surf) const =0
Test two surfaces for equality, within tolerance.
virtual bool isParallel(const Surface &surf) const =0
Test whether two surfaces are parallel, within tolerance.
virtual TrackVector getDiff(const TrackVector &vec1, const TrackVector &vec2) const
Calculate difference of two track parameter vectors.
Definition: Surface.cxx:31
std::ostream & operator<<(std::ostream &out, const KGTrack &trg)
Output operator.
Definition: KGTrack.cxx:300
virtual void toLocal(const double xyz[3], double uvw[3]) const =0
Transform global to local coordinates.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
virtual double distanceTo(const Surface &surf) const =0
Find perpendicular forward distance to a parallel surface.
Kalman filter linear algebra typedefs.
Surface()
Default constructor.
Definition: Surface.cxx:16
TDirectory * dir
Definition: macro.C:5
virtual void getMomentum(const TrackVector &vec, double mom[3], TrackDirection dir=UNKNOWN) const =0
Get momentum vector of track.
virtual ~Surface()
Destructor.
Definition: Surface.cxx:19
virtual TrackDirection getDirection(const TrackVector &, TrackDirection dir=UNKNOWN) const
Get direction of track (default UNKNOWN).
Definition: Surface.h:83
virtual void getPosition(const TrackVector &vec, double xyz[3]) const =0
Get position of track.
virtual void toGlobal(const double uvw[3], double xyz[3]) const =0
Transform local to global coordinates.