11#include <rawdata/dataobjects/RawPXD.h>
12#include <rawdata/modules/MakeDumHSLBData.h>
40MakeDumHSLBDataModule::~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;
72 int len = write(
m_filefd, &header,
sizeof(
int));
73 if (len !=
sizeof(
int)) {
74 perror(
"write error");
77 len = write(
m_filefd, &eve_num,
sizeof(
int));
78 if (len !=
sizeof(
int)) {
79 perror(
"write error");
82 len = write(
m_filefd, &cpr_id,
sizeof(
int));
83 if (len !=
sizeof(
int)) {
84 perror(
"write error");
87 len = write(
m_filefd, &nwords,
sizeof(
int));
88 if (len !=
sizeof(
int)) {
89 perror(
"write error");
93 printf(
"hdr 0x%.8x eve %10u cprid 0x%.8x nwrods %d\n", header, eve_num, cpr_id, nwords);
102 B2INFO(
"MakeDumHSLBData: event() started.");
107 for (
int i = 0; i < rawcprarray.
getEntries(); i++) {
108 for (
int j = 0; j < rawcprarray[ i ]->GetNumEntries(); j++) {
109 printf(
"\n===== DataBlock(RawCOPPER): Block # %d ", i);
118 for (
int i = 0; i < raw_svdarray.
getEntries(); i++) {
119 for (
int j = 0; j < raw_svdarray[ i ]->GetNumEntries(); j++) {
120 printf(
"\n===== DataBlock(RawSVD) : Block # %d ", i);
129 for (
int i = 0; i < raw_cdcarray.
getEntries(); i++) {
130 for (
int j = 0; j < raw_cdcarray[ i ]->GetNumEntries(); j++) {
131 printf(
"\n===== DataBlock(RawCDC) : Block # %d ", i);
140 for (
int i = 0; i < raw_pxdarray.
getEntries(); i++) {
141 printf(
"\n===== DataBlock(RawPXD) : Block # %d ", i);
146 for (
int i = 0; i < raw_bpidarray.
getEntries(); i++) {
147 for (
int j = 0; j < raw_bpidarray[ i ]->GetNumEntries(); j++) {
148 printf(
"\n===== DataBlock(RawTOP) : Block # %d ", i);
154 for (
int i = 0; i < raw_epidarray.
getEntries(); i++) {
155 for (
int j = 0; j < raw_epidarray[ i ]->GetNumEntries(); j++) {
156 printf(
"\n===== DataBlock(RawARICH) : Block # %d ", i);
162 for (
int i = 0; i < raw_klmarray.
getEntries(); i++) {
163 for (
int j = 0; j < raw_klmarray[ i ]->GetNumEntries(); j++) {
164 printf(
"\n===== DataBlock(RawKLM) : Block # %d ", i);
170 for (
int i = 0; i < raw_eclarray.
getEntries(); i++) {
171 for (
int j = 0; j < raw_eclarray[ i ]->GetNumEntries(); j++) {
172 printf(
"\n===== DataBlock(RawECL) : Block # %d ", i);
178 for (
int i = 0; i < raw_trgarray.
getEntries(); i++) {
179 for (
int j = 0; j < raw_trgarray[ i ]->GetNumEntries(); j++) {
180 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.
MakeDumHSLBDataModule()
Constructor / Destructor.
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.