Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
17 namespace JTRIGGER {}
18 namespace JPP { using namespace JTRIGGER; }
19 
20 namespace 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 
39 
40 
41  /**
42  * Default constructor.
43  */
45  JModuleHeader(),
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) :
74  JModuleHeader(),
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  */
106  void lower_bound(argument_type hit) const
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  */
119  void fast_forward(argument_type hit) const
120  {
121  for (const_iterator i = this->begin(); i != this->end(); ++i) {
122  i->fast_forward(hit);
123  }
124  }
125  };
126 }
127 
128 #endif
JLANG::JClass< JElement_t >::argument_type argument_type
std::vector< value_type >::const_iterator const_iterator
void lower_bound(argument_type hit) const
Set the internal iterators to the lower bounds corresponding to the time of the given hit...
Clone of JSuperFrame2D.
std::vector< value_type >::reverse_iterator reverse_iterator
Tools for handling different hit types.
JSuperFrameClone2D()
Default constructor.
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
std::vector< value_type >::const_reverse_iterator const_reverse_iterator
JSuperFrameClone2D(T __begin, T __end)
Constructor.
void setModuleHeader(const JModuleHeader &header)
Set module header.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Clone of JFrame.
Definition: JFrameClone.hh:22
std::vector< value_type >::iterator iterator
const JModuleHeader & getModuleHeader() const
Get module header.
JFrameClone< JElement_t > value_type
Header for Module.
JSuperFrameClone2D(const JSuperFrame2D< JElement_t > &input)
Constructor.
void fast_forward(argument_type hit) const
Increment the internal iterators until the lower bounds corresponding to the time of the given hit...
void rewind() const
Rewind internal iterators.
Template definition of hit toolkit.
Definition: JHitToolkit.hh:60
JModuleHeader()
Default constructor.