CMS 3D CMS Logo

OAEParametrizedMagneticField.cc
Go to the documentation of this file.
1 
9 
10 #include "TkBfield.h"
11 
12 using namespace std;
13 using namespace magfieldparam;
14 
16 
18 
20  : theParam(parameters.getParameter<string>("BValue")) {}
21 
23 
25  if (isDefined(gp)) {
26  return inTeslaUnchecked(gp);
27  } else {
28  edm::LogWarning("MagneticField|FieldOutsideValidity")
29  << " Point " << gp << " is outside the validity region of OAEParametrizedMagneticField";
30  return GlobalVector();
31  }
32 }
33 
34 namespace {
35  constexpr float ooh = 1. / 100;
36 }
37 
39  float x[3] = {gp.x() * ooh, gp.y() * ooh, gp.z() * ooh};
40  float B[3];
41  theParam.getBxyz(x, B);
42  return GlobalVector(B[0], B[1], B[2]);
43 }
44 
46  return (gp.perp2() < (115.f * 115.f) && fabs(gp.z()) < 280.f);
47 }
void getBxyz(float const *__restrict__ x, float *__restrict__ Bxyz) const
B out in cartesian.
Definition: TkBfield.cc:61
~OAEParametrizedMagneticField() override
Destructor.
T y() const
Definition: PV3DBase.h:60
T perp2() const
Definition: PV3DBase.h:68
GlobalVector inTesla(const GlobalPoint &gp) const override
Field value ad specified global point, in Tesla.
T z() const
Definition: PV3DBase.h:61
double f[11][100]
static const std::string B
bool isDefined(const GlobalPoint &gp) const override
True if the point is within the region where the concrete field.
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const override
OAEParametrizedMagneticField(float B)
Constructor, pass value for nominal field.
long double T
T x() const
Definition: PV3DBase.h:59
#define constexpr
Global3DVector GlobalVector
Definition: GlobalVector.h:10