Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JDETECTOR::JPMTChannel Class Reference

Auxiliary class to uniquely identify PMT readout channel. More...

#include <JPMTChannel.hh>

Inheritance diagram for JDETECTOR::JPMTChannel:
JDETECTOR::JLocation JDETECTOR::JPMTReadoutAddress JLANG::JMultiComparable< JClass_t, JTypelist_t > JLANG::JComparable< JFirst_t, JSecond_t > JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JPMTChannel ()
 Default constructor.
 
 JPMTChannel (const JLocation &location, const JPMTReadoutAddress &tdc)
 Constructor.
 
const JLocationgetLocation () const
 Get location.
 
JLocationgetLocation ()
 Get location.
 
void setLocation (const JLocation &location)
 Set location.
 
std::string toString () const
 Convert module location to string.
 
std::string toString (const std::string &fmt, const std::string target="%") const
 Convert module loation to string.
 
int getString () const
 Get string number.
 
int getFloor () const
 Get floor number.
 
bool less (const JLocation &location) const
 Less 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 string
 
int floor
 

Friends

std::istream & operator>> (std::istream &in, JPMTChannel &object)
 Read PMT channel.
 
std::ostream & operator<< (std::ostream &out, const JPMTChannel &object)
 Write PMT channel.
 

Detailed Description

Auxiliary class to uniquely identify PMT readout channel.

Definition at line 31 of file JPMTChannel.hh.

Constructor & Destructor Documentation

◆ JPMTChannel() [1/2]

JDETECTOR::JPMTChannel::JPMTChannel ( )
inline

Default constructor.

Definition at line 40 of file JPMTChannel.hh.

40 :
41 JLocation(),
43 {}
JLocation()
Default constructor.
Definition JLocation.hh:45
JPMTReadoutAddress()
Default constructor.

◆ JPMTChannel() [2/2]

JDETECTOR::JPMTChannel::JPMTChannel ( const JLocation & location,
const JPMTReadoutAddress & tdc )
inline

Constructor.

Parameters
locationmodule location
tdcPMT readout address

Definition at line 52 of file JPMTChannel.hh.

53 :
54 JLocation (location),
56 {}

Member Function Documentation

◆ getLocation() [1/2]

const JLocation & JDETECTOR::JLocation::getLocation ( ) const
inlineinherited

Get location.

Returns
location

Definition at line 70 of file JLocation.hh.

71 {
72 return static_cast<const JLocation&>(*this);
73 }

◆ getLocation() [2/2]

JLocation & JDETECTOR::JLocation::getLocation ( )
inlineinherited

Get location.

Returns
location

Definition at line 81 of file JLocation.hh.

82 {
83 return static_cast<JLocation&>(*this);
84 }

◆ setLocation()

void JDETECTOR::JLocation::setLocation ( const JLocation & location)
inlineinherited

Set location.

Parameters
locationlocation

Definition at line 92 of file JLocation.hh.

93 {
94 static_cast<JLocation&>(*this) = location;
95 }

◆ toString() [1/2]

std::string JDETECTOR::JLocation::toString ( ) const
inlineinherited

Convert module location to string.

Returns
string

Definition at line 103 of file JLocation.hh.

104 {
105 return toString("% %");
106 }
std::string toString() const
Convert module location to string.
Definition JLocation.hh:103

◆ toString() [2/2]

std::string JDETECTOR::JLocation::toString ( const std::string & fmt,
const std::string target = "%" ) const
inlineinherited

Convert module loation to string.

The targets target in the format string fmt are consecutively replaced by floor and string.

Parameters
fmtformat
targettarget
Returns
string

Definition at line 119 of file JLocation.hh.

120 {
121 JLANG::JString buffer(fmt);
122
123 buffer.replace(target, string, 1);
124 buffer.replace(target, floor, 1);
125
126 return buffer;
127 }
Wrapper class around STL string class.
Definition JString.hh:29

◆ getString()

int JDETECTOR::JLocation::getString ( ) const
inlineinherited

Get string number.

Returns
string number

Definition at line 135 of file JLocation.hh.

136 {
137 return string;
138 }

◆ getFloor()

int JDETECTOR::JLocation::getFloor ( ) const
inlineinherited

Get floor number.

Returns
floor number

Definition at line 146 of file JLocation.hh.

147 {
148 return floor;
149 }

◆ less() [1/2]

bool JDETECTOR::JLocation::less ( const JLocation & location) const
inlineinherited

Less than method.

Parameters
locationmodule location
Returns
true if first location before second location; else false

Definition at line 158 of file JLocation.hh.

159 {
160 if (this->getString() == location.getString())
161 return this->getFloor() < location.getFloor();
162 else
163 return this->getString() < location.getString();
164 }
int getFloor() const
Get floor number.
Definition JLocation.hh:146
int getString() const
Get string number.
Definition JLocation.hh:135

◆ less() [2/2]

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>>

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

Read PMT channel.

Parameters
ininput stream
objectPMT channel
Returns
input stream

Definition at line 66 of file JPMTChannel.hh.

67 {
68 in >> static_cast<JLocation&> (object);
69 in >> static_cast<JPMTReadoutAddress&>(object);
70
71 return in;
72 }

◆ operator<<

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

Write PMT channel.

Parameters
outoutput stream
objectPMT channel
Returns
output stream

Definition at line 82 of file JPMTChannel.hh.

83 {
84 out << static_cast<const JLocation&> (object) << ' ';
85 out << static_cast<const JPMTReadoutAddress&>(object);
86
87 return out;
88 }

Member Data Documentation

◆ string

int JDETECTOR::JLocation::string
protectedinherited

Definition at line 235 of file JLocation.hh.

◆ floor

int JDETECTOR::JLocation::floor
protectedinherited

Definition at line 236 of file JLocation.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: