Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDAQHitRouter.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JDAQHITROUTER__
2 #define __JDETECTOR__JDAQHITROUTER__
3 
6 #include "JDAQ/JDAQKeyHit.hh"
7 
8 
9 /**
10  * \file
11  * Direct access to PMT data in detector data structure for DAQ hits.
12  * \author mdejong
13  */
14 namespace JDETECTOR {}
15 namespace JPP { using namespace JDETECTOR; }
16 
17 namespace JDETECTOR {
18 
20 
21  /**
22  * Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structure for DAQ hits.
23  */
24  class JDAQHitRouter :
25  public JModuleRouter
26  {
27  public:
28 
30 
31  /**
32  * Constructor.
33  *
34  * \param detector detector
35  */
36  JDAQHitRouter(const JDetector& detector) :
37  JModuleRouter(detector)
38  {}
39 
40 
41  /**
42  * Get module parameters.
43  *
44  * \param hit hit
45  * \return module parameters
46  */
47  const JModule& getModule(const JDAQKeyHit& hit) const
48  {
49  return getModule(hit.getModuleID());
50  }
51 
52 
53  /**
54  * Get PMT parameters.
55  *
56  * \param hit hit
57  * \return PMT parameters
58  */
59  const JPMT& getPMT(const JDAQKeyHit& hit) const
60  {
61  return getModule(hit).getPMT(hit.getPMT());
62  }
63 
64 
65  /**
66  * Get PMT channel.
67  *
68  * \param hit hit
69  * \return PMT channel
70  */
72  {
73  return JPMTChannel(getReference().getID(),
75  JPMTReadoutAddress(hit.getPMT()));
76  }
77  };
78 }
79 
80 #endif
DAQ key hit.
Definition: JDAQKeyHit.hh:24
Auxiliary class to uniquely identify PMT readout channel.
Definition: JPMTChannel.hh:28
Data structure to uniquely identify PMT readout channel.
int getModuleID() const
Get module identifier.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
Data structure for a composite optical module.
Definition: JModule.hh:47
Detector data structure.
Definition: JDetector.hh:77
Router for direct addressing of module data in detector data structure.
const JModule & getModule(const JDAQKeyHit &hit) const
Get module parameters.
JPMT_t getPMT() const
Get PMT.
Definition: JDAQHit.hh:74
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
JDAQHitRouter(const JDetector &detector)
Constructor.
Data structure for PMT geometry and calibration.
Definition: JPMT.hh:52
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:141
Direct access to module in detector data structure.
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
Data structure for PMT readout address.
const JPMT & getPMT(const JDAQKeyHit &hit) const
Get PMT parameters.
JPMTChannel getPMTChannel(const JDAQKeyHit &hit) const
Get PMT channel.
Logical location of module.