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
PolyFit2DParametrizedMagneticField Class Reference

#include <PolyFit2DParametrizedMagneticField.h>

Inheritance diagram for PolyFit2DParametrizedMagneticField:
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...
 
 PolyFit2DParametrizedMagneticField (double bVal=3.8114)
 
 PolyFit2DParametrizedMagneticField (const edm::ParameterSet &parameters)
 Constructor. Parameters taken from a PSet. More...
 
virtual ~PolyFit2DParametrizedMagneticField ()
 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 ()
 
int nominalValue () const
 The nominal field value for this map in kGauss. More...
 
virtual ~MagneticField ()
 

Private Attributes

magfieldparam::BFittheParam
 

Detailed Description

Magnetic Field engine wrapper for V. Maroussov's 2D parametrization of the MT data.

Date:
2011/04/16 10:20:40
Revision:
1.1
Author
N. Amapane

Definition at line 20 of file PolyFit2DParametrizedMagneticField.h.

Constructor & Destructor Documentation

PolyFit2DParametrizedMagneticField::PolyFit2DParametrizedMagneticField ( double  bVal = 3.8114)

Constructor. Fitted bVal for the nominal currents are: 2.0216; 3.5162; 3.8114; 4.01242188708911

Definition at line 18 of file PolyFit2DParametrizedMagneticField.cc.

References magfieldparam::BFit::SetField(), and theParam.

18  :
19  theParam(new BFit())
20 {
21  theParam->SetField(bVal);
22 }
void SetField(double B)
Definition: BFit.cc:101
PolyFit2DParametrizedMagneticField::PolyFit2DParametrizedMagneticField ( const edm::ParameterSet parameters)

Constructor. Parameters taken from a PSet.

Definition at line 25 of file PolyFit2DParametrizedMagneticField.cc.

References edm::ParameterSet::getParameter(), magfieldparam::BFit::SetField(), and theParam.

25  : theParam(new BFit()) {
26  theParam->SetField(parameters.getParameter<double>("BValue"));
27 }
T getParameter(std::string const &) const
void SetField(double B)
Definition: BFit.cc:101
PolyFit2DParametrizedMagneticField::~PolyFit2DParametrizedMagneticField ( )
virtual

Destructor.

Definition at line 30 of file PolyFit2DParametrizedMagneticField.cc.

References theParam.

30  {
31  delete theParam;
32 }

Member Function Documentation

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

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 36 of file PolyFit2DParametrizedMagneticField.cc.

References inTeslaUnchecked(), and isDefined().

36  {
37 
38  if (isDefined(gp)) {
39  return inTeslaUnchecked(gp);
40  } else {
41  edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of PolyFit2DParametrizedMagneticField";
42  return GlobalVector();
43  }
44 }
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 PolyFit2DParametrizedMagneticField::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 47 of file PolyFit2DParametrizedMagneticField.cc.

References funct::cos(), magfieldparam::BFit::GetField(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), funct::sin(), theParam, and PV3DBase< T, PVType, FrameType >::z().

Referenced by inTesla().

47  {
48  double Br, Bz, Bphi;
49  theParam->GetField(gp.perp()/100., gp.z()/100., gp.phi(),
50  Br, Bz, Bphi);
51 
52  double cosphi = cos(gp.phi());
53  double sinphi = sin(gp.phi());
54 
55  return GlobalVector(Br*cosphi - Bphi*sinphi,
56  Br*sinphi + Bphi*cosphi,
57  Bz);
58 }
T perp() const
Definition: PV3DBase.h:71
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
void GetField(double r, double z, double phi, double &Br, double &Bz, double &Bphi)
Definition: BFit.cc:139
T z() const
Definition: PV3DBase.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool PolyFit2DParametrizedMagneticField::isDefined ( const GlobalPoint gp) const
virtual

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

Reimplemented from MagneticField.

Definition at line 61 of file PolyFit2DParametrizedMagneticField.cc.

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

Referenced by inTesla().

61  {
62  double z = fabs(gp.z());
63  double r = gp.perp();
64  //"rectangle" |z|<3.5, r<1.9 _except_ the "corners" |z|+2.5*r>6.7, everything in meters
65  if (z>350. || r>190 || z+2.5*r>670.) return false;
66  return true;
67 }
T perp() const
Definition: PV3DBase.h:71
double double double z
T z() const
Definition: PV3DBase.h:63

Member Data Documentation

magfieldparam::BFit* PolyFit2DParametrizedMagneticField::theParam
private