47 const std::string& server,
70 properties[
"datawriter"] = destination =
"localhost";
71 properties[
"inputFile"] = inputFile;
72 properties[
"eventRate_Hz"] = eventRate_Hz = 1.0;
74 properties.
read(
string(buffer, length));
76 destination = destination.
trim();
85 if (eventRate_Hz > 0.0)
86 setClockInterval((
long long int) (1.0e6 / eventRate_Hz));
88 setClockInterval(0ULL);
92 JDebugStream(logger) <<
"Event interval time " << getClockInterval() <<
" us";
144 if (timer.usec_wall > 0)
JNoticeStream(logger) <<
"I/O [MB/s] " << numberOfBytes / timer.usec_wall;
145 if (numberOfEvents > 0)
JNoticeStream(logger) <<
"Delay/event [ms] " << getClockDelay() / numberOfEvents / 1000;
157 if (datawriter.is_valid()) {
159 if (!inputFile.hasNext()) {
163 if (inputFile.hasNext()) {
177 datawriter->PutFullData(
IO_EVENT, out.data(), out.size());
180 numberOfBytes += out.size();
215 int main(
int argc,
char* argv[])
227 JParser<> zap(
"Program for real-time simulation of data.");
237 catch(
const exception &error) {
238 FATAL(error.what() << endl);
KM3NeT DAQ constants, bit handling, etc.
int main(int argc, char *argv[])
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse parameter values.
ROOT TTree parameter settings of various packages.
Scheduling of actions via fixed latency intervals.
Utility class to parse parameter values.
bool read(const JEquation &equation)
Read equation.
Auxiliary class for CPU timing and usage.
Byte array binary output.
void clear()
Clear buffer.
Exception for ControlHost.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
The template JSharedPointer class can be used to share a pointer to an object.
Wrapper class around STL string class.
JString & trim()
Trim string.
static void Throw(const bool option)
Enable/disable throw option.
Message logging based on ControlHost.
Interface for logging messages.
Message logging based on std::ostream.
Utility class to parse command line options.
Data structure for all trigger parameters.
Control unit client base class.
void run()
Run as run control client following command messages via JNET::JControlHost.
virtual bool enter(const JArgs &args)
Enter the state machine.
JTriggerCounter_t next()
Increment trigger counter.
Runcontrol client to simulate data filter(s).
virtual void actionQuit(int length, const char *buffer)
virtual void actionRunning()
This method is repeatedly called when this client machine is in state Running and the clock interval ...
virtual void actionStart(int length, const char *buffer)
long long int numberOfBytes
virtual void actionReset(int length, const char *buffer)
JSUPPORT::JMultipleFileScanner< KM3NETDAQ::JDAQEvent > inputFile
virtual void actionStop(int length, const char *buffer)
virtual void actionConfigure(int length, const char *buffer)
JTRIGGER::JTriggerParameters parameters
JSharedPointer< JControlHost > datawriter
JEventGenerator(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JTriggerParameters getTriggerParameters(const JMultipleFileScanner_t &file_list)
Get trigger parameters.
int getRunNumber(const std::string &file_name)
Get run number for given file name of data taking run.
KM3NeT DAQ data structures and auxiliaries.
static const JNET::JTag RC_EVTGENERATOR
static const JNET::JTag IO_EVENT
static const JNET::JTag RC_CMD
std::string getProcessName(const std::string &name, const std::string &process)
Get process name of run control client.
static const JNET::JTag IO_TRIGGER_PARAMETERS
Level specific message streamers.