Go to the documentation of this file.
8 #ifndef LITFIELDSLICE_H_
9 #define LITFIELDSLICE_H_
22 #define LIT_POLYNOM_DEGREE 7
37 #if LIT_POLYNOM_DEGREE == 3
38 static const unsigned int N = 10;
40 #if LIT_POLYNOM_DEGREE == 5
41 static const unsigned int N = 21;
43 #if LIT_POLYNOM_DEGREE == 7
44 static const unsigned int N = 36;
46 #if LIT_POLYNOM_DEGREE == 9
47 static const unsigned int N = 55;
58 for (
unsigned int i = 0;
i <
N;
i++) {
74 #if LIT_POLYNOM_DEGREE == 3
83 +
cx[5] * y2 +
cx[6] * x3 +
cx[7] * x2y +
cx[8] * xy2
87 +
cy[5] * y2 +
cy[6] * x3 +
cy[7] * x2y +
cy[8] * xy2
91 +
cz[5] * y2 +
cz[6] * x3 +
cz[7] * x2y +
cz[8] * xy2
94 #if LIT_POLYNOM_DEGREE == 5
118 +
cx[5] * y2 +
cx[6] * x3 +
cx[7] * x2y +
cx[8] * xy2
119 +
cx[9] * y3 +
cx[10] * x4 +
cx[11] * x3y +
cx[12] * x2y2
120 +
cx[13] * xy3 +
cx[14] * y4 +
cx[15] * x5 +
cx[16] * x4y
121 +
cx[17] * x3y2 +
cx[18] * x2y3 +
cx[19] * xy4 +
cx[20] * y5;
124 +
cy[5] * y2 +
cy[6] * x3 +
cy[7] * x2y +
cy[8] * xy2
125 +
cy[9] * y3 +
cy[10] * x4 +
cy[11] * x3y +
cy[12] * x2y2
126 +
cy[13] * xy3 +
cy[14] * y4 +
cy[15] * x5 +
cy[16] * x4y
127 +
cy[17] * x3y2 +
cy[18] * x2y3 +
cy[19] * xy4 +
cy[20] * y5;
130 +
cz[5] * y2 +
cz[6] * x3 +
cz[7] * x2y +
cz[8] * xy2
131 +
cz[9] * y3 +
cz[10] * x4 +
cz[11] * x3y +
cz[12] * x2y2
132 +
cz[13] * xy3 +
cz[14] * y4 +
cz[15] * x5 +
cz[16] * x4y
133 +
cz[17] * x3y2 +
cz[18] * x2y3 +
cz[19] * xy4 +
cz[20] * y5;
136 #if LIT_POLYNOM_DEGREE == 7
177 +
cx[5] * y2 +
cx[6] * x3 +
cx[7] * x2y +
cx[8] * xy2
178 +
cx[9] * y3 +
cx[10] * x4 +
cx[11] * x3y +
cx[12] * x2y2
179 +
cx[13] * xy3 +
cx[14] * y4 +
cx[15] * x5 +
cx[16] * x4y
180 +
cx[17] * x3y2 +
cx[18] * x2y3 +
cx[19] * xy4 +
cx[20] * y5
181 +
cx[21] * x6 +
cx[22] * x5y +
cx[23] * x4y2 +
cx[24] * x3y3
182 +
cx[25] * x2y4 +
cx[26] * xy5 +
cx[27] * y6 +
cx[28] * x7
183 +
cx[29] * x6y +
cx[30] * x5y2 +
cx[31] * x4y3 +
cx[32] * x3y4
184 +
cx[33] * x2y5 +
cx[34] * xy6 +
cx[35] * y7;
187 +
cy[5] * y2 +
cy[6] * x3 +
cy[7] * x2y +
cy[8] * xy2
188 +
cy[9] * y3 +
cy[10] * x4 +
cy[11] * x3y +
cy[12] * x2y2
189 +
cy[13] * xy3 +
cy[14] * y4 +
cy[15] * x5 +
cy[16] * x4y
190 +
cy[17] * x3y2 +
cy[18] * x2y3 +
cy[19] * xy4 +
cy[20] * y5
191 +
cy[21] * x6 +
cy[22] * x5y +
cy[23] * x4y2 +
cy[24] * x3y3
192 +
cy[25] * x2y4 +
cy[26] * xy5 +
cy[27] * y6 +
cy[28] * x7
193 +
cy[29] * x6y +
cy[30] * x5y2 +
cy[31] * x4y3 +
cy[32] * x3y4
194 +
cy[33] * x2y5 +
cy[34] * xy6 +
cy[35] * y7;
197 +
cz[5] * y2 +
cz[6] * x3 +
cz[7] * x2y +
cz[8] * xy2
198 +
cz[9] * y3 +
cz[10] * x4 +
cz[11] * x3y +
cz[12] * x2y2
199 +
cz[13] * xy3 +
cz[14] * y4 +
cz[15] * x5 +
cz[16] * x4y
200 +
cz[17] * x3y2 +
cz[18] * x2y3 +
cz[19] * xy4 +
cz[20] * y5
201 +
cz[21] * x6 +
cz[22] * x5y +
cz[23] * x4y2 +
cz[24] * x3y3
202 +
cz[25] * x2y4 +
cz[26] * xy5 +
cz[27] * y6 +
cz[28] * x7
203 +
cz[29] * x6y +
cz[30] * x5y2 +
cz[31] * x4y3 +
cz[32] * x3y4
204 +
cz[33] * x2y5 +
cz[34] * xy6 +
cz[35] * y7;
206 #if LIT_POLYNOM_DEGREE == 9
268 +
cx[5] * y2 +
cx[6] * x3 +
cx[7] * x2y +
cx[8] * xy2
269 +
cx[9] * y3 +
cx[10] * x4 +
cx[11] * x3y +
cx[12] * x2y2
270 +
cx[13] * xy3 +
cx[14] * y4 +
cx[15] * x5 +
cx[16] * x4y
271 +
cx[17] * x3y2 +
cx[18] * x2y3 +
cx[19] * xy4 +
cx[20] * y5
272 +
cx[21] * x6 +
cx[22] * x5y +
cx[23] * x4y2 +
cx[24] * x3y3
273 +
cx[25] * x2y4 +
cx[26] * xy5 +
cx[27] * y6 +
cx[28] * x7
274 +
cx[29] * x6y +
cx[30] * x5y2 +
cx[31] * x4y3 +
cx[32] * x3y4
275 +
cx[33] * x2y5 +
cx[34] * xy6 +
cx[35] * y7;
276 +
cx[36] * x8 +
cx[37] * x7y +
cx[38] * x6y2 +
cx[39] * x5y3
277 +
cx[40] * x4y4 +
cx[41] * x3y5 +
cx[42] * x2y6 +
cx[43] * xy7
278 +
cx[44] * y8 +
cx[45] * x9 +
cx[46] * x8y +
cx[47] * x7y2
279 +
cx[48] * x6y3 +
cx[49] * x5y4 +
cx[50] * x4y5 +
cx[51] * x3y6
280 +
cx[52] * x2y7 +
cx[53] * xy8 +
cx[54] * y9;
283 +
cy[5] * y2 +
cy[6] * x3 +
cy[7] * x2y +
cy[8] * xy2
284 +
cy[9] * y3 +
cy[10] * x4 +
cy[11] * x3y +
cy[12] * x2y2
285 +
cy[13] * xy3 +
cy[14] * y4 +
cy[15] * x5 +
cy[16] * x4y
286 +
cy[17] * x3y2 +
cy[18] * x2y3 +
cy[19] * xy4 +
cy[20] * y5
287 +
cy[21] * x6 +
cy[22] * x5y +
cy[23] * x4y2 +
cy[24] * x3y3
288 +
cy[25] * x2y4 +
cy[26] * xy5 +
cy[27] * y6 +
cy[28] * x7
289 +
cy[29] * x6y +
cy[30] * x5y2 +
cy[31] * x4y3 +
cy[32] * x3y4
290 +
cy[33] * x2y5 +
cy[34] * xy6 +
cy[35] * y7;
291 +
cy[36] * x8 +
cy[37] * x7y +
cy[38] * x6y2 +
cy[39] * x5y3
292 +
cy[40] * x4y4 +
cy[41] * x3y5 +
cy[42] * x2y6 +
cy[43] * xy7
293 +
cy[44] * y8 +
cy[45] * x9 +
cy[46] * x8y +
cy[47] * x7y2
294 +
cy[48] * x6y3 +
cy[49] * x5y4 +
cy[50] * x4y5 +
cy[51] * x3y6
295 +
cy[52] * x2y7 +
cy[53] * xy8 +
cy[54] * y9;
298 +
cz[5] * y2 +
cz[6] * x3 +
cz[7] * x2y +
cz[8] * xy2
299 +
cz[9] * y3 +
cz[10] * x4 +
cz[11] * x3y +
cz[12] * x2y2
300 +
cz[13] * xy3 +
cz[14] * y4 +
cz[15] * x5 +
cz[16] * x4y
301 +
cz[17] * x3y2 +
cz[18] * x2y3 +
cz[19] * xy4 +
cz[20] * y5
302 +
cz[21] * x6 +
cz[22] * x5y +
cz[23] * x4y2 +
cz[24] * x3y3
303 +
cz[25] * x2y4 +
cz[26] * xy5 +
cz[27] * y6 +
cz[28] * x7
304 +
cz[29] * x6y +
cz[30] * x5y2 +
cz[31] * x4y3 +
cz[32] * x3y4
305 +
cz[33] * x2y5 +
cz[34] * xy6 +
cz[35] * y7;
306 +
cz[36] * x8 +
cz[37] * x7y +
cz[38] * x6y2 +
cz[39] * x5y3
307 +
cz[40] * x4y4 +
cz[41] * x3y5 +
cz[42] * x2y6 +
cz[43] * xy7
308 +
cz[44] * y8 +
cz[45] * x9 +
cz[46] * x8y +
cz[47] * x7y2
309 +
cz[48] * x6y3 +
cz[49] * x5y4 +
cz[50] * x4y5 +
cz[51] * x3y6
310 +
cz[52] * x2y7 +
cz[53] * xy8 +
cz[54] * y9;
325 const std::vector<T>&
y,
326 const std::vector<T>& z) {
327 for (
unsigned int i = 0;
i <
N;
i++) {
351 std::string str =
"";
352 str =
"LitFieldSlice: Z=" + lit::parallel::ToString<T>(
fZ) +
", cx=";
353 for (
unsigned int i = 0;
i <
N;
i++) {
354 str += lit::parallel::ToString<T>(
cx[
i]) +
" ";
357 str +=
"LitFieldSlice: cy=";
358 for (
unsigned int i = 0;
i <
N;
i++) {
359 str += lit::parallel::ToString<T>(
cy[
i]) +
" ";
362 str +=
"LitFieldSlice: cz=";
363 for (
unsigned int i = 0;
i <
N;
i++) {
364 str += lit::parallel::ToString<T>(
cz[
i]) +
" ";
LitFieldSlice< fvec > LitFieldSliceVec
Vector version of LitFieldSlice.
class lit::parallel::LitDetectorLayout _fvecalignment
friend std::ostream & operator<<(std::ostream &strm, const LitFieldSlice &slice)
Operator << for convenient output to std::ostream.
std::string ToString() const
Returns std::string representation of the class.
Approximated magnetic field slice in XY plane perpendicular to Z.
static const unsigned int N
void SetZ(const T &Z)
Sets Z position of the slice.
void SetCoefficients(const std::vector< T > &x, const std::vector< T > &y, const std::vector< T > &z)
Sets polynom coefficients.
LitFieldSlice< fscal > LitFieldSliceScal
Scalar version of LitFieldSlice.
Magnetic field value at a certain point in the space.
LitFieldSlice()
Constructor.
Magnetic field value at a certain point in the space.
void GetFieldValue(const T &x, const T &y, LitFieldValue< T > &B) const
Returns field value at a certain (X, Y) position.
const T & GetZ() const
Returns Z position of the slice.