Jpp 20.0.0-72-g597b30bc9
the software that should make you happy
Loading...
Searching...
No Matches
JCLBRunByRunSimulator.hh
Go to the documentation of this file.
1#ifndef __JTRIGGER__JCLBRUNBYRUNSIMULATOR__
2#define __JTRIGGER__JCLBRUNBYRUNSIMULATOR__
3
6
10
11
12/**
13 * \author mdejong
14 */
15
16namespace JTRIGGER {}
17namespace JPP { using namespace JTRIGGER; }
18
19namespace JTRIGGER {
20
24
25
26 /**
27 * CLB simulation based on run-by-run information.
28 *
29 * This class overwrites the method JCLBDefaultSimulator::getHighRateVeto.
30 * The actual high-rate veto is obtained from summary data.
31 */
34 {
35 public:
36 /**
37 * Constructor.
38 *
39 * \param router summary router
40 */
45
46
47 /**
48 * Get number of received UDP packets.
49 *
50 * \param id module identifier
51 * \return number of received UDP packets
52 */
53 virtual int getUDPNumberOfReceivedPackets(const JModuleIdentifier& id) const override
54 {
55 using namespace KM3NETDAQ;
56
57 if (summary_router.hasSummaryFrame(id.getID())) {
58
59 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getID());
60
61 return frame.getUDPNumberOfReceivedPackets();
62 }
63
65 }
66
67
68 /**
69 * Get maximal sequence number of UDP packet.
70 *
71 * \param id module identifier
72 * \return maximal sequence number
73 */
74 virtual int getUDPMaximalSequenceNumber(const JModuleIdentifier& id) const override
75 {
76 using namespace KM3NETDAQ;
77
78 if (summary_router.hasSummaryFrame(id.getID())) {
79
80 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getID());
81
82 return frame.getUDPMaximalSequenceNumber();
83 }
84
86 }
87
88
89 /**
90 * Get UDP trailer status.
91 *
92 * \param id module identifier
93 * \return true
94 */
95 virtual bool hasUDPTrailer(const JModuleIdentifier& id) const override
96 {
97 using namespace KM3NETDAQ;
98
99 if (summary_router.hasSummaryFrame(id.getID())) {
100
101 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getID());
102
103 return frame.hasUDPTrailer();
104 }
105
107 }
108
109
110 /**
111 * Set high-rate veto based on number of hits.
112 *
113 * \return false
114 */
115 virtual bool setHighRateVeto() const
116 {
117 return false;
118 }
119
120
121 /**
122 * Apply high-rate veto based on number of hits.
123 *
124 * \return false
125 */
126 virtual bool applyHighRateVeto() const
127 {
128 return false;
129 }
130
131
132 /**
133 * Get high-rate veto of given PMT.
134 *
135 * \param id PMT identifier
136 * \return true if high-rate veto; else false
137 */
138 virtual bool getHighRateVeto(const JPMTIdentifier& id) const override
139 {
140 using namespace KM3NETDAQ;
141
142 if (summary_router.hasSummaryFrame(id.getModuleID())) {
143
144 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getModuleID());
145
146 return frame.testHighRateVeto(id.getPMTAddress());
147 }
148
150 }
151
152
153 /**
154 * Get FIFO (almost) full of given PMT.
155 *
156 * \param id PMT identifier
157 * \return true if FIFO (almost) full; else false
158 */
159 virtual bool getFIFOStatus(const JPMTIdentifier& id) const override
160 {
161 using namespace KM3NETDAQ;
162
163 if (summary_router.hasSummaryFrame(id.getModuleID())) {
164
165 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getModuleID());
166
167 return frame.testFIFOStatus(id.getPMTAddress());
168 }
169
171 }
172
173
174 /**
175 * Check if CLB exist.
176 *
177 * \param id module identifier
178 * \return true if summary data available; else false
179 */
180 virtual bool hasCLB(const JModuleIdentifier& id) const
181 {
182 return summary_router.hasSummaryFrame(id.getID());
183 }
184
185
186 protected:
188 };
189}
190
191#endif
virtual bool getFIFOStatus(const JPMTIdentifier &id) const
Get FIFO (almost) full of given PMT.
virtual bool hasUDPTrailer(const JModuleIdentifier &id) const
Get UDP trailer status.
virtual int getUDPMaximalSequenceNumber(const JModuleIdentifier &id) const
Get maximal sequence number of UDP packet.
virtual int getUDPNumberOfReceivedPackets(const JModuleIdentifier &id) const
Get number of received UDP packets.
virtual bool getHighRateVeto(const JPMTIdentifier &id) const
Get high-rate veto of given PMT.
Auxiliary class for object identification.
Definition JObjectID.hh:25
CLB simulation based on run-by-run information.
virtual bool applyHighRateVeto() const
Apply high-rate veto based on number of hits.
virtual bool hasCLB(const JModuleIdentifier &id) const
Check if CLB exist.
virtual bool getHighRateVeto(const JPMTIdentifier &id) const override
Get high-rate veto of given PMT.
virtual bool setHighRateVeto() const
Set high-rate veto based on number of hits.
virtual int getUDPNumberOfReceivedPackets(const JModuleIdentifier &id) const override
Get number of received UDP packets.
virtual bool getFIFOStatus(const JPMTIdentifier &id) const override
Get FIFO (almost) full of given PMT.
JCLBRunByRunSimulator(const JSummaryRouter &router)
Constructor.
virtual int getUDPMaximalSequenceNumber(const JModuleIdentifier &id) const override
Get maximal sequence number of UDP packet.
virtual bool hasUDPTrailer(const JModuleIdentifier &id) const override
Get UDP trailer status.
Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the op...
bool hasSummaryFrame(const JDAQModuleIdentifier &module) const
Has summary frame.
const JDAQSummaryFrame & getSummaryFrame(const JDAQModuleIdentifier &module) const
Get summary frame.
bool testFIFOStatus() const
Test FIFO status.
int getUDPNumberOfReceivedPackets() const
Get number of received UDP packets.
bool hasUDPTrailer() const
Get UDP trailer status.
bool testHighRateVeto() const
Test high-rate veto status.
int getUDPMaximalSequenceNumber() const
Get maximal sequence number of UDP packet.
Data storage class for rate measurements of all PMTs in one module.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39