1#ifndef __JDETECTOR__JCLBDEFAULTSIMULATORINTERFACE__
2#define __JDETECTOR__JCLBDEFAULTSIMULATORINTERFACE__
176 const double Tmin = 0.0;
185 for (
size_t pmt = 0; pmt != input.size(); ++pmt) {
193 if (
hit->t_ns >= Tmin &&
hit->t_ns <= Tmax) {
195 double t1 =
hit->t_ns;
196 double tot =
hit->tot_ns;
209 buffer.push_back(
TDC->makeHit((
JPMT_t) pmt, t1, (
JTOT_t) (tot + 0.5)));
225 inplace_merge(buffer.begin(), buffer.begin() + ns, buffer.end());
243 for (
int i = 0; i != ns; ++i, t0 += ts) {
258 if (buffer.size() > 1) {
271 output.
add(buffer.size(), buffer.data());
370 return first.
getT() < second.
getT();
383 return hit.getT() < tdc;
389 std::unique_ptr<JTDC>
TDC;
KM3NeT DAQ constants, bit handling, etc.
Auxiliary methods for mathematics.
Interface to mimic hit ordering effects due to state machine inside CLB.
virtual bool maybeSwapped(const JDAQHit &first, const JDAQHit &second) const
Test whether two consecutive hits may be swapped.
virtual ~JStateMachine()
Virtual destructor.
virtual ~JTDC()
Virtual destructor.
virtual JDAQHit makeHit(const JPMT_t pmt, const double t_ns, const JTOT_t tot_ns) const
Make DAQ hit.
virtual bool getFIFOStatus(const JPMTIdentifier &id) const
Get FIFO (almost) full of given PMT.
static const struct JDETECTOR::JCLBDefaultSimulatorInterface::compare compare
static double getMinimalToT()
Get minimal pulse length of time-over-threshold measurement.
JDAQFrameStatus getDAQFrameStatus(const JModuleIdentifier &id) const
Get DAQ frame status of given module.
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.
JCLBDefaultSimulatorInterface(JTDC *TDC, JStateMachine *state_machine)
Constructor.
std::unique_ptr< JStateMachine > state_machine
virtual bool setHighRateVeto() const
Set high-rate veto based on number of hits.
virtual bool getHighRateVeto(const JPMTIdentifier &id) const
Get high-rate veto of given PMT.
std::unique_ptr< JTDC > TDC
virtual void processData(const JModuleIdentifier &id, const JCLBInput &input, JDAQSuperFrame &output) const override
Process data.
Interface for CLB simulation.
std::vector< JElement_t >::const_iterator const_iterator
Auxiliary class for object identification.
Template definition of a multi-dimensional oscillation probability interpolation table.
JWriter & write(JWriter &out) const override final
Write from input.
void setHighRateVeto(const int tdc, const bool value)
Set high-rate veto.
bool testHighRateVeto() const
Test high-rate veto status.
void setDAQFrameStatus(const JDAQFrameStatus &status)
Set DAQ frame status.
static JTOT_t getMaximalToT()
Get maximal time-over-threshold.
JTDC_t getT() const
Get time.
Data frame of one optical module.
JDAQSuperFrame & add(const JDAQSuperFrame &super_frame)
Add data from same optical module.
file Auxiliary data structures and methods for detector calibration.
size_t getBayesianMedian(const size_t m, const size_t k)
Get estimate of maximum number.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
size_t getMaximalNumberOfHits()
Get maximal number of hits from one PMT within data frame.
double getFrameTime()
Get frame time duration.
static const JBits DAQ_UDP_RECEIVED_PACKETS(0, 15)
Mask of UDP received packets.
static const JBits DAQ_UDP_SEQUENCE_NUMBER(16, 31)
Mask of UDP sequence number.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
static const JBit DAQ_WHITE_RABBIT(31)
White Rabbit status.
static const JBit DAQ_UDP_TRAILER(31)
UDP trailer.
Auxiliary data structure for sorting of hits.
bool operator()(const JDAQHit &first, const JDAQHit &second) const
Compare hits by time.
bool operator()(const JDAQHit &hit, const JTDC_t tdc) const
Compare hit and TDC value.
Auxiliary data structure for single bit.
void set(int &mask) const
Set bit in given bit mask.