#ifndef __JDETECTOR__JDAQHITROUTER__ #define __JDETECTOR__JDAQHITROUTER__ #include "JDetector/JModuleRouter.hh" #include "JDetector/JPMTChannel.hh" #include "km3net-dataformat/online/JDAQKeyHit.hh" /** * \file * Direct access to PMT data in detector data structure for DAQ hits. * \author mdejong */ namespace JDETECTOR {} namespace JPP { using namespace JDETECTOR; } namespace JDETECTOR { using KM3NETDAQ::JDAQKeyHit; /** * Simple wrapper around JModuleRouter class for direct addressing of PMT data in detector data structure for DAQ hits. */ class JDAQHitRouter : public JModuleRouter { public: using JModuleRouter::getModule; /** * Constructor. * * \param detector detector */ JDAQHitRouter(const JDetector& detector) : JModuleRouter(detector) {} /** * Get module parameters. * * \param hit hit * \return module parameters */ const JModule& getModule(const JDAQKeyHit& hit) const { return getModule(hit.getModuleID()); } /** * Get PMT parameters. * * \param hit hit * \return PMT parameters */ const JPMT& getPMT(const JDAQKeyHit& hit) const { return getModule(hit).getPMT(hit.getPMT()); } /** * Get PMT channel. * * \param hit hit * \return PMT channel */ JPMTChannel getPMTChannel(const JDAQKeyHit& hit) const { return JPMTChannel(getModule(hit).getLocation(), hit.getPMT()); } }; } #endif