#ifndef __JTRIGGER__JSUPERFRAMECLONE2D__ #define __JTRIGGER__JSUPERFRAMECLONE2D__ #include #include "JTrigger/JModuleHeader.hh" #include "JTrigger/JFrameClone.hh" #include "JTrigger/JSuperFrame2D.hh" #include "JTrigger/JHitToolkit.hh" #include "JLang/JClass.hh" /** * \author mdejong */ namespace JTRIGGER {} namespace JPP { using namespace JTRIGGER; } namespace JTRIGGER { /** * Clone of JSuperFrame2D. */ template class JSuperFrameClone2D : public JModuleHeader, public std::vector< JFrameClone >, public JHitToolkit { public: typedef typename JLANG::JClass::argument_type argument_type; typedef JFrameClone value_type; typedef typename std::vector::iterator iterator; typedef typename std::vector::const_iterator const_iterator; typedef typename std::vector::reverse_iterator reverse_iterator; typedef typename std::vector::const_reverse_iterator const_reverse_iterator; /** * Default constructor. */ JSuperFrameClone2D() : JModuleHeader(), std::vector< JFrameClone >() {} /** * Constructor. * * \param input 2-dimensional super frame */ JSuperFrameClone2D(const JSuperFrame2D& input) : JModuleHeader(input.getModuleHeader()), std::vector< JFrameClone >() { for (typename JSuperFrame2D::const_iterator i = input.begin(); i != input.end(); ++i) { this->push_back(JFrameClone(*i)); } } /** * Constructor. * * \param __begin begin of 1D data * \param __end end of 1D data */ template JSuperFrameClone2D(T __begin, T __end) : JModuleHeader(), std::vector< JFrameClone >() { if (__begin != __end) { this->setModuleHeader(JModuleHeader(__begin->getDAQChronometer(), __begin->getModuleIdentifier(), __begin->getPosition())); for (T i = __begin; i != __end; ++i) { this->push_back(JFrameClone(*i)); } } } /** * Rewind internal iterators. */ inline void rewind() const { for (const_iterator i = this->begin(); i != this->end(); ++i) { i->rewind(); } } /** * Set the internal iterators to the lower bounds corresponding to the time of the given hit. * * \param hit hit */ void lower_bound(argument_type hit) const { for (const_iterator i = this->begin(); i != this->end(); ++i) { i->lower_bound(hit); } } /** * Increment the internal iterators until the lower bounds corresponding to the time of the given hit. * * \param hit hit */ void fast_forward(argument_type hit) const { for (const_iterator i = this->begin(); i != this->end(); ++i) { i->fast_forward(hit); } } }; } #endif