11#include <FairFileSource.h>
12#include <FairRootManager.h>
15#include <TClonesArray.h>
16#include <TStopwatch.h>
50 for (Int_t eventNr = 0; eventNr <
fRecoEventsIn->GetEntriesFast(); ++eventNr) {
51 const CbmEvent* pEventIn =
dynamic_cast<const CbmEvent*
>((*fRecoEventsIn)[eventNr]);
54 new ((*fRecoEventsOut)[eventNr])
CbmEvent(*pEventIn);
57 LOG(fatal) << GetName() <<
": Failed to get input event " << eventNr <<
" in TS " <<
fNumTs;
62 LOG(fatal) << GetName() <<
": Input size not matching output one: " <<
fRecoEventsIn->GetEntriesFast() <<
" VS "
69 logOut << setw(20) << left << GetName() <<
" [";
70 logOut << fixed << setw(8) << setprecision(1) << right << timer.RealTime() * 1000. <<
" ms] ";
71 logOut <<
"TS " <<
fNumTs <<
", events In " <<
fRecoEventsIn->GetEntriesFast() <<
", events Out "
73 LOG(info) << logOut.str();
86 LOG(info) <<
"=====================================";
87 LOG(info) << GetName() <<
": Run summary";
88 LOG(info) <<
"Timeslices : " <<
fNumTs;
90 LOG(info) <<
"Time / TS : " << fixed << setprecision(2) << 1000. *
fTimeTot / double(
fNumTs) <<
" ms";
91 LOG(info) <<
"=====================================";
101 LOG(info) <<
"==================================================";
102 LOG(info) << GetName() <<
": Initialising ";
105 FairRootManager* frm = FairRootManager::Instance();
106 if (
nullptr == frm) {
107 LOG(error) << GetName() <<
": Failed to get FairRootManager! Aborting...";
112 fpFileIn =
dynamic_cast<FairFileSource*
>(frm->GetSource());
114 LOG(error) << GetName() <<
": Failed to get Fair file interface object! Aborting...";
118 TTree* pTree =
fpFileIn->GetInTree();
119 if (pTree->GetBranch(
"CbmEvent")) {
122 pTree->SetBranchStatus(
"CbmEvent", 1);
124 LOG(info) << GetName() <<
": Found branch CbmEvent in input";
129 LOG(info) << GetName() <<
": created branch CbmEvent in output";
132 LOG(error) << GetName() <<
": No CbmEvent branch found in file! Aborting...";
136 LOG(info) <<
"==================================================";
ClassImp(CbmConverterManager)
Class characterising one event by a collection of links (indices) to data objects,...
Task class for clone CbmEvent objects from the Input to the output to allow their update,...
const TClonesArray * fRecoEventsIn
size_t fNumTs
Number of processed timeslices.
virtual void Finish()
Finish timeslice.
virtual ~CbmTaskEventsCloneInToOut()
Destructor.
size_t fNumEvents
Number of events.
CbmTaskEventsCloneInToOut()
Constructor.
virtual void Exec(Option_t *opt)
Task execution.
double fTimeTot
Execution time.
virtual InitStatus Init()
Task initialisation.
TClonesArray * fRecoEventsOut
FairFileSource * fpFileIn