diff --git a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx index 8b1882681c7be89e2e6f49d2f587f2137dfa54b5..7fbec9be04bd1abe23b2e2ba543159f7e2d214c8 100644 --- a/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx +++ b/reco/eventbuilder/digis/CbmAlgoBuildRawEvents.cxx @@ -79,7 +79,12 @@ Bool_t CbmAlgoBuildRawEvents::InitAlgo() } } if (fbFillHistos) { CreateHistograms(); } - if (fTimer != nullptr) { fTimer->Stop(); } + if (fTimer != nullptr) { + fTimer->Stop(); + Double_t rtime = fTimer->RealTime(); + Double_t ctime = fTimer->CpuTime(); + LOG(info) << "CbmAlgoBuildRawEvents::Init(): Real time " << rtime << " s, CPU time " << ctime << " s"; + } LOG(info) << "CbmAlgoBuildRawEvents::InitAlgo => Done"; return kTRUE; diff --git a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx index 3cb8a028231972e52340a723713a31c31a7f2d29..38ed5dae023f7643df563cc8a988da14881f993e 100644 --- a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx +++ b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.cxx @@ -68,6 +68,8 @@ InitStatus CbmTaskBuildRawEvents::Init() if (fbGetTimings) { fTimer = new TStopwatch; fTimer->Start(); + fCopyTimer = new TStopwatch; + fCopyTimer->Reset(); } /// Get a handle from the IO manager @@ -148,12 +150,17 @@ InitStatus CbmTaskBuildRawEvents::Init() // Set timeslice meta data fpAlgo->SetTimeSliceMetaDataArray(dynamic_cast<TClonesArray*>(ioman->GetObject("TimesliceMetaData"))); + if (fTimer != nullptr) { + fTimer->Stop(); + Double_t rtime = fTimer->RealTime(); + Double_t ctime = fTimer->CpuTime(); + LOG(info) << "CbmTaskBuildRawEvents::Init(): Real time " << rtime << " s, CPU time " << ctime << " s"; + } + /// Call Algo Init method if (kTRUE == fpAlgo->InitAlgo()) return kSUCCESS; else return kFATAL; - - if (fTimer != nullptr) { fTimer->Stop(); } } @@ -162,6 +169,7 @@ InitStatus CbmTaskBuildRawEvents::ReInit() { return kSUCCESS; } void CbmTaskBuildRawEvents::Exec(Option_t* /*option*/) { if (fTimer != nullptr) { fTimer->Start(kFALSE); } + LOG(debug2) << "CbmTaskBuildRawEvents::Exec => Starting sequence"; //Warning: Int_t must be used for the loop counters instead of UInt_t, //as the digi manager can return -1, which would be casted to +1 @@ -174,6 +182,8 @@ void CbmTaskBuildRawEvents::Exec(Option_t* /*option*/) //Reset explicit seed times if set if (fSeedTimeDet != kRawEventBuilderDetUndef || fSeedTimeDetList.size() > 0) { fSeedTimes->clear(); } + if (fCopyTimer != nullptr) { fCopyTimer->Start(kFALSE); } + //Read STS digis if (fDigiMan->IsPresent(ECbmModuleId::kSts)) { fStsDigis->clear(); @@ -258,6 +268,8 @@ void CbmTaskBuildRawEvents::Exec(Option_t* /*option*/) LOG(debug) << "In DigiManager: " << fPsdDigis->size() << " PSD digis."; } + if (fCopyTimer != nullptr) { fCopyTimer->Stop(); } + if (fSeedTimeDetList.size() > 0) { FillSeedTimesFromDetList(); } //DumpSeedTimesFromDetList(); @@ -375,6 +387,12 @@ void CbmTaskBuildRawEvents::PrintTimings() Double_t ctime = fTimer->CpuTime(); LOG(info) << "CbmTaskBuildRawEvents: Real time " << rtime << " s, CPU time " << ctime << " s"; } + if (fCopyTimer == nullptr) { LOG(fatal) << "Trying to print timings but timer not set"; } + else { + Double_t rtime = fCopyTimer->RealTime(); + Double_t ctime = fCopyTimer->CpuTime(); + LOG(info) << "CbmTaskBuildRawEvents (digi copy only): Real time " << rtime << " s, CPU time " << ctime << " s"; + } } void CbmTaskBuildRawEvents::Finish() diff --git a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.h b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.h index 7ec4cc99a74e735b3e080407c735db38d48f482b..62adf739004c26b56b3957f7f256b140ddfc3a98 100644 --- a/reco/eventbuilder/digis/CbmTaskBuildRawEvents.h +++ b/reco/eventbuilder/digis/CbmTaskBuildRawEvents.h @@ -153,7 +153,8 @@ private: void FillSeedTimesFromDetList(); - TStopwatch* fTimer = nullptr; //! is create when fbGetTimings is set before init + TStopwatch* fTimer = nullptr; //! is created when fbGetTimings is set before init + TStopwatch* fCopyTimer = nullptr; //! timing only for filling of std::vector<Digi> fields CbmAlgoBuildRawEvents* fpAlgo = nullptr;