diff --git a/algo/ca/TrackingChain.cxx b/algo/ca/TrackingChain.cxx index f1b1bf1e736956efcc7f9353ac7b40686a42b64c..a1d1dfc91729b434c357260ffa7a8ea85bb4401b 100644 --- a/algo/ca/TrackingChain.cxx +++ b/algo/ca/TrackingChain.cxx @@ -22,6 +22,7 @@ using cbm::algo::ca::Track; using cbm::algo::ca::constants::clrs::CL; // clear text using cbm::algo::ca::constants::clrs::GNb; // grin bald text + // --------------------------------------------------------------------------------------------------------------------- // void TrackingChain::Init() @@ -40,10 +41,17 @@ void TrackingChain::Init() // --------------------------------------------------------------------------------------------------------------------- // -std::vector<Track> TrackingChain::Run(/*vectors of hits*/) +TrackingChain::Return_t TrackingChain::Run(/*vectors of hits*/) { - std::vector<Track> vRecoTracks; - return vRecoTracks; + ca::Vector<ca::Track> vRecoTracks; + ca::TrackingMonitorData monitorData; + + // ----- Init input data --------------------------------------------------------------------------------------------- + + // ----- Run reconstruction ------------------------------------------------------------------------------------------ + + // ----- Init output data -------------------------------------------------------------------------------------------- + return std::make_pair(vRecoTracks, monitorData); } // --------------------------------------------------------------------------------------------------------------------- diff --git a/algo/ca/TrackingChain.h b/algo/ca/TrackingChain.h index 4983487652b32654b9157e4b68d84b2f481040fd..f1cd00e99a67f4d788ae83b101f6506798b62ead 100644 --- a/algo/ca/TrackingChain.h +++ b/algo/ca/TrackingChain.h @@ -13,6 +13,8 @@ #include <vector> #include "CaTrack.h" +#include "CaVector.h" +#include "CaTrackingMonitor.h" #include "SubChain.h" namespace cbm::algo::ca @@ -40,14 +42,16 @@ namespace cbm::algo /// The class executes a tracking algorithm in the online data reconstruction chain. class TrackingChain : public SubChain { public: - /// @brief Provides action in the initialization of the run + using Return_t = std::pair<ca::Vector<ca::Track>, ca::TrackingMonitorData>; + + /// \brief Provides action in the initialization of the run void Init(); - /// @brief Provides action for a given time-slice - /// @return A vector of cbm::algo::ca::Track - std::vector<ca::Track> Run(/*vecotrs of hits*/); + /// \brief Provides action for a given time-slice + /// \return A vector of cbm::algo::ca::Track + Return_t Run(/*vecotrs of hits*/); - /// @brief Provides action in the end of the run + /// \brief Provides action in the end of the run void Finalize(); }; } // namespace cbm::algo diff --git a/algo/global/Reco.cxx b/algo/global/Reco.cxx index 75ae721b054a072917729d0ceed68e97c1d620aa..ff293c2a85841380a713b5f4bb2ee5ae0c79b81c 100644 --- a/algo/global/Reco.cxx +++ b/algo/global/Reco.cxx @@ -149,6 +149,9 @@ RecoResults Reco::Run(const fles::Timeslice& ts) if (Opts().HasOutput(RecoData::DigiEvent)) results.events = std::move(events); if (Opts().HasOutput(RecoData::Hit)) results.stsHits = std::move(stsHits); + // --- Tracking + TrackingChain::Return_t trackingOutput = fTracking.Run(); + return results; } @@ -288,3 +291,20 @@ void Reco::QueueEvbuildMetrics(const evbuild::EventbuildChainMonitorData& mon) {"numEvents", mon.evbuild.nEvents}, {"totalEvSelectionRatio", totalSelectionRatio}}); } + +void Reco::QueueTrackingRecoMetrics(const ca::TrackingMonitorData& monitor) +{ + if (!HasMonitor()) { return; } + + GetMonitor().QueueMetric("cbmreco", {{"hostname", fles::system::current_hostname()}, {"child", Opts().ChildId()}}, + { + {"caRecoTimeTotal", monitor.GetTimer(ca::ETimer::Tracking).GetTotal()}, + {"caTrackFinderTime", monitor.GetTimer(ca::ETimer::TrackFinder).GetTotal()}, + {"caTrackFitterTime", monitor.GetTimer(ca::ETimer::TrackFitter).GetTotal()}, + {"caNofRecoTracks", monitor.GetCounterValue(ca::ECounter::RecoTrack)}, + {"caNofRecoHitsTotal", monitor.GetCounterValue(ca::ECounter::RecoHit)}, + {"caNofRecoHitsUsed", monitor.GetCounterValue(ca::ECounter::RecoHitUsed)}, + {"caNofWindowa", monitor.GetCounterValue(ca::ECounter::SubTS)} + }); +} + diff --git a/algo/global/Reco.h b/algo/global/Reco.h index 7ce0bb2a7357f7872e6a3b9da903a25c5fe1bebb..05989804b72ec618f41b1caf15dea37cd55053b8 100644 --- a/algo/global/Reco.h +++ b/algo/global/Reco.h @@ -62,6 +62,7 @@ namespace cbm::algo void QueueUnpackerMetrics(const fles::Timeslice&, const UnpackMonitorData&, const DigiData&); void QueueStsRecoMetrics(const sts::HitfinderMonitor&); void QueueEvbuildMetrics(const evbuild::EventbuildChainMonitorData&); + void QueueTrackingRecoMetrics(const ca::TrackingMonitorData&); }; } // namespace cbm::algo