LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
KTrack.h
Go to the documentation of this file.
1 
22 #ifndef KTRACK_H
23 #define KTRACK_H
24 
25 #include <ostream>
26 #include <memory>
29 
30 namespace trkf {
31 
32  class KTrack
33  {
34  public:
35 
37 
39  KTrack();
40 
42  KTrack(const std::shared_ptr<const Surface>& psurf);
43 
45  KTrack(std::shared_ptr<const Surface> psurf,
46  const TrackVector& vec,
48  int pdg = 0);
49 
51  virtual ~KTrack();
52 
53  // Accessors.
54 
55  const std::shared_ptr<const Surface>& getSurface() const {return fSurf;}
56  const TrackVector& getVector() const {return fVec;}
58  int PdgCode() const {return fPdgCode;}
59  double Mass() const;
60 
61  // Modifiers.
62 
63  TrackVector& getVector() {return fVec;}
64 
66  void setSurface(const std::shared_ptr<const Surface>& psurf) {fSurf = psurf;}
67  void setVector(const TrackVector& vec) {fVec = vec;}
69  void setPdgCode(int pdg) {fPdgCode = pdg;}
70 
72  bool isValid() const;
73 
75  void getPosition(double xyz[3]) const;
76 
78  void getMomentum(double mom[3]) const;
79 
81  double XLatitude() const;
82 
84  double XLongitude() const;
85 
87  virtual std::ostream& Print(std::ostream& out, bool doTitle = true) const;
88 
89  private:
90 
91  // Attributes.
92 
93  std::shared_ptr<const Surface> fSurf;
96  int fPdgCode;
97  };
98 
100  std::ostream& operator<<(std::ostream& out, const KTrack& trk);
101 }
102 
103 #endif
TrackVector fVec
Track state vector.
Definition: KTrack.h:94
TrackDirection
Track direction enum.
Definition: Surface.h:56
std::shared_ptr< const Surface > fSurf
Track surface.
Definition: KTrack.h:93
double Mass() const
Based on pdg code.
Definition: KTrack.cxx:128
const std::shared_ptr< const Surface > & getSurface() const
Surface.
Definition: KTrack.h:55
double XLongitude() const
Get x-longitude.
Definition: KTrack.cxx:200
void setPdgCode(int pdg)
Set pdg code.
Definition: KTrack.h:69
void setVector(const TrackVector &vec)
Set state vector.
Definition: KTrack.h:67
void setDirection(Surface::TrackDirection dir)
Set direction.
Definition: KTrack.h:68
TrackVector & getVector()
Modifiable state vector.
Definition: KTrack.h:63
void setSurface(const std::shared_ptr< const Surface > &psurf)
Set surface.
Definition: KTrack.h:66
int fPdgCode
Pdg id. hypothesis.
Definition: KTrack.h:96
std::ostream & operator<<(std::ostream &out, const KGTrack &trg)
Output operator.
Definition: KGTrack.cxx:306
void getPosition(double xyz[3]) const
Get position of track.
Definition: KTrack.cxx:170
Base class for Kalman filter surface.
KTrack()
Enum.
Definition: KTrack.cxx:28
virtual ~KTrack()
Destructor.
Definition: KTrack.cxx:65
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
virtual std::ostream & Print(std::ostream &out, bool doTitle=true) const
Printout.
Definition: KTrack.cxx:226
Surface::TrackDirection fDir
Track direction.
Definition: KTrack.h:95
Kalman filter linear algebra typedefs.
const TrackVector & getVector() const
Track state vector.
Definition: KTrack.h:56
int PdgCode() const
Pdg code.
Definition: KTrack.h:58
TDirectory * dir
Definition: macro.C:5
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:217
Surface::TrackDirection getDirection() const
Track direction.
Definition: KTrack.cxx:72
bool isValid() const
Test if track is valid.
Definition: KTrack.cxx:90
double XLatitude() const
Get x-latitude.
Definition: KTrack.cxx:183