#ifndef __JTRIGGEROUTPUT__ #define __JTRIGGEROUTPUT__ #include #include #include "JTrigger/JEvent.hh" /** * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { /** * Set of triggered events. */ class JTriggerOutput : public std::vector { public: /** * Default constructor. */ JTriggerOutput() : std::vector() {} /** * Merge events. * * \param match match criterion */ template inline void merge(const JMatch_t& match) { std::sort(this->begin(), this->end()); iterator out = this->begin(); for (iterator i = this->begin(); i != this->end(); ++out) { if (out != i) { *out = *i; // copy event } while (++i != this->end() && match(*out,*i)) { out->merge(*i); // merge event } } this->erase(out, this->end()); } }; } #endif