CbmRoot
Loading...
Searching...
No Matches
CaSetup.h
Go to the documentation of this file.
1/* Copyright (C) 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 "CaDefs.h"
13#include "KfSetup.h"
14
15#include <boost/serialization/access.hpp>
16#include <boost/serialization/array.hpp>
17#include <boost/serialization/split_free.hpp>
18
19#include <array>
20#include <utility>
21
22namespace cbm::algo::ca
23{
24 enum class EDetectorID;
25
53 template<typename Float>
54 class alignas(constants::misc::Alignment) Setup {
55 template<typename>
56 friend class Setup;
57
58 public:
59 using KfSetup_t = typename kf::Setup<Float>;
60
62 Setup() = default;
63
67 Setup(kf::Setup<Float> geoSetup, const std::vector<std::pair<EDetectorID, int>>& inactiveStations);
68
69
72 template<typename SrcFloat>
73 Setup(const Setup<SrcFloat>& other)
74 : fGeoSetup(other.fGeoSetup)
75 , fActSetup(other.fActSetup)
78 {
79 }
80
82 Setup(const Setup&) = default;
83
85 Setup(Setup&&) = default;
86
88 ~Setup() = default;
89
91 Setup& operator=(const Setup& other) = default;
92
94 Setup& operator=(Setup&&) = default;
95
97 const KfSetup_t& GetActiveSetup() const { return fActSetup; }
98
100 const KfSetup_t& GetGeometrySetup() const { return fGeoSetup; }
101
103 int GetNofActStations() const { return fActSetup.GetIndexMap().GetNofLayers(); }
104
107 int GetNofActStations(EDetectorID detId) const { return fActSetup.GetIndexMap().GetNofLayers(detId); }
108
110 int GetNofGeoStations() const { return fGeoSetup.GetIndexMap().GetNofLayers(); }
111
114 int GetNofGeoStations(EDetectorID detId) const { return fGeoSetup.GetIndexMap().GetNofLayers(detId); }
115
119 int ActToGeoStationId(int actId) const { return fvActToGeoMap[actId]; }
120
124 std::pair<EDetectorID, int> ActToLocStationId(int actId) const
125 {
126 return fActSetup.GetIndexMap().template GlobalToLocal<EDetectorID>(actId);
127 }
128
132 int GeoToActStationId(int geoId) const { return fvGeoToActMap[geoId]; }
133
137 std::pair<EDetectorID, int> GeoToLocStationId(int geoId) const
138 {
139 return fGeoSetup.GetIndexMap().template GlobalToLocal<EDetectorID>(geoId);
140 }
141
146 int LocToActStationId(EDetectorID detId, int locId) const
147 {
148 return fActSetup.GetIndexMap().LocalToGlobal(detId, locId);
149 }
150
155 int LocToGeoStationId(EDetectorID detId, int locId) const
156 {
157 return fGeoSetup.GetIndexMap().LocalToGlobal(detId, locId);
158 }
159
160 private:
162
163 template<typename T>
164 using StationArray_t = std::array<T, constants::size::MaxNstations>;
165
170
172 template<class Archive>
173 void serialize(Archive& ar, const unsigned int /*version*/)
174 {
175 ar& fGeoSetup;
176 ar& fActSetup;
177 ar& fvGeoToActMap;
178 ar& fvActToGeoMap;
179 }
180 };
181
182} // namespace cbm::algo::ca
Compile-time constants definition for the CA tracking algorithm.
Setup representation for the Kalman-filter framework (header)
StationArray_t< int > fvGeoToActMap
Maps geoId -> actId [geoId].
Definition CaSetup.h:168
Setup(const Setup &)=default
Default copy constructor.
std::pair< EDetectorID, int > ActToLocStationId(int actId) const
Converts active station ID to (detector ID, local station ID)
Definition CaSetup.h:124
int GetNofGeoStations() const
Gets total number of geometry stations.
Definition CaSetup.h:110
Setup & operator=(Setup &&)=default
Move assignment operator.
int LocToGeoStationId(EDetectorID detId, int locId) const
Converts (detectorId, local station ID) to geometry station ID.
Definition CaSetup.h:155
int GetNofActStations() const
Gets total number of active stations.
Definition CaSetup.h:103
int ActToGeoStationId(int actId) const
Converts active station ID to geometry station ID.
Definition CaSetup.h:119
friend class Setup
Definition CaSetup.h:56
KfSetup_t fActSetup
Active KF-setup (includes only inactive stations)
Definition CaSetup.h:167
void serialize(Archive &ar, const unsigned int)
Serialization method.
Definition CaSetup.h:173
int LocToActStationId(EDetectorID detId, int locId) const
Converts (detectorId, local station ID) to active station ID.
Definition CaSetup.h:146
Setup(const Setup< SrcFloat > &other)
Copy-convert constructor.
Definition CaSetup.h:73
KfSetup_t fGeoSetup
Geometry KF-setup (includes both active and inactive stations)
Definition CaSetup.h:166
std::pair< EDetectorID, int > GeoToLocStationId(int geoId) const
Converts geometry station ID to (detector ID, local station ID)
Definition CaSetup.h:137
typename kf::Setup< Float > KfSetup_t
Definition CaSetup.h:59
StationArray_t< int > fvActToGeoMap
Maps actId -> geoId [actId].
Definition CaSetup.h:169
std::array< T, constants::size::MaxNstations > StationArray_t
Definition CaSetup.h:164
Setup(Setup &&)=default
Move constructor.
int GetNofActStations(EDetectorID detId) const
Gets number of active stations for a given detector subsystem.
Definition CaSetup.h:107
int GeoToActStationId(int geoId) const
Converts geometry station ID to active station ID.
Definition CaSetup.h:132
~Setup()=default
Destructor.
Setup & operator=(const Setup &other)=default
Copy assignment operator.
friend class boost::serialization::access
Definition CaSetup.h:161
int GetNofGeoStations(EDetectorID detId) const
Gets number of geometry stations for a given detector subsystem.
Definition CaSetup.h:114
const KfSetup_t & GetActiveSetup() const
Constant accessor to the active setup.
Definition CaSetup.h:97
Setup()=default
Default constructor (for serialization)
const KfSetup_t & GetGeometrySetup() const
Constant accessor to the geometry setup.
Definition CaSetup.h:100
KF-framework representation of the detector setup.
Definition KfSetup.h:37
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
EDetectorID
Enumeration for the tracking detector subsystems in CBM-CA.
Definition CbmDefs.h:216