9 #include <daq/rawdata/modules/DummyDataSourceFile.h>
10 #include <daq/rawdata/modules/DeSerializer.h>
11 #include <rawdata/dataobjects/RawCDC.h>
31 DummyDataSourceFileModule::~DummyDataSourceFileModule()
37 void DummyDataSourceFileModule::initialize()
39 B2INFO(
"DummyDataSourceFile: initialize() started.");
44 #ifdef USE_RAWDATABLOCK
48 rawcprarray.registerInDataStore();
54 if (m_nodename.size() == 0 || m_nodeid < 0) {
57 printf(
"nodename = %s\n", m_nodename.c_str());
59 status.open(m_nodename, m_nodeid);
63 B2INFO(
"DummyDataSourceFile: initialize() done.");
69 void DummyDataSourceFileModule::event()
74 if (m_start_flag == 0) {
77 if (status.isAvailable()) {
78 B2INFO(
"DeSerializerCOPPER: Waiting for Start...\n");
79 status.reportRunning();
89 rawcprpacker_info.
eve_num = n_basf2evt;
90 rawcprpacker_info.
node_id = m_nodeid;
91 rawcprpacker_info.
tt_ctime = 0x7123456;
92 rawcprpacker_info.
tt_utime = 0xF1234567;
99 RawCOPPER* raw_copper = rawcprarray.appendNew();
101 int* buf[4] = {0, 0, 0, 0};
102 int nwords[4] = {0, 0, 0, 0};
104 for (
int i = 0; i < raw_cdcarray.
getEntries(); i++) {
105 for (
int j = 0; j < raw_cdcarray[ i ]->GetNumEntries(); j++) {
107 for (
int k = 0; k < 4; k ++) {
109 nwords[ k ] = raw_cdcarray[ i ]->GetDetectorNwords(j, k);
110 buf[ k ] = raw_cdcarray[ i ]->GetDetectorBuffer(j, k);
114 #ifdef USE_RAWDATABLOCK
130 #ifdef USE_RAWDATABLOCK
132 RawDataBlock* raw_datablk = raw_datablkarray.appendNew();
143 if (n_basf2evt >= (
unsigned int) max_nevt && max_nevt > 0) {
144 printf(
"[DEBUG] RunStop was detected. ( Setting: Max event # %d ) Processed Event %d \n",
145 max_nevt, n_basf2evt);
147 m_eventMetaDataPtr->setEndOfData();
151 if (n_basf2evt % 1000 == 0) {
152 printf(
"Dummy data : Event # %.8d\n", n_basf2evt);
158 if (status.isAvailable()) {
159 status.addInputNBytes(1);
160 status.setInputCount(n_basf2evt);
A class definition of an input module for Sequential ROOT I/O.
A class definition of an input module for Sequential ROOT I/O.
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 TotalBufNwords()
Get total length of m_buffer.
virtual int * GetWholeBuffer()
get pointer to buffer(m_buffer)
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.