CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
dictionary parameters
Definition: Parameters.py:2
virtual ~OAEParametrizedMagneticField()
Destructor.
void getBxyz(float const *__restrict__ x, float *__restrict__ Bxyz) const
B out in cartesian.
Definition: TkBfield.cc:59
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
#define constexpr
T z() const
Definition: PV3DBase.h:64
GlobalVector inTesla(const GlobalPoint &gp) const
Field value ad specified global point, in Tesla.
double f[11][100]
OAEParametrizedMagneticField(float B)
Constructor, pass value for nominal field.
long double T
T x() const
Definition: PV3DBase.h:62
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
Global3DVector GlobalVector
Definition: GlobalVector.h:10