Project
Loading...
Searching...
No Matches
GPUDisplayMagneticField.h
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
15#ifndef GPUDISPLAYMAGNETICFIELD_H
16#define GPUDISPLAYMAGNETICFIELD_H
17
18#include "GPUCommonDef.h"
19#include <memory>
20#include <vector>
21
22#ifdef GPUCA_O2_LIB
23#include <Field/MagneticField.h>
24#endif
25
26namespace o2::gpu
27{
29{
30 public:
32#ifdef GPUCA_O2_LIB
34#endif
35
36 static constexpr std::size_t DIMENSIONS = 3;
37 static constexpr std::size_t MAX_SOLENOID_Z_SEGMENTS = 32;
38 static constexpr std::size_t MAX_SOLENOID_P_SEGMENTS = 512;
39 static constexpr std::size_t MAX_SOLENOID_R_SEGMENTS = 4096;
40 static constexpr std::size_t MAX_DIPOLE_Z_SEGMENTS = 128;
41 static constexpr std::size_t MAX_DIPOLE_Y_SEGMENTS = 2048;
42 static constexpr std::size_t MAX_DIPOLE_X_SEGMENTS = 16384;
43 static constexpr std::size_t MAX_SOLENOID_PARAMETERIZATIONS = 2048;
44 static constexpr std::size_t MAX_SOLENOID_ROWS = 16384;
45 static constexpr std::size_t MAX_SOLENOID_COLUMNS = 65536;
46 static constexpr std::size_t MAX_SOLENOID_COEFFICIENTS = 131072;
47 static constexpr std::size_t MAX_DIPOLE_PARAMETERIZATIONS = 2048;
48 static constexpr std::size_t MAX_DIPOLE_ROWS = 16384;
49 static constexpr std::size_t MAX_DIPOLE_COLUMNS = 65536;
50 static constexpr std::size_t MAX_DIPOLE_COEFFICIENTS = 262144;
51 static constexpr std::size_t MAX_CHEBYSHEV_ORDER = 32;
52
54 uint32_t StepCount;
55 float StepSize;
56 };
57
58 template <std::size_t MAX_DIM1_SEGMENTS, std::size_t MAX_DIM2_SEGMENTS, std::size_t MAX_DIM3_SEGMENTS>
60 float MinZ;
61 float MaxZ;
63
64 int32_t ZSegments;
65
66 float SegDim1[MAX_DIM1_SEGMENTS];
67
68 int32_t BegSegDim2[MAX_DIM1_SEGMENTS];
69 int32_t NSegDim2[MAX_DIM1_SEGMENTS];
70
71 float SegDim2[MAX_DIM2_SEGMENTS];
72
73 int32_t BegSegDim3[MAX_DIM2_SEGMENTS];
74 int32_t NSegDim3[MAX_DIM2_SEGMENTS];
75
76 float SegDim3[MAX_DIM3_SEGMENTS];
77
78 int32_t SegID[MAX_DIM3_SEGMENTS];
79 };
80
81 template <std::size_t MAX_PARAMETERIZATIONS, std::size_t MAX_ROWS, std::size_t MAX_COLUMNS, std::size_t MAX_COEFFICIENTS>
83 float BOffsets[MAX_PARAMETERIZATIONS];
84 float BScales[MAX_PARAMETERIZATIONS];
85 float BMin[MAX_PARAMETERIZATIONS];
86 float BMax[MAX_PARAMETERIZATIONS];
87
88 int32_t NRows[MAX_PARAMETERIZATIONS];
89 int32_t ColsAtRowOffset[MAX_PARAMETERIZATIONS];
90 int32_t CofsAtRowOffset[MAX_PARAMETERIZATIONS];
91
92 int32_t NColsAtRow[MAX_ROWS];
93 int32_t CofsAtColOffset[MAX_ROWS];
94
95 int32_t NCofsAtCol[MAX_COLUMNS];
96 int32_t AtColCoefOffset[MAX_COLUMNS];
97
98 float Coeffs[MAX_COEFFICIENTS];
99 };
100
103
106
107 // TODO: what to do with this?
108 struct vtx {
109 float x, y, z;
110 vtx(float a, float b, float c) : x(a), y(b), z(c) {}
111 };
112
113 int32_t initializeUniforms();
114#ifdef GPUCA_O2_LIB
115 int32_t initializeUniformsFromField(o2::field::MagneticField* field);
116#endif
117 void generateSeedPoints(std::size_t count);
118
119 std::size_t mSolSegDim1;
120 std::size_t mSolSegDim2;
121 std::size_t mSolSegDim3;
122
123 std::size_t mDipSegDim1;
124 std::size_t mDipSegDim2;
125 std::size_t mDipSegDim3;
126
128 std::size_t mSolRows;
129 std::size_t mSolColumns;
130 std::size_t mSolCoefficients;
131
133 std::size_t mDipRows;
134 std::size_t mDipColumns;
135 std::size_t mDipCoefficients;
136
137 std::unique_ptr<RenderConstantsUniform> mRenderConstantsUniform;
138 std::unique_ptr<SolenoidSegmentsUniform> mSolenoidSegments;
139 std::unique_ptr<DipoleSegmentsUniform> mDipoleSegments;
140 std::unique_ptr<SolenoidParameterizationUniform> mSolenoidParameterization;
141 std::unique_ptr<DipoleParameterizationUniform> mDipoleParameterization;
142 std::vector<vtx> mFieldLineSeedPoints;
143};
144} // namespace o2::gpu
145
146#endif // GPUDISPLAYMAGNETICFIELD_H
Definition of the MagF class.
uint32_t c
Definition RawData.h:2
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
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
GLint GLenum GLint x
Definition glcorearb.h:403
GLint GLsizei count
Definition glcorearb.h:399
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843