#ifndef __JANTCC__ #define __JANTCC__ #include #include #include "antcc/Hit.hh" #include "antcc/Event.hh" #include "JDetector/JTimeRange.hh" namespace JSIRENE { /** * Enumeration of hit types. */ enum JHitType_t { HIT_TYPE_MUON_DIRECT = +5, HIT_TYPE_MUON_SCATTERED = -5, HIT_TYPE_SHOWER_DIRECT = +3, HIT_TYPE_SHOWER_SCATTERED = -3, HIT_TYPE_NOISE = -1 }; /** * Get true time of hit. * * \param hit hit * \return true time of hit */ inline double getTime(const Hit& hit) { // if IGAIN = 0 in km3 program, then pure_xx values are not set. if (hit.pure_npe() == 0.0) return hit.dt(); else return hit.pure_dt(); } /** * Get true charge of hit. * * \param hit hit * \return true charge of hit */ inline double getNPE(const Hit& hit) { // if IGAIN = 0 in km3 program, then pure_xx values are not set. if (hit.pure_npe() == 0.0) return hit.npe(); else return hit.pure_npe(); } /** * Verify hit origin. * * \param hit hit * \return true if noise; else false */ inline bool is_noise(const Hit& hit) { return hit.type() == HIT_TYPE_NOISE; } /** * Get time range (i.e. earlist and latest hit time) of Monte Carlo event. * Note that the global event time in not taken into account. * * \param event Event * \return time range */ inline JTimeRange getTimeRange(const Event& event) { JTimeRange timeRange(JTimeRange::JDEFAULT_RANGE); for (std::vector::const_iterator hit = event.HitList().begin(); hit != event.HitList().end(); ++hit) timeRange.include(getTime(*hit)); return timeRange; } } #endif