CMS 3D CMS Logo

OAEParametrizedMagneticField Class Reference

Magnetic Field engine wrapper for V. More...

#include <MagneticField/ParametrizedEngine/src/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
 Optional implementation that derived classes can implement to provide faster query by skipping the check to isDefined.
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::TkBfieldtheParam


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

Date
2008/05/28 13:17:48
Revision
1.3
Author:
N. Amapane - CERN

Definition at line 22 of file OAEParametrizedMagneticField.h.


Constructor & Destructor Documentation

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

Constructor.

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

Constructor. Parameters taken from a PSet.

Definition at line 22 of file OAEParametrizedMagneticField.cc.

References edm::ParameterSet::getParameter(), and theParam.

00022                                                                                             {
00023   theParam = new TkBfield(parameters.getParameter<string>("BValue"));
00024 }

OAEParametrizedMagneticField::~OAEParametrizedMagneticField (  )  [virtual]

Destructor.

Definition at line 27 of file OAEParametrizedMagneticField.cc.

References theParam.

00027                                                             {
00028   delete theParam;
00029 }


Member Function Documentation

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

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 33 of file OAEParametrizedMagneticField.cc.

References inTeslaUnchecked(), and isDefined().

00033                                                                  {
00034   if (isDefined(gp)) {
00035     return inTeslaUnchecked(gp);
00036   } else {
00037     edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of OAEParametrizedMagneticField";
00038     return GlobalVector();
00039   }
00040 }

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

00043                                                                           {
00044   double x[3] = {gp.x()/100., gp.y()/100., gp.z()/100.};
00045   double B[3];
00046   theParam->getBxyz(x,B);
00047   return GlobalVector(B[0], B[1], B[2]);
00048 }

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 52 of file OAEParametrizedMagneticField.cc.

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

Referenced by inTesla().

00052                                                                    {
00053   return (gp.perp()<115. && fabs(gp.z())<280.);
00054 }


Member Data Documentation

magfieldparam::TkBfield* OAEParametrizedMagneticField::theParam [private]

Definition at line 40 of file OAEParametrizedMagneticField.h.

Referenced by inTeslaUnchecked(), OAEParametrizedMagneticField(), and ~OAEParametrizedMagneticField().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:07 2009 for CMSSW by  doxygen 1.5.4