7#include <FairRootManager.h>
21 LOG(info) <<
"Source: Closing after " <<
fNumTs <<
"timeslices with " <<
fNumEvents <<
"events.";
32 LOG(info) <<
"Source: Reading from input archive " <<
fInputFileName;
34 LOG(info) <<
" - Time created: " << desc.time_created();
35 LOG(info) <<
" - Host name : " << desc.hostname();
36 LOG(info) <<
" - User name : " << desc.username();
39 FairRootManager* ioman = FairRootManager::Instance();
41 if (ioman->GetObject(
"DigiEvent")) {
42 LOG(fatal) <<
"Source: Branch DigiEvent already exists!";
45 fEvents =
new std::vector<CbmDigiEvent>();
46 ioman->RegisterAny(
"DigiEvent",
fEvents,
true);
47 LOG(info) <<
"Source: Registered branch DigiEvent at " <<
fEvents;
64 LOG(info) <<
"Source: End of input archive; terminating run";
69 if (results ==
nullptr) {
70 LOG(error) <<
"Source: Failed to read RecoResults from archive";
73 size_t numEvents = results->DigiEvents().size();
75 LOG(info) <<
"Source: Reading TS " <<
fNumTs <<
", index " << results->TsIndex() <<
", start "
76 << results->TsStartTime() <<
", events " << numEvents;
77 std::move(results->DigiEvents().begin(), results->DigiEvents().end(), std::back_inserter(*
fEvents));
78 assert(
fEvents->size() == numEvents);
ClassImp(CbmConverterManager)
Source class for reading from files resulting from online processing (containing DigiEvents)
virtual void Close()
Close source after end of run.
std::string fInputFileName
CbmSourceDigiEvents(const char *fileName="")
Constructor.
virtual Bool_t Init()
Initialisation.
std::unique_ptr< cbm::algo::RecoResultsInputArchive > fArchive
Int_t ReadEvent(UInt_t=0)
Read one time slice from file.
std::vector< CbmDigiEvent > * fEvents