#ifndef __JDETECTOR__JCLBSIMULATOR__ #define __JDETECTOR__JCLBSIMULATOR__ #include "JDetector/JPMTSimulator.hh" #include "km3net-dataformat/online/JDAQHit.hh" #include "km3net-dataformat/online/JDAQSuperFrame.hh" #include "JDetector/JModuleIdentifier.hh" /** * \author mdejong */ namespace JDETECTOR {} namespace JPP { using namespace JDETECTOR; } namespace JDETECTOR { using KM3NETDAQ::JDAQSuperFrame; /** * Type definition of PMT base output. */ typedef JPMTData JPMTOutput; /** * Wrapper for CLB input. */ struct JCLBInput : public std::vector { /** * Reset CLB buffers. * * \param size number of buffers */ inline void reset(size_t size) { this->resize(size); for (iterator i = this->begin(); i != this->end(); ++i) { i->clear(); } } }; /** * Interface for CLB simulation. * * This interface defines the conversion of simulated data to the standard %KM3NeT data format.\n * The input consists of a 2D-array of JPMTPulse's organised per PMT channel and * the output of a KM3NETDAQ::JDAQSuperFrame data structure in which data from different PMTs are mixed. */ class JCLBSimulator { protected: /** * Default constructor. */ JCLBSimulator() {} public: /** * Virtual destructor. */ virtual ~JCLBSimulator() {} /** * Process data. * * \param id module identifier * \param input PMT data * \param output CLB data */ virtual void processData(const JModuleIdentifier& id, const JCLBInput& input, JDAQSuperFrame& output) const = 0; }; } #endif