From 6f09799028db71f962375f9411aa02192b0b9a42 Mon Sep 17 00:00:00 2001 From: Felix Weiglhofer <weiglhofer@fias.uni-frankfurt.de> Date: Fri, 3 Nov 2023 15:48:11 +0000 Subject: [PATCH] cbmreco: Dump TOF Hits and Tracks from archives. --- reco/app/cbmreco/main.cxx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/reco/app/cbmreco/main.cxx b/reco/app/cbmreco/main.cxx index 054846d559..f5e2f84d8d 100644 --- a/reco/app/cbmreco/main.cxx +++ b/reco/app/cbmreco/main.cxx @@ -43,6 +43,7 @@ bool dumpArchive(const Options& opts) // Limit the number of events per timeslice to dump to avoid spamming the log constexpr size_t DumpEventsPerTS = 10; constexpr size_t DumpHitsPerSensor = 2; + constexpr size_t DumpTracksPerTS = 10; if (!opts.DumpArchive()) return false; @@ -64,7 +65,8 @@ bool dumpArchive(const Options& opts) size_t nEvents = recoResults->DigiEvents().size(); L_(info) << "TS " << recoResults->TsIndex() << " start: " << recoResults->TsStartTime() << " events: " << nEvents - << ", stsHits: " << recoResults->StsHits().NElements(); + << ", stsHits: " << recoResults->StsHits().NElements() + << ", tofHits: " << recoResults->TofHits().NElements() << ", tracks: " << recoResults->Tracks().size(); for (size_t i = 0; i < std::min(DumpEventsPerTS, nEvents); i++) { const auto& digiEvent = recoResults->DigiEvents().at(i); @@ -85,7 +87,26 @@ bool dumpArchive(const Options& opts) } } - if (nEvents > DumpEventsPerTS) L_(info) << "..."; + L_(info) << "..."; + + auto tofHits = recoResults->TofHits(); + for (size_t m = 0; m < tofHits.NPartitions(); m++) { + auto [hits, address] = tofHits.Partition(m); + for (size_t i = 0; i < std::min(DumpHitsPerSensor, hits.size()); i++) { + const auto& hit = hits[i]; + L_(info) << " - TOF Hit " << i << " sensor: " << address << "; time: " << hit.Time() << ", X: " << hit.X() + << ", Y: " << hit.Y() << ", Z: " << hit.Z(); + } + } + + L_(info) << "..."; + + auto& tracks = recoResults->Tracks(); + for (size_t t = 0; t < std::min(tracks.size(), DumpTracksPerTS); t++) { + const auto& track = tracks[t]; + L_(info) << " - Track " << t << " nHits: " << track.fNofHits << ", chi2: " << track.fParPV.ChiSq() + << ", X: " << track.fParPV.X() << ", Y: " << track.fParPV.Y() << ", Z: " << track.fParPV.Z(); + } } return true; -- GitLab