Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
externals/km3net-dataformat/src/JDAQTimeslice.cc
Go to the documentation of this file.
1#include <map>
2#include <vector>
3#include <algorithm>
4
8
9
10/**
11 * \author mdejong
12 */
13
14namespace KM3NETDAQ {
15
16 /**
17 * Constructor.
18 *
19 * \param event DAQ event
20 * \param snapshot use shapshot hits (else use triggered hits)
21 */
23 const bool snapshot) :
25 JDAQTimesliceHeader(event.getDAQChronometer()),
27 {
28 using namespace std;
29
31
32 if (snapshot) {
33
35 buffer[hit->getModuleID()].push_back(*hit);
36 }
37
38 } else {
39
41 buffer[hit->getModuleID()].push_back(*hit);
42 }
43 }
44
45
46 for (map<int, vector<JDAQHit> >::iterator entry = buffer.begin(); entry != buffer.end(); ++entry) {
47
48 sort(entry->second.begin(), entry->second.end());
49
51
52 this->rbegin()->add(entry->second.size(), entry->second.data());
53 }
54 }
55
56
57 /**
58 * Constructor.
59 *
60 * \param event DAQ event
61 * \param summary summary
62 * \param snapshot use shapshot hits (else use triggered hits)
63 */
65 const JDAQSummaryslice& summary,
66 const bool snapshot) :
68 JDAQTimesliceHeader(event.getDAQChronometer()),
70 {
71 using namespace std;
72 using namespace JPP;
73
75
76 if (snapshot) {
77
79 buffer[hit->getModuleID()].push_back(*hit);
80 }
81
82 } else {
83
85 buffer[hit->getModuleID()].push_back(*hit);
86 }
87 }
88
90
91 for (JDAQSummaryslice::const_iterator i = summary.begin(); i != summary.end(); ++i) {
92 sumo[i->getModuleID()] = i->getDAQFrameStatus();
93 }
94
95 for (map<int, vector<JDAQHit> >::iterator entry = buffer.begin(); entry != buffer.end(); ++entry) {
96
97 sort(entry->second.begin(), entry->second.end());
98
100
102
103 if (ps != sumo.end()) {
104 status = ps->second;
105 }
106
107 this->push_back(JDAQSuperFrame(JDAQSuperFrameHeader(getDAQChronometer(), entry->first, status)));
108
109 this->rbegin()->add(entry->second.size(), entry->second.data());
110 }
111 }
112}
Template definition of a multi-dimensional oscillation probability interpolation table.
const JDAQChronometer & getDAQChronometer() const
Get DAQ chronometer.
const_iterator< T > begin() const
Get begin of data.
static const JDAQFrameStatus & getInstance()
Get reference to unique instance of this class object.
Data frame of one optical module.
JDAQTimeslice()
Default constructor.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Auxiliary class for a DAQ type holder.