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 "CaMcData.h"
15#include "CaMcMatch.h"
16#include "CaParameters.h"
17#include "CaSimd.h"
18#include "CaTimer.h"
19#include "CaTimesliceHeader.h"
20#include "CaTrack.h"
21#include "CaTrackFinder.h"
22#include "CaTrackingMonitor.h"
23#include "CaTriplet.h"
24#include "CaVector.h"
25#include "CaWindowData.h"
26#include "KfFramework.h"
27
28#include <array>
29#include <iomanip>
30#include <iostream>
31#include <limits>
32#include <map>
33
34namespace cbm::algo::ca
35{
37 class Track;
38
39 //namespace
40 //{
41 // using cbm::algo::ca::Track; // TMP
42 // using cbm::algo::ca::Vector; // TMP
43 // using cbm::algo::ca::Iteration; // TMP
44 //} // namespace
45
46 // *******************************
47 // ** Types definition (global) **
48 // *******************************
49
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 /*********************************************************************************************/
122
123
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 int GetBestMcTrackIdForCaHit(int iHit) const;
152
153 McMatch GetMcMatchForCaHit(int iHit) const;
154
156 void SetNofThreads(int nThreads)
157 {
158 fNofThreads = nThreads;
159 assert(nThreads > 0);
160 LOG(info) << "ca::Framework: number of threads is set to " << fNofThreads;
161 }
162
164 int GetNofThreads() const { return fNofThreads; }
165
166 void SetMcData(const ca::McData* pMCData) { fpMcData = pMCData; }
167
168 const ca::McData* GetMcData() const { return fpMcData; }
169
170 private:
174
175 // ***************************
176 // ** Member variables list **
177 // ***************************
178
181
183 "Framework::fvHitKeyFlags"};
184
186
187 int fNofThreads = 1;
189 bool checkTripletMatch(const ca::Triplet& l, const ca::Triplet& r, fscal& dchi2) const;
190
191 std::unique_ptr<ca::TrackFinder> fpTrackFinder;
192
194
195 public:
196 // Vector<CaHitTimeInfo> fHitTimeInfo;
197
198 double fCaRecoTime{0.}; // time of the track finder + fitter
199
200 Vector<Track> fRecoTracks{"Framework::fRecoTracks"};
201 Vector<ca::HitIndex_t> fRecoHits{"Framework::fRecoHits"};
202
204 fvec Err{0.f};
205
206 public:
208
209} // 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)
Data structure for internal tracking MC-information (header)
Data structure to represent a set of MC links in CA tracking MC module.
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)
#define _fvecalignment
const TrackingMonitorData & GetMonitorData() const
Gets monitor data.
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.
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
const ca::McData * GetMcData() const
fscal GetDefaultParticleMass() const
McMatch GetMcMatchForCaHit(int iHit) const
void ReceiveInputData(InputData &&inputData)
Receives input data.
const ca::McData * fpMcData
Monte Carlo data container.
const std::vector< ca::WindowData > & GetWData()
bool checkTripletMatch(const ca::Triplet &l, const ca::Triplet &r, fscal &dchi2) const
int GetBestMcTrackIdForCaHit(int iHit) const
Gets number of stations before the pipe (MVD stations in CBM)
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)
void SetMcData(const ca::McData *pMCData)
This class represents a package for tracking-related data.
Definition CaMcData.h:33
A container for all external parameters of the CA tracking algorithm.
Structure for keeping the current information on the timeslice.
Class representing an output track in the CA tracking algorithm.
Definition CaTrack.h:28
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:90
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
MonitorData< ECounter, ETimer > TrackingMonitorData
kf::fscal fscal
Definition CaSimd.h:14
kf::fvec fvec
Definition CaSimd.h:13