ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::SolenoidParametrization Class Reference

#include <SolenoidParametrization.h>

Collaboration diagram for Trk::SolenoidParametrization:

Classes

class  BinParameters
class  Parameters

Public Member Functions

 SolenoidParametrization (const AtlasFieldCacheCondObj &field_cond_obj)
 ~SolenoidParametrization ()=default
double centralField () const
double fieldComponent (double z, const Parameters &parms) const
double fieldComponent (double r, double z, double cotTheta, MagField::AtlasFieldCache &fieldCache) const
void fieldIntegrals (double &firstIntegral, double &secondIntegral, double zBegin, double zEnd, Parameters &parms) const
double maximumR () const
double maximumZ () const
void printFieldIntegrals (MsgStream &m) const
void printParametersForEtaLine (double eta, double z_origin, MsgStream &msg) const
void printResidualForEtaLine (double eta, double zOrigin, MsgStream &msg) const
bool validOrigin (const Amg::Vector3D &origin) const
bool currentMatches (double current) const

Private Member Functions

void integrate (double &firstIntegral, double &secondIntegral, double zBegin, double zEnd, const Parameters &parms) const
double interpolate (int key1, int key2, int key3, int key4, const Parameters &parms) const
void parametrizeSolenoid ()
void setTerms (int, Parameters &parms) const
 SolenoidParametrization (const SolenoidParametrization &)=delete
SolenoidParametrizationoperator= (const SolenoidParametrization &)=delete

Static Private Member Functions

static int fieldKey (BinParameters &parms)

Private Attributes

const AtlasFieldCacheCondObjm_fieldCondObj
double m_currentMin {}
double m_currentMax {}
double m_centralField
double m_parameters [14688]

Static Private Attributes

static const double s_binInvSizeTheta = 1./0.1
static const double s_binInvSizeZ = 1./20.*Gaudi::Units::mm
static const double s_binZeroTheta = 0.
static const double s_binZeroZ = -160.*Gaudi::Units::mm
static const double s_lightSpeed = -1.*299792458*Gaudi::Units::m/Gaudi::Units::s
static const int s_maxBinTheta = 72
static const int s_maxBinZ = 17
static const double s_maximumImpactAtOrigin = 30.*Gaudi::Units::mm
static const double s_maximumZatOrigin = 250.*Gaudi::Units::mm
static const int s_numberParameters = 6
static const double s_rInner = 570.*Gaudi::Units::mm
static const double s_rOuter = 1050.*Gaudi::Units::mm
static const double s_zInner = 2150.0*Gaudi::Units::mm
static const double s_zOuter = 2800.0*Gaudi::Units::mm

Friends

class Parameters

Detailed Description

Definition at line 30 of file SolenoidParametrization.h.

Constructor & Destructor Documentation

◆ SolenoidParametrization() [1/2]

Trk::SolenoidParametrization::SolenoidParametrization ( const AtlasFieldCacheCondObj & field_cond_obj)

Definition at line 92 of file SolenoidParametrization.cxx.

93 : m_fieldCondObj (&field_cond_obj),
95{
96
97 MagField::AtlasFieldCache fieldCache;
98 m_fieldCondObj->getInitializedCache (fieldCache);
99 m_centralField = fieldComponent(0.,0.,0., fieldCache);
100 // now parametrise field - if requested
101 {
103 }
104}
const AtlasFieldCacheCondObj * m_fieldCondObj
double fieldComponent(double z, const Parameters &parms) const

◆ ~SolenoidParametrization()

Trk::SolenoidParametrization::~SolenoidParametrization ( )
default

◆ SolenoidParametrization() [2/2]

Trk::SolenoidParametrization::SolenoidParametrization ( const SolenoidParametrization & )
privatedelete

Member Function Documentation

◆ centralField()

double Trk::SolenoidParametrization::centralField ( void ) const
inline

Definition at line 221 of file SolenoidParametrization.h.

222{ return m_centralField; }

◆ currentMatches()

bool Trk::SolenoidParametrization::currentMatches ( double current) const

◆ fieldComponent() [1/2]

double Trk::SolenoidParametrization::fieldComponent ( double r,
double z,
double cotTheta,
MagField::AtlasFieldCache & fieldCache ) const
inline

Definition at line 236 of file SolenoidParametrization.h.

237{
240 fieldCache.getField(position.data(),field.data());
241 return s_lightSpeed*(field.z() - field.perp()*cotTheta);
242}
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
int r
Definition globals.cxx:22
Eigen::Matrix< double, 3, 1 > Vector3D
@ z
global position (cartesian)
Definition ParamDefs.h:57
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.

◆ fieldComponent() [2/2]

double Trk::SolenoidParametrization::fieldComponent ( double z,
const Parameters & parms ) const
inline

Definition at line 225 of file SolenoidParametrization.h.

226{
227 double z_local = parms.m_signTheta*z - parms.m_zAtAxis;
228 double z_squared = z_local*z_local;
229 double value = parms.m_fieldAtOrigin +
230 parms.m_quadraticTerm*z_squared +
231 parms.m_cubicTerm*z_squared*z_local;
232 return value;
233}

◆ fieldIntegrals()

void Trk::SolenoidParametrization::fieldIntegrals ( double & firstIntegral,
double & secondIntegral,
double zBegin,
double zEnd,
Parameters & parms ) const
inline

Definition at line 245 of file SolenoidParametrization.h.

250{
251 zBegin = parms.m_signTheta*zBegin;
252 zEnd = parms.m_signTheta*zEnd;
253 if (zEnd < s_zInner || zBegin > s_zInner)
254 {
255 integrate(firstIntegral,secondIntegral,zBegin-parms.m_zAtAxis,zEnd-parms.m_zAtAxis, parms);
256 }
257 else
258 {
259 integrate(firstIntegral,secondIntegral,zBegin-parms.m_zAtAxis,s_zInner, parms);
260 int key = fieldKey(parms) + s_numberParameters/2;
261 setTerms(key, parms);
262 integrate(firstIntegral,secondIntegral,s_zInner,zEnd-parms.m_zAtAxis,parms);
263 }
264}
static int fieldKey(BinParameters &parms)
void integrate(double &firstIntegral, double &secondIntegral, double zBegin, double zEnd, const Parameters &parms) const
void setTerms(int, Parameters &parms) const

◆ fieldKey()

int Trk::SolenoidParametrization::fieldKey ( BinParameters & parms)
inlinestaticprivate

Definition at line 131 of file SolenoidParametrization.h.

132{
133 double z = parms.m_zAtAxis - s_binZeroZ;
134 int zBin = static_cast<int>(s_binInvSizeZ*z);
135 parms.m_interpolateZ = z*s_binInvSizeZ - double(zBin);
136 if (zBin < 0)
137 {
138 parms.m_interpolateZ = 0.;
139 zBin = 0;
140 }
141 else if (zBin > s_maxBinZ - 2)
142 {
143 parms.m_interpolateZ = 0.;
144 zBin = s_maxBinZ - 1;
145 }
146 parms.m_complementZ = 1. - parms.m_interpolateZ;
147
148 int thetaBin = static_cast<int>(s_binInvSizeTheta*parms.m_cotTheta);
149 parms.m_interpolateTheta = parms.m_cotTheta*s_binInvSizeTheta - double(thetaBin);
150 if (thetaBin > s_maxBinTheta - 3)
151 {
152 parms.m_interpolateTheta = 0.;
153 thetaBin = s_maxBinTheta - 2;
154 }
155 parms.m_complementTheta = 1. - parms.m_interpolateTheta;
156 return 2*s_numberParameters*(s_maxBinTheta*zBin + thetaBin);
157}

◆ integrate()

void Trk::SolenoidParametrization::integrate ( double & firstIntegral,
double & secondIntegral,
double zBegin,
double zEnd,
const Parameters & parms ) const
inlineprivate

Definition at line 160 of file SolenoidParametrization.h.

165{
166 double zDiff = zEnd - zBegin;
167 double zBeg2 = zBegin*zBegin;
168 double zBeg3 = zBeg2*zBegin;
169 double zEnd2 = zEnd*zEnd;
170 double zEnd3 = zEnd2*zEnd;
171 double zDiff4 = 0.25*(zEnd2 + zBeg2)*(zEnd2 - zBeg2);
172
173 firstIntegral += parms.m_fieldAtOrigin*zDiff +
174 parms.m_quadraticTerm*(zEnd3 - zBeg3)*0.333333333333 +
175 parms.m_cubicTerm*zDiff4;
176 double zDiffInv = 1./zDiff;
177 secondIntegral += parms.m_fieldAtOrigin*zDiff +
178 parms.m_quadraticTerm*(zDiffInv*zDiff4 - zBeg3)*0.666666666667 +
179 parms.m_cubicTerm*(0.1*zDiffInv*(zEnd2*zEnd3 - zBeg2*zBeg3) - 0.5*zBeg2*zBeg2);
180}

◆ interpolate()

double Trk::SolenoidParametrization::interpolate ( int key1,
int key2,
int key3,
int key4,
const Parameters & parms ) const
inlineprivate

Definition at line 183 of file SolenoidParametrization.h.

188{
189 return ((m_parameters[key1]*parms.m_complementZ +
190 m_parameters[key2]*parms.m_interpolateZ)*parms.m_complementTheta +
191 (m_parameters[key3]*parms.m_complementZ +
192 m_parameters[key4]*parms.m_interpolateZ)*parms.m_interpolateTheta);
193}

◆ maximumR()

double Trk::SolenoidParametrization::maximumR ( void ) const
inline

Definition at line 267 of file SolenoidParametrization.h.

268{ return s_rInner; }

◆ maximumZ()

double Trk::SolenoidParametrization::maximumZ ( void ) const
inline

Definition at line 271 of file SolenoidParametrization.h.

272{ return s_zInner; }

◆ operator=()

SolenoidParametrization & Trk::SolenoidParametrization::operator= ( const SolenoidParametrization & )
privatedelete

◆ parametrizeSolenoid()

void Trk::SolenoidParametrization::parametrizeSolenoid ( void )
private

Definition at line 109 of file SolenoidParametrization.cxx.

109 {
110 // set parametrisation granularity (up to cotTheta = 7.)
111 // get value of cubic term for approx: Bz = Bcentral*(1 - term * z^3)
112 // 'fit' to average over cotTheta lines
113 double smallOffset = 0.0000000000001; // avoid FPE
114 double zAtAxis = s_binZeroZ; // + smallOffset ?
115 MagField::AtlasFieldCache fieldCache;
116 m_fieldCondObj->getInitializedCache (fieldCache);
117
118 constexpr int n = 200;
119 Amg::VectorX difference(n); // it is filled below in the loop over n
120 Amg::MatrixX derivative(n,s_numberParameters); //set zero below
121 for (int binZ = 0; binZ < s_maxBinZ; ++binZ){
122 double cotTheta = smallOffset;
123 for (int binTheta = 0; binTheta < s_maxBinTheta - 1; ++binTheta) {
124 double r = 0.;
125 double z = zAtAxis;
126 double dr;
127 if (cotTheta < s_zOuter/s_rOuter){
128 dr = s_rOuter/double(n);
129 } else {
130 dr = s_zOuter/(cotTheta*double(n));
131 }
132 derivative.setZero();
133 for (int k = 0; k < n; ++k){
134 r += dr;
135 z += dr*cotTheta;
136 double w = (n - k)*(n - k);
137 double zLocal = z - zAtAxis;
138 if (r > s_rInner || z > s_zInner){
139 derivative(k,3) = w;
140 derivative(k,4) = w*zLocal*zLocal;
141 derivative(k,5) = w*zLocal*zLocal*zLocal;
142 } else {
143 derivative(k,0) = w;
144 derivative(k,1) = w*zLocal*zLocal;
145 derivative(k,2) = w*zLocal*zLocal*zLocal;
146 }
147 difference(k) = w*(fieldComponent(r,z,cotTheta, fieldCache) - m_centralField);
148 }
149 // solve for parametrization coefficients
150 Amg::VectorX solution = derivative.colPivHouseholderQr().solve(difference);
151 BinParameters parms (zAtAxis, cotTheta);
152 int key = fieldKey(parms);
153 assert (m_parameters[key] == 0.);
154 m_parameters[key++] = m_centralField + solution(0);
155 m_parameters[key++] = solution(1);
156 m_parameters[key++] = solution(2);
157 m_parameters[key++] = m_centralField + solution(3);
158 m_parameters[key++] = solution(4);
159 m_parameters[key++] = solution(5);
160 // duplicate last z-bin for contiguous neighbour lookup
161 if (binZ == s_maxBinZ - 1){
162 assert (m_parameters[key] == 0.);
163 m_parameters[key++] = m_centralField + solution(0);
164 m_parameters[key++] = solution(1);
165 m_parameters[key++] = solution(2);
166 m_parameters[key++] = m_centralField + solution(3);
167 m_parameters[key++] = solution(4);
168 m_parameters[key++] = solution(5);
170 }
171
172 // duplicate next to previous z-bin for contiguous neighbour lookup
173 if (binZ > 0){
175 assert (m_parameters[key] == 0.);
176 m_parameters[key++] = m_centralField + solution(0);
177 m_parameters[key++] = solution(1);
178 m_parameters[key++] = solution(2);
179 m_parameters[key++] = m_centralField + solution(3);
180 m_parameters[key++] = solution(4);
181 m_parameters[key++] = solution(5);
182 }
184 } // Loop over binTheta
185 zAtAxis += 1./s_binInvSizeZ;
186 }
187 //
188 // duplicate end theta-bins for contiguous neighbour lookup
189 zAtAxis = s_binZeroZ; // + smallOffset ??
190 for (int binZ = 0; binZ < s_maxBinZ; ++binZ){
192 BinParameters parms (zAtAxis, cotTheta);
193 int key = fieldKey(parms);
194 for (int k = 0; k < 2*s_numberParameters; ++k){
195 assert (m_parameters[key+2*s_numberParameters] == 0.);
197 ++key;
198 }
199 zAtAxis += 1./s_binInvSizeZ;
200 }
201}
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
@ binZ
Definition BinningType.h:49
difference(file_1="Geometry_1.json", file_2="Geometry_2.json", output_file="Geometry_diff.json")

◆ printFieldIntegrals()

void Trk::SolenoidParametrization::printFieldIntegrals ( MsgStream & m) const

Definition at line 206 of file SolenoidParametrization.cxx.

207{
208 // integrate along lines of const eta from origin to r = 1m or |z| = 2.65m
209 // direction normalised st transverse component = 1 (equiv to a fixed pt)
210 msg << __func__<<"\n"
211 << std::setiosflags(std::ios::fixed)
212 << " eta rEnd mean(Bz) max(dBz/dR) mean(Bt) max(dBt/dR) "
213 << "min(Bt) max(Bt) reverse-bend(z) integrals: Bt.dR Bl.dR"
214 << " asymm: x y z"
215 << " " << std::endl
216 << " m T T/m T T/m "
217 << " T T m T.m T.m"
218 << " T T T"
219 << "/n";
220
221 double maxR = 1000.*Gaudi::Units::mm;
222 double maxZ = 2650.*Gaudi::Units::mm;
223 int numSteps = 1000;
224
225 MagField::AtlasFieldCache fieldCache;
226 m_fieldCondObj->getInitializedCache (fieldCache);
227
228 // step through eta-range
229 double eta = 0.;
230 for (int i = 0; i != 31; ++i)
231 {
232 double phi = 0.;
233 double cotTheta = std::sinh(eta);
234 Amg::Vector3D direction(std::cos(phi),std::sin(phi),cotTheta);
235 double rEnd = maxR;
236 if (std::abs(cotTheta) > maxZ/maxR) rEnd = maxZ/direction.z();
237 double step = rEnd/static_cast<double>(numSteps); // radial step in mm
238 Amg::Vector3D position(0.,0.,0.);
239 double meanBL = 0.;
240 double meanBT = 0.;
241 double meanBZ = 0.;
242 double maxBT = 0.;
243 double minBT = 9999.;
244 double maxGradBT = 0.;
245 double maxGradBZ = 0.;
246 double prevBT = 0.;
247 double prevBZ = 0.;
248 double reverseZ = 0.;
249
250 // look up field along eta-line
251 for (int j = 0; j != numSteps; ++j)
252 {
253 position += 0.5*step*direction;
255 fieldCache.getField(position.data(),field.data());
256 Amg::Vector3D vCrossB = direction.cross(field);
257 position += 0.5*step*direction;
258 double BZ = field.z();
259 double BT = vCrossB.x()*direction.y() - vCrossB.y()*direction.x();
260 double BL = std::sqrt(vCrossB.mag2() - BT*BT);
261 meanBL += BL;
262 meanBT += BT;
263 meanBZ += BZ;
264 if (BT > maxBT) maxBT = BT;
265 if (BT < minBT) minBT = BT;
266 if (j > 0)
267 {
268 if (BT*prevBT < 0.) reverseZ = position.z() - step*direction.z();
269 double grad = std::abs(BT - prevBT);
270 if (grad > maxGradBT) maxGradBT = grad;
271 grad = std::abs(BZ - prevBZ);
272 if (grad > maxGradBZ) maxGradBZ = grad;
273 }
274 prevBT = BT;
275 prevBZ = BZ;
276 }
277
278 // normalize
279 maxGradBT *= static_cast<double>(numSteps)/step;
280 maxGradBZ *= static_cast<double>(numSteps)/step;
281 meanBL /= static_cast<double>(numSteps);
282 meanBT /= static_cast<double>(numSteps);
283 meanBZ /= static_cast<double>(numSteps);
284 double integralBL = meanBL*rEnd;
285 double integralBT = meanBT*rEnd;
286
287 msg << std::setw(6) << std::setprecision(2) << eta
288 << std::setw(8) << std::setprecision(3) << rEnd /Gaudi::Units::meter
289 << std::setw(11) << std::setprecision(4) << meanBZ /Gaudi::Units::tesla
290 << std::setw(12) << std::setprecision(3) << maxGradBZ /Gaudi::Units::tesla
291 << std::setw(13) << std::setprecision(4) << meanBT /Gaudi::Units::tesla
292 << std::setw(12) << std::setprecision(3) << maxGradBT /Gaudi::Units::tesla
293 << std::setw(13) << std::setprecision(4) << minBT /Gaudi::Units::tesla
294 << std::setw(8) << std::setprecision(4) << maxBT /Gaudi::Units::tesla;
295 if (reverseZ > 0.)
296 {
297 msg << std::setw(17) << std::setprecision(2) << reverseZ /Gaudi::Units::meter
298 << std::setw(18) << std::setprecision(4) << integralBT /(Gaudi::Units::tesla*Gaudi::Units::meter)
299 << std::setw(8) << std::setprecision(4) << integralBL /(Gaudi::Units::tesla*Gaudi::Units::meter)
300 << " ";
301 }
302 else
303 {
304 msg << std::setw(35) << std::setprecision(4) << integralBT /(Gaudi::Units::tesla*Gaudi::Units::meter)
305 << std::setw(8) << std::setprecision(4) << integralBL /(Gaudi::Units::tesla*Gaudi::Units::meter)
306 << " ";
307 }
308
309 // check symmetry (reflect in each axis)
310 for (int k = 0; k != 3; ++k)
311 {
312 if (k == 0) direction = Amg::Vector3D(-std::cos(phi),std::sin(phi),cotTheta);
313 if (k == 1) direction = Amg::Vector3D(std::cos(phi),-std::sin(phi),cotTheta);
314 if (k == 2) direction = Amg::Vector3D(std::cos(phi),std::sin(phi),-cotTheta);
315 position = Amg::Vector3D(0.,0.,0.);
316 double asymm = 0.;
317 // look up field along eta-line
318 for (int j = 0; j != numSteps; ++j)
319 {
320 position += 0.5*step*direction;
322 fieldCache.getField(position.data(),field.data());
323 Amg::Vector3D vCrossB = direction.cross(field);
324 position += 0.5*step*direction;
325 double BT = vCrossB.x()*direction.y() - vCrossB.y()*direction.x();
326 asymm += BT;
327 }
328 asymm = asymm/static_cast<double>(numSteps) - meanBT;
329 msg << std::setw(9) << std::setprecision(4) << asymm /Gaudi::Units::tesla;
330 }
331 msg<<"/n";
332 eta += 0.1;
333 }
334}
Scalar eta() const
pseudorapidity method
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
const Amg::Vector3D & direction() const
Method to retrieve the direction at the Intersection.
@ phi
Definition ParamDefs.h:75
MsgStream & msg
Definition testRead.cxx:32

◆ printParametersForEtaLine()

void Trk::SolenoidParametrization::printParametersForEtaLine ( double eta,
double z_origin,
MsgStream & msg ) const

Definition at line 337 of file SolenoidParametrization.cxx.

338{
339 double cotTheta = 1./std::tan(2.*std::atan(1./std::exp(eta)));
340 BinParameters parms (z_origin, cotTheta);
341 int key = fieldKey(parms);
342 double z_max;
343 if (cotTheta < s_zInner/s_rInner)
344 {
345 z_max = s_rInner*cotTheta;
346 }
347 else
348 {
349 z_max = s_zInner;
350 }
351 msg <<__func__<<"\n"
352 << std::setiosflags(std::ios::fixed)
353 << "SolenoidParametrization: line with eta " << std::setw(6) << std::setprecision(2) << eta
354 << " from (r,z) 0.0," << std::setw(6) << std::setprecision(1) << z_origin
355 << " inner terms: z0 "<< std::setw(6) << std::setprecision(2)
357 << " z^2 "<< std::setw(6) << std::setprecision(3)
358 << m_parameters[key+1]*z_max*z_max/m_centralField
359 << " z^3 " << std::setw(6) << std::setprecision(3)
360 << m_parameters[key+2]*z_max*z_max*z_max/m_centralField
361 << " outer terms: z0 "<< std::setw(6) << std::setprecision(3)
363 << " z^2 "<< std::setw(6) << std::setprecision(3)
364 << m_parameters[key+4]*z_max*z_max/m_centralField
365 << " z^3 " << std::setw(6) << std::setprecision(3)
366 << m_parameters[key+5]*z_max*z_max*z_max/m_centralField
367 << std::resetiosflags(std::ios::fixed) << "\n";
368}

◆ printResidualForEtaLine()

void Trk::SolenoidParametrization::printResidualForEtaLine ( double eta,
double zOrigin,
MsgStream & msg ) const

Definition at line 371 of file SolenoidParametrization.cxx.

372{
373 double cotTheta = 1./std::tan(2.*std::atan(1./std::exp(std::abs(eta))));
374 double z = zOrigin;
375 double r = 0.;
376 int n = 200;
377 double dr;
378 if (cotTheta < s_zOuter/s_rOuter)
379 {
380 dr = s_rOuter/double(n);
381 }
382 else
383 {
384 dr = s_zOuter/(cotTheta*double(n));
385 }
386 double chiSquareIn = 0.;
387 double chiSquareOut = 0.;
388 double nIn = 0.;
389 double nOut = 0.;
390 double worstBCalc = 0.;
391 double worstBTrue = 0.;
392 double worstDiff = -1.;
393 double worstR = 0.;
394 double worstZ = 0.;
395 MagField::AtlasFieldCache fieldCache;
396 m_fieldCondObj->getInitializedCache (fieldCache);
397 for (int k = 0; k < n; ++k)
398 {
399 double b = fieldComponent(r,z,cotTheta,fieldCache);
400 Parameters parms (*this, r, z, cotTheta);
401 double diff = (fieldComponent(z, parms) - b)/s_lightSpeed;
402
403 if (r > s_rInner || z > s_zInner)
404 {
405 chiSquareOut+= diff*diff;
406 nOut += 1.;
407 }
408 else
409 {
410 chiSquareIn += diff*diff;
411 nIn += 1.;
412 }
413
414 if (std::abs(diff) > worstDiff)
415 {
416 worstDiff = std::abs(diff);
417 worstBCalc = fieldComponent(z, parms);
418 worstBTrue = b;
419 worstR = r;
420 worstZ = z;
421 }
422 r += dr;
423 z += dr*cotTheta;
424 }
425 if ((nIn == 0) or (nOut == 0)){
426 msg <<__func__<<"nIn = "<<nIn<<"; nOut = "<<nOut<<".\n";
427 return;
428 }
429
430 msg <<__func__<<"\n"
431 << std::setiosflags(std::ios::fixed)
432 << "SolenoidParametrization: line with eta " << std::setw(6) << std::setprecision(2) << eta
433 << " from (r,z) 0.0, " << std::setw(6) << std::setprecision(1) << zOrigin
434 << " rms diff inner/outer " << std::setw(6) << std::setprecision(3)
435 << std::sqrt(chiSquareIn/nIn) /Gaudi::Units::tesla << " " << std::setw(6) << std::setprecision(3)
436 << std::sqrt(chiSquareOut/nOut) /Gaudi::Units::tesla << std::endl
437 << " worst residual at: (r,z) "
438 << std::setw(6) << std::setprecision(1) << worstR
439 << ", " << std::setw(6) << std::setprecision(1) << worstZ
440 << " with B true/calc " << std::setw(6) << std::setprecision(3)
441 << worstBTrue/s_lightSpeed /Gaudi::Units::tesla
442 << " " << std::setw(6) << std::setprecision(3) << worstBCalc/s_lightSpeed /Gaudi::Units::tesla
443 << std::resetiosflags(std::ios::fixed) << "\n";
444}
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition Jet.cxx:631

◆ setTerms()

void Trk::SolenoidParametrization::setTerms ( int key1,
Parameters & parms ) const
inlineprivate

Definition at line 196 of file SolenoidParametrization.h.

197{
199 int key3 = key2 + s_numberParameters;
200 int key4 = key3 + s_numberParameters;
201
202 assert (key1 >= 0);
203 assert (key4 < 14688);
204 assert (m_parameters[key1] != 0.);
205 assert (m_parameters[key3] != 0.);
206 if (parms.m_cotTheta < 7.)
207 {
208 assert (m_parameters[key2] != 0.);
209 assert (m_parameters[key4] != 0.);
210 }
211
212
213 parms.m_fieldAtOrigin = interpolate(key1++,key2++,key3++,key4++,parms);
214 parms.m_quadraticTerm = interpolate(key1++,key2++,key3++,key4++,parms);
215 parms.m_cubicTerm = interpolate(key1,key2,key3,key4,parms);
216}
double interpolate(int key1, int key2, int key3, int key4, const Parameters &parms) const

◆ validOrigin()

bool Trk::SolenoidParametrization::validOrigin ( const Amg::Vector3D & origin) const
inline

Definition at line 275 of file SolenoidParametrization.h.

276{ return (origin.perp() < s_maximumImpactAtOrigin
277 && std::abs(origin.z()) < s_maximumZatOrigin); }

◆ Parameters

friend class Parameters
friend

Definition at line 88 of file SolenoidParametrization.h.

Member Data Documentation

◆ m_centralField

double Trk::SolenoidParametrization::m_centralField
private

Definition at line 120 of file SolenoidParametrization.h.

◆ m_currentMax

double Trk::SolenoidParametrization::m_currentMax {}
private

Definition at line 119 of file SolenoidParametrization.h.

119{};

◆ m_currentMin

double Trk::SolenoidParametrization::m_currentMin {}
private

Definition at line 118 of file SolenoidParametrization.h.

118{};

◆ m_fieldCondObj

const AtlasFieldCacheCondObj* Trk::SolenoidParametrization::m_fieldCondObj
private

Definition at line 117 of file SolenoidParametrization.h.

◆ m_parameters

double Trk::SolenoidParametrization::m_parameters[14688]
private

Definition at line 121 of file SolenoidParametrization.h.

◆ s_binInvSizeTheta

const double Trk::SolenoidParametrization::s_binInvSizeTheta = 1./0.1
staticprivate

Definition at line 102 of file SolenoidParametrization.h.

◆ s_binInvSizeZ

const double Trk::SolenoidParametrization::s_binInvSizeZ = 1./20.*Gaudi::Units::mm
staticprivate

Definition at line 103 of file SolenoidParametrization.h.

◆ s_binZeroTheta

const double Trk::SolenoidParametrization::s_binZeroTheta = 0.
staticprivate

Definition at line 104 of file SolenoidParametrization.h.

◆ s_binZeroZ

const double Trk::SolenoidParametrization::s_binZeroZ = -160.*Gaudi::Units::mm
staticprivate

Definition at line 105 of file SolenoidParametrization.h.

◆ s_lightSpeed

const double Trk::SolenoidParametrization::s_lightSpeed = -1.*299792458*Gaudi::Units::m/Gaudi::Units::s
staticprivate

Definition at line 106 of file SolenoidParametrization.h.

◆ s_maxBinTheta

const int Trk::SolenoidParametrization::s_maxBinTheta = 72
staticprivate

Definition at line 107 of file SolenoidParametrization.h.

◆ s_maxBinZ

const int Trk::SolenoidParametrization::s_maxBinZ = 17
staticprivate

Definition at line 108 of file SolenoidParametrization.h.

◆ s_maximumImpactAtOrigin

const double Trk::SolenoidParametrization::s_maximumImpactAtOrigin = 30.*Gaudi::Units::mm
staticprivate

Definition at line 109 of file SolenoidParametrization.h.

◆ s_maximumZatOrigin

const double Trk::SolenoidParametrization::s_maximumZatOrigin = 250.*Gaudi::Units::mm
staticprivate

Definition at line 110 of file SolenoidParametrization.h.

◆ s_numberParameters

const int Trk::SolenoidParametrization::s_numberParameters = 6
staticprivate

Definition at line 111 of file SolenoidParametrization.h.

◆ s_rInner

const double Trk::SolenoidParametrization::s_rInner = 570.*Gaudi::Units::mm
staticprivate

Definition at line 112 of file SolenoidParametrization.h.

◆ s_rOuter

const double Trk::SolenoidParametrization::s_rOuter = 1050.*Gaudi::Units::mm
staticprivate

Definition at line 113 of file SolenoidParametrization.h.

◆ s_zInner

const double Trk::SolenoidParametrization::s_zInner = 2150.0*Gaudi::Units::mm
staticprivate

Definition at line 114 of file SolenoidParametrization.h.

◆ s_zOuter

const double Trk::SolenoidParametrization::s_zOuter = 2800.0*Gaudi::Units::mm
staticprivate

Definition at line 115 of file SolenoidParametrization.h.


The documentation for this class was generated from the following files: