Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JDETECTOR::JPMTIdentifier Class Reference

PMT identifier. More...

#include <JPMTIdentifier.hh>

Inheritance diagram for JDETECTOR::JPMTIdentifier:
JLANG::JObjectID JDETECTOR::JPMTReadoutAddress JLANG::JMultiComparable< JClass_t, JTypelist_t > JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int > JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JPMTIdentifier ()
 Default constructor.
 
 JPMTIdentifier (const JModuleIdentifier &id, const int tdc)
 Constructor.
 
const JPMTIdentifiergetPMTIdentifier () const
 Get PMT identifier.
 
void setPMTIdentifier (const JPMTIdentifier &id)
 Set PMT identifier.
 
int getModuleID () const
 Get module identifier.
 
int getPMTAddress () const
 Get PMT address (= TDC).
 
bool is_valid () const
 Check validity.
 
int getID () const
 Get identifier.
 
int & getID ()
 Get identifier.
 
void setID (const int id)
 Set identifier.
 
bool less (const JObjectID &object) const
 Less than method.
 
bool less (const int id) const
 Less than method.
 
bool more (const int id) const
 More than method.
 
bool less (const JPMTReadoutAddress &address) const
 Less than method.
 
int getTDC () const
 Get TDC.
 

Public Attributes

int tdc
 TDC channel.
 

Static Protected Member Functions

template<class JHead_t , class JTail_t >
static bool lt (const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
 Less than method for composite data types.
 
template<class JHead_t >
static bool lt (const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JNullType > > &type)
 Less than method for composite data types.
 

Protected Attributes

int __id
 

Friends

std::istream & operator>> (std::istream &in, JPMTIdentifier &object)
 Read PMT identifier from input.
 
std::ostream & operator<< (std::ostream &out, const JPMTIdentifier &object)
 Write PMT identifier to output.
 
JReaderoperator>> (JReader &in, JPMTIdentifier &object)
 Read PMT identifier from input.
 
JWriteroperator<< (JWriter &out, const JPMTIdentifier &object)
 Write PMT identifier to output.
 

Detailed Description

PMT identifier.

Definition at line 36 of file JPMTIdentifier.hh.

Constructor & Destructor Documentation

◆ JPMTIdentifier() [1/2]

JDETECTOR::JPMTIdentifier::JPMTIdentifier ( )
inline

Default constructor.

Definition at line 45 of file JPMTIdentifier.hh.

45 :
48 {}
JPMTReadoutAddress()
Default constructor.
JLANG::JObjectID JModuleIdentifier

◆ JPMTIdentifier() [2/2]

JDETECTOR::JPMTIdentifier::JPMTIdentifier ( const JModuleIdentifier & id,
const int tdc )
inline

Constructor.

Parameters
idmodule identifier
tdcTDC

Definition at line 57 of file JPMTIdentifier.hh.

Member Function Documentation

◆ getPMTIdentifier()

const JPMTIdentifier & JDETECTOR::JPMTIdentifier::getPMTIdentifier ( ) const
inline

Get PMT identifier.

Returns
PMT identifier

Definition at line 69 of file JPMTIdentifier.hh.

70 {
71 return static_cast<const JPMTIdentifier&>(*this);
72 }
JPMTIdentifier()
Default constructor.

◆ setPMTIdentifier()

void JDETECTOR::JPMTIdentifier::setPMTIdentifier ( const JPMTIdentifier & id)
inline

Set PMT identifier.

Parameters
idPMT identifier

Definition at line 80 of file JPMTIdentifier.hh.

81 {
82 static_cast<JPMTIdentifier&>(*this) = id;
83 }

◆ getModuleID()

int JDETECTOR::JPMTIdentifier::getModuleID ( ) const
inline

Get module identifier.

Returns
module identifier

Definition at line 91 of file JPMTIdentifier.hh.

92 {
93 return getID();
94 }
int getID() const
Get identifier.
Definition JObjectID.hh:50

◆ getPMTAddress()

int JDETECTOR::JPMTIdentifier::getPMTAddress ( ) const
inline

Get PMT address (= TDC).

Returns
PMT address

Definition at line 102 of file JPMTIdentifier.hh.

103 {
104 return tdc;
105 }

◆ is_valid()

bool JDETECTOR::JPMTIdentifier::is_valid ( ) const
inline

Check validity.

Returns
true if PMT identifier is valid; else false

Definition at line 113 of file JPMTIdentifier.hh.

114 {
115 return !(getID() < 0 || tdc < 0);
116 }

◆ getID() [1/2]

int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51 {
52 return __id;
53 }

◆ getID() [2/2]

int & JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62 {
63 return __id;
64 }

◆ setID()

void JLANG::JObjectID::setID ( const int id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73 {
74 this->__id = id;
75 }

◆ less() [1/3]

bool JLANG::JObjectID::less ( const JObjectID & object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 84 of file JObjectID.hh.

85 {
86 return this->getID() < object.getID();
87 }

◆ less() [2/3]

bool JLANG::JObjectID::less ( const int id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 96 of file JObjectID.hh.

97 {
98 return this->getID() < id;
99 }

◆ more()

bool JLANG::JObjectID::more ( const int id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 108 of file JObjectID.hh.

109 {
110 return this->getID() > id;
111 }

◆ less() [3/3]

bool JDETECTOR::JPMTReadoutAddress::less ( const JPMTReadoutAddress & address) const
inlineinherited

Less than method.

Parameters
addressPMT readout address
Returns
true if this address before given address; else false

Definition at line 58 of file JPMTReadoutAddress.hh.

59 {
60 return this->tdc < address.tdc;
61 }

◆ getTDC()

int JDETECTOR::JPMTReadoutAddress::getTDC ( ) const
inlineinherited

Get TDC.

Returns
TDC

Definition at line 69 of file JPMTReadoutAddress.hh.

70 {
71 return tdc;
72 }

◆ lt() [1/2]

template<class JClass_t , class JTypelist_t >
template<class JHead_t , class JTail_t >
static bool JLANG::JMultiComparable< JClass_t, JTypelist_t >::lt ( const JClass_t & first,
const JClass_t & second,
const JType< JTypeList< JHead_t, JTail_t > > & type )
inlinestaticprotectedinherited

Less than method for composite data types.

Parameters
firstfirst object
secondsecond object
typetype
Returns
true if first object is less than second object; else false

Definition at line 43 of file JMultiComparable.hh.

46 {
47 if (static_cast<const JHead_t&>(first) <
48 static_cast<const JHead_t&>(second))
49 return true;
50 else if (static_cast<const JHead_t&>(second) <
51 static_cast<const JHead_t&>(first))
52 return false;
53 else
54 return lt(first, second, JType<JTail_t>());
55 }
static bool lt(const JClass_t &first, const JClass_t &second, const JType< JTypeList< JHead_t, JTail_t > > &type)
Less than method for composite data types.

◆ lt() [2/2]

template<class JClass_t , class JTypelist_t >
template<class JHead_t >
static bool JLANG::JMultiComparable< JClass_t, JTypelist_t >::lt ( const JClass_t & first,
const JClass_t & second,
const JType< JTypeList< JHead_t, JNullType > > & type )
inlinestaticprotectedinherited

Less than method for composite data types.

Parameters
firstfirst object
secondsecond object
typetype
Returns
true if first object is less than second object; else false

Definition at line 67 of file JMultiComparable.hh.

70 {
71 return (static_cast<const JHead_t&>(first) <
72 static_cast<const JHead_t&>(second));
73 }

Friends And Related Symbol Documentation

◆ operator>> [1/2]

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

Read PMT identifier from input.

Parameters
ininput stream
objectPMT identifier
Returns
input stream

Definition at line 126 of file JPMTIdentifier.hh.

127 {
128 in >> static_cast<JModuleIdentifier&> (object);
129 in >> static_cast<JPMTReadoutAddress&>(object);
130
131 return in;
132 }

◆ operator<< [1/2]

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

Write PMT identifier to output.

Parameters
outoutput stream
objectPMT identifier
Returns
output stream

Definition at line 142 of file JPMTIdentifier.hh.

143 {
144 using namespace std;
145
146 out << setw(10) << static_cast<const JModuleIdentifier&> (object) << ' ';
147 out << setw(2) << static_cast<const JPMTReadoutAddress&>(object);
148
149 return out;
150 }

◆ operator>> [2/2]

JReader & operator>> ( JReader & in,
JPMTIdentifier & object )
friend

Read PMT identifier from input.

Parameters
inreader
objectPMT identifier
Returns
reader

Definition at line 160 of file JPMTIdentifier.hh.

161 {
162 in >> static_cast<JModuleIdentifier&> (object);
163 in >> static_cast<JPMTReadoutAddress&>(object);
164
165 return in;
166 }

◆ operator<< [2/2]

JWriter & operator<< ( JWriter & out,
const JPMTIdentifier & object )
friend

Write PMT identifier to output.

Parameters
outwriter
objectPMT identifier
Returns
writer

Definition at line 176 of file JPMTIdentifier.hh.

177 {
178 out << static_cast<const JModuleIdentifier&> (object);
179 out << static_cast<const JPMTReadoutAddress&>(object);
180
181 return out;
182 }

Member Data Documentation

◆ __id

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

◆ tdc

int JDETECTOR::JPMTReadoutAddress::tdc
inherited

TDC channel.

Definition at line 127 of file JPMTReadoutAddress.hh.


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