CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParabolicParametrizedMagneticField.cc
Go to the documentation of this file.
1 
9 
10 using namespace std;
11 using namespace magfieldparam;
12 
14 
15 
16 //ParabolicParametrizedMagneticField::ParabolicParametrizedMagneticField(const edm::ParameterSet& parameters) {}
17 // theParam(parameters.getParameter<string>("BValue")) {}
18 
19 
21 
22 
25  if (isDefined(gp)) {
26  return inTeslaUnchecked(gp);
27  } else {
28  LogDebug("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of ParabolicParametrizedMagneticField";
29  return GlobalVector();
30  }
31 }
32 
34  float B=B0Z(gp.z())*Kr(gp.perp2());
35  return GlobalVector(0, 0, B);
36 }
37 
38 inline float ParabolicParametrizedMagneticField::B0Z(const float z) const {
39  return b0*z*z + b1*z + c1;
40 }
41 
42 inline float ParabolicParametrizedMagneticField::Kr(const float R2) const {
43  return a*R2 +1.;
44 }
45 
47  return (gp.perp2()<(13225.f) && fabs(gp.z())<280.f);
48 }
#define LogDebug(id)
T perp2() const
Definition: PV3DBase.h:71
float float float z
bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
T z() const
Definition: PV3DBase.h:64
double f[11][100]
virtual ~ParabolicParametrizedMagneticField()
Constructor. Parameters taken from a PSet.
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