CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
OAEParametrizedMagneticField Class Reference

#include <OAEParametrizedMagneticField.h>

Inheritance diagram for OAEParametrizedMagneticField:
MagneticField

Public Member Functions

GlobalVector inTesla (const GlobalPoint &gp) const
 Field value ad specified global point, in Tesla. More...
 
GlobalVector inTeslaUnchecked (const GlobalPoint &gp) const
 
bool isDefined (const GlobalPoint &gp) const
 True if the point is within the region where the concrete field. More...
 
 OAEParametrizedMagneticField (std::string T="3_8T")
 Constructor. More...
 
 OAEParametrizedMagneticField (const edm::ParameterSet &parameters)
 Constructor. Parameters taken from a PSet. More...
 
virtual ~OAEParametrizedMagneticField ()
 Destructor. More...
 
- Public Member Functions inherited from MagneticField
virtual MagneticFieldclone () const
 
GlobalVector inInverseGeV (const GlobalPoint &gp) const
 Field value ad specified global point, in 1/Gev. More...
 
GlobalVector inKGauss (const GlobalPoint &gp) const
 Field value ad specified global point, in KGauss. More...
 
 MagneticField ()
 
 MagneticField (const MagneticField &orig)
 
int nominalValue () const
 The nominal field value for this map in kGauss. More...
 
virtual ~MagneticField ()
 

Private Attributes

magfieldparam::TkBfield theParam
 

Detailed Description

Magnetic Field engine wrapper for V. Karimaki's "off-axis expansion" of the TOSCA field version 1103l_071212 (2, 3, 3.4, 3.8, 4 T) valid in the region r<1.15 m and |z|<2.8 m For details, cf TkBfield.h

Author
N. Amapane - CERN

Definition at line 21 of file OAEParametrizedMagneticField.h.

Constructor & Destructor Documentation

OAEParametrizedMagneticField::OAEParametrizedMagneticField ( std::string  T = "3_8T")
explicit

Constructor.

OAEParametrizedMagneticField::OAEParametrizedMagneticField ( const edm::ParameterSet parameters)
explicit

Constructor. Parameters taken from a PSet.

Definition at line 19 of file OAEParametrizedMagneticField.cc.

19  :
20  theParam(parameters.getParameter<string>("BValue")) {}
T getParameter(std::string const &) const
OAEParametrizedMagneticField::~OAEParametrizedMagneticField ( )
virtual

Destructor.

Definition at line 23 of file OAEParametrizedMagneticField.cc.

23 {}

Member Function Documentation

GlobalVector OAEParametrizedMagneticField::inTesla ( const GlobalPoint gp) const
virtual

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 27 of file OAEParametrizedMagneticField.cc.

References inTeslaUnchecked(), and isDefined().

27  {
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 }
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
GlobalVector OAEParametrizedMagneticField::inTeslaUnchecked ( const GlobalPoint gp) const
virtual

Optional implementation that derived classes can implement to provide faster query by skipping the check to isDefined.

Reimplemented from MagneticField.

Definition at line 41 of file OAEParametrizedMagneticField.cc.

References magfieldparam::TkBfield::getBxyz(), theParam, x, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by inTesla().

41  {
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 }
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 z() const
Definition: PV3DBase.h:64
Definition: DDAxes.h:10
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool OAEParametrizedMagneticField::isDefined ( const GlobalPoint gp) const
virtual

True if the point is within the region where the concrete field.

Reimplemented from MagneticField.

Definition at line 50 of file OAEParametrizedMagneticField.cc.

References f, PV3DBase< T, PVType, FrameType >::perp2(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by inTesla().

50  {
51  return (gp.perp2()<(115.f*115.f) && fabs(gp.z())<280.f);
52 }
T perp2() const
Definition: PV3DBase.h:71
T z() const
Definition: PV3DBase.h:64
double f[11][100]

Member Data Documentation

magfieldparam::TkBfield OAEParametrizedMagneticField::theParam
private

Definition at line 39 of file OAEParametrizedMagneticField.h.

Referenced by inTeslaUnchecked().