KHitGroup.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file KHitGroup.h
4 ///
5 /// \brief A collection of measurements on the same surface.
6 ///
7 /// \author H. Greenlee
8 ///
9 /// This class represents a collection of measurements on a common
10 /// surface. The measurements are polymorphic, stored as pointers
11 /// to KHitBase base class.
12 ///
13 /// The idea behind this class is that the contained measurement are
14 /// mutually exclusive for inclusion in a single track.
15 ///
16 /// This class includes the following attributes.
17 ///
18 /// 1. Pointer to common surface.
19 /// 2. Plane index.
20 /// 3. Measurement collection.
21 /// 4. Estimated path flag.
22 /// 5. Estimated path distance.
23 ///
24 /// The last two attributes is included as an aid in sorting
25 /// measurements for inclusion in tracks.
26 ///
27 ////////////////////////////////////////////////////////////////////////
28 
29 #ifndef KHITGROUP_H
30 #define KHITGROUP_H
31 
32 #include <vector>
34 
35 namespace trkf {
36 
37  class KHitGroup
38  {
39  public:
40 
41  /// Default constructor.
42  KHitGroup(bool has_path = false, double path = 0.);
43 
44  /// Destructor.
45  virtual ~KHitGroup();
46 
47  // Accessors.
48 
49  /// Surface accessor.
50  const std::shared_ptr<const Surface>& getSurface() const {return fSurf;}
51 
52  /// Plane index.
53  int getPlane() const {return fPlane;}
54 
55  /// Measurement collection accessor.
56  const std::vector<std::shared_ptr<const KHitBase> >& getHits() const {return fHits;}
57 
58  /// Path flag.
59  bool getHasPath() const {return fHasPath;}
60 
61  /// Estimated path distance.
62  double getPath() const {return fPath;}
63 
64  // Modifiers.
65 
66  /// Clear the collection.
67  void clear() {fHits.clear();}
68 
69  /// Add a mesaurement into the colleciton.
70  void addHit(const std::shared_ptr<const KHitBase>& hit);
71 
72  /// Set path flag and estimated path distance.
73  void setPath(bool has_path, double path) {fHasPath = has_path; fPath = path;}
74 
75  // Relational operators, sort by estimated path distance.
76 
77  bool operator==(const KHitGroup& obj) const; ///< Equivalance operator.
78  bool operator<(const KHitGroup& obj) const; ///< Less than operator.
79 
80  private:
81 
82  // Attributes.
83 
84  std::shared_ptr<const Surface> fSurf; ///< Common surface.
85  int fPlane; ///< Plane index of measurements.
86  std::vector<std::shared_ptr<const KHitBase> > fHits; ///< Measuement collection.
87  bool fHasPath; ///< Path flag.
88  double fPath; ///< Estimated path distance.
89  };
90 }
91 
92 #endif
bool operator<(const KHitGroup &obj) const
Less than operator.
Definition: KHitGroup.cxx:107
const std::vector< std::shared_ptr< const KHitBase > > & getHits() const
Measurement collection accessor.
Definition: KHitGroup.h:56
void setPath(bool has_path, double path)
Set path flag and estimated path distance.
Definition: KHitGroup.h:73
bool getHasPath() const
Path flag.
Definition: KHitGroup.h:59
bool fHasPath
Path flag.
Definition: KHitGroup.h:87
double getPath() const
Estimated path distance.
Definition: KHitGroup.h:62
KHitGroup(bool has_path=false, double path=0.)
Default constructor.
Definition: KHitGroup.cxx:23
virtual ~KHitGroup()
Destructor.
Definition: KHitGroup.cxx:30
void clear()
Clear the collection.
Definition: KHitGroup.h:67
std::shared_ptr< const Surface > fSurf
Common surface.
Definition: KHitGroup.h:84
int fPlane
Plane index of measurements.
Definition: KHitGroup.h:85
Detector simulation of raw signals on wires.
void addHit(const std::shared_ptr< const KHitBase > &hit)
Add a mesaurement into the colleciton.
Definition: KHitGroup.cxx:39
std::vector< std::shared_ptr< const KHitBase > > fHits
Measuement collection.
Definition: KHitGroup.h:86
const std::shared_ptr< const Surface > & getSurface() const
Surface accessor.
Definition: KHitGroup.h:50
bool operator==(const KHitGroup &obj) const
Equivalance operator.
Definition: KHitGroup.cxx:86
double fPath
Estimated path distance.
Definition: KHitGroup.h:88
Base class for Kalman filter measurement.
int getPlane() const
Plane index.
Definition: KHitGroup.h:53