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

Address of PMT in detector data structure. More...

#include <JPMTAddress.hh>

Inheritance diagram for JDETECTOR::JPMTAddress:
JDETECTOR::JModuleAddress JLANG::JComparable< JFirst_t, JSecond_t > JLANG::JEquals< JFirst_t, JSecond_t >

Public Member Functions

 JPMTAddress ()
 Default constructor.
 
 JPMTAddress (const JModuleAddress &module, const int pmt)
 Constructor.
 
bool less (const JPMTAddress &address) const
 Less than method.
 
bool equals (const JModuleAddress &address) const
 Equal method.
 

Public Attributes

int second
 index of PMT in module data structure.
 
int first
 index of module in detector data structure
 

Friends

std::istream & operator>> (std::istream &in, JPMTAddress &object)
 Read PMT address from input.
 
std::ostream & operator<< (std::ostream &out, const JPMTAddress &object)
 Write PMT address to output.
 

Detailed Description

Address of PMT in detector data structure.

The address of a PMT consists of a pair of integer values, where

  • JPMTAddress::first refers to the index of the parent module in the detector data structure; and
  • JPMTAddress::second refers to the index of the PMT in the corresponding module data structure.

This class implements the JLANG::JComparable interface.

Definition at line 32 of file JPMTAddress.hh.

Constructor & Destructor Documentation

◆ JPMTAddress() [1/2]

JDETECTOR::JPMTAddress::JPMTAddress ( )
inline

Default constructor.

Definition at line 40 of file JPMTAddress.hh.

40 :
42 second(-1)
43 {}
JModuleAddress()
Default constructor.
int second
index of PMT in module data structure.

◆ JPMTAddress() [2/2]

JDETECTOR::JPMTAddress::JPMTAddress ( const JModuleAddress & module,
const int pmt )
inline

Constructor.

Parameters
modulemodule address
pmtPMT index

Definition at line 52 of file JPMTAddress.hh.

53 :
54 JModuleAddress(module),
55 second(pmt)
56 {}

Member Function Documentation

◆ less()

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

Less than method.

Parameters
addressPMT address
Returns
true if this PMT address is less than given PMT address; else false

Definition at line 65 of file JPMTAddress.hh.

66 {
67 if (this->first == address.first)
68 return this->second < address.second;
69 else
70 return this->first < address.first;
71 }
int first
index of module in detector data structure

◆ equals()

bool JDETECTOR::JModuleAddress::equals ( const JModuleAddress & address) const
inlineinherited

Equal method.

Parameters
addressmodule address
Returns
true if this module address equal to given module address; else false

Definition at line 58 of file JModuleAddress.hh.

59 {
60 return this->first == address.first;
61 }

Friends And Related Symbol Documentation

◆ operator>>

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

Read PMT address from input.

Parameters
ininput stream
objectPMT address
Returns
input stream

Definition at line 81 of file JPMTAddress.hh.

82 {
83 return in >> static_cast<JModuleAddress&>(object) >> object.second;
84 }

◆ operator<<

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

Write PMT address to output.

Parameters
outoutput stream
objectPMT address
Returns
output stream

Definition at line 94 of file JPMTAddress.hh.

95 {
96 return out << static_cast<const JModuleAddress&>(object) << ' ' << object.second;
97 }

Member Data Documentation

◆ second

int JDETECTOR::JPMTAddress::second

index of PMT in module data structure.

Definition at line 100 of file JPMTAddress.hh.

◆ first

int JDETECTOR::JModuleAddress::first
inherited

index of module in detector data structure

Definition at line 90 of file JModuleAddress.hh.


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