CbmRoot
Loading...
Searching...
No Matches
CaSearchWindow.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
5#include "CaSearchWindow.h"
6
7#include <cassert>
8#include <iomanip>
9#include <sstream>
10
12
13// ---------------------------------------------------------------------------------------------------------------------
14//
15SearchWindow::SearchWindow(int stationID, int trackGrID) : fStationID(stationID), fTrackGroupID(trackGrID)
16{
17 assert(stationID > -1);
18 assert(trackGrID > -1);
19
20 // Case for constant windows (TEMPORARY: we should add selection of different windows):
21 static_assert(kNpars == 1);
22}
23
24// TODO: SZh 08.11.2022: Probably, we should have the assertions in the InitManager and remove them from here, since
25// this class is supposed to be used inside the algorithm core
26// ---------------------------------------------------------------------------------------------------------------------
27//
28void SearchWindow::SetParamDxMaxVsX0(int id, float val)
29{
30 assert(id > -1 && id < kNpars);
31 fvParams[kDxMaxVsX0 * kNpars + id] = val;
32}
33
34// ---------------------------------------------------------------------------------------------------------------------
35//
36void SearchWindow::SetParamDxMinVsX0(int id, float val)
37{
38 assert(id > -1 && id < kNpars);
39 fvParams[kDxMinVsX0 * kNpars + id] = val;
40}
41
42// ---------------------------------------------------------------------------------------------------------------------
43//
44void SearchWindow::SetParamDxMaxVsY0(int id, float val)
45{
46 assert(id > -1 && id < kNpars);
47 fvParams[kDxMaxVsY0 * kNpars + id] = val;
48}
49
50// ---------------------------------------------------------------------------------------------------------------------
51//
52void SearchWindow::SetParamDxMinVsY0(int id, float val)
53{
54 assert(id > -1 && id < kNpars);
55 fvParams[kDxMinVsY0 * kNpars + id] = val;
56}
57
58// ---------------------------------------------------------------------------------------------------------------------
59//
60void SearchWindow::SetParamDyMaxVsX0(int id, float val)
61{
62 assert(id > -1 && id < kNpars);
63 fvParams[kDyMaxVsX0 * kNpars + id] = val;
64}
65
66// ---------------------------------------------------------------------------------------------------------------------
67//
68void SearchWindow::SetParamDyMinVsX0(int id, float val)
69{
70 assert(id > -1 && id < kNpars);
71 fvParams[kDyMinVsX0 * kNpars + id] = val;
72}
73
74// ---------------------------------------------------------------------------------------------------------------------
75//
76void SearchWindow::SetParamDyMaxVsY0(int id, float val)
77{
78 assert(id > -1 && id < kNpars);
79 fvParams[kDyMaxVsY0 * kNpars + id] = val;
80}
81
82// ---------------------------------------------------------------------------------------------------------------------
83//
84void SearchWindow::SetParamDyMinVsY0(int id, float val)
85{
86 assert(id > -1 && id < kNpars);
87 fvParams[kDyMinVsY0 * kNpars + id] = val;
88}
89
90// ---------------------------------------------------------------------------------------------------------------------
91//
92std::string SearchWindow::ToString() const
93{
94 using std::setw;
95 std::stringstream msg;
96 msg << "----- CA hits search window: \n";
97 msg << "\tstation ID: " << fStationID << '\n';
98 msg << "\ttracks group ID: " << fTrackGroupID << '\n';
99 msg << "\tparameters:\n";
100 msg << "\t\t" << setw(6) << "No." << ' ';
101 msg << setw(12) << "dx_max(x0)" << ' ';
102 msg << setw(12) << "dx_min(x0)" << ' ';
103 msg << setw(12) << "dx_max(y0)" << ' ';
104 msg << setw(12) << "dx_min(y0)" << ' ';
105 msg << setw(12) << "dy_max(x0)" << ' ';
106 msg << setw(12) << "dy_min(x0)" << ' ';
107 msg << setw(12) << "dy_max(y0)" << ' ';
108 msg << setw(12) << "dy_min(y0)" << '\n';
109 for (int iPar = 0; iPar < kNpars; ++iPar) {
110 msg << "\t\t" << setw(6) << iPar << ' ';
111 for (int iDep = 0; iDep < kNdeps; ++iDep) {
112 msg << setw(12) << fvParams[iDep * kNpars + iPar] << ' ';
113 }
114 }
115 return msg.str();
116}
Class L1SearchWindow defines a parameterisation of hits search window for CA tracking algorithm TODO:...
void SetParamDxMinVsX0(int id, float val)
Sets parameters for dx_min(x0)
void SetParamDyMaxVsX0(int id, float val)
Sets parameters for dy_max(x0)
void SetParamDxMaxVsY0(int id, float val)
Sets parameters for dx_max(y0)
static constexpr unsigned char kNpars
Max number of parameters for one dependency.
SearchWindow()=default
Default constructor.
int fTrackGroupID
Index of tracks group.
void SetParamDyMinVsX0(int id, float val)
Sets parameters for dy_min(x0)
std::array< float, kNdeps *kNpars > fvParams
Search window parameter array containing parameters from.
void SetParamDyMaxVsY0(int id, float val)
Sets parameters for dy_max(y0)
void SetParamDxMinVsY0(int id, float val)
Sets parameters for dx_min(y0)
void SetParamDyMinVsY0(int id, float val)
Sets parameters for dy_min(y0)
void SetParamDxMaxVsX0(int id, float val)
Sets parameters for dx_max(x0)
int fStationID
Global index of active tracking station.
std::string ToString() const
String representation of the contents.
static constexpr unsigned char kNdeps
Number of the dependencies.