15#ifndef GPUTPCGMPOLYNOMIALFIELD_H
16#define GPUTPCGMPOLYNOMIALFIELD_H
39 void SetFieldTpc(
const float* Bx,
const float* By,
const float* Bz);
40 void SetFieldTrd(
const float* Bx,
const float* By,
const float* Bz);
41 void SetFieldIts(
const float* Bx,
const float* By,
const float* Bz);
43 GPUdi() float GetNominalBz()
const {
return mNominalBz; }
60 GPUd() static
void GetPolynomsTpc(
float x,
float y,
float z,
float f[
NTPCM]);
61 GPUd() static
void GetPolynomsTrd(
float x,
float y,
float z,
float f[
NTRDM]);
62 GPUd() static
void GetPolynomsIts(
float x,
float y,
float z,
float f[
NITSM]);
92 for (int32_t
i = 0;
i <
NTPCM;
i++) {
97 for (int32_t
i = 0;
i <
NTRDM;
i++) {
102 for (int32_t
i = 0;
i <
NITSM;
i++) {
113 if (Bx && By && Bz) {
114 for (int32_t
i = 0;
i <
NTPCM;
i++) {
124 if (Bx && By && Bz) {
125 for (int32_t
i = 0;
i <
NTRDM;
i++) {
135 if (Bx && By && Bz) {
136 for (int32_t
i = 0;
i <
NITSM;
i++) {
158GPUdi()
void GPUTPCGMPolynomialField::GetField(
float x,
float y,
float z,
float*
B)
const
160 const float* fBxS = &mTpcBx[1];
161 const float* fByS = &mTpcBy[1];
162 const float* fBzS = &mTpcBz[1];
164 const float f[NTPCM - 1] = {
x,
y,
z,
x *
x,
x *
y,
x *
z,
y *
y,
y *
z,
z *
z};
165 float bx = mTpcBx[0], by = mTpcBy[0], bz = mTpcBz[0];
166 for (int32_t
i = NTPCM - 1;
i--;) {
168 bx += fBxS[
i] *
f[
i];
169 by += fByS[
i] *
f[
i];
170 bz += fBzS[
i] *
f[
i];
177GPUdi() float GPUTPCGMPolynomialField::GetFieldBz(
float x,
float y,
float z)
const
179 const float* fBzS = &mTpcBz[1];
181 const float f[NTPCM - 1] = {
x,
y,
z,
x *
x,
x *
y,
x *
z,
y *
y,
y *
z,
z *
z};
182 float bz = mTpcBz[0];
183 for (int32_t
i = NTPCM - 1;
i--;) {
184 bz += fBzS[
i] *
f[
i];
189GPUdi()
void GPUTPCGMPolynomialField::GetPolynomsTrd(
float x,
float y,
float z,
float f[NTRDM])
191 float xx =
x *
x, xy =
x *
y, xz =
x *
z, yy =
y *
y, yz =
y *
z, zz =
z *
z;
214GPUdi()
void GPUTPCGMPolynomialField::GetFieldTrd(
float x,
float y,
float z,
float*
B)
const
217 GetPolynomsTrd(
x,
y,
z,
f);
218 float bx = 0.f, by = 0.f, bz = 0.f;
219 for (int32_t
i = 0;
i < NTRDM;
i++) {
220 bx += mTrdBx[
i] *
f[
i];
221 by += mTrdBy[
i] *
f[
i];
222 bz += mTrdBz[
i] *
f[
i];
229GPUdi() float GPUTPCGMPolynomialField::GetFieldTrdBz(
float x,
float y,
float z)
const
232 GetPolynomsTrd(
x,
y,
z,
f);
234 for (int32_t
i = 0;
i < NTRDM;
i++) {
235 bz += mTrdBz[
i] *
f[
i];
240GPUdi()
void GPUTPCGMPolynomialField::GetPolynomsIts(
float x,
float y,
float z,
float f[NITSM])
242 float xx =
x *
x, xy =
x *
y, xz =
x *
z, yy =
y *
y, yz =
y *
z, zz =
z *
z;
260GPUdi()
void GPUTPCGMPolynomialField::GetFieldIts(
float x,
float y,
float z,
float*
B)
const
262 const float* fBxS = &mItsBx[1];
263 const float* fByS = &mItsBy[1];
264 const float* fBzS = &mItsBz[1];
266 const float f[NITSM - 1] = {
x,
y,
z,
x *
x,
x *
y,
x *
z,
y *
y,
y *
z,
z *
z};
267 float bx = mItsBx[0], by = mItsBy[0], bz = mItsBz[0];
268 for (int32_t
i = NITSM - 1;
i--;) {
269 bx += fBxS[
i] *
f[
i];
270 by += fByS[
i] *
f[
i];
271 bz += fBzS[
i] *
f[
i];
278GPUdi() float GPUTPCGMPolynomialField::GetFieldItsBz(
float x,
float y,
float z)
const
280 const float* fBzS = &mItsBz[1];
282 const float f[NITSM - 1] = {
x,
y,
z,
x *
x,
x *
y,
x *
z,
y *
y,
y *
z,
z *
z};
283 float bz = mItsBz[0];
284 for (int32_t
i = NITSM - 1;
i--;) {
285 bz += fBzS[
i] *
f[
i];
void SetFieldTpc(const float *Bx, const float *By, const float *Bz)
float float float *B const
GPUTPCGMPolynomialField()
void SetFieldNominal(float nominalBz)
void SetFieldTrd(const float *Bx, const float *By, const float *Bz)
const float * GetCoefmTrdBz() const
static constexpr const int32_t NTPCM
const float * GetCoefmTpcBy() const
static constexpr const int32_t NTRDM
static constexpr const int32_t NITSM
const float * GetCoefmTrdBx() const
void SetFieldIts(const float *Bx, const float *By, const float *Bz)
const float * GetCoefmTpcBx() const
const float * GetCoefmItsBz() const
GPUdi() float GetNominalBz() const
const float * GetCoefmTrdBy() const
const float * GetCoefmItsBy() const
const float * GetCoefmItsBx() const
GPUd() void GetField(float x
const float * GetCoefmTpcBz() const
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z