#ifndef __JTRIGGER__JHITR0__ #define __JTRIGGER__JHITR0__ #include "JTrigger/JHit.hh" #include "km3net-dataformat/online/JDAQHit.hh" /** * \file * * Basic data structure for L0 hit. * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { using KM3NETDAQ::JDAQHit; /** * Reduced data structure for L0 hit. */ class JHitR0 : public JHit { public: typedef JDAQHit::JPMT_t JPMT_t; //!< PMT channel in FPGA /** * Default constructor. */ JHitR0() : JHit(), pmt (0) {} /** * Constructor. * * \param id PMT identifier * \param hit hit */ JHitR0(const JPMT_t& id, const JHit& hit) : JHit(hit), pmt (id) {} /** * Get PMT. * * \return PMT */ inline JPMT_t getPMT() const { return pmt; } /** * Get count. * * \return count */ inline int getN() const { return 1; } /** * Get weight.\n * The returned weight is set to one. * * \return 1 */ inline double getW() const { return 1.0; } /** * Auxiliary data structure for sorting of hits. */ static const struct compare { /** * Compare hits by PMT and time. * * \param first first hit * \param second second hit * \return true if first before second; else false */ bool operator()(const JHitR0& first, const JHitR0& second) const { if (first.getPMT() == second.getPMT()) return first.getT() < second.getT(); else return first.getPMT() < second.getPMT(); } } compare; protected: JPMT_t pmt; //!< PMT readout channel in FPGA }; } #endif