1#ifndef __JDETECTOR__JCLBDEFAULTSIMULATORINTERFACE__
2#define __JDETECTOR__JCLBDEFAULTSIMULATORINTERFACE__
172 const double Tmin = 0.0;
181 for (
size_t pmt = 0; pmt != input.size(); ++pmt) {
189 if (hit->t_ns >= Tmin && hit->t_ns <= Tmax) {
191 double t1 = hit->t_ns;
192 double tot = hit->tot_ns;
233 for (
int i = 0; i != n2 + 1; ++i, t0 += ts) {
235 if (gRandom->Rndm() * (n2 + 1) >= (
double) n1) {
337 return first.
getT() < second.
getT();
350 return hit.
getT() < tdc;
KM3NeT DAQ constants, bit handling, etc.
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.
static const struct JDETECTOR::JCLBDefaultSimulatorInterface::compare compare
JLANG::JSinglePointer< JStateMachine > state_machine
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.
JLANG::JSinglePointer< JTDC > TDC
virtual int getUDPNumberOfReceivedPackets(const JModuleIdentifier &id) const
Get number of received UDP packets.
JCLBDefaultSimulatorInterface(JTDC *TDC, JStateMachine *state_machine)
Constructor.
std::vector< JDAQHit > buffer
virtual bool getHighRateVeto(const JPMTIdentifier &id) const
Get high-rate veto of given PMT.
virtual void processData(const JModuleIdentifier &id, const JCLBInput &input, JDAQSuperFrame &output) const override
Process data.
Interface for CLB simulation.
Template data structure for PMT I/O.
std::vector< JElement_t >::const_iterator const_iterator
Auxiliary class for object identification.
The template JSinglePointer class can be used to hold a pointer to an object.
void setHighRateVeto(const int tdc, const bool value)
Set high-rate veto.
void setDAQFrameStatus(const JDAQFrameStatus &status)
Set DAQ frame status.
unsigned int JTDC_t
leading edge [ns]
unsigned char JTOT_t
time over threshold [ns]
static JTOT_t getMaximalToT()
Get maximal time-over-threshold.
JTDC_t getT() const
Get time.
unsigned char JPMT_t
PMT channel in FPGA.
Data frame of one optical module.
JDAQSuperFrame & add(const JDAQSuperFrame &super_frame)
Add data from same optical module.
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
file Auxiliary data structures and methods for detector calibration.
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.
int write(const int value) const
Write given value as bit mask.
void set(int &mask) const
Set bit in given bit mask.
int write(const int value) const
Write given value as bit mask.