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  theParam(B){}
17 
19  theParam(T){}
20 
21 
23  theParam(parameters.getParameter<string>("BValue")) {}
24 
25 
27 
28 
31  if (isDefined(gp)) {
32  return inTeslaUnchecked(gp);
33  } else {
34  edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of OAEParametrizedMagneticField";
35  return GlobalVector();
36  }
37 }
38 
39 namespace {
40  constexpr float ooh = 1./100;
41 }
42 
45  float x[3] = {gp.x()*ooh, gp.y()*ooh, gp.z()*ooh};
46  float B[3];
47  theParam.getBxyz(x,B);
48  return GlobalVector(B[0], B[1], B[2]);
49 }
50 
51 
52 bool
54  return (gp.perp2()<(115.f*115.f) && fabs(gp.z())<280.f);
55 }
void getBxyz(float const *__restrict__ x, float *__restrict__ Bxyz) const
B out in cartesian.
Definition: TkBfield.cc:59
~OAEParametrizedMagneticField() override
Destructor.
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
GlobalVector inTesla(const GlobalPoint &gp) const override
Field value ad specified global point, in Tesla.
T z() const
Definition: PV3DBase.h:64
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:62
#define constexpr
Global3DVector GlobalVector
Definition: GlobalVector.h:10