Jpp
JTimesliceClone.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JTIMESLICECLONE__
2 #define __JTRIGGER__JTIMESLICECLONE__
3 
4 #include <vector>
5 
7 #include "JTrigger/JTimeslice.hh"
9 #include "JLang/JClass.hh"
10 #include "JGeometry3D/JMatrix3D.hh"
13 
14 
15 /**
16  * \author mdejong
17  */
18 
19 namespace JTRIGGER {}
20 namespace JPP { using namespace JTRIGGER; }
21 
22 namespace JTRIGGER {
23 
27 
28 
29  /**
30  * Clone of JTimeslice.
31  */
32  template<class JElement_t>
34  public std::vector< JSuperFrameClone1D<JElement_t> >,
35  public JHitToolkit<JElement_t>
36  {
37  public:
38 
45 
46 
47  /**
48  * Default constructor.
49  */
51  {}
52 
53 
54  /**
55  * Constructor.
56  *
57  * The cloned data are organised according the input time slice.
58  *
59  * \param input super frame
60  */
62  {
63  for (typename JTimeslice<JElement_t>::const_iterator i = input.begin(); i != input.end(); ++i) {
64  this->push_back(JSuperFrameClone1D<JElement_t>(*i));
65  }
66  }
67 
68 
69  /**
70  * Constructor.
71  *
72  * The cloned data are organised according the module router.
73  *
74  * \param input super frame
75  * \param router module router
76  */
78  const JModuleRouter& router)
79  {
80  this->resize(router.getReference().size());
81 
82  for (typename JTimeslice<JElement_t>::const_iterator i = input.begin(); i != input.end(); ++i) {
83  (*this)[router.getAddress(i->getModuleID()).first] = JSuperFrameClone1D<JElement_t>(*i);
84  }
85 
86  // add end marker to empty frames
87 
88  if (buffer.empty()) {
89  buffer.push_back(this->getEndMarker());
90  }
91 
92  for (iterator i = this->begin(); i != this->end(); ++i) {
93  if (i->empty()) {
95  }
96  }
97  }
98 
99 
100  /**
101  * Transform.
102  *
103  * \param R matrix
104  */
106  {
107  for (iterator i = this->begin(); i != this->end(); ++i) {
108  i->transform(R);
109  }
110 
111  return *this;
112  }
113 
114 
115  /**
116  * Rotate.
117  *
118  * \param R rotation matrix
119  */
121  {
122  for (iterator i = this->begin(); i != this->end(); ++i) {
123  i->rotate(R);
124  }
125 
126  return *this;
127  }
128 
129 
130  /**
131  * Rotate back.
132  *
133  * \param R rotation matrix
134  */
136  {
137  for (iterator i = this->begin(); i != this->end(); ++i) {
138  i->rotate_back(R);
139  }
140 
141  return *this;
142  }
143 
144 
145  /**
146  * Rewind internal iterators.
147  */
148  inline void rewind() const
149  {
150  for (const_iterator i = this->begin(); i != this->end(); ++i) {
151  i->rewind();
152  }
153  }
154 
155 
156  /**
157  * Set the internal iterators to the lower bounds corresponding to the time of the given hit.
158  *
159  * \param hit hit
160  */
161  void lower_bound(argument_type hit) const
162  {
163  for (const_iterator i = this->begin(); i != this->end(); ++i) {
164  i->lower_bound(hit);
165  }
166  }
167 
168 
169  /**
170  * Increment the internal iterators until the lower bounds corresponding to the time of the given hit.
171  *
172  * \param hit hit
173  */
174  void fast_forward(argument_type hit) const
175  {
176  for (const_iterator i = this->begin(); i != this->end(); ++i) {
177  i->fast_forward(hit);
178  }
179  }
180 
181  private:
183  };
184 
185 
186  /**
187  */
188  template<class JElement_t>
190 }
191 
192 #endif
JTRIGGER::JHitToolkit
Template definition of hit toolkit.
Definition: JHitToolkit.hh:60
JTRIGGER::JTimesliceClone::JTimesliceClone
JTimesliceClone(const JTimeslice< JElement_t > &input)
Constructor.
Definition: JTimesliceClone.hh:61
JTRIGGER::JTimesliceClone::const_reverse_iterator
std::vector< value_type >::const_reverse_iterator const_reverse_iterator
Definition: JTimesliceClone.hh:44
JTRIGGER::JTimesliceClone::fast_forward
void fast_forward(argument_type hit) const
Increment the internal iterators until the lower bounds corresponding to the time of the given hit.
Definition: JTimesliceClone.hh:174
JTRIGGER::JTimesliceClone::reverse_iterator
std::vector< value_type >::reverse_iterator reverse_iterator
Definition: JTimesliceClone.hh:43
JTimeslice.hh
JMATH::JMatrix3D
3 x 3 matrix
Definition: JMath/JMatrix3D.hh:32
JTRIGGER::JTimesliceClone::iterator
std::vector< value_type >::iterator iterator
Definition: JTimesliceClone.hh:41
JTRIGGER::JSuperFrame1D< JElement_t >
JLANG::JClass::argument_type
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
std::vector
Definition: JSTDTypes.hh:12
JTRIGGER::JTimesliceClone::JTimesliceClone
JTimesliceClone()
Default constructor.
Definition: JTimesliceClone.hh:50
JTRIGGER::JTimesliceClone::value_type
JSuperFrameClone1D< JElement_t > value_type
Definition: JTimesliceClone.hh:40
JTRIGGER::JTimesliceClone::buffer
static JSuperFrame1D< JElement_t > buffer
Definition: JTimesliceClone.hh:182
JTRIGGER::JTimesliceClone::lower_bound
void lower_bound(argument_type hit) const
Set the internal iterators to the lower bounds corresponding to the time of the given hit.
Definition: JTimesliceClone.hh:161
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTRIGGER::JTimesliceClone::transform
JTimesliceClone< JElement_t > & transform(const JMatrix3D &R)
Transform.
Definition: JTimesliceClone.hh:105
JLANG::JReference::getReference
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
JHitToolkit.hh
JTRIGGER::JTimeslice
Time slice with calibrated data.
Definition: JTimeslice.hh:26
JModuleRouter.hh
JTRIGGER::JTimesliceClone::const_iterator
std::vector< value_type >::const_iterator const_iterator
Definition: JTimesliceClone.hh:42
JTRIGGER::JTimesliceClone::JTimesliceClone
JTimesliceClone(const JTimeslice< JElement_t > &input, const JModuleRouter &router)
Constructor.
Definition: JTimesliceClone.hh:77
JDETECTOR::JModuleRouter
Router for direct addressing of module data in detector data structure.
Definition: JModuleRouter.hh:34
JTRIGGER::JTimeslice::const_iterator
std::vector< value_type >::const_iterator const_iterator
Definition: JTimeslice.hh:34
JTRIGGER::JTimesliceClone
Clone of JTimeslice.
Definition: JTimesliceClone.hh:33
JDETECTOR::JModuleRouter::getAddress
const JModuleAddress & getAddress(const JObjectID &id) const
Get address of module.
Definition: JModuleRouter.hh:77
JTRIGGER::JTimesliceClone::rotate_back
JTimesliceClone< JElement_t > & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JTimesliceClone.hh:135
JRotation3D.hh
JMatrix3D.hh
JClass.hh
JTRIGGER
Checksum.
Definition: JSupport/JSupport.hh:35
JTRIGGER::JTimesliceClone::rewind
void rewind() const
Rewind internal iterators.
Definition: JTimesliceClone.hh:148
JSuperFrameClone1D.hh
JTRIGGER::JTimesliceClone::argument_type
JLANG::JClass< JElement_t >::argument_type argument_type
Definition: JTimesliceClone.hh:39
JTRIGGER::JSuperFrameClone1D
Clone of JSuperFrame1D.
Definition: JSuperFrameClone1D.hh:22
JGEOMETRY3D::JRotation3D
Rotation matrix.
Definition: JRotation3D.hh:111
JTRIGGER::JTimesliceClone::rotate
JTimesliceClone< JElement_t > & rotate(const JRotation3D &R)
Rotate.
Definition: JTimesliceClone.hh:120