19 #include <FairMQLogger.h>
24 : fInputChannelName(
"data-in")
32 fFileName = fConfig->GetValue<std::string>(
"file-name");
33 fInputChannelName = fConfig->GetValue<std::string>(
"in-channel");
34 fAckChannelName = fConfig->GetValue<std::string>(
"ack-channel");
36 LOG(info) <<
"SHOULD CREATE THE FILE AND TREE";
38 fOutFile.open(fFileName, std::fstream::out | std::fstream::binary);
45 if (parts.Size() == 0)
56 int hitArraySize = parts.At(1)->GetSize();
59 fOutFile.write((
char*)&(payloadE->
fRunId),
sizeof(payloadE->
fRunId));
61 fOutFile.write((
char*)&(payloadE->
fPartNo),
sizeof(payloadE->
fPartNo));
62 fOutFile.write((
char*)&nofHits,
sizeof(nofHits));
64 float posX, posY, posZ, dposX, dposY, dposZ;
65 for (
int ihit = 0; ihit < nofHits; ihit++) {
66 posX = (float)payloadH->
posX;
67 posY = (
float)payloadH->
posY;
68 posZ = (float)payloadH->
posZ;
69 dposX = (
float)payloadH->
dposX;
70 dposY = (float)payloadH->
dposY;
71 dposZ = (
float)payloadH->
dposZ;
79 fOutFile.write(reinterpret_cast<char*>(&posX),
sizeof(posX));
80 fOutFile.write(reinterpret_cast<char*>(&posY),
sizeof(posY));
81 fOutFile.write(reinterpret_cast<char*>(&posZ),
sizeof(posZ));
82 fOutFile.write(reinterpret_cast<char*>(&dposX),
sizeof(dposX));
83 fOutFile.write(reinterpret_cast<char*>(&dposY),
sizeof(dposY));
84 fOutFile.write(reinterpret_cast<char*>(&dposZ),
sizeof(dposZ));
87 if (fAckChannelName !=
"") {
88 unique_ptr<FairMQMessage> msg(NewMessage());
89 Send(msg, fAckChannelName);
bool StoreData(FairMQParts &, int)
virtual ~FairMQPixAltFileSinkBin()
FairMQPixAltFileSinkBin()