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

Data structure for PMT physical address. More...

#include <JPMTPhysicalAddress.hh>

Inheritance diagram for JDETECTOR::JPMTPhysicalAddress:
JLANG::JComparable< JFirst_t, JSecond_t > JDETECTOR::JPMTAddressTranslator

Public Member Functions

 JPMTPhysicalAddress ()
 Default constructor.
 
 JPMTPhysicalAddress (const char ring, const int position)
 Constructor.
 
bool less (const JPMTPhysicalAddress &address) const
 Less than method.
 
std::string toString () const
 Convert PMT physical address to string.
 

Public Attributes

char ring
 ring number ['A','F']
 
int position
 position within ring [1,6]
 

Friends

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

Detailed Description

Data structure for PMT physical address.

Definition at line 29 of file JPMTPhysicalAddress.hh.

Constructor & Destructor Documentation

◆ JPMTPhysicalAddress() [1/2]

JDETECTOR::JPMTPhysicalAddress::JPMTPhysicalAddress ( )
inline

Default constructor.

Definition at line 36 of file JPMTPhysicalAddress.hh.

37 {
38 this->ring = '\0';
39 this->position = -1;
40 }
int position
position within ring [1,6]

◆ JPMTPhysicalAddress() [2/2]

JDETECTOR::JPMTPhysicalAddress::JPMTPhysicalAddress ( const char ring,
const int position )
inline

Constructor.

Parameters
ringring
positionposition

Definition at line 49 of file JPMTPhysicalAddress.hh.

51 {
52 this->ring = ring;
53 this->position = position;
54 }

Member Function Documentation

◆ less()

bool JDETECTOR::JPMTPhysicalAddress::less ( const JPMTPhysicalAddress & address) const
inline

Less than method.

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

Definition at line 63 of file JPMTPhysicalAddress.hh.

64 {
65 if (this->ring == address.ring)
66 return this->position < address.position;
67 else
68 return this->ring < address.ring;
69 }

◆ toString()

std::string JDETECTOR::JPMTPhysicalAddress::toString ( ) const
inline

Convert PMT physical address to string.

Returns
string

Definition at line 141 of file JPMTPhysicalAddress.hh.

142 {
143 std::ostringstream os;
144
145 os << *this;
146
147 return os.str();
148 }

Friends And Related Symbol Documentation

◆ operator>> [1/2]

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

Read PMT physical address from input.

Parameters
ininput stream
objectPMT physical address
Returns
input stream

Definition at line 79 of file JPMTPhysicalAddress.hh.

80 {
81 in >> object.ring;
82 in >> object.position;
83
84 return in;
85 }

◆ operator<< [1/2]

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

Write PMT physical address to output.

Parameters
outoutput stream
objectPMT physical address
Returns
output stream

Definition at line 95 of file JPMTPhysicalAddress.hh.

96 {
97 out << object.ring;
98 out << object.position;
99
100 return out;
101 }

◆ operator>> [2/2]

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

Read PMT physical address from input.

Parameters
inreader
objectPMT physical address
Returns
reader

Definition at line 111 of file JPMTPhysicalAddress.hh.

112 {
113 in >> object.ring;
114 in >> object.position;
115
116 return in;
117 }

◆ operator<< [2/2]

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

Write PMT physical address to output.

Parameters
outwriter
objectPMT physical address
Returns
writer

Definition at line 127 of file JPMTPhysicalAddress.hh.

128 {
129 out << object.ring;
130 out << object.position;
131
132 return out;
133 }

Member Data Documentation

◆ ring

char JDETECTOR::JPMTPhysicalAddress::ring

ring number ['A','F']

Definition at line 151 of file JPMTPhysicalAddress.hh.

◆ position

int JDETECTOR::JPMTPhysicalAddress::position

position within ring [1,6]

Definition at line 152 of file JPMTPhysicalAddress.hh.


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