16#include <framework/core/Module.h>
17#include <framework/datastore/StoreObjPtr.h>
18#include <framework/datastore/StoreArray.h>
19#include <framework/dataobjects/EventMetaData.h>
21#include <daq/slc/readout/RunInfoBuffer.h>
22#include <daq/rawdata/CprErrorMessage.h>
23#include <daq/rawdata/modules/DAQConsts.h>
25#include <rawdata/dataobjects/RawDataBlock.h>
56 virtual void dumpData(
char* buf,
int size);
59 virtual void printData(
int* buf,
int nwords);
107 virtual int*
getNewBuffer(
int nwords,
int* delete_flag);
112 double m_prev_totbytes = 0.0;
117 double m_start_time = 0.0;
119 double time_array0[1000] = {};
120 double time_array1[1000] = {};
121 double time_array2[1000] = {};
122 double time_array3[1000] = {};
123 double time_array4[1000] = {};
124 double time_array5[1000] = {};
142 virtual void clearNumUsedBuf()
149 void RateMonitor(
unsigned int nevt,
int subrun = -1,
int run = -1);
187 static void shmOpen(
char* path_cfg,
char* path_sta);
190 static int*
shmGet(
int fd,
int size_words);
220 virtual void openRunPauseNshm();
223 virtual int checkRunPause();
226 virtual int checkRunRecovery();
230 virtual void resumeRun();
233 virtual void pauseRun();
236 virtual void waitResume();
239 void callCheckRunPause(std::string& err_str);
242 int CheckConnection(
int socket);
static void shmOpen(char *path_cfg, char *path_sta)
open shared memory
void RateMonitor(unsigned int nevt, int subrun=-1, int run=-1)
monitor rate
unsigned int m_prev_exprunsubrun_no
run no.
static unsigned int calcSimpleChecksum(const int *buf, int nwords)
calculate checksum
void initialize() override
Module functions to be called from main process.
std::string m_nodename
Node name.
virtual int * getPreAllocBuf()
Getbuffer.
static int * shmGet(int fd, int size_words)
Get shared memory.
int m_start_flag
start flag
int BUF_SIZE_WORD
size of buffer for one event (word)
int m_shmfd_cfg
file descripter for shm
static RunInfoBuffer g_status
buffer class to communicate with NSM client
int checkData(char *buf, int prev_eve, int *cur_eve)
check data
void terminate() override
This method is called at the end of the event processing.
int n_basf2evt
No. of sent events.
int m_trunc_mask
trunc mask
DeSerializerModule()
Constructor / Destructor.
CprErrorMessage print_err
wrapper for B2LOG system
int m_shmfd_sta
file descripter for shm
virtual void dumpData(char *buf, int size)
dump binary data
virtual void printData(int *buf, int nwords)
dump error data
virtual int * getNewBuffer(int nwords, int *delete_flag)
Getbuffer.
double cur_time
for time monitoring
std::string m_dump_fname
dump filename
int m_shmflag
Use shared memory.
int monitor_numeve
buffer for shared memory
static unsigned int calcXORChecksum(const int *buf, int nwords)
calculate checksum
int m_prev_nevt
No. of prev sent events.
void recordTime(int event, double *array)
store time info.
int m_compressionLevel
Compression Level.
int * m_bufary[NUM_PREALLOC_BUF]
buffer
unsigned int m_exprunsubrun_no
run no.
virtual void printASCIIData(int *buf, int nwords)
dump error data
virtual void openOutputFile()
Module functions to be called from main process.
double max_seconds
time to stop a run
FILE * m_fp_dump
dump file descripter
int m_nodeid
Node(PC or COPPER) ID.
static double getTimeSec()
store time info.
virtual void event()
This method is the core of the module.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
Abstract base class for different kinds of events.