Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
std::vector< value_type >::const_iterator const_iterator
Definition: JTimeslice.hh:34
std::vector< value_type >::reverse_iterator reverse_iterator
JTimesliceClone< JElement_t > & transform(const JMatrix3D &R)
Transform.
JLANG::JClass< JElement_t >::argument_type argument_type
std::vector< value_type >::const_reverse_iterator const_reverse_iterator
3 x 3 matrix
Router for direct addressing of module data in detector data structure.
Rotation matrix.
Definition: JRotation3D.hh:111
JTimesliceClone< JElement_t > & rotate(const JRotation3D &R)
Rotate.
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.
Tools for handling different hit types.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
JTimesliceClone(const JTimeslice< JElement_t > &input)
Constructor.
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
std::vector< value_type >::iterator iterator
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
Direct access to module in detector data structure.
std::vector< value_type >::const_iterator const_iterator
JTimesliceClone()
Default constructor.
const JClass_t & getReference() const
Get reference to object.
Definition: JReference.hh:38
Clone of JTimeslice.
const JModuleAddress & getAddress(const JObjectID &id) const
Get address of module.
JSuperFrameClone1D< JElement_t > value_type
Template definition of hit toolkit.
Definition: JHitToolkit.hh:60
JTimesliceClone(const JTimeslice< JElement_t > &input, const JModuleRouter &router)
Constructor.
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 JSuperFrame1D.
static JSuperFrame1D< JElement_t > buffer
JTimesliceClone< JElement_t > & rotate_back(const JRotation3D &R)
Rotate back.
Time slice with calibrated data.
Definition: JTimeslice.hh:26