CMS 3D CMS Logo

ParabolicParametrizedMagneticField.cc
Go to the documentation of this file.
1 
9 
10 using namespace std;
11 
12 // Default parameters are the best fit of 3.8T to the OAEParametrizedMagneticField parametrization.
14  : c1(3.8114), b0(-3.94991e-06), b1(7.53701e-06), a(2.43878e-11) {}
15 
17  : c1(parameters[0]), b0(parameters[1]), b1(parameters[2]), a(parameters[3]) {}
18 
20 
22  if (isDefined(gp)) {
23  return inTeslaUnchecked(gp);
24  } else {
25  LogDebug("MagneticField|FieldOutsideValidity")
26  << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField";
27  return GlobalVector();
28  }
29 }
30 
32  return GlobalVector(0, 0, B0Z(gp.z()) * Kr(gp.perp2()));
33 }
34 
35 inline float ParabolicParametrizedMagneticField::B0Z(const float z) const { return b0 * z * z + b1 * z + c1; }
36 
37 inline float ParabolicParametrizedMagneticField::Kr(const float R2) const { return a * R2 + 1.; }
38 
40  return (gp.perp2() < (13225.f) && fabs(gp.z()) < 280.f);
41 }
#define LogDebug(id)
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const override
bool isDefined(const GlobalPoint &gp) const override
True if the point is within the region where the concrete field.
T perp2() const
Definition: PV3DBase.h:68
ParabolicParametrizedMagneticField()
Default constructor, use default values for 3.8T map.
T z() const
Definition: PV3DBase.h:61
double f[11][100]
double a
Definition: hdecay.h:119
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector inTesla(const GlobalPoint &gp) const override
Field value ad specified global point, in Tesla.