CbmRoot
Loading...
Searching...
No Matches
TrackingChain.h
Go to the documentation of this file.
1/* Copyright (C) 2023-2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "CaDataManager.h"
13#include "CaFramework.h"
14#include "CaTrack.h"
15#include "CaTrackingMonitor.h"
16#include "CaVector.h"
17#include "PartitionedSpan.h"
18#include "algo/base/SubChain.h"
20#include "algo/ca/qa/CaQa.h"
23
24#include <memory>
25#include <vector>
26
27namespace cbm::algo
28{
29 struct ParFiles;
30
31 namespace qa
32 {
33 class Manager;
34 }
35}
36
37namespace cbm::algo
38{
43 class TrackingChain : public SubChain {
44 public:
49 TrackingChain(ECbmRecoMode recoMode, const std::unique_ptr<cbm::algo::qa::Manager>& qaManager = nullptr,
50 std::string_view name = "");
51
59
81
83 const ca::TrackingMonitor& GetCaMonitor() const { return fCaMonitor; }
84
87 void Init(const std::string& caParPath);
88
90 void RegisterSetup(std::shared_ptr<RecoSetup> pSetup) { fpSetup = pSetup; }
91
95 Output_t Run(Input_t recoResults);
96
98 void Finalize();
99
100
101 private:
102 // *********************
103 // ** Utility functions
104
107 void PrepareInput(Input_t recoResults);
108
110 Output_t PrepareOutput();
111
115 template<ca::EDetectorID DetID>
117
118 // *************************
119 // ** Framework variables
120
126
127 std::shared_ptr<RecoSetup> fpSetup;
128
130
131 // ************************
132 // ** Auxilary variables
133
135
139
141
142 static constexpr bool kDEBUG = false;
143 static constexpr bool kStoreMonitor = false;
144 };
145
146
147} // namespace cbm::algo
Input-output data manager for L1 tracking algorithm.
A QA module for CA tracking (header)
source file for the ca::Track class
Monitor specialization for the tracking algorithm.
ECbmRecoMode
Reconstruct the full time slice or event-by-event.
Definition CbmDefs.h:202
static vector< vector< QAHit > > hits
A structure for reconstructed results: digi-events, hits and tracks.
A collection of reconstruction setup unit interfaces for different CBM subsystems.
Definitions for tracking in the online reconstruction.
Output_t Run(Input_t recoResults)
Provides action for a given time-slice.
ca::Framework fCaFramework
CA framework instance.
std::shared_ptr< RecoSetup > fpSetup
setup interface
static constexpr bool kStoreMonitor
Store monitor (debug)
void ReadHits(PartitionedSpan< const ca::HitTypes_t::at< DetID > > hits)
Reads from different detector subsystems.
TrackingChain(ECbmRecoMode recoMode, const std::unique_ptr< cbm::algo::qa::Manager > &qaManager=nullptr, std::string_view name="")
Constructor from parameters.
Output_t PrepareOutput()
Prepares output data.
ca::TrackingMonitorData fCaMonitorData
CA monitor data object.
ca::Qa fQa
CA QA builder.
void PrepareInput(Input_t recoResults)
Prepares input data.
ca::DataManager fCaDataManager
CA data manager.
const ca::TrackingMonitor & GetCaMonitor() const
Gets internal monitor.
ca::Vector< std::tuple< ca::EDetectorID, uint32_t, uint32_t > > faHitExternalIndices
External indices of used hits.
void RegisterSetup(std::shared_ptr< RecoSetup > pSetup)
Registers reco-setup.
void Init(const std::string &caParPath)
Provides action in the initialization of the run.
ECbmRecoMode fRecoMode
Reconstruction mode.
static constexpr bool kDEBUG
Debug mode.
ca::HitKeyIndex_t fNofHitKeys
Current number of hit keys (aux)
ca::TrackingMonitor fCaMonitor
CA internal monitor (debug purposes)
void Finalize()
Provides action in the end of the run.
ca::DetIdArray_t< bool > fbDetUsed
Flags of detector subsystems used in tracking.
A manager for the input-output data of the CA tracking algorithm.
A monitor specialization for cbm::algo::ca::Framework class.
A central class to manage the histogram storage and sending to the histogram server.
Definition QaManager.h:20
unsigned int HitKeyIndex_t
Index of the hit key (e.g. front / back cluster id for STS)
Definition CaHit.h:28
MonitorData< ECounter, ETimer > TrackingMonitorData
EnumArray< EDetectorID, T > DetIdArray_t
Alias to array, indexed by the EDetectorID enum.
Class to hold the paths to the parameter files for the different detectors.
Definition ParFiles.h:21
Input to the TrackingChain.
PartitionedSpan< trd::Hit > trdHits
PartitionedSpan< sts::Hit > stsHits
PartitionedSpan< tof::Hit > tofHits
Output from the TrackingChain.
ca::Vector< ca::Track > tracks
Reconstructed tracks.
ca::TrackingMonitorData monitorData
Monitor data.
ca::Vector< std::vector< std::pair< uint32_t, uint32_t > > > trdHitIndices
TRD hit indices.
ca::Vector< std::vector< std::pair< uint32_t, uint32_t > > > tofHitIndices
TOF hit indices.
ca::Vector< std::vector< std::pair< uint32_t, uint32_t > > > stsHitIndices
STS hit indices.
std::tuple_element_t< static_cast< std::size_t >(DetID), std::tuple< Types... > > at