Jpp 20.0.0-27-g39925593c-D
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 * Get high-rate veto of given PMT.
123 *
124 * \param id PMT identifier
125 * \return true if high-rate veto; else false
126 */
127 virtual bool getHighRateVeto(const JPMTIdentifier& id) const override
128 {
129 using namespace KM3NETDAQ;
130
131 if (summary_router.hasSummaryFrame(id.getModuleID())) {
132
133 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getModuleID());
134
135 return frame.testHighRateVeto(id.getPMTAddress());
136 }
137
139 }
140
141
142 /**
143 * Get FIFO (almost) full of given PMT.
144 *
145 * \param id PMT identifier
146 * \return true if FIFO (almost) full; else false
147 */
148 virtual bool getFIFOStatus(const JPMTIdentifier& id) const override
149 {
150 using namespace KM3NETDAQ;
151
152 if (summary_router.hasSummaryFrame(id.getModuleID())) {
153
154 const JDAQSummaryFrame& frame = summary_router.getSummaryFrame(id.getModuleID());
155
156 return frame.testFIFOStatus(id.getPMTAddress());
157 }
158
160 }
161
162
163 /**
164 * Check if CLB exist.
165 *
166 * \param id module identifier
167 * \return true if summary data available; else false
168 */
169 virtual bool hasCLB(const JModuleIdentifier& id) const
170 {
171 return summary_router.hasSummaryFrame(id.getID());
172 }
173
174
175 protected:
177 };
178}
179
180#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 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 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