Jpp  15.0.1-rc.1-highQE
the software that should make you happy
 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:
JDETECTOR::JLocation JDETECTOR::JPMTReadoutAddress JLANG::JComparable< JFirst_t, JSecond_t >

Public Member Functions

 JPMTChannel ()
 Default constructor. More...
 
 JPMTChannel (const JLocation &location, const JPMTReadoutAddress &tdc)
 Constructor. More...
 
bool less (const JPMTChannel &channel) const
 Less than method. More...
 
const JLocationgetLocation () const
 Get location. More...
 
JLocationgetLocation ()
 Get location. More...
 
void setLocation (const JLocation &location)
 Set location. More...
 
std::string toString () const
 Convert module location to string. 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 JLocation &location) const
 Less than method. More...
 
int getTDC () const
 Get TDC. More...
 

Public Attributes

int tdc
 TDC channel. More...
 

Protected Attributes

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 30 of file JPMTChannel.hh.

Constructor & Destructor Documentation

JDETECTOR::JPMTChannel::JPMTChannel ( )
inline

Default constructor.

Definition at line 38 of file JPMTChannel.hh.

38  :
39  JLocation(),
41  {}
JLocation()
Default constructor.
Definition: JLocation.hh:44
JPMTReadoutAddress()
Default constructor.
JDETECTOR::JPMTChannel::JPMTChannel ( const JLocation location,
const JPMTReadoutAddress tdc 
)
inline

Constructor.

Parameters
locationmodule location
tdcPMT readout address

Definition at line 50 of file JPMTChannel.hh.

51  :
52  JLocation (location),
54  {}
JLocation()
Default constructor.
Definition: JLocation.hh:44
JPMTReadoutAddress()
Default constructor.

Member Function Documentation

bool JDETECTOR::JPMTChannel::less ( const JPMTChannel channel) const
inline

Less than method.

Parameters
channelPMT channel
Returns
true if first channel before second channel; else false

Definition at line 63 of file JPMTChannel.hh.

64  {
65  if (this->getLocation() == channel.getLocation())
66  return this->getTDC() < channel.getTDC();
67  else
68  return this->getLocation() < channel.getLocation();
69  }
const JLocation & getLocation() const
Get location.
Definition: JLocation.hh:69
const JLocation& JDETECTOR::JLocation::getLocation ( ) const
inlineinherited

Get location.

Returns
location

Definition at line 69 of file JLocation.hh.

70  {
71  return static_cast<const JLocation&>(*this);
72  }
Logical location of module.
Definition: JLocation.hh:37
JLocation& JDETECTOR::JLocation::getLocation ( )
inlineinherited

Get location.

Returns
location

Definition at line 80 of file JLocation.hh.

81  {
82  return static_cast<JLocation&>(*this);
83  }
Logical location of module.
Definition: JLocation.hh:37
void JDETECTOR::JLocation::setLocation ( const JLocation location)
inlineinherited

Set location.

Parameters
locationlocation

Definition at line 91 of file JLocation.hh.

92  {
93  static_cast<JLocation&>(*this) = location;
94  }
Logical location of module.
Definition: JLocation.hh:37
std::string JDETECTOR::JLocation::toString ( ) const
inlineinherited

Convert module location to string.

Returns
string

Definition at line 102 of file JLocation.hh.

103  {
104  return toString("% %");
105  }
std::string toString() const
Convert module location to string.
Definition: JLocation.hh:102
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 118 of file JLocation.hh.

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

Get string number.

Returns
string number

Definition at line 134 of file JLocation.hh.

135  {
136  return string;
137  }
int JDETECTOR::JLocation::getFloor ( ) const
inlineinherited

Get floor number.

Returns
floor number

Definition at line 145 of file JLocation.hh.

146  {
147  return floor;
148  }
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 157 of file JLocation.hh.

158  {
159  if (this->getString() == location.getString())
160  return this->getFloor() < location.getFloor();
161  else
162  return this->getString() < location.getString();
163  }
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
int getString() const
Get string number.
Definition: JLocation.hh:134
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 79 of file JPMTChannel.hh.

80  {
81  in >> static_cast<JLocation&> (object);
82  in >> static_cast<JPMTReadoutAddress&>(object);
83 
84  return in;
85  }
Logical location of module.
Definition: JLocation.hh:37
Data structure for PMT readout address.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
std::ostream& operator<< ( std::ostream &  out,
const JPMTChannel object 
)
friend

Write PMT channel.

Parameters
outoutput stream
objectPMT channel
Returns
output stream

Definition at line 95 of file JPMTChannel.hh.

96  {
97  out << static_cast<const JLocation&> (object) << ' ';
98  out << static_cast<const JPMTReadoutAddress&>(object);
99 
100  return out;
101  }

Member Data Documentation

int JDETECTOR::JLocation::string
protectedinherited

Definition at line 234 of file JLocation.hh.

int JDETECTOR::JLocation::floor
protectedinherited

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