Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
JDETECTOR::JPMTChannel Class Reference

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

#include <JPMTChannel.hh>

Inheritance diagram for JDETECTOR::JPMTChannel:
JLANG::JObjectID JDETECTOR::JModuleLocation JDETECTOR::JPMTReadoutAddress JLANG::JComparable< JObjectID, int > JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JPMTChannel ()
 Default constructor. More...
 
 JPMTChannel (const JObjectID &id, const JModuleLocation &location, const JPMTReadoutAddress &tdc)
 Constructor. More...
 
std::string toString () const
 Convert PMT channel to string. More...
 
int getID () const
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 
const JModuleLocationgetLocation () const
 Get location. More...
 
JModuleLocationgetLocation ()
 Get location. More...
 
void setLocation (const JModuleLocation &location)
 Set location. More...
 
std::string toString (const std::string &fmt, const std::string target="%") const
 Convert module loation to string. More...
 
int getString () const
 Get string number. More...
 
int getFloor () const
 Get floor number. More...
 
bool less (const JModuleLocation &location) const
 Less than method. More...
 
int getTDC () const
 Get TDC. More...
 

Public Attributes

int tdc
 TDC channel. More...
 

Protected Attributes

int __id
 
int string
 
int floor
 

Friends

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

Detailed Description

Auxiliary class to uniquely identify PMT readout channel.

Definition at line 28 of file JPMTChannel.hh.

Constructor & Destructor Documentation

JDETECTOR::JPMTChannel::JPMTChannel ( )
inline

Default constructor.

Definition at line 37 of file JPMTChannel.hh.

37  :
38  JObjectID(),
41  {}
JObjectID()
Default constructor.
Definition: JObjectID.hh:34
JModuleLocation()
Default constructor.
JPMTReadoutAddress()
Default constructor.
JDETECTOR::JPMTChannel::JPMTChannel ( const JObjectID id,
const JModuleLocation location,
const JPMTReadoutAddress tdc 
)
inline

Constructor.

Parameters
iddetector identifier
locationmodule location
tdcPMT readout address

Definition at line 51 of file JPMTChannel.hh.

53  :
54  JObjectID (id),
55  JModuleLocation (location),
57  {}
JObjectID()
Default constructor.
Definition: JObjectID.hh:34
JModuleLocation()
Default constructor.
JPMTReadoutAddress()
Default constructor.

Member Function Documentation

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

Convert PMT channel to string.

Returns
string

Definition at line 65 of file JPMTChannel.hh.

66  {
67  std::ostringstream os;
68 
69  os << *this;
70 
71  return os.str();
72  }
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 54 of file JObjectID.hh.

55  {
56  return __id;
57  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 65 of file JObjectID.hh.

66  {
67  this->__id = id;
68  }
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 77 of file JObjectID.hh.

78  {
79  return this->getID() < object.getID();
80  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
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 89 of file JObjectID.hh.

90  {
91  return this->getID() < id;
92  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
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 101 of file JObjectID.hh.

102  {
103  return this->getID() > id;
104  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
const JModuleLocation& JDETECTOR::JModuleLocation::getLocation ( ) const
inlineinherited

Get location.

Returns
location

Definition at line 68 of file JModuleLocation.hh.

69  {
70  return static_cast<const JModuleLocation&>(*this);
71  }
Logical location of module.
JModuleLocation& JDETECTOR::JModuleLocation::getLocation ( )
inlineinherited

Get location.

Returns
location

Definition at line 79 of file JModuleLocation.hh.

80  {
81  return static_cast<JModuleLocation&>(*this);
82  }
Logical location of module.
void JDETECTOR::JModuleLocation::setLocation ( const JModuleLocation location)
inlineinherited

Set location.

Parameters
locationlocation

Definition at line 90 of file JModuleLocation.hh.

91  {
92  static_cast<JModuleLocation&>(*this) = location;
93  }
Logical location of module.
std::string JDETECTOR::JModuleLocation::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 117 of file JModuleLocation.hh.

118  {
119  JLANG::JString buffer(fmt);
120 
121  buffer.replace(target, string, 1);
122  buffer.replace(target, floor, 1);
123 
124  return buffer;
125  }
Wrapper class around STL string class.
Definition: JString.hh:28
int JDETECTOR::JModuleLocation::getString ( ) const
inlineinherited

Get string number.

Returns
string number

Definition at line 133 of file JModuleLocation.hh.

134  {
135  return string;
136  }
int JDETECTOR::JModuleLocation::getFloor ( ) const
inlineinherited

Get floor number.

Returns
floor number

Definition at line 144 of file JModuleLocation.hh.

145  {
146  return floor;
147  }
bool JDETECTOR::JModuleLocation::less ( const JModuleLocation location) const
inlineinherited

Less than method.

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

Definition at line 156 of file JModuleLocation.hh.

157  {
158  if (this->getString() == location.getString())
159  return this->getFloor() < location.getFloor();
160  else
161  return this->getString() < location.getString();
162  }
int getFloor() const
Get floor number.
int getString() const
Get string number.
int JDETECTOR::JPMTReadoutAddress::getTDC ( ) const
inlineinherited

Get TDC.

Returns
TDC

Definition at line 55 of file JPMTReadoutAddress.hh.

56  {
57  return tdc;
58  }

Friends And Related Function Documentation

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

Read PMT channel.

Parameters
ininput stream
objectPMT channel
Returns
input stream

Definition at line 82 of file JPMTChannel.hh.

83  {
84  in >> static_cast<JObjectID&> (object);
85  in >> static_cast<JModuleLocation&> (object);
86  in >> static_cast<JPMTReadoutAddress&>(object);
87 
88  return in;
89  }
JObjectID()
Default constructor.
Definition: JObjectID.hh:34
Data structure for PMT readout address.
Logical location of module.
std::ostream& operator<< ( std::ostream &  out,
const JPMTChannel object 
)
friend

Write PMT channel.

Parameters
outoutput stream
objectPMT channel
Returns
output stream

Definition at line 99 of file JPMTChannel.hh.

100  {
101  out << static_cast<const JObjectID&> (object) << ' ';
102  out << static_cast<const JModuleLocation&> (object) << ' ';
103  out << static_cast<const JPMTReadoutAddress&>(object);
104 
105  return out;
106  }

Member Data Documentation

int JLANG::JObjectID::__id
protectedinherited

Definition at line 159 of file JObjectID.hh.

int JDETECTOR::JModuleLocation::string
protectedinherited

Definition at line 233 of file JModuleLocation.hh.

int JDETECTOR::JModuleLocation::floor
protectedinherited

Definition at line 234 of file JModuleLocation.hh.

int JDETECTOR::JPMTReadoutAddress::tdc
inherited

TDC channel.

Definition at line 113 of file JPMTReadoutAddress.hh.


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