8 #include <FairMQDevice.h>
39 fFileName = fConfig->GetValue<std::string>(
"input-file");
40 fInputFile = TFile::Open(fFileName.c_str(),
"READ");
42 fTree =
static_cast<TTree*
>(fInputFile->Get(
"cbmsim"));
44 fTree->SetBranchAddress(
"MyDigi", &fInput);
46 LOG(error) <<
"Could not find tree 'MyDigi'";
49 LOG(error) <<
"Could not open file " << fFileName <<
" in SimpleTreeReader::InitSource()";
56 const int64_t numEvents = fTree->GetEntries();
57 LOG(info) <<
"Number of events to process: " << numEvents;
59 auto tStart = std::chrono::high_resolution_clock::now();
61 for (int64_t idx = 0; idx < numEvents; idx++) {
66 FairMQMessagePtr msgHeader(NewMessage());
67 Serialize<SerializerEx2>(*msgHeader, header);
69 FairMQMessagePtr msg(NewMessage());
70 Serialize<RootSerializer>(*msg, fInput);
73 parts.AddPart(std::move(msgHeader));
74 parts.AddPart(std::move(msg));
76 if (Send(parts,
"data1") > 0) {
80 if (NewStatePending()) {
85 auto tEnd = std::chrono::high_resolution_clock::now();
86 LOG(info) <<
"Sent " << sentMsgs
87 <<
" messages in: " << std::chrono::duration<double, std::milli>(tEnd - tStart).count() <<
" ms";
93 std::string fFileName;
Ex2Sampler & operator=(const Ex2Sampler &)