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  double ooh = 1./100;
38 }
39 
42  double x[3] = {gp.x()*ooh, gp.y()*ooh, gp.z()*ooh};
43  double 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.*115.) && fabs(gp.z())<280.);
52 }
dictionary parameters
Definition: Parameters.py:2
virtual ~OAEParametrizedMagneticField()
Destructor.
T y() const
Definition: PV3DBase.h:62
T perp2() const
Definition: PV3DBase.h:70
T z() const
Definition: PV3DBase.h:63
GlobalVector inTesla(const GlobalPoint &gp) const
Field value ad specified global point, in Tesla.
void getBxyz(double const *__restrict__ x, double *__restrict__ Bxyz) const
B out in cartesian.
Definition: TkBfield.cc:120
OAEParametrizedMagneticField(std::string T="3_8T")
Constructor.
Definition: DDAxes.h:10
long double T
T x() const
Definition: PV3DBase.h:61
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