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")) {}
21 
23 
25  if (isDefined(gp)) {
26  return inTeslaUnchecked(gp);
27  } else {
28  edm::LogWarning("MagneticField") << " Point " << gp
29  << " is outside the validity region of OAEParametrizedMagneticField";
30  return GlobalVector();
31  }
32 }
33 
34 namespace {
35  constexpr float ooh = 1. / 100;
36 }
37 
39  float x[3] = {gp.x() * ooh, gp.y() * ooh, gp.z() * ooh};
40  float B[3];
41  theParam.getBxyz(x, B);
42  return GlobalVector(B[0], B[1], B[2]);
43 }
44 
46  return (gp.perp2() < (115.f * 115.f) && fabs(gp.z()) < 280.f);
47 }
Vector3DBase
Definition: Vector3DBase.h:8
OAEParametrizedMagneticField::isDefined
bool isDefined(const GlobalPoint &gp) const override
True if the point is within the region where the concrete field.
Definition: OAEParametrizedMagneticField.cc:45
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
OAEParametrizedMagneticField::inTeslaUnchecked
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const override
Definition: OAEParametrizedMagneticField.cc:38
OAEParametrizedMagneticField::OAEParametrizedMagneticField
OAEParametrizedMagneticField(float B)
Constructor, pass value for nominal field.
Definition: OAEParametrizedMagneticField.cc:15
MessageLogger.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DDAxes::x
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TkBfield.h
OAEParametrizedMagneticField::~OAEParametrizedMagneticField
~OAEParametrizedMagneticField() override
Destructor.
Definition: OAEParametrizedMagneticField.cc:22
OAEParametrizedMagneticField::theParam
magfieldparam::TkBfield theParam
Definition: OAEParametrizedMagneticField.h:46
Point3DBase< float, GlobalTag >
magfieldparam
Definition: BCyl.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
edm::ParameterSet
Definition: ParameterSet.h:47
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
std
Definition: JetResolutionObject.h:76
magfieldparam::TkBfield::getBxyz
void getBxyz(float const *__restrict__ x, float *__restrict__ Bxyz) const
B out in cartesian.
Definition: TkBfield.cc:61
OAEParametrizedMagneticField.h
T
long double T
Definition: Basic3DVectorLD.h:48
ParameterSet.h
OAEParametrizedMagneticField::inTesla
GlobalVector inTesla(const GlobalPoint &gp) const override
Field value ad specified global point, in Tesla.
Definition: OAEParametrizedMagneticField.cc:24