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();
55 if (m_nodename.size() == 0 || m_nodeid < 0) {
58 printf(
"nodename = %s\n", m_nodename.c_str());
60 status.open(m_nodename, m_nodeid);
64 B2INFO(
"DummyDataSourceFile: initialize() done.");
70 void DummyDataSourceFileModule::event()
75 if (m_start_flag == 0) {
78 if (status.isAvailable()) {
79 B2INFO(
"DeSerializerCOPPER: Waiting for Start...\n");
80 status.reportRunning();
90 rawcprpacker_info.
eve_num = n_basf2evt;
91 rawcprpacker_info.
node_id = m_nodeid;
92 rawcprpacker_info.
tt_ctime = 0x7123456;
93 rawcprpacker_info.
tt_utime = 0xF1234567;
100 RawCOPPER* raw_copper = rawcprarray.appendNew();
102 int* buf[4] = {0, 0, 0, 0};
103 int nwords[4] = {0, 0, 0, 0};
105 for (
int i = 0; i < raw_cdcarray.
getEntries(); i++) {
106 for (
int j = 0; j < raw_cdcarray[ i ]->GetNumEntries(); j++) {
108 for (
int k = 0; k < 4; k ++) {
110 nwords[ k ] = raw_cdcarray[ i ]->GetDetectorNwords(j, k);
111 buf[ k ] = raw_cdcarray[ i ]->GetDetectorBuffer(j, k);
115 #ifdef USE_RAWDATABLOCK
131 #ifdef USE_RAWDATABLOCK
133 RawDataBlock* raw_datablk = raw_datablkarray.appendNew();
144 if (n_basf2evt >= max_nevt && max_nevt > 0) {
145 printf(
"[DEBUG] RunStop was detected. ( Setting: Max event # %d ) Processed Event %d \n",
146 max_nevt , n_basf2evt);
148 m_eventMetaDataPtr->setEndOfData();
152 if (n_basf2evt % 1000 == 0) {
153 printf(
"Dummy data : Event # %.8d\n", n_basf2evt);
159 if (status.isAvailable()) {
160 status.addInputNBytes(1);
161 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.