Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JSuperFrameClone2D.hh
Go to the documentation of this file.
1#ifndef __JTRIGGER__JSUPERFRAMECLONE2D__
2#define __JTRIGGER__JSUPERFRAMECLONE2D__
3
4#include <vector>
5
10#include "JLang/JClass.hh"
11
12
13/**
14 * \author mdejong
15 */
16
17namespace JTRIGGER {}
18namespace JPP { using namespace JTRIGGER; }
19
20namespace JTRIGGER {
21
22 /**
23 * Clone of JSuperFrame2D.
24 */
25 template<class JElement_t>
27 public JModuleHeader,
28 public std::vector< JFrameClone<JElement_t> >,
29 public JHitToolkit<JElement_t>
30 {
31 public:
32
36 typedef typename std::vector<value_type>::const_iterator const_iterator;
38 typedef typename std::vector<value_type>::const_reverse_iterator const_reverse_iterator;
39
40
41 /**
42 * Default constructor.
43 */
46 std::vector< JFrameClone<JElement_t> >()
47 {}
48
49
50 /**
51 * Constructor.
52 *
53 * \param input 2-dimensional super frame
54 */
57 std::vector< JFrameClone<JElement_t> >()
58 {
59 for (typename JSuperFrame2D<JElement_t>::const_iterator i = input.begin(); i != input.end(); ++i) {
60 this->push_back(JFrameClone<JElement_t>(*i));
61 }
62 }
63
64
65 /**
66 * Constructor.
67 *
68 * \param __begin begin of 1D data
69 * \param __end end of 1D data
70 */
71 template<class T>
73 T __end) :
75 std::vector< JFrameClone<JElement_t> >()
76 {
77 if (__begin != __end) {
78
79 this->setModuleHeader(JModuleHeader(__begin->getDAQChronometer(),
80 __begin->getModuleIdentifier(),
81 __begin->getPosition()));
82
83 for (T i = __begin; i != __end; ++i) {
84 this->push_back(JFrameClone<JElement_t>(*i));
85 }
86 }
87 }
88
89
90 /**
91 * Rewind internal iterators.
92 */
93 inline void rewind() const
94 {
95 for (const_iterator i = this->begin(); i != this->end(); ++i) {
96 i->rewind();
97 }
98 }
99
100
101 /**
102 * Set the internal iterators to the lower bounds corresponding to the time of the given hit.
103 *
104 * \param hit hit
105 */
107 {
108 for (const_iterator i = this->begin(); i != this->end(); ++i) {
109 i->lower_bound(hit);
110 }
111 }
112
113
114 /**
115 * Increment the internal iterators until the lower bounds corresponding to the time of the given hit.
116 *
117 * \param hit hit
118 */
120 {
121 for (const_iterator i = this->begin(); i != this->end(); ++i) {
122 i->fast_forward(hit);
123 }
124 }
125 };
126}
127
128#endif
Tools for handling different hit types.
Clone of JFrame.
2-dimensional frame with time calibrated data from one optical module.
std::vector< value_type >::const_iterator const_iterator
JLANG::JClass< JElement_t >::argument_type argument_type
std::vector< value_type >::reverse_iterator reverse_iterator
JFrameClone< JElement_t > value_type
std::vector< value_type >::iterator iterator
JSuperFrameClone2D(const JSuperFrame2D< JElement_t > &input)
Constructor.
std::vector< value_type >::const_reverse_iterator const_reverse_iterator
void lower_bound(argument_type hit) const
Set the internal iterators to the lower bounds corresponding to the time of the given hit.
JSuperFrameClone2D()
Default constructor.
JSuperFrameClone2D(T __begin, T __end)
Constructor.
std::vector< value_type >::const_iterator const_iterator
void rewind() const
Rewind internal iterators.
void fast_forward(argument_type hit) const
Increment the internal iterators until the lower bounds corresponding to the time of the given hit.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
JArgument< T >::argument_type argument_type
Definition JClass.hh:82
Template definition of hit toolkit.
Header for Module.
JModuleHeader()
Default constructor.
const JModuleHeader & getModuleHeader() const
Get module header.
void setModuleHeader(const JModuleHeader &header)
Set module header.