CbmRoot
Loading...
Searching...
No Matches
CaSearchWindowMapContainer.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"
15
16#include <boost/serialization/array.hpp>
17
18#include <string>
19
20namespace cbm::algo::ca
21{
26
27 public:
31
34
35 using DoubletSwContainer_t = std::array<DoubletSearchWindowMap, kNofDoubletSw>;
36 using TripletSwContainer_t = std::array<TripletSearchWindowMap, kNofTripletSw>;
37
42 DoubletSearchWindowMap& DoubletSw(int iIter, int iSta, int iGap)
43 {
44 return fDoubletSwMaps[DoubletSwIndex(iIter, iSta, iGap)];
45 }
46
51 const DoubletSearchWindowMap& DoubletSw(int iIter, int iSta, int iGap) const
52 {
53 return fDoubletSwMaps[DoubletSwIndex(iIter, iSta, iGap)];
54 }
55
61 TripletSearchWindowMap& TripletSw(int iIter, int iSta, int iGapL, int iGapM)
62 {
63 return fTripletSwMaps[TripletSwIndex(iIter, iSta, iGapL, iGapM)];
64 }
65
71 const TripletSearchWindowMap& TripletSw(int iIter, int iSta, int iGapL, int iGapM) const
72 {
73 return fTripletSwMaps[TripletSwIndex(iIter, iSta, iGapL, iGapM)];
74 }
75
76 private:
79
84 [[gnu::always_inline]] static size_t DoubletSwIndex(int iIter, int iSta, int iGap)
85 {
86 assert(iIter >= 0 && iIter < kMaxNofIterations);
87 assert(iSta >= 0 && iSta < kMaxNofStations);
88 assert(iGap >= 0 && iGap < kMaxNofTripletGaps);
89 return kMaxNofTripletGaps * (kMaxNofStations * iIter + iSta) + iGap;
90 }
91
97 [[gnu::always_inline]] static size_t TripletSwIndex(int iIter, int iSta, int iGapL, int iGapM)
98 {
99 assert(iIter >= 0 && iIter < kMaxNofIterations);
100 assert(iSta >= 0 && iSta < kMaxNofStations);
101 assert(iGapL >= 0 && iGapL < kMaxNofTripletGaps);
102 assert(iGapM >= 0 && iGapM < kMaxNofTripletGaps);
103 return kMaxNofTripletGaps * (kMaxNofTripletGaps * (kMaxNofStations * iIter + iSta) + iGapL) + iGapM;
104 }
105
107 template<class Archive>
108 void serialize(Archive& ar, const unsigned int)
109 {
110 ar& fDoubletSwMaps;
111 ar& fTripletSwMaps;
112 }
113 };
114} // namespace cbm::algo::ca
Compile-time constants definition for the CA tracking algorithm.
Provides parameterisation for hit search area for doublets in the CA tracking.
Provides parameterisation for hit search area for Triplets in the CA tracking.
Class DoubletSearchWindowMap parameterisation for hit search area for doublets in the CA tracking.
static size_t TripletSwIndex(int iIter, int iSta, int iGapL, int iGapM)
Maps iteration, station and gap indices to a global triplet SW index.
static constexpr int kMaxNofStations
Max number of stations.
DoubletSwContainer_t fDoubletSwMaps
Doublet search windows.
std::array< TripletSearchWindowMap, kNofTripletSw > TripletSwContainer_t
Container of triplet SWs.
std::array< DoubletSearchWindowMap, kNofDoubletSw > DoubletSwContainer_t
Container of doublet SWs.
static constexpr int kMaxNofTripletGaps
Max number of gaps in triplets.
DoubletSearchWindowMap & DoubletSw(int iIter, int iSta, int iGap)
Mutable accessor to doublet search window map.
const TripletSearchWindowMap & TripletSw(int iIter, int iSta, int iGapL, int iGapM) const
Constant accessor to triplet search window map.
void serialize(Archive &ar, const unsigned int)
Serialization function.
friend class boost::serialization::access
const DoubletSearchWindowMap & DoubletSw(int iIter, int iSta, int iGap) const
Constant accessor to doublet search window map.
TripletSearchWindowMap & TripletSw(int iIter, int iSta, int iGapL, int iGapM)
Mutual accessor to triplet search window map.
static constexpr int kMaxNofIterations
Max number of iterations.
TripletSwContainer_t fTripletSwMaps
Triplet search windows.
static size_t DoubletSwIndex(int iIter, int iSta, int iGap)
Maps iteration, station and gap indices to a global doublet SW index.
Class TripletSearchWindowMap parameterisation for hit search area for Triplets in the CA tracking.
constexpr int MaxNstations
Max number of stations, 2^6 = 64.
Definition CaDefs.h:44
constexpr int MaxNiterations
Max number of iterations in the track finder.
Definition CaDefs.h:50
constexpr int MaxTripletGap
Max gaps in the triplet.
Definition CaDefs.h:53
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14