11 #include <rawdata/dataobjects/RawPXD.h>
12 #include <rawdata/modules/MakeDumHSLBData.h>
16 #include <sys/types.h>
40 MakeDumHSLBDataModule::~MakeDumHSLBDataModule()
46 B2INFO(
"MakeDumHSLBData: initialize() started.");
51 printf(
"Error : cannot open %s: %s\n",
m_out_fname.c_str(), strerror(errno));
59 B2INFO(
"MakeDumHSLBData: initialize() done.");
65 unsigned int eve_num = raw_copper->
GetEveNo(i);
66 unsigned int cpr_id = raw_copper->
GetNodeID(i);
67 for (
int j = 0 ; j < 4; j++) {
70 printf(
"===== Detector Buffer(FINESSE A) 0x%x words \n", raw_copper->
GetDetectorNwords(i, 0));
71 int header = 0xCAFEBABE;
73 if ((len = write(
m_filefd, &header,
sizeof(
int))) !=
sizeof(
int)) {
74 perror(
"write error");
77 if ((len = write(
m_filefd, &eve_num,
sizeof(
int))) !=
sizeof(
int)) {
78 perror(
"write error");
81 if ((len = write(
m_filefd, &cpr_id,
sizeof(
int))) !=
sizeof(
int)) {
82 perror(
"write error");
85 if ((len = write(
m_filefd, &nwords,
sizeof(
int))) !=
sizeof(
int)) {
86 perror(
"write error");
90 printf(
"hdr 0x%.8x eve %10u cprid 0x%.8x nwrods %d\n", header, eve_num, cpr_id, nwords);
99 B2INFO(
"MakeDumHSLBData: event() started.");
104 for (
int i = 0; i < rawcprarray.
getEntries(); i++) {
105 for (
int j = 0; j < rawcprarray[ i ]->GetNumEntries(); j++) {
106 printf(
"\n===== DataBlock(RawCOPPER): Block # %d ", i);
115 for (
int i = 0; i < raw_svdarray.
getEntries(); i++) {
116 for (
int j = 0; j < raw_svdarray[ i ]->GetNumEntries(); j++) {
117 printf(
"\n===== DataBlock(RawSVD) : Block # %d ", i);
126 for (
int i = 0; i < raw_cdcarray.
getEntries(); i++) {
127 for (
int j = 0; j < raw_cdcarray[ i ]->GetNumEntries(); j++) {
128 printf(
"\n===== DataBlock(RawCDC) : Block # %d ", i);
137 for (
int i = 0; i < raw_pxdarray.
getEntries(); i++) {
138 printf(
"\n===== DataBlock(RawPXD) : Block # %d ", i);
143 for (
int i = 0; i < raw_bpidarray.
getEntries(); i++) {
144 for (
int j = 0; j < raw_bpidarray[ i ]->GetNumEntries(); j++) {
145 printf(
"\n===== DataBlock(RawTOP) : Block # %d ", i);
151 for (
int i = 0; i < raw_epidarray.
getEntries(); i++) {
152 for (
int j = 0; j < raw_epidarray[ i ]->GetNumEntries(); j++) {
153 printf(
"\n===== DataBlock(RawARICH) : Block # %d ", i);
159 for (
int i = 0; i < raw_klmarray.
getEntries(); i++) {
160 for (
int j = 0; j < raw_klmarray[ i ]->GetNumEntries(); j++) {
161 printf(
"\n===== DataBlock(RawKLM) : Block # %d ", i);
167 for (
int i = 0; i < raw_eclarray.
getEntries(); i++) {
168 for (
int j = 0; j < raw_eclarray[ i ]->GetNumEntries(); j++) {
169 printf(
"\n===== DataBlock(RawECL) : Block # %d ", i);
175 for (
int i = 0; i < raw_trgarray.
getEntries(); i++) {
176 for (
int j = 0; j < raw_trgarray[ i ]->GetNumEntries(); j++) {
177 printf(
"\n===== DataBlock(RawTRG) : Block # %d ", i);
virtual void initialize() override
initialization
virtual void writeData(RawCOPPER *raw_copper, int i)
write data
virtual void event() override
event module
int m_filefd
File descripter.
std::string m_out_fname
Output file name.
Module to get data from DataStore and send it to another network node.
int n_basf2evt
No. of sent events.
virtual void printPXDEvent(RawPXD *raw_pxd)
print a PXD event
The Raw COPPER class This class stores data received by COPPER via belle2linkt Data from all detector...
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
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.
unsigned int GetEveNo(int n)
get subrun #(8bit)
int GetDetectorNwords(int n, int finesse_num)
get Detector buffer length
int * GetDetectorBuffer(int n, int finesse_num)
get Detector buffer
unsigned int GetNodeID(int n)
get node-ID from data
Abstract base class for different kinds of events.