Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JTriggerInput.hh
Go to the documentation of this file.
1#ifndef __JTRIGGER__JTRIGGERINPUT__
2#define __JTRIGGER__JTRIGGERINPUT__
3
4#include <vector>
5#include <algorithm>
6
9#include "JTrigger/JHitR1.hh"
12
13
14/**
15 * \author mdejong
16 */
17
18namespace JTRIGGER {}
19namespace JPP { using namespace JTRIGGER; }
20
21namespace JTRIGGER {
22
24
25
26 /**
27 * Data structure for input to trigger algorithm.
28 *
29 * The input data for the trigger are time ordered and contain an end marker.
30 * The member methods <tt>size()</tt> and <tt>end()</tt> refer to the position before the end marker.
31 */
33 public JDAQChronometer,
34 public std::vector<JHitR1>,
35 public JHitToolkit<JHit>
36 {
37 public:
38 /**
39 * Constructor.
40 *
41 * \param input input data
42 */
43 template<class JHit_t>
46 std::vector<JHitR1>()
47 {
48 size_t n = 0;
49
50 for (typename JTimeslice<JHit_t>::const_iterator frame = input.begin(); frame != input.end(); ++frame) {
51 n += frame->size();
52 }
53
54 this->reserve(n + 1); // reserve space for end marker
55 this->resize (n + 0); // reserve space for data
56
57 std::vector<JHitR1>::iterator out = this->begin();
58
59 for (typename JTimeslice<JHit_t>::const_iterator frame = input.begin(); frame != input.end(); ++frame) {
60
61 const JDAQModuleIdentifier& id = frame->getModuleID();
62 const JPosition3D& pos = frame->getPosition();
63
64 for (typename JFrame<JHit_t>::const_iterator i = frame->begin(); i != frame->end(); ++i, ++out) {
65 *out = JHitR1(id, pos, getJHit(*i));
66 }
67 }
68
69 *out = JHitR1(JDAQPMTIdentifier(), JPosition3D(), getEndMarker());
70
71 std::sort(this->begin(), this->end(), getToolkit());
72 }
73 };
74}
75
76#endif
Reduced data structure for L1 hit.
Tools for handling different hit types.
Data structure for position in three dimensions.
Reduced data structure for L1 hit.
Definition JHitR1.hh:35
Time slice with calibrated data.
Definition JTimeslice.hh:29
std::vector< value_type >::const_iterator const_iterator
Definition JTimeslice.hh:34
Data structure for input to trigger algorithm.
JTriggerInput(const JTimeslice< JHit_t > &input)
Constructor.
const JDAQChronometer & getDAQChronometer() const
Get DAQ chronometer.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const int n
Definition JPolint.hh:791
for(int i=n/2;i !=0 &&p !=this->end();--i,++p)
Definition JPolint.hh:793
Auxiliary classes and methods for triggering.
Template definition of hit toolkit.