Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTRIGGER::JPMTIdentifier_t Class Reference

#include <JPMTIdentifier_t.hh>

Inheritance diagram for JTRIGGER::JPMTIdentifier_t:
TObject

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

int moduleID
 
int pmtAddress
 

Friends

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

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.

◆ 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
pmtPMT identifier

Definition at line 52 of file JPMTIdentifier_t.hh.

53 {
54 moduleID = pmt.getModuleID();
56 }
int getModuleID() const
Get module identifier.
int getPMTAddress() const
Get PMT identifier.

◆ ~JPMTIdentifier_t()

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

Virtual destructor.

Definition at line 62 of file JPMTIdentifier_t.hh.

63 {}

Member Function Documentation

◆ getModuleID()

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

Get module identifier.

Returns
module identifier

Definition at line 71 of file JPMTIdentifier_t.hh.

72 {
73 return moduleID;
74 }

◆ getPMTAddress()

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

Get PMT address.

Returns
PMT address

Definition at line 82 of file JPMTIdentifier_t.hh.

83 {
84 return pmtAddress;
85 }

◆ 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 98 of file JPMTIdentifier_t.hh.

99 {
100 return ((first .getModuleID() == second.getModuleID() ||
101 first .getModuleID() == -1 ||
102 second.getModuleID() == -1)
103
104 &&
105
106 (first .getPMTAddress() == second.getPMTAddress() ||
107 first .getPMTAddress() == -1 ||
108 second.getPMTAddress() == -1));
109 }
int getPMTAddress() const
Get PMT address.
int getModuleID() const
Get module identifier.

◆ operator JDAQPMTIdentifier()

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

Type conversion operator.

Returns
PMT identifier

Definition at line 148 of file JPMTIdentifier_t.hh.

149 {
151 }

◆ ClassDef()

JTRIGGER::JPMTIdentifier_t::ClassDef ( JPMTIdentifier_t ,
8  )

Friends And Related Symbol 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 119 of file JPMTIdentifier_t.hh.

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

◆ 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 135 of file JPMTIdentifier_t.hh.

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

Member Data Documentation

◆ moduleID

int JTRIGGER::JPMTIdentifier_t::moduleID
protected

Definition at line 157 of file JPMTIdentifier_t.hh.

◆ pmtAddress

int JTRIGGER::JPMTIdentifier_t::pmtAddress
protected

Definition at line 158 of file JPMTIdentifier_t.hh.


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