Jpp  19.0.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 | Static Protected Member Functions | 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::JMultiComparable< JClass_t, JTypelist_t > JLANG::JComparable< JFirst_t, JSecond_t > 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...
 
bool less (const JPMTReadoutAddress &address) const
 Less than method. 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...
 

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

Detailed Description

Data structure to translate PMT physical to readout address.

Definition at line 31 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 42 of file JModuleAddressMap.hh.

43  :
44  JPMTReadoutAddress (readout),
45  JPMTPhysicalAddress(address)
46  {}
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 54 of file JModuleAddressMap.hh.

55  {
56  return toString("% % %");
57  }
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 70 of file JModuleAddressMap.hh.

71  {
72  JLANG::JString buffer(fmt);
73 
74  buffer.replace(target, tdc, 1);
75  buffer.replace(target, ring, 1);
76  buffer.replace(target, position, 1);
77 
78  return buffer;
79  }
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]
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  }
int JDETECTOR::JPMTReadoutAddress::getTDC ( ) const
inlineinherited

Get TDC.

Returns
TDC

Definition at line 69 of file JPMTReadoutAddress.hh.

70  {
71  return tdc;
72  }
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 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  }
char ring
ring number [&#39;A&#39;,&#39;F&#39;]
int position
position within ring [1,6]
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  }
Auxiliary class for a type holder.
Definition: JType.hh:19
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
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 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  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first

Member Data Documentation

int JDETECTOR::JPMTReadoutAddress::tdc
inherited

TDC channel.

Definition at line 127 of file JPMTReadoutAddress.hh.

char JDETECTOR::JPMTPhysicalAddress::ring
inherited

ring number ['A','F']

Definition at line 151 of file JPMTPhysicalAddress.hh.

int JDETECTOR::JPMTPhysicalAddress::position
inherited

position within ring [1,6]

Definition at line 152 of file JPMTPhysicalAddress.hh.


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