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