diff --git a/reco/detectors/rich/CbmRichReconstruction.cxx b/reco/detectors/rich/CbmRichReconstruction.cxx index f119bc294047a0cbc9cbed3513e95d14c9e2352a..b83404f4fd29ba9e698567b8e3cd2c0a1ceaf607 100644 --- a/reco/detectors/rich/CbmRichReconstruction.cxx +++ b/reco/detectors/rich/CbmRichReconstruction.cxx @@ -40,6 +40,7 @@ #include "TClonesArray.h" +#include <iomanip> #include <iostream> using std::cout; @@ -98,22 +99,36 @@ InitStatus CbmRichReconstruction::Init() void CbmRichReconstruction::Exec(Option_t* /*opt*/) { + TStopwatch timer; + timer.Start(); if (fRichTrackParamZ != nullptr) fRichTrackParamZ->Delete(); if (fRichProjections != nullptr) fRichProjections->Delete(); if (fRichRings != nullptr) fRichRings->Delete(); + fNofTs++; + if (fCbmEvents == nullptr) { - LOG(info) << "CbmRichReconstruction: Event " << ++fEventNum; + fNofEvents++; ProcessData(nullptr); } else { int nEvents = fCbmEvents->GetEntriesFast(); - LOG(info) << "CbmRichReconstruction: Timeslice " << ++fEventNum << " with " << nEvents << " events"; + fNofEvents += nEvents; for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { CbmEvent* event = static_cast<CbmEvent*>(fCbmEvents->At(iEvent)); ProcessData(event); } } + timer.Stop(); + fCalcTime += timer.RealTime(); + fTotalNofHits += fRichHits->GetEntriesFast(); + fTotalNofRings += fRichRings->GetEntriesFast(); + fTotalNofTrackProj += (fRichProjections ? fRichProjections->GetEntriesFast() : 0); + + LOG(info) << setw(20) << left << GetName() << "[" << fixed << setw(8) << setprecision(1) << right + << timer.RealTime() * 1000. << " ms] " + << "TS " << fNofTs << ", hits " << fRichHits->GetEntriesFast() << ", rings " << fRichRings->GetEntriesFast() + << ", trackProj " << (fRichProjections ? fRichProjections->GetEntriesFast() : 0); } void CbmRichReconstruction::ProcessData(CbmEvent* event) @@ -249,6 +264,24 @@ void CbmRichReconstruction::RunTrackAssign(CbmEvent* event) fRingTrackAssign->DoAssign(event, fRichRings, fRichProjections); } -void CbmRichReconstruction::Finish() {} +void CbmRichReconstruction::Finish() +{ + + std::cout << std::endl; + LOG(info) << "====================================="; + LOG(info) << GetName() << ": Run summary"; + LOG(info) << "Time slices : " << fNofTs; + LOG(info) << "Events : " << fNofEvents; + LOG(info) << "Events / TS : " << fixed << setprecision(2) << fNofEvents / (Double_t) fNofTs; + LOG(info) << "Hits / TS : " << fixed << setprecision(2) << fTotalNofHits / (Double_t) fNofTs; + LOG(info) << "Ring / TS : " << fixed << setprecision(2) << fTotalNofRings / (Double_t) fNofTs; + LOG(info) << "TrackProj / TS : " << fixed << setprecision(2) << fTotalNofTrackProj / (Double_t) fNofTs; + LOG(info) << "Time / TS : " << fixed << setprecision(2) << 1000. * fCalcTime / Double_t(fNofTs) << " ms"; + LOG(info) << "Hits / ev : " << fixed << setprecision(2) << fTotalNofHits / (Double_t) fNofEvents; + LOG(info) << "Ring / ev : " << fixed << setprecision(2) << fTotalNofRings / (Double_t) fNofEvents; + LOG(info) << "TrackProj / ev : " << fixed << setprecision(2) << fTotalNofTrackProj / (Double_t) fNofEvents; + LOG(info) << "Time / ev : " << fixed << setprecision(2) << 1000. * fCalcTime / Double_t(fNofEvents) << " ms"; + LOG(info) << "=====================================\n"; +} ClassImp(CbmRichReconstruction) diff --git a/reco/detectors/rich/CbmRichReconstruction.h b/reco/detectors/rich/CbmRichReconstruction.h index 2e5d4b17631561b074392ea461623c0c72611852..00278b46594ce129325806c0c478f27f26f84a6e 100644 --- a/reco/detectors/rich/CbmRichReconstruction.h +++ b/reco/detectors/rich/CbmRichReconstruction.h @@ -96,7 +96,13 @@ private: TClonesArray* fGlobalTracks = nullptr; TClonesArray* fCbmEvents = nullptr; - Int_t fEventNum = 0; // event or timeslice counter + Int_t fNofTs = 0; + Int_t fNofEvents = 0; + Double_t fCalcTime = 0.; + Int_t fTotalNofHits = 0; + Int_t fTotalNofRings = 0; + Int_t fTotalNofTrackProj = 0; + // pointers to the algorithms CbmRichRingFinder* fRingFinder = nullptr; diff --git a/reco/detectors/rich/finder/CbmRichRingFinderHough.cxx b/reco/detectors/rich/finder/CbmRichRingFinderHough.cxx index cdee4ad6bfd5dfe60c3724bb8b1beef7ace4492c..045fe3616768966443e81458445b0bff82ca3848 100644 --- a/reco/detectors/rich/finder/CbmRichRingFinderHough.cxx +++ b/reco/detectors/rich/finder/CbmRichRingFinderHough.cxx @@ -111,9 +111,9 @@ Int_t CbmRichRingFinderHough::DoFind(CbmEvent* event, TClonesArray* rHitArray, T Double_t dt3 = timer.RealTime(); int nofFoundRings = event ? event->GetNofData(ECbmDataType::kRichRing) : rRingArray->GetEntriesFast(); - LOG(info) << "CbmRichRingFinderHough::DoFind(): Event:" << fEventNum << " hits:" << nofRichHits - << " rings:" << nofFoundRings << " ringsInTS:" << rRingArray->GetEntriesFast() - << " Time:" << dt1 + dt2 + dt3; + LOG(debug) << "CbmRichRingFinderHough::DoFind(): Event:" << fEventNum << " hits:" << nofRichHits + << " rings:" << nofFoundRings << " ringsInTS:" << rRingArray->GetEntriesFast() + << " Time:" << dt1 + dt2 + dt3; return 1; } diff --git a/reco/detectors/rich/tracks/CbmRichRingTrackAssignClosestD.cxx b/reco/detectors/rich/tracks/CbmRichRingTrackAssignClosestD.cxx index feee8de28bf1cab9ed676678dcb5a921e19802cf..ac95de0226fab2e83fdb38ab6bf0a13e0079dcca 100644 --- a/reco/detectors/rich/tracks/CbmRichRingTrackAssignClosestD.cxx +++ b/reco/detectors/rich/tracks/CbmRichRingTrackAssignClosestD.cxx @@ -59,9 +59,9 @@ void CbmRichRingTrackAssignClosestD::DoAssign(CbmEvent* event, TClonesArray* rin Int_t nofTracks = event ? event->GetNofData(ECbmDataType::kRichTrackProjection) : richProj->GetEntriesFast(); Int_t nofRings = event ? event->GetNofData(ECbmDataType::kRichRing) : rings->GetEntriesFast(); - LOG(info) << "CbmRichRingTrackAssignClosestD::DoAssign(): Event:" << fEventNum << " rings:" << nofRings - << " ringsInTS:" << rings->GetEntriesFast() << " tracks:" << nofTracks - << " tracksInTS:" << richProj->GetEntriesFast(); + LOG(debug) << "CbmRichRingTrackAssignClosestD::DoAssign(): Event:" << fEventNum << " rings:" << nofRings + << " ringsInTS:" << rings->GetEntriesFast() << " tracks:" << nofTracks + << " tracksInTS:" << richProj->GetEntriesFast(); } void CbmRichRingTrackAssignClosestD::DoAssignRingTrack(CbmEvent* event, TClonesArray* rings, TClonesArray* richProj) diff --git a/reco/detectors/rich/tracks/CbmRichTrackExtrapolationIdeal.cxx b/reco/detectors/rich/tracks/CbmRichTrackExtrapolationIdeal.cxx index a4b5b5369de6e6d25f3e3b240954ea2f9df4be29..b36c65b84242a32c7c3ddd8d02a8602cc31f8b2d 100644 --- a/reco/detectors/rich/tracks/CbmRichTrackExtrapolationIdeal.cxx +++ b/reco/detectors/rich/tracks/CbmRichTrackExtrapolationIdeal.cxx @@ -33,16 +33,16 @@ CbmRichTrackExtrapolationIdeal::~CbmRichTrackExtrapolationIdeal() {} void CbmRichTrackExtrapolationIdeal::Init() { FairRootManager* manager = FairRootManager::Instance(); - if (manager = nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): FairRootManager is nullptr."; + if (manager == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): FairRootManager is nullptr."; fRefPlanePoints = (TClonesArray*) manager->GetObject("RefPlanePoint"); - if (fRefPlanePoints = nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): No RefPlanePoint array."; + if (fRefPlanePoints == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): No RefPlanePoint array."; fStsTracks = (TClonesArray*) manager->GetObject("StsTrack"); - if (fStsTracks = nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): No StsTrack array."; + if (fStsTracks == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): No StsTrack array."; fStsTrackMatches = (TClonesArray*) manager->GetObject("StsTrackMatch"); - if (fStsTrackMatches = nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): No StsTrackMatch array."; + if (fStsTrackMatches == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationIdeal::Init(): No StsTrackMatch array."; } void CbmRichTrackExtrapolationIdeal::DoExtrapolation(CbmEvent* event, TClonesArray* globalTracks,