#ifndef __JTRIGGER__JEVENTTOOLKIT__ #define __JTRIGGER__JEVENTTOOLKIT__ #include "JTrigger/JEvent.hh" #include "JDetector/JTimeRange.hh" /** * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { using JDETECTOR::JTimeRange; /** * Get time range (i.e.\ earlist and latest hit time) of triggered event. * * \param event event * \return time range */ inline JTimeRange getTimeRange(const JEvent& event) { if (!event.empty()) return JTimeRange(event.begin()->getT(), event.rbegin()->getT()); else return JTimeRange::DEFAULT_RANGE(); } } #endif