Jpp  master_rocky-43-ge265d140c
the software that should make you happy
JSuperFrame1D.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JSUPERFRAME1D__
2 #define __JTRIGGER__JSUPERFRAME1D__
3 
4 #include <vector>
5 
7 #include "JDetector/JModule.hh"
8 #include "JTools/JMergeSort.hh"
10 #include "JTrigger/JFrame_t.hh"
12 
13 
14 
15 /**
16  * \author mdejong
17  */
18 
19 namespace JTRIGGER {}
20 namespace JPP { using namespace JTRIGGER; }
21 
22 namespace JTRIGGER {
23 
25  using JDETECTOR::JModule;
26 
27 
28  /**
29  * 1-dimensional frame with time calibrated data from one optical module.
30  *
31  * This class can be used to merge the data from different PMTs contained in a JSuperFrame2D object.\n
32  * The data will then be time sorted.
33  *
34  * The static data member JSuperFrame1D::multiplex can be used as an I/O buffer.
35  */
36  template<class JElement_t, class JAllocator_t = std::allocator<JElement_t> >
37  class JSuperFrame1D :
38  public JModuleHeader,
39  public JFrame_t<JElement_t, JAllocator_t>
40  {
41  public:
42 
44 
45 
46  /**
47  * Default constructor.
48  */
50  {}
51 
52 
53  /**
54  * Constructor.
55  *
56  * \param chronometer DAQ chronometer
57  * \param id module identifier
58  * \param pos module position
59  */
60  JSuperFrame1D(const JDAQChronometer& chronometer,
61  const JDAQModuleIdentifier& id,
62  const JPosition3D& pos) :
63  JModuleHeader(chronometer, id, pos)
64  {}
65 
66 
67  /**
68  * Constructor.
69  *
70  * \param input 2D super frame
71  */
74  {
75  merge(input.begin(), input.end(), *this, this->getToolkit());
76  }
77 
78 
79  /**
80  * Process 2D super frame.
81  *
82  * The data are sorted in time and an appropriate end marker is added.
83  *
84  * \param input 2D super frame
85  * \return this 1D super frame
86  */
88  {
89  this->setModuleHeader(input.getModuleHeader());
90 
91  merge(input.begin(), input.end(), static_cast<std::vector<JElement_t, JAllocator_t>&>(*this), this->getToolkit());
92 
93  return *this;
94  }
95 
96 
97  /**
98  * Process set of 2D super frame data.
99  *
100  * The data are sorted in time and an appropriate end marker is added.
101  * Note that this method only updates the data in the container.
102  *
103  * \param __begin begin of 2D super frame data
104  * \param __end end of 2D super frame data
105  * \return this 1D super frame
106  */
109  {
110  merge(__begin, __end, static_cast<std::vector<JElement_t, JAllocator_t>&>(*this), this->getToolkit());
111 
112  return *this;
113  }
114 
115 
116  /**
117  * Process DAQ super frame.
118  *
119  * The time calibration is applied, data are sorted in time and an appropriate end marker is added.
120  *
121  * \param input DAQ super frame
122  * \param module module data
123  * \return this 1D super frame
124  */
126  const JModule& module)
127  {
128  return (*this)(buffer(input, module));
129  }
130 
131 
132  /**
133  * Multiplexer.
134  */
136 
137 
138  private:
141  };
142 
143 
144  /**
145  * Internal merge method.
146  */
147  template<class JElement_t, class JAllocator_t>
149 
150 
151  /**
152  * Internal buffer.
153  */
154  template<class JElement_t, class JAllocator_t>
156 
157 
158  /**
159  * Multiplexer.
160  */
161  template<class JElement_t, class JAllocator_t>
163 }
164 
165 #endif
Data structure for optical module.
Data structure for a composite optical module.
Definition: JModule.hh:75
Data structure for position in three dimensions.
Definition: JPosition3D.hh:38
This class implements a merge and sort algorithm based on the divide-and-conquer concept.
Definition: JMergeSort.hh:50
Data frame with end marker.
Definition: JFrame_t.hh:30
1-dimensional frame with time calibrated data from one optical module.
JSuperFrame1D & operator()(typename JSuperFrame2D< JElement_t >::const_iterator __begin, typename JSuperFrame2D< JElement_t >::const_iterator __end)
Process set of 2D super frame data.
JFrame_t< JElement_t, JAllocator_t > container_type
static JSuperFrame1D< JElement_t, JAllocator_t > multiplex
Multiplexer.
JSuperFrame1D & operator()(const JDAQSuperFrame &input, const JModule &module)
Process DAQ super frame.
JSuperFrame1D(const JDAQChronometer &chronometer, const JDAQModuleIdentifier &id, const JPosition3D &pos)
Constructor.
JSuperFrame1D & operator()(const JSuperFrame2D< JElement_t > &input)
Process 2D super frame.
JSuperFrame1D()
Default constructor.
static JSuperFrame2D< JElement_t > buffer
Internal buffer.
static JTOOLS::JMergeSort< JElement_t > merge
Internal merge method.
JSuperFrame1D(const JSuperFrame2D< JElement_t > &input)
Constructor.
2-dimensional frame with time calibrated data from one optical module.
std::vector< value_type >::const_iterator const_iterator
Data frame of one optical module.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
Header for Module.
void setModuleHeader(const JModuleHeader &header)
Set module header.
const JModuleHeader & getModuleHeader() const
Get module header.