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

#include "MCHitCollection.h"

Inheritance diagram for sim::MCHitCollection:

Public Member Functions

 MCHitCollection (const unsigned int ch=::sim::kINVALID_UINT)
 Default ctor. More...
 
void Reset ()
 Method to reset. More...
 
unsigned int Channel () const
 Getter for channel number. More...
 
bool operator< (const MCHitCollection &rhs) const
 For sorting. More...
 
void push_back (const MCHit &hit)
 wrapper for push_back More...
 

Public Attributes

elements
 STL member. More...
 

Private Attributes

unsigned int fChannel
 Channel number. More...
 

Detailed Description

Definition at line 11 of file MCHitCollection.h.

Constructor & Destructor Documentation

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

Default ctor.

Definition at line 15 of file MCHitCollection.h.

References fChannel, and Reset().

16  {
17  Reset();
18  fChannel = ch;
19  }
void Reset()
Method to reset.
unsigned int fChannel
Channel number.

Member Function Documentation

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

Getter for channel number.

Definition at line 33 of file MCHitCollection.h.

References fChannel.

33 { return fChannel; }
unsigned int fChannel
Channel number.
bool sim::MCHitCollection::operator< ( const MCHitCollection rhs) const
inline

For sorting.

Definition at line 36 of file MCHitCollection.h.

References fChannel.

36 { return fChannel < rhs.fChannel; }
unsigned int fChannel
Channel number.
void sim::MCHitCollection::push_back ( const MCHit hit)
inline

wrapper for push_back

Definition at line 39 of file MCHitCollection.h.

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

40  {
41 
42  bool sort = (!empty() && hit < (*rbegin()));
43 
44  std::vector<sim::MCHit>::push_back(hit);
45 
46  if (sort) std::sort(begin(), end());
47  }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
Detector simulation of raw signals on wires.
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::MCHitCollection::Reset ( )
inline

Method to reset.

Definition at line 22 of file MCHitCollection.h.

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

Referenced by MCHitCollection().

23  {
26  }
unsigned int fChannel
Channel number.
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::MCHitCollection::fChannel
private

Channel number.

Definition at line 29 of file MCHitCollection.h.

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


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