15#include <FairRootManager.h>
27 LOG(info) <<
"Source: closing after " <<
fNumTs <<
" timeslices";
40 LOG(info) <<
"Source: Reading from input archive " <<
fInputFileName;
42 LOG(info) <<
" - Time created: " << desc.time_created();
43 LOG(info) <<
" - Host name : " << desc.hostname();
44 LOG(info) <<
" - User name : " << desc.username();
46 auto* ioman = FairRootManager::Instance();
48 LOG(fatal) <<
"CbmSourceRecoTimeslice::Init(): FairRootManager is not defined";
53 LOG(fatal) <<
"CbmSourceRecoTimeslice::Init() no CbmTsEventHeader was added to the run. Without it, we can not "
54 "store the UTC of the "
55 "Timeslices correctly. Hence, this causes a fatal. Please add it in the steering macro to the Run.";
60 if (ioman->GetObject(
"TimeSlice.")) {
61 LOG(fatal) <<
"Source: Branch TimeSlice. already exists!";
67 ioman->Register(
"TimeSlice.",
"DAQ",
fTimeslice, kTRUE);
70 auto RegisterVector = [&](
auto*& vec,
const char* name) ->
bool {
71 if (ioman->GetObject(name)) {
72 LOG(fatal) <<
"Source: branch " << name <<
" already exists!";
75 ioman->RegisterAny(name, vec, kTRUE);
76 LOG(info) <<
"Source: registered branch " << name <<
" at " << vec;
83 if (!RegisterVector(
fBmonHits,
"OnlineBmonHit")) {
88 if (!RegisterVector(
fStsHits,
"OnlineStsHit")) {
93 if (!RegisterVector(
fTrdHits,
"OnlineTrdHit")) {
98 if (!RegisterVector(
fTofHits,
"OnlineTofHit")) {
103 if (!RegisterVector(
fTracks,
"OnlineTrack")) {
133 LOG(info) <<
"Source: End of input archive; terminating run";
139 LOG(error) <<
"Source: Failed to read RecoResults from archive";
143 LOG(info) <<
"Source: reading TS " <<
fNumTs <<
", index " << results->TsIndex() <<
", start "
144 << results->TsStartTime() <<
", contains\n"
145 <<
" Hits: BMON=" << results->BmonHits().NElements() <<
", STS=" << results->StsHits().NElements()
146 <<
", TRD=" << results->TrdHits().NElements() <<
", TOF=" << results->TofHits().NElements()
147 <<
"\n Tracks: " << results->Tracks().size();
151 fTimeslice->SetStartTime(results->TsStartTime());
153 *
fBmonHits = std::move(results->BmonHits());
154 *
fStsHits = std::move(results->StsHits());
155 *
fTrdHits = std::move(results->TrdHits());
156 *
fTofHits = std::move(results->TofHits());
157 *
fTracks = std::move(results->Tracks());
ClassImp(CbmSourceRecoTimeslice)
A source class for reading reconstruction results from the online processing.
Source class for reading reconstruction results from the online processing.
virtual Bool_t Init()
Initializes the source.
cbm::algo::StorableRecoResults::TrackHitIndexContainer_t * fTrackTofHitIndices
CbmTimeSlice * fTimeslice
Timeslice header (NOTE: legacy, will be deprecated soon)
cbm::PartitionedVector< cbm::algo::bmon::Hit > * fBmonHits
virtual void Close()
Closes the source in the end of the run.
std::string fInputFileName
Input file name.
cbm::algo::StorableRecoResults::TrackHitIndexContainer_t * fTrackTrdHitIndices
size_t fNumTs
Timeslice counter.
cbm::PartitionedVector< cbm::algo::trd::Hit > * fTrdHits
cbm::algo::StorableRecoResults::TrackHitIndexContainer_t * fTrackStsHitIndices
cbm::algo::ca::Vector< cbm::algo::ca::Track > * fTracks
CbmTsEventHeader * fTsEventHeader
Timeslice event header.
cbm::PartitionedVector< cbm::algo::tof::Hit > * fTofHits
CbmSourceRecoTimeslice(const char *filename="")
Constructor.
std::unique_ptr< cbm::algo::RecoResultsInputArchive > fArchive
Input archive.
virtual Int_t ReadEvent(UInt_t=0)
Reads one timeslice from file.
void ClearOutputVectors()
Clears the output vectors.
cbm::PartitionedVector< cbm::algo::sts::Hit > * fStsHits
Bookkeeping of time-slice content.
A vector that is partitioned into multiple subvectors.
ca::Vector< std::vector< std::pair< uint32_t, uint32_t > > > TrackHitIndexContainer_t