CMS 3D CMS Logo

Public Member Functions | Private Attributes

OAEParametrizedMagneticField Class Reference

#include <OAEParametrizedMagneticField.h>

Inheritance diagram for OAEParametrizedMagneticField:
MagneticField

List of all members.

Public Member Functions

GlobalVector inTesla (const GlobalPoint &gp) const
 Field value ad specified global point, in Tesla.
GlobalVector inTeslaUnchecked (const GlobalPoint &gp) const
bool isDefined (const GlobalPoint &gp) const
 True if the point is within the region where the concrete field.
 OAEParametrizedMagneticField (const edm::ParameterSet &parameters)
 Constructor. Parameters taken from a PSet.
 OAEParametrizedMagneticField (std::string T="3_8T")
 Constructor.
virtual ~OAEParametrizedMagneticField ()
 Destructor.

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.

                                                                                            : 
  theParam(parameters.getParameter<string>("BValue")) {}
OAEParametrizedMagneticField::~OAEParametrizedMagneticField ( ) [virtual]

Destructor.

Definition at line 23 of file OAEParametrizedMagneticField.cc.

{}

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().

                                                                 {
  if (isDefined(gp)) {
    return inTeslaUnchecked(gp);
  } else {
    edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of OAEParametrizedMagneticField";
    return GlobalVector();
  }
}
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, PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by inTesla().

                                                                          {
  double x[3] = {gp.x()*ooh, gp.y()*ooh, gp.z()*ooh};
  double B[3];
  theParam.getBxyz(x,B);
  return GlobalVector(B[0], B[1], B[2]);
}
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 PV3DBase< T, PVType, FrameType >::perp2(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by inTesla().

                                                                   {
  return (gp.perp2()<(115.*115.) && fabs(gp.z())<280.);
}

Member Data Documentation

Definition at line 39 of file OAEParametrizedMagneticField.h.

Referenced by inTeslaUnchecked().