9#include <daq/rawdata/modules/DummyDataSource.h>
10#include <daq/rawdata/modules/DeSerializer.h>
37 addParam(
"UseShmFlag",
m_shmflag,
"Use shared memory to communicate with Runcontroller", 0);
39 B2INFO(
"DummyDataSource: Constructor done.");
44DummyDataSourceModule::~DummyDataSourceModule()
52 B2INFO(
"DummyDataSource: initialize() started.");
57#ifdef USE_RAWDATABLOCK
77 B2INFO(
"DummyDataSource: initialize() done.");
90 if (status.isAvailable()) {
91 B2INFO(
"DeSerializerCOPPER: Waiting for Start...\n");
92 status.reportRunning();
104 rawcprpacker_info.
tt_ctime = 0x7123456;
105 rawcprpacker_info.
tt_utime = 0xF1234567;
114 int* buf1, *buf2, *buf3, *buf4;
115 int nwords_1st = 0, nwords_2nd = 0, nwords_3rd = 0, nwords_4th = 0;
125 buf1 =
new int[ nwords_1st];
127 for (
int i = 0; i < nwords_1st; i++) {
129 buf1[ i ] = 0x12345678;
131 buf1[ i ] = (i + 1) * buf1[ i - 1 ];
144 buf2 =
new int[ nwords_2nd];
145 for (
int i = 0; i < nwords_2nd; i++) {
147 buf2[ i ] = 0x34567890;
149 buf2[ i ] = (i + 1) * buf2[ i - 1 ];
162 buf3 =
new int[ nwords_3rd];
163 for (
int i = 0; i < nwords_3rd; i++) {
165 buf3[ i ] = 0x56789012;
167 buf3[ i ] = (i + 1) * buf3[ i - 1 ];
180 buf4 =
new int[ nwords_4th];
181 for (
int i = 0; i < nwords_4th; i++) {
183 buf4[ i ] = 0x78901234;
185 buf4[ i ] = (i + 1) * buf4[ i - 1 ];
189#ifdef USE_RAWDATABLOCK
204#ifdef USE_RAWDATABLOCK
229 printf(
"[DEBUG] RunStop was detected. ( Setting: Max event # %d ) Processed Event %d \n",
238 double interval = cur_time - m_prev_time;
239 double total_time = cur_time - m_start_time;
243 printf(
"[INFO] Event %12d Rate %6.2lf[kHz] Recvd Flow %6.2lf[MB/s] RunTime %8.2lf[s] interval %8.4lf[s]\n",
245 (
n_basf2evt - m_prev_nevt)*NUM_EVT_PER_BASF2LOOP_PC / interval / 1.e3,
246 (m_totbytes - m_prev_totbytes) / interval / 1.e6,
250 m_prev_time = cur_time;
251 m_prev_totbytes = m_totbytes;
259 if (status.isAvailable()) {
260 status.addInputNBytes(1);
StoreArray< RawCOPPER > rawcprarray
RawCOPPER array.
DummyDataSourceModule()
Constructor / Destructor.
void initialize() override
Module functions to be called from main process.
unsigned int n_basf2evt
Number of events.
std::string m_nodename
Node name.
void event() override
Module functions to be called from event process.
int m_start_flag
start flag
StoreArray< RawDataBlock > raw_datablkarray
RawDataBlock array.
int m_shmflag
Use shared memory.
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Event Meta Data.
int max_nevt
check data contents
double getTimeSec()
store time info.
void setDescription(const std::string &description)
Sets the description of the module.
struct to contain header information used by RawCOPPERFormat::Packer()
unsigned int b2l_ctime
32bit unitx time at trigger timing distributed by FTSW. For details, see Nakao-san's belle2link user ...
unsigned int eve_num
Run # and subrun # ( 22bit )
unsigned int tt_ctime
Node ID (32bit)
unsigned int tt_utime
27bit clock ticks at trigger timing distributed by FTSW. For details, see Nakao-san's belle2link user...
unsigned int node_id
Event Number (32bit)
unsigned int run_subrun_num
Experiment number (10bit)
unsigned int exp_num
Experiment number (10bit)
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
void PackDetectorBuf(int *detector_buf_1st, int nwords_1st, int *detector_buf_2nd, int nwords_2nd, int *detector_buf_3rd, int nwords_3rd, int *detector_buf_4th, int nwords_4th, RawCOPPERPackerInfo rawcprpacker_info)
Packer for RawCOPPER class Pack data (format ver.
void PackDetectorBuf4DummyData(int *detector_buf_1st, int nwords_1st, int *detector_buf_2nd, int nwords_2nd, int *detector_buf_3rd, int nwords_3rd, int *detector_buf_4th, int nwords_4th, RawCOPPERPackerInfo rawcprpacker_info)
Pack dummy data (format ver. = -1 -> Select the latest format version)
The RawDataBlock class Base class for rawdata handling.
virtual void SetBuffer(int *bufin, int nwords, int delete_flag, int num_events, int num_nodes)
set buffer ( delete_flag : m_buffer is freeed( = 0 )/ not freeed( = 1 ) in Destructer )
virtual int * GetWholeBuffer()
get pointer to buffer(m_buffer)
virtual int TotalBufNwords()
Get total length of m_buffer.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.