LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
KTrack.h
Go to the documentation of this file.
1 
22 #ifndef KTRACK_H
23 #define KTRACK_H
24 
27 #include <iosfwd>
28 #include <memory>
29 
30 namespace trkf {
31 
32  class KTrack {
33  public:
35 
37  KTrack();
38 
40  KTrack(const std::shared_ptr<const Surface>& psurf);
41 
43  KTrack(std::shared_ptr<const Surface> psurf,
44  const TrackVector& vec,
46  int pdg = 0);
47 
49  virtual ~KTrack();
50 
51  // Accessors.
52 
53  const std::shared_ptr<const Surface>& getSurface() const { return fSurf; }
54  const TrackVector& getVector() const { return fVec; }
56  int PdgCode() const { return fPdgCode; }
57  double Mass() const;
58 
59  // Modifiers.
60 
61  TrackVector& getVector() { return fVec; }
62 
64  void setSurface(const std::shared_ptr<const Surface>& psurf) { fSurf = psurf; }
65  void setVector(const TrackVector& vec) { fVec = vec; }
67  void setPdgCode(int pdg) { fPdgCode = pdg; }
68 
70  bool isValid() const;
71 
73  void getPosition(double xyz[3]) const;
74 
76  void getMomentum(double mom[3]) const;
77 
79  double XLatitude() const;
80 
82  double XLongitude() const;
83 
85  virtual std::ostream& Print(std::ostream& out, bool doTitle = true) const;
86 
87  private:
88  // Attributes.
89 
90  std::shared_ptr<const Surface> fSurf;
93  int fPdgCode;
94  };
95 
97  std::ostream& operator<<(std::ostream& out, const KTrack& trk);
98 }
99 
100 #endif
TrackVector fVec
Track state vector.
Definition: KTrack.h:91
TrackDirection
Track direction enum.
Definition: Surface.h:54
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:90
double Mass() const
Based on pdg code.
Definition: KTrack.cxx:116
const std::shared_ptr< const Surface > & getSurface() const
Surface.
Definition: KTrack.h:53
double XLongitude() const
Get x-longitude.
Definition: KTrack.cxx:185
void setPdgCode(int pdg)
Set pdg code.
Definition: KTrack.h:67
void setVector(const TrackVector &vec)
Set state vector.
Definition: KTrack.h:65
void setDirection(Surface::TrackDirection dir)
Set direction.
Definition: KTrack.h:66
TrackVector & getVector()
Modifiable state vector.
Definition: KTrack.h:61
void setSurface(const std::shared_ptr< const Surface > &psurf)
Set surface.
Definition: KTrack.h:64
int fPdgCode
Pdg id. hypothesis.
Definition: KTrack.h:93
std::ostream & operator<<(std::ostream &out, const KGTrack &trg)
Output operator.
Definition: KGTrack.cxx:300
void getPosition(double xyz[3]) const
Get position of track.
Definition: KTrack.cxx:157
Base class for Kalman filter surface.
KTrack()
Enum.
Definition: KTrack.cxx:29
virtual ~KTrack()
Destructor.
Definition: KTrack.cxx:58
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Definition: KTrack.cxx:210
Surface::TrackDirection fDir
Track direction.
Definition: KTrack.h:92
Kalman filter linear algebra typedefs.
const TrackVector & getVector() const
Track state vector.
Definition: KTrack.h:54
int PdgCode() const
Pdg code.
Definition: KTrack.h:56
TDirectory * dir
Definition: macro.C:5
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:201
Surface::TrackDirection getDirection() const
Track direction.
Definition: KTrack.cxx:64
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:81
double XLatitude() const
Get x-latitude.
Definition: KTrack.cxx:169