Jpp
Public Types | Public Member Functions | Protected Attributes | Private Types | Private Attributes | List of all members
JDETECTOR::JDAQHitRouter Class Reference

Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structure for DAQ hits. More...

#include <JDAQHitRouter.hh>

Inheritance diagram for JDETECTOR::JDAQHitRouter:
JDETECTOR::JModuleRouter JLANG::JReference< JClass_t >

Public Types

typedef JDetector::const_iterator const_iterator
 

Public Member Functions

 JDAQHitRouter (const JDetector &detector)
 Constructor. More...
 
const JModulegetModule (const JDAQKeyHit &hit) const
 Get module parameters. More...
 
const JPMTgetPMT (const JDAQKeyHit &hit) const
 Get PMT parameters. More...
 
JPMTChannel getPMTChannel (const JDAQKeyHit &hit) const
 Get PMT channel. More...
 
const JModulegetModule (const JObjectID &id) const
 Get module parameters. More...
 
const JModuleRoutergetModuleRouter () const
 Get module router. More...
 
const JModuleAddressgetAddress (const JObjectID &id) const
 Get address of module. More...
 
const JModulegetModule (const JObjectID &id) const
 Get module parameters. More...
 
bool hasModule (const JObjectID &id) const
 Has module. More...
 
const int getIndex (const JObjectID &id) const
 Get index of module. More...
 
bool hasPMT (const JPMTIdentifier &id) const
 Has PMT. More...
 
const JPMTgetPMT (const JPMTIdentifier &id) const
 Get PMT parameters. More...
 
JUTMPosition getUTMPosition (const JObjectID &id) const
 Get UTM position of given module identifier. More...
 
const JClass_t & getReference () const
 Get reference to object. More...
 
JClass_t & getReference ()
 Get reference to object. More...
 
bool is_valid () const
 Check validity of reference. More...
 
const JClass_t * operator-> () const
 Smart pointer. More...
 
JClass_t * operator-> ()
 Smart pointer. More...
 
const JClass_t & operator* () const
 Dereference operator. More...
 
JClass_t & operator* ()
 Dereference operator. More...
 

Protected Attributes

JClass_t & __object
 

Private Types

typedef JReference< const JDetectorJReference_t
 

Private Attributes

JTOOLS::JRouter< JModuleAddressrouter
 

Detailed Description

Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structure for DAQ hits.

Definition at line 24 of file JDAQHitRouter.hh.

Member Typedef Documentation

◆ JReference_t

Definition at line 38 of file JModuleRouter.hh.

◆ const_iterator

typedef JDetector::const_iterator JDETECTOR::JModuleRouter::const_iterator
inherited

Definition at line 42 of file JModuleRouter.hh.

Constructor & Destructor Documentation

◆ JDAQHitRouter()

JDETECTOR::JDAQHitRouter::JDAQHitRouter ( const JDetector detector)
inline

Constructor.

Parameters
detectordetector

Definition at line 36 of file JDAQHitRouter.hh.

36  :
37  JModuleRouter(detector)
38  {}

Member Function Documentation

◆ getModule() [1/3]

const JModule& JDETECTOR::JDAQHitRouter::getModule ( const JDAQKeyHit hit) const
inline

Get module parameters.

Parameters
hithit
Returns
module parameters

Definition at line 47 of file JDAQHitRouter.hh.

48  {
49  return getModule(hit.getModuleID());
50  }

◆ getPMT() [1/2]

const JPMT& JDETECTOR::JDAQHitRouter::getPMT ( const JDAQKeyHit hit) const
inline

Get PMT parameters.

Parameters
hithit
Returns
PMT parameters

Definition at line 59 of file JDAQHitRouter.hh.

60  {
61  return getModule(hit).getPMT(hit.getPMT());
62  }

◆ getPMTChannel()

JPMTChannel JDETECTOR::JDAQHitRouter::getPMTChannel ( const JDAQKeyHit hit) const
inline

Get PMT channel.

Parameters
hithit
Returns
PMT channel

Definition at line 71 of file JDAQHitRouter.hh.

72  {
73  return JPMTChannel(getReference().getID(),
75  JPMTReadoutAddress(hit.getPMT()));
76  }

◆ getModule() [2/3]

const JModule& JDETECTOR::JModuleRouter::getModule
inline

Get module parameters.

Parameters
idmodule identifier
Returns
module parameters

Definition at line 89 of file JModuleRouter.hh.

90  {
91  return getReference().getModule(this->getAddress(id));
92  }

◆ getModuleRouter()

const JModuleRouter& JDETECTOR::JModuleRouter::getModuleRouter ( ) const
inlineinherited

Get module router.

Returns
module router

Definition at line 65 of file JModuleRouter.hh.

66  {
67  return static_cast<const JModuleRouter&>(*this);
68  }

◆ getAddress()

const JModuleAddress& JDETECTOR::JModuleRouter::getAddress ( const JObjectID id) const
inlineinherited

Get address of module.

Parameters
idmodule identifier
Returns
address

Definition at line 77 of file JModuleRouter.hh.

78  {
79  return router.get(id.getID());
80  }

◆ getModule() [3/3]

const JModule& JDETECTOR::JModuleRouter::getModule ( const JObjectID id) const
inlineinherited

Get module parameters.

Parameters
idmodule identifier
Returns
module parameters

Definition at line 89 of file JModuleRouter.hh.

90  {
91  return getReference().getModule(this->getAddress(id));
92  }

◆ hasModule()

bool JDETECTOR::JModuleRouter::hasModule ( const JObjectID id) const
inlineinherited

Has module.

Parameters
idmodule identifier
Returns
true if module present; else false

Definition at line 101 of file JModuleRouter.hh.

102  {
103  return router.has(id.getID());
104  }

◆ getIndex()

const int JDETECTOR::JModuleRouter::getIndex ( const JObjectID id) const
inlineinherited

Get index of module.

Parameters
idmodule identifier
Returns
index

Definition at line 113 of file JModuleRouter.hh.

114  {
115  return getAddress(id).first;
116  }

◆ hasPMT()

bool JDETECTOR::JModuleRouter::hasPMT ( const JPMTIdentifier id) const
inlineinherited

Has PMT.

Parameters
idPMT identifier
Returns
true if PMT present; else false

Definition at line 125 of file JModuleRouter.hh.

126  {
127  return hasModule(id.getID()) && id.getPMTAddress() >= 0 && id.getPMTAddress() < (int) getModule(id.getID()).size();
128  }

◆ getPMT() [2/2]

const JPMT& JDETECTOR::JModuleRouter::getPMT ( const JPMTIdentifier id) const
inlineinherited

Get PMT parameters.

Parameters
idPMT identifier
Returns
PMT parameters

Definition at line 137 of file JModuleRouter.hh.

138  {
139  return getModule(id.getID()).getPMT(id.getPMTAddress());
140  }

◆ getUTMPosition()

JUTMPosition JDETECTOR::JModuleRouter::getUTMPosition ( const JObjectID id) const
inlineinherited

Get UTM position of given module identifier.

Parameters
idmodule identifier
Returns
UTM position

Definition at line 149 of file JModuleRouter.hh.

150  {
151  return JUTMPosition(getModule(id).getPosition() + getReference().getPosition());
152  }

◆ getReference() [1/2]

template<class JClass_t>
const JClass_t& JLANG::JReference< JClass_t >::getReference ( ) const
inlineinherited

Get reference to object.

Returns
reference to object

Definition at line 38 of file JReference.hh.

39  {
40  return __object;
41  }

◆ getReference() [2/2]

template<class JClass_t>
JClass_t& JLANG::JReference< JClass_t >::getReference ( )
inlineinherited

Get reference to object.

Returns
reference to object

Definition at line 49 of file JReference.hh.

50  {
51  return __object;
52  }

◆ is_valid()

template<class JClass_t>
bool JLANG::JReference< JClass_t >::is_valid ( ) const
inlineinherited

Check validity of reference.

Returns
true

Definition at line 60 of file JReference.hh.

61  {
62  return true;
63  }

◆ operator->() [1/2]

template<class JClass_t>
const JClass_t* JLANG::JReference< JClass_t >::operator-> ( ) const
inlineinherited

Smart pointer.

Returns
pointer to object

Definition at line 71 of file JReference.hh.

72  {
73  return &__object;
74  }

◆ operator->() [2/2]

template<class JClass_t>
JClass_t* JLANG::JReference< JClass_t >::operator-> ( )
inlineinherited

Smart pointer.

Returns
pointer to object

Definition at line 82 of file JReference.hh.

83  {
84  return &__object;
85  }

◆ operator*() [1/2]

template<class JClass_t>
const JClass_t& JLANG::JReference< JClass_t >::operator* ( ) const
inlineinherited

Dereference operator.

Returns
reference to object

Definition at line 93 of file JReference.hh.

94  {
95  return __object;
96  }

◆ operator*() [2/2]

template<class JClass_t>
JClass_t& JLANG::JReference< JClass_t >::operator* ( )
inlineinherited

Dereference operator.

Returns
reference to object

Definition at line 104 of file JReference.hh.

105  {
106  return __object;
107  }

Member Data Documentation

◆ router

JTOOLS::JRouter<JModuleAddress> JDETECTOR::JModuleRouter::router
privateinherited

Definition at line 155 of file JModuleRouter.hh.

◆ __object

template<class JClass_t>
JClass_t& JLANG::JReference< JClass_t >::__object
protectedinherited

Definition at line 110 of file JReference.hh.


The documentation for this class was generated from the following file:
JDETECTOR::JPMTChannel
Auxiliary class to uniquely identify PMT readout channel.
Definition: JPMTChannel.hh:28
JDETECTOR::JModuleAddress::first
int first
index of module in detector data structure
Definition: JModuleAddress.hh:90
JDETECTOR::JDAQHitRouter::getModule
const JModule & getModule(const JDAQKeyHit &hit) const
Get module parameters.
Definition: JDAQHitRouter.hh:47
JDETECTOR::JModuleRouter::getModule
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Definition: JModuleRouter.hh:89
JLANG::JReference::__object
JClass_t & __object
Definition: JReference.hh:110
JDETECTOR::JModuleLocation
Logical location of module.
Definition: JModuleLocation.hh:36
JDETECTOR::JModule::getPMT
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:173
JLANG::JReference::getReference
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
JDETECTOR::JModuleRouter::JModuleRouter
JModuleRouter(const JDetector &detector)
Constructor.
Definition: JModuleRouter.hh:50
JDETECTOR::JModuleRouter::getAddress
const JModuleAddress & getAddress(const JObjectID &id) const
Get address of module.
Definition: JModuleRouter.hh:77
JDETECTOR::JModuleRouter::hasModule
bool hasModule(const JObjectID &id) const
Has module.
Definition: JModuleRouter.hh:101
JDETECTOR::getPosition
JPosition3D getPosition(const JModule &first, const JModule &second)
Get position to go from first to second module.
Definition: JDetectorToolkit.hh:833
JDETECTOR::JPMTReadoutAddress
Data structure for PMT readout address.
Definition: JPMTReadoutAddress.hh:27
JDETECTOR::JModuleRouter::router
JTOOLS::JRouter< JModuleAddress > router
Definition: JModuleRouter.hh:155