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")) {
22 }
23 
25 
27  if (isDefined(gp)) {
28  return inTeslaUnchecked(gp);
29  } else {
30  edm::LogWarning("MagneticField") << " Point " << gp
31  << " is outside the validity region of OAEParametrizedMagneticField";
32  return GlobalVector();
33  }
34 }
35 
36 namespace {
37  constexpr float ooh = 1. / 100;
38 }
39 
41  float x[3] = {gp.x() * ooh, gp.y() * ooh, gp.z() * ooh};
42  float B[3];
43  theParam.getBxyz(x, B);
44  return GlobalVector(B[0], B[1], B[2]);
45 }
46 
48  return (gp.perp2() < (115.f * 115.f) && fabs(gp.z()) < 280.f);
49 }
Definition: APVGainStruct.h:7
~OAEParametrizedMagneticField() override
Destructor.
bool isDefined(const GlobalPoint &gp) const override
True if the point is within the region where the concrete field.
double f[11][100]
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const override
GlobalVector inTesla(const GlobalPoint &gp) const override
Field value ad specified global point, in Tesla.
OAEParametrizedMagneticField(float B)
Constructor, pass value for nominal field.
void getBxyz(float const *__restrict__ x, float *__restrict__ Bxyz) const
B out in cartesian.
Definition: TkBfield.cc:61
void setNominalValue()
Log< level::Warning, false > LogWarning
long double T
Global3DVector GlobalVector
Definition: GlobalVector.h:10