Jpp
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
JTRIGGER::JPMTIdentifier_t Class Reference

#include <JPMTIdentifier_t.hh>

Inheritance diagram for JTRIGGER::JPMTIdentifier_t:
TObject

Public Member Functions

 JPMTIdentifier_t ()
 Default constructor. More...
 
 JPMTIdentifier_t (int id, int tdc)
 Constructor. More...
 
 JPMTIdentifier_t (const JDAQPMTIdentifier &pmt)
 Copy constructor. More...
 
virtual ~JPMTIdentifier_t ()
 Virtual destructor. More...
 
int getModuleID () const
 Get module identifier. More...
 
int getPMTAddress () const
 Get PMT address. More...
 
 operator JDAQPMTIdentifier () const
 Type conversion operator. More...
 
 ClassDef (JPMTIdentifier_t, 8)
 

Static Public Member Functions

static bool compare (const JPMTIdentifier_t &first, const JPMTIdentifier_t &second)
 Compare PMT identifiers. More...
 

Protected Attributes

int moduleID
 
int pmtAddress
 

Friends

std::istream & operator>> (std::istream &in, JPMTIdentifier_t &id)
 Read PMT identifier from input. More...
 
std::ostream & operator<< (std::ostream &out, const JPMTIdentifier_t &id)
 Write PMT identifier to output. More...
 

Detailed Description

Definition at line 21 of file JPMTIdentifier_t.hh.

Constructor & Destructor Documentation

◆ JPMTIdentifier_t() [1/3]

JTRIGGER::JPMTIdentifier_t::JPMTIdentifier_t ( )
inline

Default constructor.

Definition at line 28 of file JPMTIdentifier_t.hh.

28  :
29  moduleID (-1),
30  pmtAddress(-1)
31  {}

◆ JPMTIdentifier_t() [2/3]

JTRIGGER::JPMTIdentifier_t::JPMTIdentifier_t ( int  id,
int  tdc 
)
inline

Constructor.

Parameters
idmodule identifier
tdcPMT readout channel

Definition at line 40 of file JPMTIdentifier_t.hh.

41  {
42  moduleID = id;
43  pmtAddress = tdc;
44  }

◆ JPMTIdentifier_t() [3/3]

JTRIGGER::JPMTIdentifier_t::JPMTIdentifier_t ( const JDAQPMTIdentifier pmt)
inline

Copy constructor.

Parameters
idmodule identifier
tdcPMT readout channel

Definition at line 53 of file JPMTIdentifier_t.hh.

54  {
55  moduleID = pmt.getModuleID();
56  pmtAddress = pmt.getPMTAddress();
57  }

◆ ~JPMTIdentifier_t()

virtual JTRIGGER::JPMTIdentifier_t::~JPMTIdentifier_t ( )
inlinevirtual

Virtual destructor.

Definition at line 63 of file JPMTIdentifier_t.hh.

64  {}

Member Function Documentation

◆ getModuleID()

int JTRIGGER::JPMTIdentifier_t::getModuleID ( ) const
inline

Get module identifier.

Returns
module identifier

Definition at line 72 of file JPMTIdentifier_t.hh.

73  {
74  return moduleID;
75  }

◆ getPMTAddress()

int JTRIGGER::JPMTIdentifier_t::getPMTAddress ( ) const
inline

Get PMT address.

Returns
PMT address

Definition at line 83 of file JPMTIdentifier_t.hh.

84  {
85  return pmtAddress;
86  }

◆ compare()

static bool JTRIGGER::JPMTIdentifier_t::compare ( const JPMTIdentifier_t first,
const JPMTIdentifier_t second 
)
inlinestatic

Compare PMT identifiers.

The comparison is applied to the module identifer and to the PMT address. If the module identifier or PMT address is -1, the corresponding comparison evaluates to true.

Parameters
firstfirst PMT identifier
secondsecond PMT identifier
Returns
true if first and second PMT identifier are equal; else false

Definition at line 99 of file JPMTIdentifier_t.hh.

100  {
101  return ((first .getModuleID() == second.getModuleID() ||
102  first .getModuleID() == -1 ||
103  second.getModuleID() == -1)
104 
105  &&
106 
107  (first .getPMTAddress() == second.getPMTAddress() ||
108  first .getPMTAddress() == -1 ||
109  second.getPMTAddress() == -1));
110  }

◆ operator JDAQPMTIdentifier()

JTRIGGER::JPMTIdentifier_t::operator JDAQPMTIdentifier ( ) const
inline

Type conversion operator.

Returns
PMT identifier

Definition at line 149 of file JPMTIdentifier_t.hh.

150  {
151  return JDAQPMTIdentifier (moduleID , pmtAddress);
152  }

◆ ClassDef()

JTRIGGER::JPMTIdentifier_t::ClassDef ( JPMTIdentifier_t  ,
 
)

Friends And Related Function Documentation

◆ operator>>

std::istream& operator>> ( std::istream &  in,
JPMTIdentifier_t id 
)
friend

Read PMT identifier from input.

Parameters
ininput stream
idPMT identifier
Returns
input stream

Definition at line 120 of file JPMTIdentifier_t.hh.

121  {
122  in >> id.moduleID;
123  in >> id.pmtAddress;
124 
125  return in;
126  }

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const JPMTIdentifier_t id 
)
friend

Write PMT identifier to output.

Parameters
outoutput stream
idPMT identifier
Returns
output stream

Definition at line 136 of file JPMTIdentifier_t.hh.

137  {
138  out << id.moduleID << ' ';
139  out << id.pmtAddress;
140 
141  return out;
142  }

Member Data Documentation

◆ moduleID

int JTRIGGER::JPMTIdentifier_t::moduleID
protected

Definition at line 158 of file JPMTIdentifier_t.hh.

◆ pmtAddress

int JTRIGGER::JPMTIdentifier_t::pmtAddress
protected

Definition at line 159 of file JPMTIdentifier_t.hh.


The documentation for this class was generated from the following file:
JTRIGGER::JPMTIdentifier_t::getPMTAddress
int getPMTAddress() const
Get PMT address.
Definition: JPMTIdentifier_t.hh:83
JTRIGGER::JPMTIdentifier_t::moduleID
int moduleID
Definition: JPMTIdentifier_t.hh:158
JTRIGGER::JPMTIdentifier_t::pmtAddress
int pmtAddress
Definition: JPMTIdentifier_t.hh:159
JTRIGGER::JPMTIdentifier_t::getModuleID
int getModuleID() const
Get module identifier.
Definition: JPMTIdentifier_t.hh:72