8 #include <FairMQDevice.h>
30 fTree->Write(
"", TObject::kOverwrite);
36 if (fOutFile->IsOpen()) {
46 fNumMsgs = fConfig->GetValue<
int>(
"num-msgs");
47 fFileName = fConfig->GetValue<std::string>(
"output-file");
48 fOutFile = TFile::Open(fFileName.c_str(),
"RECREATE");
49 fInput =
new TClonesArray(
"MyHit");
50 fTree =
new TTree(
"SerializationEx2",
"output");
51 fTree->Branch(
"MyHit",
"TClonesArray", &fInput);
57 while (!NewStatePending()) {
59 if (Receive(parts,
"data2") > 0) {
61 Deserialize<BoostSerializer<Ex2Header>>(*(parts.At(0)), header);
62 Deserialize<BoostSerializer<MyHit>>(*(parts.At(1)), fInput);
65 fTree->SetBranchAddress(
"MyHit", &fInput);
69 if (receivedMsgs == fNumMsgs) {
75 LOG(info) <<
"Received " << receivedMsgs <<
" messages!";
80 std::string fFileName;
Ex2Sink & operator=(const Ex2Sink &)