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(T){}
17 
18 
20  theParam(parameters.getParameter<string>("BValue")) {}
21 
22 
24 
25 
28  if (isDefined(gp)) {
29  return inTeslaUnchecked(gp);
30  } else {
31  edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of OAEParametrizedMagneticField";
32  return GlobalVector();
33  }
34 }
35 
36 namespace {
37  constexpr float ooh = 1./100;
38 }
39 
42  float x[3] = {gp.x()*ooh, gp.y()*ooh, gp.z()*ooh};
43  float B[3];
44  theParam.getBxyz(x,B);
45  return GlobalVector(B[0], B[1], B[2]);
46 }
47 
48 
49 bool
51  return (gp.perp2()<(115.f*115.f) && fabs(gp.z())<280.f);
52 }
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:46
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
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(std::string T="3_8T")
Constructor.
Definition: DDAxes.h:10
long double T
T x() const
Definition: PV3DBase.h:62
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
#define constexpr
bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
Global3DVector GlobalVector
Definition: GlobalVector.h:10