diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index c5cfacdc4afb399f708f3ee16129b632deb036ed..444693d290be2bd7f5fc314f8032fc9dbd5d815b 100644 --- a/macro/run/run_unpack_tsa.C +++ b/macro/run/run_unpack_tsa.C @@ -190,6 +190,9 @@ void run_unpack_tsa(std::string infile = "test.tsa", UInt_t runid = 0, const cha auto run = new FairRunOnline(source); auto sink = new FairRootFileSink(outfilename.data()); run->SetSink(sink); + auto eventheader = new CbmTsEventHeader(); + run->SetRunId(runid); + run->SetEventHeader(eventheader); // ------------------------------------------------------------------------ diff --git a/reco/steer/CbmRecoUnpack.cxx b/reco/steer/CbmRecoUnpack.cxx index eec6bd57450f1944e72f1b85472ea725566b4400..191dcff0cfc30eb89ff61288807ea7fcc61e3cd6 100644 --- a/reco/steer/CbmRecoUnpack.cxx +++ b/reco/steer/CbmRecoUnpack.cxx @@ -54,10 +54,13 @@ Bool_t CbmRecoUnpack::Init() FairRootManager* ioman = FairRootManager::Instance(); assert(ioman); - // --- Register the branch for the Timeslice start time - fCbmTsEventHeader = new CbmTsEventHeader(); - ioman->RegisterAny("TsEventHeader", fCbmTsEventHeader, kTRUE); - LOG(info) << "CbmRecoUnpack::Init() registered CbmTsEventHeader to output tree!\n"; + + auto eh = FairRun::Instance()->GetEventHeader(); + if (eh->IsA() == CbmTsEventHeader::Class()) fCbmTsEventHeader = static_cast<CbmTsEventHeader*>(eh); + else + LOG(fatal) + << "CbmRecoUnpack::Init() no CbmTsEventHeader was added to the run. Without it, we can not store the UTC of the " + "Timeslices correctly. Hence, this causes a fatal. Please add it in the steering macro to the Run."; // --- Psd diff --git a/reco/steer/CbmRecoUnpack.h b/reco/steer/CbmRecoUnpack.h index 7f9441ac3183c7c903f94419d2add433132ba7bd..c1d9cd2c0178cc9afb790ad5c18d30f91f5dc421 100644 --- a/reco/steer/CbmRecoUnpack.h +++ b/reco/steer/CbmRecoUnpack.h @@ -39,9 +39,7 @@ class CbmRecoUnpack : public TObject { public: /** @brief Constructor - ** @param fileName Name of (single) input file. - ** - ** More input files can be added by the method AddInputFile. + ** */ CbmRecoUnpack();