CbmRoot
Loading...
Searching...
No Matches
CaDefs.h
Go to the documentation of this file.
1/* Copyright (C) 2022-2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov, Sergei Zharko [committer] */
4
9
10#pragma once // include this header only once per compilation unit
11
12#include "CaSimd.h"
13#include "KfFramework.h"
14#include "KfTrackParam.h"
15
16#include <limits>
17
18namespace cbm::algo::ca
19{
22} // namespace cbm::algo::ca
23
27{
28
30 namespace size
31 {
34
38
40 constexpr unsigned int StationBits = 6u;
41 constexpr unsigned int TripletBits = 32u - StationBits;
42
43 constexpr int MaxNdetectors = 5;
44 constexpr int MaxNstations = 1u << StationBits;
45 constexpr int MaxNtriplets = 1u << TripletBits;
46
47 constexpr uint8_t DetBits = 4u;
48
51 constexpr int MaxNtrackGroups = 4;
52
53 } // namespace size
54
55
57 namespace control
58 {
66 constexpr int InputDataQaLevel = 0;
67
68 } // namespace control
69
71 namespace phys
72 {
74 constexpr double MuonMassD = 0.105658375523;
75 constexpr double PionMassD = 0.1395703918;
76 constexpr double KaonMassD = 0.493677f;
77 constexpr double ElectronMassD = 0.0005109989500015;
78 constexpr double ProtonMassD = 0.93827208816;
79 constexpr double SpeedOfLightD = 29.9792458;
80 constexpr double SpeedOfLightInvD = 1. / SpeedOfLightD;
81
83 constexpr fscal MuonMass = MuonMassD;
84 constexpr fscal PionMass = PionMassD;
85 constexpr fscal KaonMass = KaonMassD;
89 constexpr fscal SpeedOfLightInv = SpeedOfLightInvD;
90
91 } // namespace phys
92
94 namespace math
95 {
96 constexpr double Pi = 3.14159265358979323846;
97 } // namespace math
98
100 namespace misc
101 {
102 constexpr int AssertionLevel = 0;
103 constexpr int Alignment = 16;
104 constexpr fscal NegligibleFieldkG = 1.e-4;
105
106 } // namespace misc
107
109 template<typename T1, typename T2 = T1>
110 constexpr T2 Undef;
111
112 template<>
113 inline constexpr int Undef<int> = std::numeric_limits<int>::min();
114
115 template<>
116 inline constexpr unsigned Undef<unsigned> = std::numeric_limits<unsigned>::max();
117
118 template<>
119 inline constexpr float Undef<float> = std::numeric_limits<float>::signaling_NaN();
120
121 template<>
122 inline constexpr double Undef<double> = std::numeric_limits<double>::signaling_NaN();
123
124 template<>
125 inline constexpr fscal Undef<fvec> = std::numeric_limits<fscal>::signaling_NaN();
126
127
129 namespace clrs
130 {
131 // NOTE: To be used first, because different users may have different console bg and fg colors
132 constexpr char CL[] = "\e[0m";
133 constexpr char CLb[] = "\e[1m";
134 constexpr char CLi[] = "\e[3m";
135 constexpr char CLu[] = "\e[4m";
136 constexpr char CLr[] = "\e[7m";
137 constexpr char CLbi[] = "\e[1;3m";
138 constexpr char CLbu[] = "\e[1;4m";
139 constexpr char CLbr[] = "\e[1;7m";
140
141 // regular
142 constexpr char BK[] = "\e[30m";
143 constexpr char RD[] = "\e[31m";
144 constexpr char GN[] = "\e[32m";
145 constexpr char YL[] = "\e[33m";
146 constexpr char BL[] = "\e[34m";
147 constexpr char MG[] = "\e[35m";
148 constexpr char CY[] = "\e[36m";
149 constexpr char GY[] = "\e[37m";
150 constexpr char WT[] = "\e[38m";
151
152 // bold
153 constexpr char BKb[] = "\e[1;30m";
154 constexpr char RDb[] = "\e[1;31m";
155 constexpr char GNb[] = "\e[1;32m";
156 constexpr char YLb[] = "\e[1;33m";
157 constexpr char BLb[] = "\e[1;34m";
158 constexpr char MGb[] = "\e[1;35m";
159 constexpr char CYb[] = "\e[1;36m";
160 constexpr char GYb[] = "\e[1;37m";
161 constexpr char WTb[] = "\e[1;38m";
162
163 // italic
164 constexpr char BKi[] = "\e[3;30m";
165 constexpr char RDi[] = "\e[3;31m";
166 constexpr char GNi[] = "\e[3;32m";
167 constexpr char YLi[] = "\e[3;33m";
168 constexpr char BLi[] = "\e[3;34m";
169 constexpr char MGi[] = "\e[3;35m";
170 constexpr char CYi[] = "\e[3;36m";
171 constexpr char GYi[] = "\e[3;37m";
172 constexpr char WTi[] = "\e[3;38m";
173
174 // underline
175 constexpr char BKu[] = "\e[4;30m";
176 constexpr char RDu[] = "\e[4;31m";
177 constexpr char GNu[] = "\e[4;32m";
178 constexpr char YLu[] = "\e[4;33m";
179 constexpr char BLu[] = "\e[4;34m";
180 constexpr char MGu[] = "\e[4;35m";
181 constexpr char CYu[] = "\e[4;36m";
182 constexpr char GYu[] = "\e[4;37m";
183 constexpr char WTu[] = "\e[4;38m";
184
185 // reverse
186 constexpr char BKr[] = "\e[7;30m";
187 constexpr char RDr[] = "\e[7;31m";
188 constexpr char GNr[] = "\e[7;32m";
189 constexpr char YLr[] = "\e[7;33m";
190 constexpr char BLr[] = "\e[7;34m";
191 constexpr char MGr[] = "\e[7;35m";
192 constexpr char CYr[] = "\e[7;36m";
193 constexpr char GYr[] = "\e[7;37m";
194 constexpr char WTr[] = "\e[7;38m";
195
196 // bold-underline
197 constexpr char BKbu[] = "\e[1;4;30m";
198 constexpr char RDbu[] = "\e[1;4;31m";
199 constexpr char GNbu[] = "\e[1;4;32m";
200 constexpr char YLbu[] = "\e[1;4;33m";
201 constexpr char BLbu[] = "\e[1;4;34m";
202 constexpr char MGbu[] = "\e[1;4;35m";
203 constexpr char CYbu[] = "\e[1;4;36m";
204 constexpr char GYbu[] = "\e[1;4;37m";
205 constexpr char WTbu[] = "\e[1;4;38m";
206
207 // bold-italic
208 constexpr char BKbi[] = "\e[1;3;30m";
209 constexpr char RDbi[] = "\e[1;3;31m";
210 constexpr char GNbi[] = "\e[1;3;32m";
211 constexpr char YLbi[] = "\e[1;3;33m";
212 constexpr char BLbi[] = "\e[1;3;34m";
213 constexpr char MGbi[] = "\e[1;3;35m";
214 constexpr char CYbi[] = "\e[1;3;36m";
215 constexpr char GYbi[] = "\e[1;3;37m";
216 constexpr char WTbi[] = "\e[1;3;38m";
217
218 // bold-reverse
219 constexpr char BKbr[] = "\e[1;7;30m";
220 constexpr char RDbr[] = "\e[1;7;31m";
221 constexpr char GNbr[] = "\e[1;7;32m";
222 constexpr char YLbr[] = "\e[1;7;33m";
223 constexpr char BLbr[] = "\e[1;7;34m";
224 constexpr char MGbr[] = "\e[1;7;35m";
225 constexpr char CYbr[] = "\e[1;7;36m";
226 constexpr char GYbr[] = "\e[1;7;37m";
227 constexpr char WTbr[] = "\e[1;7;38m";
228 } // namespace clrs
229} // namespace cbm::algo::ca::constants
The Kalman-filter framework main class (header)
static constexpr size_t size()
Definition KfSimdPseudo.h:2
TrackParam classes of different types.
Colors of terminal log messages.
Definition CaDefs.h:130
constexpr char CYbr[]
bold-reverse cyan
Definition CaDefs.h:225
constexpr char CYbi[]
bold-italic cyan
Definition CaDefs.h:214
constexpr char WTi[]
italic white
Definition CaDefs.h:172
constexpr char GYbr[]
bold-reverse grey
Definition CaDefs.h:226
constexpr char GNbr[]
bold-reverse green
Definition CaDefs.h:221
constexpr char WTbu[]
bold-underline white
Definition CaDefs.h:205
constexpr char CLr[]
clear reverse
Definition CaDefs.h:136
constexpr char MGu[]
underline magenta
Definition CaDefs.h:180
constexpr char GNr[]
reverse green
Definition CaDefs.h:188
constexpr char BKbr[]
bold-reverse black
Definition CaDefs.h:219
constexpr char GYu[]
underline grey
Definition CaDefs.h:182
constexpr char GNu[]
underline green
Definition CaDefs.h:177
constexpr char RD[]
normal red
Definition CaDefs.h:143
constexpr char GYr[]
reverse grey
Definition CaDefs.h:193
constexpr char CY[]
normal cyan
Definition CaDefs.h:148
constexpr char GNi[]
italic green
Definition CaDefs.h:166
constexpr char CLi[]
clear italic
Definition CaDefs.h:134
constexpr char MGr[]
reverse magenta
Definition CaDefs.h:191
constexpr char BKr[]
reverse black
Definition CaDefs.h:186
constexpr char BK[]
normal black
Definition CaDefs.h:142
constexpr char GYi[]
italic grey
Definition CaDefs.h:171
constexpr char GY[]
normal grey
Definition CaDefs.h:149
constexpr char GNbu[]
bold-underline green
Definition CaDefs.h:199
constexpr char BKu[]
underline black
Definition CaDefs.h:175
constexpr char MGbr[]
bold-reverse magenta
Definition CaDefs.h:224
constexpr char CYr[]
reverse cyan
Definition CaDefs.h:192
constexpr char YLbu[]
bold-underline yellow
Definition CaDefs.h:200
constexpr char WTbr[]
bold-reverse white
Definition CaDefs.h:227
constexpr char BL[]
normal blue
Definition CaDefs.h:146
constexpr char RDu[]
underline red
Definition CaDefs.h:176
constexpr char WTbi[]
bold-italic white
Definition CaDefs.h:216
constexpr char CLbr[]
clear bold-reverse
Definition CaDefs.h:139
constexpr char GYb[]
bold grey
Definition CaDefs.h:160
constexpr char WTr[]
reverse white
Definition CaDefs.h:194
constexpr char YL[]
normal yellow
Definition CaDefs.h:145
constexpr char MGi[]
italic magenta
Definition CaDefs.h:169
constexpr char CYi[]
italic cyan
Definition CaDefs.h:170
constexpr char YLu[]
underline yellow
Definition CaDefs.h:178
constexpr char CLbu[]
clear bold-underline
Definition CaDefs.h:138
constexpr char YLi[]
italic yellow
Definition CaDefs.h:167
constexpr char CLu[]
clear underline
Definition CaDefs.h:135
constexpr char BLbi[]
bold-italic blue
Definition CaDefs.h:212
constexpr char RDbi[]
bold-italic red
Definition CaDefs.h:209
constexpr char BLbu[]
bold-underline blue
Definition CaDefs.h:201
constexpr char WTu[]
underline white
Definition CaDefs.h:183
constexpr char MGbu[]
bold-underline magenta
Definition CaDefs.h:202
constexpr char CYb[]
bold cyan
Definition CaDefs.h:159
constexpr char BKbu[]
bold-underline black
Definition CaDefs.h:197
constexpr char RDi[]
italic red
Definition CaDefs.h:165
constexpr char MGb[]
bold magenta
Definition CaDefs.h:158
constexpr char GNbi[]
bold-italic green
Definition CaDefs.h:210
constexpr char GYbu[]
bold-underline grey
Definition CaDefs.h:204
constexpr char BLbr[]
bold-reverse blue
Definition CaDefs.h:223
constexpr char WTb[]
bold white
Definition CaDefs.h:161
constexpr char BKb[]
bold black
Definition CaDefs.h:153
constexpr char MGbi[]
bold-italic magenta
Definition CaDefs.h:213
constexpr char BKi[]
italic black
Definition CaDefs.h:164
constexpr char RDbu[]
bold-underline red
Definition CaDefs.h:198
constexpr char BKbi[]
bold-italic black
Definition CaDefs.h:208
constexpr char CYbu[]
bold-underline cyan
Definition CaDefs.h:203
constexpr char GYbi[]
bold-italic grey
Definition CaDefs.h:215
constexpr char MG[]
normal magenta
Definition CaDefs.h:147
constexpr char BLb[]
bold blue
Definition CaDefs.h:157
constexpr char CYu[]
underline cyan
Definition CaDefs.h:181
constexpr char BLu[]
underline blue
Definition CaDefs.h:179
constexpr char GN[]
normal green
Definition CaDefs.h:144
constexpr char RDr[]
reverse red
Definition CaDefs.h:187
constexpr char YLbr[]
bold-reverse yellow
Definition CaDefs.h:222
constexpr char BLr[]
reverse blue
Definition CaDefs.h:190
constexpr char CLbi[]
clear bold-italic
Definition CaDefs.h:137
constexpr char YLb[]
bold yellow
Definition CaDefs.h:156
constexpr char WT[]
normal white
Definition CaDefs.h:150
constexpr char YLr[]
reverse yellow
Definition CaDefs.h:189
constexpr char YLbi[]
bold-italic yellow
Definition CaDefs.h:211
constexpr char RDbr[]
bold-reverse red
Definition CaDefs.h:220
constexpr char CLb[]
clear bold
Definition CaDefs.h:133
constexpr char BLi[]
italic blue
Definition CaDefs.h:168
constexpr int InputDataQaLevel
Flag: input data QA level.
Definition CaDefs.h:66
constexpr int Alignment
Default alignment of data (bytes)
Definition CaDefs.h:103
constexpr int AssertionLevel
Assertion level.
Definition CaDefs.h:102
constexpr fscal NegligibleFieldkG
Negligible field [kG].
Definition CaDefs.h:104
Physics constants.
Definition CaDefs.h:72
constexpr double PionMassD
Pion mass [GeV/c2].
Definition CaDefs.h:75
constexpr fscal ElectronMass
Electron mass [GeV/c2].
Definition CaDefs.h:86
constexpr fscal KaonMass
Kaon mass [GeV/c2] (PDG 22.08.2023)
Definition CaDefs.h:85
constexpr double MuonMassD
Particle masses etc used for the track fit, double precision.
Definition CaDefs.h:74
constexpr double ProtonMassD
Proton mass [GeV/c2] (PDG 11.08.2022)
Definition CaDefs.h:78
constexpr fscal PionMass
Pion mass [GeV/c2].
Definition CaDefs.h:84
constexpr double SpeedOfLightD
Speed of light [cm/ns].
Definition CaDefs.h:79
constexpr fscal MuonMass
Particle masses etc used for the track fit, fscal precision.
Definition CaDefs.h:83
constexpr fscal SpeedOfLight
Speed of light [cm/ns].
Definition CaDefs.h:88
constexpr double KaonMassD
Kaon mass [GeV/c2] (PDG 22.08.2023)
Definition CaDefs.h:76
constexpr fscal ProtonMass
Proton mass [GeV/c2] (PDG 11.08.2022)
Definition CaDefs.h:87
constexpr double SpeedOfLightInvD
Inverse speed of light [ns/cm].
Definition CaDefs.h:80
constexpr double ElectronMassD
Electron mass [GeV/c2].
Definition CaDefs.h:77
constexpr unsigned int StationBits
Amount of bits to code a station or triplet. This values determine the maximum number of stations and...
Definition CaDefs.h:40
constexpr uint8_t DetBits
Maximum 16 detector systems.
Definition CaDefs.h:47
constexpr int MaxFieldApproxPolynomialOrder
Order of polynomial to approximate field in the vicinity of station plane.
Definition CaDefs.h:33
constexpr int MaxNtrackGroups
Definition CaDefs.h:51
constexpr unsigned int TripletBits
Amount of bits to code one triplet.
Definition CaDefs.h:41
constexpr int MaxNtriplets
Max number of triplets, 2^26 = 67,108,864.
Definition CaDefs.h:45
constexpr int MaxNFieldApproxCoefficients
Amount of coefficients in field approximations.
Definition CaDefs.h:36
constexpr int MaxNdetectors
Max number of tracking detectors.
Definition CaDefs.h:43
constexpr T2 Undef
Undefined values.
Definition CaDefs.h:110
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
kf::fscal fscal
Definition CaSimd.h:14