#ifndef __JTRIGGER__JHITL0__ #define __JTRIGGER__JHITL0__ #include "km3net-dataformat/online/JDAQPMTIdentifier.hh" #include "JGeometry3D/JAxis3D.hh" #include "JTrigger/JHit.hh" /** * \file * * Basic data structure for L0 hit. * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { using KM3NETDAQ::JDAQPMTIdentifier; using JGEOMETRY3D::JAxis3D; /** * Data structure for L0 hit. */ class JHitL0 : public JDAQPMTIdentifier, public JAxis3D, public JHit { public: /** * Default constructor. */ JHitL0() : JDAQPMTIdentifier(), JAxis3D (), JHit () {} /** * Constructor. * * \param pmt PMT identifier * \param axis PMT axis * \param hit hit */ JHitL0(const JDAQPMTIdentifier& pmt, const JAxis3D& axis, const JHit& hit) : JDAQPMTIdentifier(pmt), JAxis3D (axis), JHit (hit) {} /** * 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 identifier and time. * * \param first first hit * \param second second hit * \return true if first before second; else false */ bool operator()(const JHitL0& first, const JHitL0& second) const { if (first.getPMTIdentifier() == second.getPMTIdentifier()) return first.getT() < second.getT(); else return first.getPMTIdentifier() < second.getPMTIdentifier(); } } compare; }; } #endif