15 #ifndef FAIRTESTDETECTORFILESINK_H_
16 #define FAIRTESTDETECTORFILESINK_H_
21 #include <FairMQDevice.h>
22 #include <FairMQLogger.h>
24 #include <TClonesArray.h>
33 template<
typename TIn,
typename TPayloadIn>
38 : fOutput(new TClonesArray(
"FairTestDetectorHit"))
40 , fTree(
"MQOut",
"Test output")
42 , fInChannelName(
"data2")
43 , fAckChannelName(
"ack")
45 gSystem->ResetSignal(kSigInterrupt);
46 gSystem->ResetSignal(kSigTermination);
60 std::string filename(
"filesink_" + defaultId +
".root");
61 fOutFile = std::unique_ptr<TFile>(TFile::Open(filename.c_str(),
"recreate"));
62 fTree.Branch(
"Output",
"TClonesArray", fOutput.get(), 64000, 99);
68 fInChannelName = fConfig->GetValue<std::string>(
"in-channel");
69 fAckChannelName = fConfig->GetValue<std::string>(
"ack-channel");
74 virtual void PostRun() { LOG(info) <<
"Received " << fReceivedMsgs <<
" messages!"; }
79 std::unique_ptr<TClonesArray> fOutput;
80 std::unique_ptr<TFile> fOutFile;
83 std::string fInChannelName;
84 std::string fAckChannelName;
88 #include "FairTestDetectorFileSinkBin.tpl"
89 #include "FairTestDetectorFileSinkBoost.tpl"
90 #include "FairTestDetectorFileSinkFlatBuffers.tpl"
91 #include "FairTestDetectorFileSinkMsgpack.tpl"
92 #include "FairTestDetectorFileSinkProtobuf.tpl"
93 #include "FairTestDetectorFileSinkTMessage.tpl"
FairTestDetectorFileSink operator=(const FairTestDetectorFileSink &)=delete
virtual ~FairTestDetectorFileSink()
virtual void InitOutputFile(const std::string &defaultId="100")
FairTestDetectorFileSink()