MCHitCollection.h
Go to the documentation of this file.
1 
2 #ifndef MCHITCOLLECTION_H
3 #define MCHITCOLLECTION_H
4 
5 // C++ includes
6 #include <vector>
8 
9 namespace sim {
10 
11  class MCHitCollection : public std::vector<sim::MCHit> {
12 
13  public:
14 
15  /// Default ctor
16  MCHitCollection(const unsigned int ch= ::sim::kINVALID_UINT)
17  {
18  Reset();
19  fChannel = ch;
20  }
21 
22  /// Method to reset
23  void Reset()
24  {
27  }
28 
29  private:
30 
31  unsigned int fChannel; ///< Channel number
32 
33 
34  public:
35 
36  /// Getter for channel number
37  unsigned int Channel() const { return fChannel; }
38 
39  /// For sorting
40  inline bool operator< ( const MCHitCollection& rhs ) const { return fChannel < rhs.fChannel; }
41 
42  /// wrapper for push_back
43  inline void push_back(const MCHit& hit)
44  {
45 
46  bool sort = (!empty() && hit < (*rbegin()));
47 
49 
50  if(sort) std::sort(begin(),end());
51 
52  }
53  };
54 }
55 
56 // Define a pointer comparison
57 namespace std {
58  template <>
60  {
61  public:
62  bool operator()( const sim::MCHitCollection* lhs, const sim::MCHitCollection* rhs )
63  { return (*lhs) < (*rhs); }
64  };
65 }
66 
67 #endif
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void push_back(const MCHit &hit)
wrapper for push_back
struct vector vector
STL namespace.
void Reset()
Method to reset.
bool operator()(const sim::MCHitCollection *lhs, const sim::MCHitCollection *rhs)
fInnerVessel push_back(Point(-578.400000, 0.000000, 0.000000))
unsigned int fChannel
Channel number.
Code to link reconstructed objects back to the MC truth information.
Detector simulation of raw signals on wires.
unsigned int Channel() const
Getter for channel number.
const unsigned int kINVALID_UINT
Definition: MCLimits.h:14
vector< vector< double > > clear
bool operator<(const MCHitCollection &rhs) const
For sorting.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
MCHitCollection(const unsigned int ch=::sim::kINVALID_UINT)
Default ctor.
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97