CMS 3D CMS Logo

Public Member Functions | Private Attributes

PolyFit2DParametrizedMagneticField Class Reference

#include <PolyFit2DParametrizedMagneticField.h>

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

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.

                                                                                  : 
  theParam(new BFit())
{
  theParam->SetField(bVal);
}
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.

                                                                                                        : theParam(new BFit()) {
  theParam->SetField(parameters.getParameter<double>("BValue"));
}
PolyFit2DParametrizedMagneticField::~PolyFit2DParametrizedMagneticField ( ) [virtual]

Destructor.

Definition at line 30 of file PolyFit2DParametrizedMagneticField.cc.

References theParam.

                                                                        {
  delete theParam;
}

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

                                                                       {

  if (isDefined(gp)) {
    return inTeslaUnchecked(gp);
  } else {
    edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of PolyFit2DParametrizedMagneticField";
    return GlobalVector();
  }
}
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().

                                                                                {
  double Br, Bz, Bphi;
  theParam->GetField(gp.perp()/100., gp.z()/100., gp.phi(),
                     Br, Bz, Bphi);

  double cosphi = cos(gp.phi());
  double sinphi = sin(gp.phi());

  return GlobalVector(Br*cosphi - Bphi*sinphi,
                      Br*sinphi + Bphi*cosphi, 
                      Bz);  
}
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, PV3DBase< T, PVType, FrameType >::z(), and z.

Referenced by inTesla().

                                                                         {
  double z = fabs(gp.z());
  double r = gp.perp();
  //"rectangle" |z|<3.5, r<1.9 _except_ the "corners" |z|+2.5*r>6.7, everything in meters
  if (z>350. || r>190 || z+2.5*r>670.) return false;
  return true;
}

Member Data Documentation