LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
sim::MCWireCollection Class Reference

#include "MCWireCollection.h"

Inheritance diagram for sim::MCWireCollection:

Public Member Functions

 MCWireCollection (const unsigned int ch=sim::kINVALID_UINT)
 Default ctor. More...
 
void Reset ()
 
unsigned int Channel () const
 Getter for channel number. More...
 
bool operator< (const MCWireCollection &rhs) const
 For sorting. More...
 
void push_back (const MCWire &wire)
 wrapper for push_back More...
 

Public Attributes

elements
 STL member. More...
 

Private Attributes

unsigned int fChannel
 

Detailed Description

Definition at line 10 of file MCWireCollection.h.

Constructor & Destructor Documentation

sim::MCWireCollection::MCWireCollection ( const unsigned int  ch = sim::kINVALID_UINT)
inline

Default ctor.

Definition at line 14 of file MCWireCollection.h.

References fChannel, and Reset().

15  {
16  Reset();
17  fChannel = ch;
18  }

Member Function Documentation

unsigned int sim::MCWireCollection::Channel ( ) const
inline

Getter for channel number.

Definition at line 31 of file MCWireCollection.h.

References fChannel.

31 { return fChannel; }
bool sim::MCWireCollection::operator< ( const MCWireCollection rhs) const
inline

For sorting.

Definition at line 34 of file MCWireCollection.h.

References fChannel.

34 { return fChannel < rhs.fChannel; }
void sim::MCWireCollection::push_back ( const MCWire wire)
inline

wrapper for push_back

Definition at line 37 of file MCWireCollection.h.

References util::begin(), util::empty(), and util::end().

38  {
39 
40  bool sort = (!empty() && wire < (*rbegin()));
41 
42  std::vector<sim::MCWire>::push_back(wire);
43 
44  if (sort) std::sort(begin(), end());
45  }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
void sim::MCWireCollection::Reset ( )
inline

Definition at line 20 of file MCWireCollection.h.

References clear(), fChannel, and sim::kINVALID_UINT.

Referenced by MCWireCollection().

21  {
24  }
const unsigned int kINVALID_UINT
Definition: MCLimits.h:14
vec_iX clear()

Member Data Documentation

T std::vector< T >::elements
inherited

STL member.

unsigned int sim::MCWireCollection::fChannel
private

Definition at line 27 of file MCWireCollection.h.

Referenced by Channel(), MCWireCollection(), operator<(), and Reset().


The documentation for this class was generated from the following file: