Jpp
Public Member Functions | Friends | List of all members
JTRIGGER::JPMTSelector Struct Reference

Auxiliary data structure for set of PMT identifiers. More...

#include <JPMTSelector.hh>

Inheritance diagram for JTRIGGER::JPMTSelector:
std::vector< JPMTIdentifier_t > TObject

Public Member Functions

 JPMTSelector ()
 Default constructor. More...
 
virtual ~JPMTSelector ()
 Virtual destructor. More...
 
bool operator() (const JPMTIdentifier_t &pmt) const
 Test match with given PMT. More...
 
 ClassDef (JPMTSelector, 1)
 

Friends

std::istream & operator>> (std::istream &in, JPMTSelector &object)
 Read vector of PMT identifiers from input. More...
 
std::ostream & operator<< (std::ostream &out, const JPMTSelector &object)
 Write vector of PMT identifiers to output. More...
 

Detailed Description

Auxiliary data structure for set of PMT identifiers.

Definition at line 22 of file JPMTSelector.hh.

Constructor & Destructor Documentation

◆ JPMTSelector()

JTRIGGER::JPMTSelector::JPMTSelector ( )
inline

Default constructor.

Definition at line 29 of file JPMTSelector.hh.

30  {}

◆ ~JPMTSelector()

virtual JTRIGGER::JPMTSelector::~JPMTSelector ( )
inlinevirtual

Virtual destructor.

Definition at line 36 of file JPMTSelector.hh.

37  {}

Member Function Documentation

◆ operator()()

bool JTRIGGER::JPMTSelector::operator() ( const JPMTIdentifier_t pmt) const
inline

Test match with given PMT.

Parameters
pmtPMT
Returns
true if match; else false

Definition at line 46 of file JPMTSelector.hh.

47  {
48  for (const_iterator i = this->begin(); i != this->end(); ++i) {
49  if (JPMTIdentifier_t::compare(*i, pmt)) {
50  return true;
51  }
52  }
53 
54  return false;
55  }

◆ ClassDef()

JTRIGGER::JPMTSelector::ClassDef ( JPMTSelector  ,
 
)

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  in,
JPMTSelector object 
)
friend

Read vector of PMT identifiers from input.

Parameters
ininput stream
objectPMT identifiers
Returns
input stream

Definition at line 65 of file JPMTSelector.hh.

66  {
67  object.clear();
68 
69  for (JPMTIdentifier_t pmt; in >> pmt; ) {
70  object.push_back(pmt);
71  }
72 
73  return in;
74  }

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const JPMTSelector object 
)
friend

Write vector of PMT identifiers to output.

Parameters
outoutput stream
objectPMT identifiers
Returns
output stream

Definition at line 84 of file JPMTSelector.hh.

85  {
86  for (JPMTSelector::const_iterator i = object.begin(); i != object.end(); ++i) {
87  out << ' ' << i->getModuleID() << ' ' << i->getPMTAddress();
88  }
89 
90  return out;
91  }

The documentation for this struct was generated from the following file:
JTRIGGER::JPMTIdentifier_t::compare
static bool compare(const JPMTIdentifier_t &first, const JPMTIdentifier_t &second)
Compare PMT identifiers.
Definition: JPMTIdentifier_t.hh:98
JTRIGGER::JPMTIdentifier_t
Definition: JPMTIdentifier_t.hh:21