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

#include <PolyFit3DParametrizedMagneticField.h>

Inheritance diagram for PolyFit3DParametrizedMagneticField:
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...
 
 PolyFit3DParametrizedMagneticField (double bVal=3.8114)
 
 PolyFit3DParametrizedMagneticField (const edm::ParameterSet &parameters)
 Constructor. Parameters taken from a PSet. More...
 
virtual ~PolyFit3DParametrizedMagneticField ()
 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::BFit3DtheParam
 

Detailed Description

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

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

Definition at line 20 of file PolyFit3DParametrizedMagneticField.h.

Constructor & Destructor Documentation

PolyFit3DParametrizedMagneticField::PolyFit3DParametrizedMagneticField ( 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 PolyFit3DParametrizedMagneticField.cc.

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

18  :
19  theParam(new BFit3D())
20 {
21  theParam->SetField(bVal);
22 }
void SetField(const double B)
Definition: BFit3D.h:47
PolyFit3DParametrizedMagneticField::PolyFit3DParametrizedMagneticField ( const edm::ParameterSet parameters)

Constructor. Parameters taken from a PSet.

Definition at line 25 of file PolyFit3DParametrizedMagneticField.cc.

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

25  : theParam(new BFit3D()) {
26  theParam->SetField(parameters.getParameter<double>("BValue"));
27 
28  // Additional options (documentation by Vassili):
29 
30  // By default, the package accepts signed value of "r". That means,
31  // one can cross r=0 and orientation of the coordinate "orts"
32  // e_r and e_phi will not be flipped over.
33  // In other words for an r<0 the e_r points inward, in the direction r=0.
34  // This is a "natural" mode. However, the default behavior may be
35  // changed by the call
36 
37  // theParam->UseSignedRad(false);
38 
39  // In that case with crossing of r=0 e_r and e_phi will be flipped in
40  // such a way that e_r always points outward. In other words instead of
41  // (r<0, phi) the (abs(r), phi+PI) will be used in this mode.
42 
43  // The expansion coefficients for a nominal field in between measurement
44  // field values (2.0T, 3.5T, 3.8T and 4.0T) by default are calculated by
45  // means of a linear piecewise interpolation. Another provided
46  // interpolation mode is cubic spline. This mode can be switched
47  // on by the call:
48 
49  // theParam->UseSpline(true);
50 
51  // From practical point of view the use of spline interpolation doesn't
52  // change much, but it makes the coefficients' behavior a bit more
53  // physical at very low/high field values.
54 }
T getParameter(std::string const &) const
void SetField(const double B)
Definition: BFit3D.h:47
PolyFit3DParametrizedMagneticField::~PolyFit3DParametrizedMagneticField ( )
virtual

Destructor.

Definition at line 57 of file PolyFit3DParametrizedMagneticField.cc.

References theParam.

57  {
58  delete theParam;
59 }

Member Function Documentation

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

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 63 of file PolyFit3DParametrizedMagneticField.cc.

References inTeslaUnchecked(), and isDefined().

63  {
64 
65  if (isDefined(gp)) {
66  return inTeslaUnchecked(gp);
67  } else {
68  edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of PolyFit3DParametrizedMagneticField";
69  return GlobalVector();
70  }
71 }
bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector PolyFit3DParametrizedMagneticField::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 74 of file PolyFit3DParametrizedMagneticField.cc.

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

Referenced by inTesla().

74  {
75  double Br, Bz, Bphi;
76  theParam->GetField(gp.perp()/100., gp.z()/100., gp.phi(),
77  Br, Bz, Bphi);
78 
79  double cosphi = cos(gp.phi());
80  double sinphi = sin(gp.phi());
81 
82  return GlobalVector(Br*cosphi - Bphi*sinphi,
83  Br*sinphi + Bphi*cosphi,
84  Bz);
85 }
T perp() const
Definition: PV3DBase.h:72
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void GetField(const double r, const double z, const double phi, double &Br, double &Bz, double &Bphi)
Definition: BFit3D.cc:70
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool PolyFit3DParametrizedMagneticField::isDefined ( const GlobalPoint gp) const
virtual

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

Reimplemented from MagneticField.

Definition at line 88 of file PolyFit3DParametrizedMagneticField.cc.

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

Referenced by inTesla().

88  {
89  double z = fabs(gp.z());
90  double r = gp.perp();
91  //"rectangle" |z|<3.5, r<1.9 _except_ the "corners" |z|+2.5*r>6.7, everything in meters
92  if (z>350. || r>190 || z+2.5*r>670.) return false;
93  return true;
94 }
T perp() const
Definition: PV3DBase.h:72
float float float z
T z() const
Definition: PV3DBase.h:64

Member Data Documentation

magfieldparam::BFit3D* PolyFit3DParametrizedMagneticField::theParam
private