#ifndef __JSUPERFRAMECLONE__ #define __JSUPERFRAMECLONE__ #include #include "JTrigger/JSuperFrame.hh" #include "JTrigger/JFrameClone.hh" #include "JTrigger/JHitToolkit.hh" #include "JGeometry3D/JMatrix3D.hh" #include "JGeometry3D/JRotation3D.hh" namespace JTRIGGER { namespace { using JGEOMETRY3D::JMatrix3D; using JGEOMETRY3D::JRotation3D; } /** * Clone of JSuperFrame. */ template class JSuperFrameClone : public JDAQSuperFrameHeader, public std::vector< JFrameClone >, public JHitToolkit { public: typedef typename std::vector< JFrameClone >::iterator iterator; typedef typename std::vector< JFrameClone >::const_iterator const_iterator; /** * Default constructor. */ JSuperFrameClone() : JDAQSuperFrameHeader(), std::vector< JFrameClone >() {} /** * Constructor. * * \param super_frame super frame */ JSuperFrameClone(const JSuperFrame& super_frame) : JDAQSuperFrameHeader(super_frame.getDAQSuperFrameHeader()), std::vector< JFrameClone >(super_frame.size()) { iterator out = this->begin(); for (typename JSuperFrame::const_iterator i = super_frame.begin(); i != super_frame.end(); ++i, ++out) *out = JFrameClone(*i); } /** * Transform. * * \param R matrix */ JSuperFrameClone& transform(const JMatrix3D& R) { for (iterator i = this->begin(); i != this->end(); ++i) i->transform(R); return *this; } /** * Rotate. * * \param R rotation matrix */ JSuperFrameClone& rotate(const JRotation3D& R) { for (iterator i = this->begin(); i != this->end(); ++i) i->rotate(R); return *this; } /** * Rotate back. * * \param R rotation matrix */ JSuperFrameClone& rotate_back(const JRotation3D& R) { for (iterator i = this->begin(); i != this->end(); ++i) i->rotate_back(R); return *this; } /** * Rewind internal iterators. */ inline void rewind() const { for (const_iterator i = this->begin(); i != this->end(); ++i) i->rewind(); } /** * Set the internal pointers of this frame to the lower bounds corresponding to the given time. * * \param t time offset [ns] */ void lower_bound(const double t) const { for (const_iterator i = this->begin(); i != this->end(); ++i) i->lower_bound(t); } /** * Set the internal pointers of this frame to the lower bounds corresponding to the given time. * * \param t time offset [ns] */ void fast_forward(const double t) const { for (const_iterator i = this->begin(); i != this->end(); ++i) i->fast_forward(t); } }; } #endif