Project
Loading...
Searching...
No Matches
GPUDisplayMagneticField.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
16#include "GPULogging.h"
17
18#include <fstream>
19#include <random>
20#include <cassert>
21
22#ifndef GPUCA_NO_ROOT
23#include <TGeoGlobalMagField.h>
24#endif
25#if !defined(GPUCA_NO_ROOT) && !defined(GPUCA_STANDALONE)
29#endif
30
31using namespace o2::gpu;
32
37
38#ifndef GPUCA_STANDALONE
43#endif
44
46{
47 std::mt19937 rng(0xDEADBEEF);
48
49 // TODO: fetch these values from somewhere?
50 std::uniform_int_distribution<int32_t> generator_x(-512, 512);
51 std::uniform_int_distribution<int32_t> generator_y(-512, 512);
52 std::uniform_int_distribution<int32_t> generator_z(-455 - 1312, -455 + 1312);
53
55
56 for (std::size_t i = 0; i < count; ++i) {
57 mFieldLineSeedPoints.emplace_back(generator_x(rng), generator_y(rng), generator_z(rng));
58 }
59}
60
61template <std::size_t MAX_DIM1_SEGMENTS, std::size_t MAX_DIM2_SEGMENTS, std::size_t MAX_DIM3_SEGMENTS>
63{
64 file.read(reinterpret_cast<char*>(&segments.MinZ), sizeof(segments.MinZ));
65 file.read(reinterpret_cast<char*>(&segments.MaxZ), sizeof(segments.MaxZ));
66 file.read(reinterpret_cast<char*>(&segments.MultiplicativeFactor), sizeof(segments.MultiplicativeFactor));
67
68 std::size_t NSegDim1, NSegDim2, NSegDim3;
69
70 file.read(reinterpret_cast<char*>(&NSegDim1), sizeof(std::int32_t));
71 assert(NSegDim1 <= MAX_DIM1_SEGMENTS);
72
73 segments.ZSegments = NSegDim1;
74
75 file.read(reinterpret_cast<char*>(segments.SegDim1), NSegDim1 * sizeof(segments.SegDim1[0]));
76
77 file.read(reinterpret_cast<char*>(segments.BegSegDim2), NSegDim1 * sizeof(segments.BegSegDim2[0]));
78 file.read(reinterpret_cast<char*>(segments.NSegDim2), NSegDim1 * sizeof(segments.NSegDim2[0]));
79
80 file.read(reinterpret_cast<char*>(&NSegDim2), sizeof(std::int32_t));
81 assert(NSegDim2 <= MAX_DIM2_SEGMENTS);
82
83 file.read(reinterpret_cast<char*>(segments.SegDim2), NSegDim2 * sizeof(segments.SegDim2[0]));
84
85 file.read(reinterpret_cast<char*>(segments.BegSegDim3), NSegDim2 * sizeof(segments.BegSegDim3[0]));
86 file.read(reinterpret_cast<char*>(segments.NSegDim3), NSegDim2 * sizeof(segments.NSegDim3[0]));
87
88 file.read(reinterpret_cast<char*>(&NSegDim3), sizeof(std::int32_t));
89 assert(NSegDim3 <= MAX_DIM3_SEGMENTS);
90
91 file.read(reinterpret_cast<char*>(segments.SegDim3), NSegDim3 * sizeof(segments.SegDim3[0]));
92 file.read(reinterpret_cast<char*>(segments.SegID), NSegDim3 * sizeof(segments.SegID[0]));
93
94 return std::make_tuple(NSegDim1, NSegDim2, NSegDim3);
95}
96
97template <std::size_t DIMENSIONS, std::size_t MAX_PARAMETERIZATIONS, std::size_t MAX_ROWS, std::size_t MAX_COLUMNS, std::size_t MAX_COEFFICIENTS>
98std::tuple<std::size_t, std::size_t, std::size_t, std::size_t> loadParams(std::ifstream& file, GPUDisplayMagneticField::ParametrizationUniform<MAX_PARAMETERIZATIONS, MAX_ROWS, MAX_COLUMNS, MAX_COEFFICIENTS>& parametrizations)
99{
100 std::size_t NParams, NRows, NColumns, NCoefficients;
101 file.read(reinterpret_cast<char*>(&NParams), sizeof(std::int32_t));
102 assert(NParams <= (MAX_PARAMETERIZATIONS / DIMENSIONS));
103
104 file.read(reinterpret_cast<char*>(parametrizations.BOffsets), DIMENSIONS * NParams * sizeof(parametrizations.BOffsets[0]));
105 file.read(reinterpret_cast<char*>(parametrizations.BScales), DIMENSIONS * NParams * sizeof(parametrizations.BScales[0]));
106 file.read(reinterpret_cast<char*>(parametrizations.BMin), DIMENSIONS * NParams * sizeof(parametrizations.BMin[0]));
107 file.read(reinterpret_cast<char*>(parametrizations.BMax), DIMENSIONS * NParams * sizeof(parametrizations.BMax[0]));
108
109 file.read(reinterpret_cast<char*>(parametrizations.NRows), DIMENSIONS * NParams * sizeof(parametrizations.NRows[0]));
110 file.read(reinterpret_cast<char*>(parametrizations.ColsAtRowOffset), DIMENSIONS * NParams * sizeof(parametrizations.ColsAtRowOffset[0]));
111 file.read(reinterpret_cast<char*>(parametrizations.CofsAtRowOffset), DIMENSIONS * NParams * sizeof(parametrizations.CofsAtRowOffset[0]));
112
113 file.read(reinterpret_cast<char*>(&NRows), sizeof(std::int32_t));
114 assert(NRows <= MAX_ROWS);
115
116 file.read(reinterpret_cast<char*>(parametrizations.NColsAtRow), NRows * sizeof(parametrizations.NColsAtRow[0]));
117 file.read(reinterpret_cast<char*>(parametrizations.CofsAtColOffset), NRows * sizeof(parametrizations.CofsAtColOffset[0]));
118
119 file.read(reinterpret_cast<char*>(&NColumns), sizeof(std::int32_t));
120 assert(NColumns <= MAX_COLUMNS);
121
122 file.read(reinterpret_cast<char*>(parametrizations.NCofsAtCol), NColumns * sizeof(parametrizations.NCofsAtCol[0]));
123 file.read(reinterpret_cast<char*>(parametrizations.AtColCoefOffset), NColumns * sizeof(parametrizations.AtColCoefOffset[0]));
124
125 file.read(reinterpret_cast<char*>(&NCoefficients), sizeof(std::int32_t));
126 assert(NCoefficients <= MAX_COEFFICIENTS);
127
128 file.read(reinterpret_cast<char*>(parametrizations.Coeffs), NCoefficients * sizeof(parametrizations.Coeffs[0]));
129
130 return std::make_tuple(NParams, NRows, NColumns, NCoefficients);
131}
132
133#ifdef GPUCA_STANDALONE
135{
136 mSolenoidSegments = std::make_unique<SolenoidSegmentsUniform>();
137 mDipoleSegments = std::make_unique<DipoleSegmentsUniform>();
138 mSolenoidParameterization = std::make_unique<SolenoidParameterizationUniform>();
139 mDipoleParameterization = std::make_unique<DipoleParameterizationUniform>();
140
141 std::ifstream file;
142
143 file.open("field.uniform", std::ifstream::binary);
144
145 if (!file.good()) {
146 GPUError("Cannot load field file \"field.uniform\" from the working directory.");
147 return 1;
148 }
149
150 const auto [SolSegDim1, SolSegDim2, SolSegDim3] = loadSegments(file, *mSolenoidSegments);
151 const auto [DipSegDim1, DipSegDim2, DipSegDim3] = loadSegments(file, *mDipoleSegments);
152 const auto [SParams, SRows, SCols, SCoeffs] = loadParams<DIMENSIONS>(file, *mSolenoidParameterization);
153 const auto [DParams, DRows, DCols, DCoeffs] = loadParams<DIMENSIONS>(file, *mDipoleParameterization);
154
155 mSolSegDim1 = SolSegDim1;
156 mSolSegDim2 = SolSegDim2;
157 mSolSegDim3 = SolSegDim3;
158
159 mSolParametrizations = SParams;
160 mSolRows = SRows;
161 mSolColumns = SCols;
162 mSolCoefficients = SCoeffs;
163
164 mDipSegDim1 = DipSegDim1;
165 mDipSegDim2 = DipSegDim2;
166 mDipSegDim3 = DipSegDim3;
167
168 mDipParametrizations = DParams;
169 mDipRows = DRows;
170 mDipColumns = DCols;
171 mDipCoefficients = DCoeffs;
172
173 mRenderConstantsUniform = std::make_unique<RenderConstantsUniform>();
174
175 return 0;
176}
177#else
179{
180 mRenderConstantsUniform = std::make_unique<RenderConstantsUniform>();
181
182 auto* field = dynamic_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
183
184 if (!field) {
185 const auto grp = o2::parameters::GRPObject::loadFrom();
188 field = dynamic_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
189 }
190
191 if (!field) {
192 GPUError("Error loading magnetic field data");
193 return 1;
194 }
195
196 return initializeUniformsFromField(field);
197}
198
200{
201 const auto chebMap = field->getMeasuredMap();
202
203 const auto numberOfParameterizationSolenoid = chebMap->getNumberOfParametersSol();
204
205 if (numberOfParameterizationSolenoid > MAX_SOLENOID_PARAMETERIZATIONS) {
206 GPUError("Model has too many Solenoid parametrization regions to fit in the designated uniform");
207 return 1;
208 }
209
210 const auto numberOfParameterizationDipole = chebMap->getNumberOfParametersDip();
211
212 if (numberOfParameterizationDipole > MAX_DIPOLE_PARAMETERIZATIONS) {
213 GPUError("Model has too many Dipole parametrization regions to fit in the designated uniform");
214 return 1;
215 }
216
217 struct TableInfo {
220 Int_t numberOfDistinctDim1Segments;
221 Int_t numberOfDistinctDim2Segments;
222 Int_t numberOfDistinctDim3Segments;
223 Float_t* coordinatesSegmentsDim1;
224 Float_t* coordinatesSegmentsDim2;
225 Float_t* coordinatesSegmentsDim3;
226 Int_t* beginningOfSegmentsDim2;
227 Int_t* beginningOfSegmentsDim3;
228 Int_t* numberOfSegmentsDim2;
229 Int_t* numberOfSegmentsDim3;
230 Int_t* segmentId;
231
232 ~TableInfo()
233 {
234 delete[] coordinatesSegmentsDim1;
235 delete[] coordinatesSegmentsDim2;
236 delete[] coordinatesSegmentsDim3;
237 delete[] beginningOfSegmentsDim2;
238 delete[] beginningOfSegmentsDim3;
239 delete[] numberOfSegmentsDim2;
240 delete[] numberOfSegmentsDim3;
241 delete[] segmentId;
242 }
243 };
244
245 TableInfo solenoidTableInfo, dipoleTableInfo;
246
247 const auto parameterizationSolenoid = std::make_unique<TObjArray>();
248
249 for (auto i = 0; i < numberOfParameterizationSolenoid; ++i) {
250 parameterizationSolenoid->Add(chebMap->getParameterSolenoid(i));
251 }
252
253 chebMap->buildTable(numberOfParameterizationSolenoid, parameterizationSolenoid.get(), solenoidTableInfo.numberOfDistinctDim1Segments,
254 solenoidTableInfo.numberOfDistinctDim2Segments, solenoidTableInfo.numberOfDistinctDim3Segments, solenoidTableInfo.minZ, solenoidTableInfo.maxZ,
255 &solenoidTableInfo.coordinatesSegmentsDim1, &solenoidTableInfo.coordinatesSegmentsDim2, &solenoidTableInfo.coordinatesSegmentsDim3,
256 &solenoidTableInfo.beginningOfSegmentsDim2, &solenoidTableInfo.numberOfSegmentsDim2, &solenoidTableInfo.beginningOfSegmentsDim3,
257 &solenoidTableInfo.numberOfSegmentsDim3, &solenoidTableInfo.segmentId);
258
259 LOGF(info, "Solenoid minZ: %f maxZ: %f", solenoidTableInfo.minZ, solenoidTableInfo.maxZ);
260 LOGF(info, "Solenoid segment count: Z %d P %d R %d", solenoidTableInfo.numberOfDistinctDim1Segments, solenoidTableInfo.numberOfDistinctDim2Segments, solenoidTableInfo.numberOfDistinctDim3Segments);
261
262 const auto parameterizationDipole = std::make_unique<TObjArray>();
263
264 for (auto i = 0; i < numberOfParameterizationDipole; ++i) {
265 parameterizationDipole->Add(chebMap->getParameterDipole(i));
266 }
267
268 chebMap->buildTable(numberOfParameterizationDipole, parameterizationDipole.get(), dipoleTableInfo.numberOfDistinctDim1Segments,
269 dipoleTableInfo.numberOfDistinctDim2Segments, dipoleTableInfo.numberOfDistinctDim3Segments, dipoleTableInfo.minZ, dipoleTableInfo.maxZ,
270 &dipoleTableInfo.coordinatesSegmentsDim1, &dipoleTableInfo.coordinatesSegmentsDim2, &dipoleTableInfo.coordinatesSegmentsDim3,
271 &dipoleTableInfo.beginningOfSegmentsDim2, &dipoleTableInfo.numberOfSegmentsDim2, &dipoleTableInfo.beginningOfSegmentsDim3,
272 &dipoleTableInfo.numberOfSegmentsDim3, &dipoleTableInfo.segmentId);
273
274 LOGF(info, "Dipole minZ: %f maxZ: %f", dipoleTableInfo.minZ, dipoleTableInfo.maxZ);
275 LOGF(info, "Dipole segment count: Z %d Y %d X %d", dipoleTableInfo.numberOfDistinctDim1Segments, dipoleTableInfo.numberOfDistinctDim2Segments, dipoleTableInfo.numberOfDistinctDim3Segments);
276
277 const auto getParameterSolenoid = [chebMap](Int_t i) { return chebMap->getParameterSolenoid(i); };
278 const auto getParameterDipole = [chebMap](Int_t i) { return chebMap->getParameterDipole(i); };
279
280 auto countArraySizes = [](int32_t numberOfParametrization, auto& getParameter) {
281 int32_t TotalRows = 0, TotalColumns = 0, TotalCoefficients = 0;
282 UShort_t MaxChebyshevOrder = 0;
283
284 for (auto i = 0; i < numberOfParametrization; ++i) {
285 const auto param = getParameter(i);
286
287 for (auto j = 0; j < DIMENSIONS; ++j) {
288 const auto calc = param->getChebyshevCalc(j);
289
290 const auto NRows = calc->getNumberOfRows();
291 TotalRows += NRows;
292
293 const auto colsAtRow = calc->getNumberOfColumnsAtRow();
294
295 for (auto row = 0; row < NRows; ++row) {
296 const auto NCols = colsAtRow[row];
297 TotalColumns += NCols;
298
299 const auto col0 = calc->getColAtRowBg()[row];
300
301 for (auto col = 0; col < NCols; ++col) {
302 const auto ncoffs = calc->getCoefficientBound2D0()[col0 + col];
303 MaxChebyshevOrder = std::max(MaxChebyshevOrder, ncoffs);
304 }
305 }
306
307 TotalCoefficients += calc->getNumberOfCoefficients();
308 }
309 }
310
311 return std::make_tuple(TotalRows, TotalColumns, TotalCoefficients, MaxChebyshevOrder);
312 };
313
314 const auto [TotalRowsSolenoid, TotalColumnsSolenoid, TotalCoefficientsSolenoid, MaxChebyshevOrderSolenoid] = countArraySizes(numberOfParameterizationSolenoid, getParameterSolenoid);
315 const auto [TotalRowsDipole, TotalColumnsDipole, TotalCoefficientsDipole, MaxChebyshevOrderDipole] = countArraySizes(numberOfParameterizationDipole, getParameterDipole);
316
317 LOGF(info, "Solenoid Params: %d Rows %d Columns %d Coefficients %d MaxChebOrder: %d", numberOfParameterizationSolenoid, TotalRowsSolenoid, TotalColumnsSolenoid, TotalCoefficientsSolenoid, MaxChebyshevOrderSolenoid);
318 LOGF(info, "Dipole Params: %d Rows %d Columns %d Coefficients %d MaxChebOrder: %d", numberOfParameterizationDipole, TotalRowsDipole, TotalColumnsDipole, TotalCoefficientsDipole, MaxChebyshevOrderDipole);
319
320 bool spaceOk = true;
321 std::string reason;
322
323 if (solenoidTableInfo.numberOfDistinctDim1Segments > MAX_SOLENOID_Z_SEGMENTS) {
324 spaceOk = false;
325 reason = "Solenoid Z segment";
326 } else if (solenoidTableInfo.numberOfDistinctDim2Segments > MAX_SOLENOID_P_SEGMENTS) {
327 spaceOk = false;
328 reason = "Solenoid P segment";
329 } else if (solenoidTableInfo.numberOfDistinctDim3Segments > MAX_SOLENOID_R_SEGMENTS) {
330 spaceOk = false;
331 reason = "Solenoid R segment";
332 } else if (dipoleTableInfo.numberOfDistinctDim1Segments > MAX_DIPOLE_Z_SEGMENTS) {
333 spaceOk = false;
334 reason = "Dipole Z Segment";
335 } else if (dipoleTableInfo.numberOfDistinctDim2Segments > MAX_DIPOLE_Y_SEGMENTS) {
336 spaceOk = false;
337 reason = "Dipole Y Segment";
338 } else if (dipoleTableInfo.numberOfDistinctDim3Segments > MAX_DIPOLE_X_SEGMENTS) {
339 spaceOk = false;
340 reason = "Dipole X Segment";
341 } else if (TotalRowsSolenoid > MAX_SOLENOID_ROWS) {
342 spaceOk = false;
343 reason = "Solenoid Rows";
344 } else if (TotalColumnsSolenoid > MAX_SOLENOID_COLUMNS) {
345 spaceOk = false;
346 reason = "Solenoid Columns";
347 } else if (TotalCoefficientsSolenoid > MAX_SOLENOID_COEFFICIENTS) {
348 spaceOk = false;
349 reason = "Solenoid Coefficients";
350 } else if (TotalRowsDipole > MAX_DIPOLE_ROWS) {
351 spaceOk = false;
352 reason = "Dipole Rows";
353 } else if (TotalColumnsDipole > MAX_DIPOLE_COLUMNS) {
354 spaceOk = false;
355 reason = "Dipole Columns";
356 } else if (TotalCoefficientsDipole > MAX_DIPOLE_COEFFICIENTS) {
357 spaceOk = false;
358 reason = "Dipole Coefficients";
359 } else if (std::max(MaxChebyshevOrderSolenoid, MaxChebyshevOrderDipole) > MAX_CHEBYSHEV_ORDER) {
360 spaceOk = false;
361 reason = "Chebyshev Polynomial order";
362 }
363
364 if (!spaceOk) {
365 GPUError("Model has too large %s to fit in the designated uniform", reason);
366 return 1;
367 }
368
369 auto loadSegments = [](const auto& info, auto& segments) {
370 std::copy(info.coordinatesSegmentsDim1, info.coordinatesSegmentsDim1 + info.numberOfDistinctDim1Segments, segments.SegDim1);
371
372 std::copy(info.beginningOfSegmentsDim2, info.beginningOfSegmentsDim2 + info.numberOfDistinctDim1Segments, segments.BegSegDim2);
373 std::copy(info.numberOfSegmentsDim2, info.numberOfSegmentsDim2 + info.numberOfDistinctDim1Segments, segments.NSegDim2);
374
375 std::copy(info.coordinatesSegmentsDim2, info.coordinatesSegmentsDim2 + info.numberOfDistinctDim2Segments, segments.SegDim2);
376
377 std::copy(info.beginningOfSegmentsDim3, info.beginningOfSegmentsDim3 + info.numberOfDistinctDim2Segments, segments.BegSegDim3);
378 std::copy(info.numberOfSegmentsDim3, info.numberOfSegmentsDim3 + info.numberOfDistinctDim2Segments, segments.NSegDim3);
379 std::copy(info.coordinatesSegmentsDim3, info.coordinatesSegmentsDim3 + info.numberOfDistinctDim3Segments, segments.SegDim3);
380
381 std::copy(info.segmentId, info.segmentId + info.numberOfDistinctDim3Segments, segments.SegID);
382 };
383
384 mSolenoidSegments = std::make_unique<SolenoidSegmentsUniform>();
385 loadSegments(solenoidTableInfo, *mSolenoidSegments);
386
387 mDipoleSegments = std::make_unique<DipoleSegmentsUniform>();
388 loadSegments(dipoleTableInfo, *mDipoleSegments);
389
390 auto initParametrization = [](int32_t numberOfParametrization, auto& getParameter, auto& parametrizationUniform) {
391 int32_t ColsAtRowOffset = 0, CofsAtRowOffset = 0, CofsAtColOffset = 0, Coeffs = 0;
392
393 for (auto i = 0; i < numberOfParametrization; ++i) {
394 const auto param = getParameter(i);
395 std::copy(param->getBoundaryMappingOffset(), param->getBoundaryMappingOffset() + DIMENSIONS, &parametrizationUniform->BOffsets[i * DIMENSIONS]);
396 std::copy(param->getBoundaryMappingScale(), param->getBoundaryMappingScale() + DIMENSIONS, &parametrizationUniform->BScales[i * DIMENSIONS]);
397 std::copy(param->getBoundMin(), param->getBoundMin() + DIMENSIONS, &parametrizationUniform->BMin[i * DIMENSIONS]);
398 std::copy(param->getBoundMax(), param->getBoundMax() + DIMENSIONS, &parametrizationUniform->BMax[i * DIMENSIONS]);
399
400 for (auto j = 0; j < DIMENSIONS; ++j) {
401 const auto calc = param->getChebyshevCalc(j);
402
403 const auto NRows = calc->getNumberOfRows();
404
405 parametrizationUniform->NRows[i * DIMENSIONS + j] = NRows;
406 parametrizationUniform->ColsAtRowOffset[i * DIMENSIONS + j] = ColsAtRowOffset;
407 parametrizationUniform->CofsAtRowOffset[i * DIMENSIONS + j] = CofsAtRowOffset;
408
409 const auto colsAtRow = calc->getNumberOfColumnsAtRow();
410
411 for (auto row = 0; row < NRows; ++row) {
412 const auto NCols = colsAtRow[row];
413 parametrizationUniform->NColsAtRow[ColsAtRowOffset + row] = NCols;
414 parametrizationUniform->CofsAtColOffset[ColsAtRowOffset + row] = CofsAtColOffset;
415
416 const auto col0 = calc->getColAtRowBg()[row];
417
418 for (auto col = 0; col < NCols; ++col) {
419 const auto ncoffs = calc->getCoefficientBound2D0()[col0 + col];
420 const auto offset = calc->getCoefficientBound2D1()[col0 + col];
421
422 parametrizationUniform->NCofsAtCol[CofsAtColOffset + col] = ncoffs;
423 parametrizationUniform->AtColCoefOffset[CofsAtColOffset + col] = offset;
424 }
425 CofsAtColOffset += NCols;
426 }
427
428 ColsAtRowOffset += NRows;
429 CofsAtRowOffset += calc->getNumberOfCoefficients();
430
431 std::copy(calc->getCoefficients(), calc->getCoefficients() + calc->getNumberOfCoefficients(), &parametrizationUniform->Coeffs[Coeffs]);
432
433 Coeffs += calc->getNumberOfCoefficients();
434 }
435 }
436
437 return std::make_tuple(ColsAtRowOffset, CofsAtColOffset, Coeffs);
438 };
439
440 mSolenoidParameterization = std::make_unique<SolenoidParameterizationUniform>();
441 mDipoleParameterization = std::make_unique<DipoleParameterizationUniform>();
442
443 const auto [SRows, SCols, SCoeffs] = initParametrization(numberOfParameterizationSolenoid, getParameterSolenoid, mSolenoidParameterization);
444 const auto [DRows, DCols, DCoeffs] = initParametrization(numberOfParameterizationDipole, getParameterDipole, mDipoleParameterization);
445
446 assert(TotalRowsSolenoid == SRows);
447 assert(TotalColumnsSolenoid == SCols);
448 assert(TotalCoefficientsSolenoid == SCoeffs);
449 assert(TotalRowsDipole == DRows);
450 assert(TotalColumnsDipole == DCols);
451 assert(TotalCoefficientsDipole == DCoeffs);
452
453 mSolenoidSegments->MinZ = solenoidTableInfo.minZ;
454 mSolenoidSegments->MaxZ = solenoidTableInfo.maxZ;
455 mSolenoidSegments->MultiplicativeFactor = field->getFactorSolenoid();
456 mSolenoidSegments->ZSegments = solenoidTableInfo.numberOfDistinctDim1Segments;
457
458 mDipoleSegments->MinZ = dipoleTableInfo.minZ;
459 mDipoleSegments->MaxZ = dipoleTableInfo.maxZ;
460 mDipoleSegments->MultiplicativeFactor = field->getFactorDipole();
461 mDipoleSegments->ZSegments = dipoleTableInfo.numberOfDistinctDim1Segments;
462
463 mSolSegDim1 = solenoidTableInfo.numberOfDistinctDim1Segments;
464 mSolSegDim2 = solenoidTableInfo.numberOfDistinctDim2Segments;
465 mSolSegDim3 = solenoidTableInfo.numberOfDistinctDim3Segments;
466
467 mSolParametrizations = numberOfParameterizationSolenoid;
468 mSolRows = TotalRowsSolenoid;
469 mSolColumns = TotalColumnsSolenoid;
470 mSolCoefficients = TotalCoefficientsSolenoid;
471
472 mDipSegDim1 = dipoleTableInfo.numberOfDistinctDim1Segments;
473 mDipSegDim2 = dipoleTableInfo.numberOfDistinctDim2Segments;
474 mDipSegDim3 = dipoleTableInfo.numberOfDistinctDim3Segments;
475
476 mDipParametrizations = numberOfParameterizationDipole;
477 mDipRows = TotalRowsDipole;
478 mDipColumns = TotalColumnsDipole;
479 mDipCoefficients = TotalCoefficientsDipole;
480
481 return 0;
482}
483#endif
Definition of the GeometryManager class.
int32_t i
std::tuple< std::size_t, std::size_t, std::size_t, std::size_t > loadParams(std::ifstream &file, GPUDisplayMagneticField::ParametrizationUniform< MAX_PARAMETERIZATIONS, MAX_ROWS, MAX_COLUMNS, MAX_COEFFICIENTS > &parametrizations)
std::tuple< std::size_t, std::size_t, std::size_t > loadSegments(std::ifstream &file, GPUDisplayMagneticField::SegmentsUniform< MAX_DIM1_SEGMENTS, MAX_DIM2_SEGMENTS, MAX_DIM3_SEGMENTS > &segments)
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
Header of the General Run Parameters object.
uint32_t j
Definition RawData.h:0
uint32_t col
Definition RawData.h:4
static void loadGeometry(std::string_view geomFilePath="", bool applyMisalignment=false, bool preferAlignedFile=true)
static int initFieldFromGRP(const o2::parameters::GRPMagField *grp, bool verbose=false)
Double_t getFactorDipole() const
Return the sign*scale of the current in the Dipole according to sPolarityConventionthe.
Double_t getFactorSolenoid() const
Returns the sign*scale of the current in the Dipole according to sPolarityConventionthe.
MagneticWrapperChebyshev * getMeasuredMap() const
std::unique_ptr< RenderConstantsUniform > mRenderConstantsUniform
std::unique_ptr< SolenoidSegmentsUniform > mSolenoidSegments
static constexpr std::size_t MAX_SOLENOID_R_SEGMENTS
static constexpr std::size_t MAX_DIPOLE_ROWS
static constexpr std::size_t MAX_CHEBYSHEV_ORDER
static constexpr std::size_t MAX_SOLENOID_COEFFICIENTS
std::unique_ptr< DipoleParameterizationUniform > mDipoleParameterization
static constexpr std::size_t MAX_DIPOLE_Y_SEGMENTS
static constexpr std::size_t MAX_DIPOLE_PARAMETERIZATIONS
static constexpr std::size_t MAX_DIPOLE_X_SEGMENTS
static constexpr std::size_t DIMENSIONS
static constexpr std::size_t MAX_DIPOLE_Z_SEGMENTS
int32_t initializeUniformsFromField(o2::field::MagneticField *field)
static constexpr std::size_t MAX_DIPOLE_COLUMNS
static constexpr std::size_t MAX_SOLENOID_COLUMNS
static constexpr std::size_t MAX_SOLENOID_P_SEGMENTS
std::unique_ptr< SolenoidParameterizationUniform > mSolenoidParameterization
static constexpr std::size_t MAX_SOLENOID_Z_SEGMENTS
static constexpr std::size_t MAX_SOLENOID_PARAMETERIZATIONS
static constexpr std::size_t MAX_DIPOLE_COEFFICIENTS
std::unique_ptr< DipoleSegmentsUniform > mDipoleSegments
static constexpr std::size_t MAX_SOLENOID_ROWS
static GRPObject * loadFrom(const std::string &grpFileName="")
GLint GLsizei count
Definition glcorearb.h:399
GLintptr offset
Definition glcorearb.h:660
GLuint segments
Definition glcorearb.h:4946
GLenum GLfloat param
Definition glcorearb.h:271
GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat maxZ
Definition glcorearb.h:2910
GLfloat GLfloat minZ
Definition glcorearb.h:2910
std::vector< int > row