LArSoft  v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
MCHitCollection.h
Go to the documentation of this file.
1 #ifndef MCHITCOLLECTION_H
2 #define MCHITCOLLECTION_H
3 
4 // C++ includes
6 #include <vector>
7 
8 namespace sim {
9 
10  class MCHitCollection : public std::vector<sim::MCHit> {
11  public:
12  MCHitCollection(const unsigned int ch = ::sim::kINVALID_UINT);
13 
14  void Reset();
15  void push_back(MCHit const& hit);
16 
17  unsigned int Channel() const { return fChannel; }
18  bool operator<(MCHitCollection const& rhs) const { return fChannel < rhs.fChannel; }
19 
20  private:
21  unsigned int fChannel;
22  };
23 }
24 
25 // Define a pointer comparison
26 namespace std {
27  template <>
29  public:
30  bool operator()(sim::MCHitCollection const* lhs, sim::MCHitCollection const* rhs) const
31  {
32  return *lhs < *rhs;
33  }
34  };
35 }
36 
37 #endif
bool operator<(MCHitCollection const &rhs) const
STL namespace.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
Monte Carlo Simulation.
Detector simulation of raw signals on wires.
unsigned int Channel() const
void push_back(MCHit const &hit)
bool operator()(sim::MCHitCollection const *lhs, sim::MCHitCollection const *rhs) const
const unsigned int kINVALID_UINT
Definition: MCLimits.h:14
MCHitCollection(const unsigned int ch=::sim::kINVALID_UINT)