CMS 3D CMS Logo

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