Jpp  15.0.5
the software that should make you happy
 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 
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  */
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(getModule(hit).getLocation(), hit.getPMT());
74  }
75  };
76 }
77 
78 #endif
DAQ key hit.
Definition: JDAQKeyHit.hh:19
Auxiliary class to uniquely identify PMT readout channel.
Definition: JPMTChannel.hh:30
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:68
Detector data structure.
Definition: JDetector.hh:89
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:75
Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structur...
Detector file.
Definition: JHead.hh:196
JDAQHitRouter(const JDetector &detector)
Constructor.
Data structure for PMT geometry, calibration and status.
Definition: JPMT.hh:43
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:173
Direct access to module in detector data structure.
const JPMT & getPMT(const JDAQKeyHit &hit) const
Get PMT parameters.
JPMTChannel getPMTChannel(const JDAQKeyHit &hit) const
Get PMT channel.