7 #include <FairMQDevice.h>
9 #include <TClonesArray.h>
37 fFileName = fConfig->GetValue<std::string>(
"input-file");
38 fInputFile = TFile::Open(fFileName.c_str(),
"READ");
40 fTree =
static_cast<TTree*
>(fInputFile->Get(
"cbmsim"));
42 fTree->SetBranchAddress(
"MyDigi", &fInput);
44 LOG(error) <<
"Could not find tree 'MyDigi'";
47 LOG(error) <<
"Could not open file " << fFileName <<
" in SimpleTreeReader::InitSource()";
53 uint64_t sentMsgs = 0;
54 const uint64_t numEvents = fTree->GetEntries();
55 LOG(info) <<
"Number of events to process: " << numEvents;
57 for (uint64_t i = 0; i < numEvents; i++) {
58 FairMQMessagePtr msg(NewMessage());
60 Serialize<RootSerializer>(*msg, fInput);
63 if (NewStatePending()) {
68 LOG(info) <<
"Sent " << sentMsgs <<
" messages!";
74 std::string fFileName;
78 #endif // EX1SAMPLER_H
Ex1Sampler & operator=(const Ex1Sampler &)