Jpp  18.5.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
JDETECTOR::JPMTAddressTranslator Struct Reference

Data structure to translate PMT physical to readout address. More...

#include <JModuleAddressMap.hh>

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

Public Member Functions

 JPMTAddressTranslator (const JPMTReadoutAddress &readout, const JPMTPhysicalAddress &address)
 Constructor. More...
 
std::string toString () const
 Convert PMT address translator to string. More...
 
std::string toString (const std::string &fmt, const std::string target="%") const
 Convert PMT address translator to string. More...
 
int getTDC () const
 Get TDC. More...
 
bool less (const JPMTPhysicalAddress &address) const
 Less than method. More...
 

Public Attributes

int tdc
 TDC channel. More...
 
char ring
 ring number ['A','F'] More...
 
int position
 position within ring [1,6] More...
 

Detailed Description

Data structure to translate PMT physical to readout address.

Definition at line 28 of file JModuleAddressMap.hh.

Constructor & Destructor Documentation

JDETECTOR::JPMTAddressTranslator::JPMTAddressTranslator ( const JPMTReadoutAddress readout,
const JPMTPhysicalAddress address 
)
inline

Constructor.

Parameters
readoutreadout address
addressphysical address

Definition at line 38 of file JModuleAddressMap.hh.

39  :
40  JPMTReadoutAddress (readout),
41  JPMTPhysicalAddress(address)
42  {}
JPMTPhysicalAddress()
Default constructor.
JPMTReadoutAddress()
Default constructor.

Member Function Documentation

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

Convert PMT address translator to string.

Returns
string

Definition at line 50 of file JModuleAddressMap.hh.

51  {
52  return toString("% % %");
53  }
std::string toString() const
Convert PMT address translator to string.
std::string JDETECTOR::JPMTAddressTranslator::toString ( const std::string fmt,
const std::string  target = "%" 
) const
inline

Convert PMT address translator to string.

The targets target in the format string fmt are consecutively replaced by tdc, ring and position.

Parameters
fmtformat
targettarget
Returns
string

Definition at line 66 of file JModuleAddressMap.hh.

67  {
68  JLANG::JString buffer(fmt);
69 
70  buffer.replace(target, tdc, 1);
71  buffer.replace(target, ring, 1);
72  buffer.replace(target, position, 1);
73 
74  return buffer;
75  }
Wrapper class around STL string class.
Definition: JString.hh:27
char ring
ring number [&#39;A&#39;,&#39;F&#39;]
int position
position within ring [1,6]
int JDETECTOR::JPMTReadoutAddress::getTDC ( ) const
inlineinherited

Get TDC.

Returns
TDC

Definition at line 55 of file JPMTReadoutAddress.hh.

56  {
57  return tdc;
58  }
bool JDETECTOR::JPMTPhysicalAddress::less ( const JPMTPhysicalAddress address) const
inlineinherited

Less than method.

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

Definition at line 60 of file JPMTPhysicalAddress.hh.

61  {
62  if (this->ring == address.ring)
63  return this->position < address.position;
64  else
65  return this->ring < address.ring;
66  }
char ring
ring number [&#39;A&#39;,&#39;F&#39;]
int position
position within ring [1,6]

Member Data Documentation

int JDETECTOR::JPMTReadoutAddress::tdc
inherited

TDC channel.

Definition at line 113 of file JPMTReadoutAddress.hh.

char JDETECTOR::JPMTPhysicalAddress::ring
inherited

ring number ['A','F']

Definition at line 148 of file JPMTPhysicalAddress.hh.

int JDETECTOR::JPMTPhysicalAddress::position
inherited

position within ring [1,6]

Definition at line 149 of file JPMTPhysicalAddress.hh.


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