CbmRoot
Loading...
Searching...
No Matches
CaFramework.h
Go to the documentation of this file.
1/* Copyright (C) 2007-2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Maksym Zyzak, Valentina Akishina, Igor Kulakov [committer], Sergei Zharko */
4
5#pragma once // include this header only once per compilation unit
6
7#include "CaBranch.h"
8#include "CaCloneMerger.h"
9#include "CaDefs.h"
10#include "CaGrid.h"
11#include "CaGridEntry.h"
12#include "CaHit.h"
13#include "CaInputData.h"
14#include "CaParameters.h"
15#include "CaSimd.h"
16#include "CaStation.h"
17#include "CaTimer.h"
18#include "CaTimesliceHeader.h"
19#include "CaTrack.h"
20#include "CaTrackFinder.h"
21#include "CaTrackingMonitor.h"
22#include "CaTriplet.h"
23#include "CaVector.h"
24#include "CaWindowData.h"
25#include "KfFramework.h"
26
27#include <array>
28#include <iomanip>
29#include <iostream>
30#include <limits>
31#include <map>
32
33namespace cbm::algo::ca
34{
35 class TripletConstructor;
36 class Track;
37
38 //namespace
39 //{
40 // using cbm::algo::ca::Track; // TMP
41 // using cbm::algo::ca::Vector; // TMP
42 // using cbm::algo::ca::Iteration; // TMP
43 //} // namespace
44
45 // *******************************
46 // ** Types definition (global) **
47 // *******************************
48
49 using CaStationsArray_t = std::array<ca::Station<fvec>, constants::size::MaxNstations>;
50 using Tindex = int; // TODO: Replace with ca::HitIndex_t, if suitable
51
55 class Framework {
56 public:
57 // **********************************
58 // ** Member functions declaration **
59 // **********************************
60
61 // ** Constructors and destructor
62
65
67 Framework(const Framework&) = delete;
68
70 Framework(Framework&&) = delete;
71
73 Framework& operator=(const Framework&) = delete;
74
77
79 ~Framework() = default;
80
83 void SetParameters(const Parameters<fvec>& other) { fParameters = other; }
84 // TODO: remove it (S.Zharko)
85
87 const Parameters<fvec>& GetParameters() const { return fParameters; }
88
90 void ReceiveInputData(InputData&& inputData);
91
93 void ReceiveParameters(Parameters<fvec>&& parameters);
94
96 const InputData& GetInputData() const { return fInputData; }
97
98 int PackIndex(const int& a, const int& b, const int& c);
99
100 int UnPackIndex(const int& i, int& a, int& b, int& c);
101
107
111
115
117 const TimesliceHeader& GetTsHeader() const { return fTsHeader; }
118
119 /*********************************************************************************************/
124 void Init(const TrackingMode mode);
125
126 void Finish();
127
128 void PrintHits();
129
132
134 void SetMonitorData(const TrackingMonitorData& monitorData) { fMonitorData = monitorData; }
135
136 TrackingMode GetTrackingMode() { return fpTrackFinder->GetTrackingMode(); }
137
138 const std::vector<ca::WindowData>& GetWData() { return fpTrackFinder->GetWData(); }
139
140 public:
142 {
143 std::tie(fRecoTracks, fRecoHits) = fpTrackFinder->FindTracks(fInputData, fTsHeader);
144 return;
145 };
146
148 // int GetNstationsBeforePipe() const { return fNstationsBeforePipe; }
149
151 static int GetMcTrackIdForCaHit(int iHit);
152
154 static int GetMcTrackIdForWindowHit(int iGridHit);
155
156 // const CbmL1MCTrack* GetMcTrackForWindowHit(int iHit) const;
157
159 void SetNofThreads(int nThreads)
160 {
161 fNofThreads = nThreads;
162 assert(nThreads > 0);
163 LOG(info) << "ca::Framework: number of threads is set to " << fNofThreads;
164 }
165
167 int GetNofThreads() const { return fNofThreads; }
168
169 private:
173
174 // ***************************
175 // ** Member variables list **
176 // ***************************
177
180
182 "Framework::fvHitKeyFlags"};
183
185
186 int fNofThreads = 1;
188 bool checkTripletMatch(const ca::Triplet& l, const ca::Triplet& r, fscal& dchi2) const;
189
190 std::unique_ptr<ca::TrackFinder> fpTrackFinder;
191
192 public:
193 // Vector<CaHitTimeInfo> fHitTimeInfo;
194
195 double fCaRecoTime{0.}; // time of the track finder + fitter
196
197 Vector<Track> fRecoTracks{"Framework::fRecoTracks"};
198 Vector<ca::HitIndex_t> fRecoHits{"Framework::fRecoHits"};
199
201 fvec Err{0.f};
202
203 public:
205
206} // namespace cbm::algo::ca
Compile-time constants definition for the CA tracking algorithm.
A class to store hit information in a backet-sorted way on 2D grid.
A generic hit for the CA tracker (header)
Structure for input data to the L1 tracking algorithm (declaration)
Timer class for CA tracking (header)
A structure to keep all the common information on the timeslice coming from tracking.
source file for the ca::Track class
Monitor specialization for the tracking algorithm.
Container for all data, which are processed within a single sub-timeslice (implementation)
The Kalman-filter framework main class (header)
const TrackingMonitorData & GetMonitorData() const
Gets monitor data.
static int GetMcTrackIdForCaHit(int iHit)
Gets number of stations before the pipe (MVD stations in CBM)
int GetNofThreads() const
Gets number of threads.
void SetDefaultParticleMass(fscal mass)
Sets a default particle mass for the track fit.
int PackIndex(const int &a, const int &b, const int &c)
Framework(Framework &&)=delete
Move constructor.
static int GetMcTrackIdForWindowHit(int iGridHit)
Get mc track ID for a hit (debug tool)
const TimesliceHeader & GetTsHeader() const
Gets timeslice header.
const InputData & GetInputData() const
Gets pointer to input data object for external access.
Definition CaFramework.h:96
Framework()
Constructor.
Definition CaFramework.h:64
Vector< Track > fRecoTracks
reconstructed tracks
void SetNofThreads(int nThreads)
Sets number of threads.
std::unique_ptr< ca::TrackFinder > fpTrackFinder
Track finder steer class for the entire time slice.
InputData fInputData
Tracking input data.
void ReceiveParameters(Parameters< fvec > &&parameters)
Receives tracking parameters.
TrackingMode GetTrackingMode()
fscal fDefaultMass
mass of the propagated particle [GeV/c2]
int fNstationsBeforePipe
number of stations before pipe (MVD stations in CBM)
TrackingMonitorData fMonitorData
Tracking monitor data (statistics per call)
Vector< ca::HitIndex_t > fRecoHits
packed hits of reconstructed tracks
fscal GetDefaultParticleMass() const
void ReceiveInputData(InputData &&inputData)
Receives input data.
const std::vector< ca::WindowData > & GetWData()
bool checkTripletMatch(const ca::Triplet &l, const ca::Triplet &r, fscal &dchi2) const
void SetParameters(const Parameters< fvec > &other)
Definition CaFramework.h:83
Framework & operator=(Framework &&)=delete
Move assignment operator.
Framework & operator=(const Framework &)=delete
Copy assignment operator.
Vector< unsigned char > fvHitKeyFlags
List of key flags: has been this hit or cluster already used.
void SetMonitorData(const TrackingMonitorData &monitorData)
Sets monitor data.
void Init(const TrackingMode mode)
fscal GetDefaultParticleMass2() const
TimesliceHeader fTsHeader
current timeslice header
Parameters< fvec > fParameters
Object of Framework parameters class.
const Parameters< fvec > & GetParameters() const
Gets a pointer to the Framework parameters object.
Definition CaFramework.h:87
Framework(const Framework &)=delete
Copy constructor.
~Framework()=default
Destructor.
int UnPackIndex(const int &i, int &a, int &b, int &c)
A container for all external parameters of the CA tracking algorithm.
Structure for keeping the current information on the timeslice.
Triplet class represents a short 3-hits track segment called a "triplet".
Definition CaTriplet.h:22
constexpr fscal MuonMass
Particle masses etc used for the track fit, fscal precision.
Definition CaDefs.h:83
constexpr int MaxNstations
Max number of stations, 2^6 = 64.
Definition CaDefs.h:44
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
class cbm::algo::ca::WindowData _fvecalignment
kf::fscal fscal
Definition CaSimd.h:14
std::array< ca::Station< fvec >, constants::size::MaxNstations > CaStationsArray_t
Definition CaFramework.h:49