Skip to content
Snippets Groups Projects
Commit c0336050 authored by Sergei Zharko's avatar Sergei Zharko Committed by Sergey Gorbunov
Browse files

online CA: added monitor to TrackingChain

parent 7147c3e6
No related branches found
No related tags found
1 merge request!1398CA in online: Algorithm introduction and timeslice processing
......@@ -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);
}
// ---------------------------------------------------------------------------------------------------------------------
......
......@@ -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
......
......@@ -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)}
});
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment