CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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) {
16 }
17 
19  : c1(parameters[0]), b0(parameters[1]), b1(parameters[2]), a(parameters[3]) {
21 }
22 
24 
26  if (isDefined(gp)) {
27  return inTeslaUnchecked(gp);
28  } else {
29  LogDebug("MagneticField|FieldOutsideValidity")
30  << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField";
31  return GlobalVector();
32  }
33 }
34 
36  return GlobalVector(0, 0, B0Z(gp.z()) * Kr(gp.perp2()));
37 }
38 
39 inline float ParabolicParametrizedMagneticField::B0Z(const float z) const { return b0 * z * z + b1 * z + c1; }
40 
41 inline float ParabolicParametrizedMagneticField::Kr(const float R2) const { return a * R2 + 1.; }
42 
44  return (gp.perp2() < (13225.f) && fabs(gp.z()) < 280.f);
45 }
T perp2() const
Definition: PV3DBase.h:68
float float float z
ParabolicParametrizedMagneticField()
Default constructor, use default values for 3.8T map.
T z() const
Definition: PV3DBase.h:61
bool isDefined(const GlobalPoint &gp) const override
True if the point is within the region where the concrete field.
GlobalVector inTesla(const GlobalPoint &gp) const override
Field value ad specified global point, in Tesla.
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const override
double a
Definition: hdecay.h:119
void setNominalValue()
static constexpr float b0
static constexpr float b1
Global3DVector GlobalVector
Definition: GlobalVector.h:10
#define LogDebug(id)