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

#include <VolumeBasedMagneticField.h>

Inheritance diagram for VolumeBasedMagneticField:
MagneticField

Public Member Functions

virtual MagneticFieldclone () const
 Returns a shallow copy. More...
 
const MagVolumefindVolume (const GlobalPoint &gp) const
 
GlobalVector inTesla (const GlobalPoint &g) const
 Field value ad specified global point, in Tesla. More...
 
GlobalVector inTeslaUnchecked (const GlobalPoint &g) const
 
bool isDefined (const GlobalPoint &gp) const
 True if the point is within the region where the concrete field. More...
 
bool isZSymmetric () const
 
 VolumeBasedMagneticField (const edm::ParameterSet &config, const std::vector< MagBLayer * > &theBLayers, const std::vector< MagESector * > &theESectors, const std::vector< MagVolume6Faces * > &theBVolumes, const std::vector< MagVolume6Faces * > &theEVolumes, float rMax, float zMax, const MagneticField *param=0, bool isParamFieldOwned=false)
 
 VolumeBasedMagneticField (const VolumeBasedMagneticField &vbf)
 Copy constructor implement a shallow copy (ie no ownership of actual engines) More...
 
virtual ~VolumeBasedMagneticField ()
 
- Public Member Functions inherited from MagneticField
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 ()
 
 MagneticField (const MagneticField &orig)
 
int nominalValue () const
 The nominal field value for this map in kGauss. More...
 
virtual ~MagneticField ()
 

Private Attributes

const MagGeometryfield
 
bool magGeomOwned
 
float maxR
 
float maxZ
 
const MagneticFieldparamField
 
bool paramFieldOwned
 

Detailed Description

Field engine providing interpolation within the full CMS region.

Author
N. Amapane - CERN

Definition at line 14 of file VolumeBasedMagneticField.h.

Constructor & Destructor Documentation

VolumeBasedMagneticField::VolumeBasedMagneticField ( const edm::ParameterSet config,
const std::vector< MagBLayer * > &  theBLayers,
const std::vector< MagESector * > &  theESectors,
const std::vector< MagVolume6Faces * > &  theBVolumes,
const std::vector< MagVolume6Faces * > &  theEVolumes,
float  rMax,
float  zMax,
const MagneticField param = 0,
bool  isParamFieldOwned = false 
)

Definition at line 5 of file VolumeBasedMagneticField.cc.

Referenced by clone().

12  :
13  field(new MagGeometry(config,theBLayers,theESectors,theBVolumes,theEVolumes)),
14  maxR(rMax),
15  maxZ(zMax),
16  paramField(param),
17  magGeomOwned(true),
18  paramFieldOwned(isParamFieldOwned)
19 {}
const MagneticField * paramField
VolumeBasedMagneticField::~VolumeBasedMagneticField ( )
virtual

Definition at line 38 of file VolumeBasedMagneticField.cc.

References field, magGeomOwned, paramField, and paramFieldOwned.

VolumeBasedMagneticField::VolumeBasedMagneticField ( const VolumeBasedMagneticField vbf)

Copy constructor implement a shallow copy (ie no ownership of actual engines)

Definition at line 22 of file VolumeBasedMagneticField.cc.

22  :
23  field(vbf.field),
24  maxR(vbf.maxR),
25  maxZ(vbf.maxZ),
27  magGeomOwned(false),
28  paramFieldOwned(false) {
29  // std::cout << "VolumeBasedMagneticField::clone() (shallow copy)" << std::endl;
30 }
const MagneticField * paramField

Member Function Documentation

MagneticField * VolumeBasedMagneticField::clone ( void  ) const
virtual

Returns a shallow copy.

Reimplemented from MagneticField.

Definition at line 33 of file VolumeBasedMagneticField.cc.

References VolumeBasedMagneticField().

33  {
34  return new VolumeBasedMagneticField(*this);
35 }
VolumeBasedMagneticField(const edm::ParameterSet &config, const std::vector< MagBLayer * > &theBLayers, const std::vector< MagESector * > &theESectors, const std::vector< MagVolume6Faces * > &theBVolumes, const std::vector< MagVolume6Faces * > &theEVolumes, float rMax, float zMax, const MagneticField *param=0, bool isParamFieldOwned=false)
const MagVolume * VolumeBasedMagneticField::findVolume ( const GlobalPoint gp) const

Definition at line 61 of file VolumeBasedMagneticField.cc.

References field, and MagGeometry::findVolume().

Referenced by SteppingHelixPropagator::getNextState(), and SteppingHelixPropagator::loadState().

62 {
63  return field->findVolume(gp);
64 }
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
Definition: MagGeometry.cc:142
GlobalVector VolumeBasedMagneticField::inTesla ( const GlobalPoint gp) const
virtual

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 43 of file VolumeBasedMagneticField.cc.

References field, MagGeometry::fieldInTesla(), MagneticField::inTeslaUnchecked(), isDefined(), MagneticField::isDefined(), and paramField.

Referenced by IsolatedPixelTrackCandidateProducer::beginRun().

43  {
44 
45  // If parametrization of the inner region is available, use it.
47 
48  // If point is outside magfield map, return 0 field (not an error)
49  if (!isDefined(gp)) return GlobalVector();
50 
51  return field->fieldInTesla(gp);
52 }
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:51
virtual bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
Definition: MagneticField.h:45
bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
const MagneticField * paramField
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:83
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalVector VolumeBasedMagneticField::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 54 of file VolumeBasedMagneticField.cc.

References field, MagGeometry::fieldInTesla(), MagneticField::inTeslaUnchecked(), MagneticField::isDefined(), and paramField.

54  {
55  //same as above, but do not check range
57  return field->fieldInTesla(gp);
58 }
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:51
virtual bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
Definition: MagneticField.h:45
const MagneticField * paramField
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:83
bool VolumeBasedMagneticField::isDefined ( const GlobalPoint gp) const
virtual

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

Reimplemented from MagneticField.

Definition at line 67 of file VolumeBasedMagneticField.cc.

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

Referenced by inTesla().

67  {
68  return (fabs(gp.z()) < maxZ && gp.perp() < maxR);
69 }
T perp() const
Definition: PV3DBase.h:72
T z() const
Definition: PV3DBase.h:64
bool VolumeBasedMagneticField::isZSymmetric ( ) const

Definition at line 72 of file VolumeBasedMagneticField.cc.

References field, and MagGeometry::isZSymmetric().

72  {
73  return field->isZSymmetric();
74 }
bool isZSymmetric() const
Definition: MagGeometry.h:50

Member Data Documentation

const MagGeometry* VolumeBasedMagneticField::field
private
bool VolumeBasedMagneticField::magGeomOwned
private

Definition at line 49 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

float VolumeBasedMagneticField::maxR
private

Definition at line 46 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

float VolumeBasedMagneticField::maxZ
private

Definition at line 47 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

const MagneticField* VolumeBasedMagneticField::paramField
private

Definition at line 48 of file VolumeBasedMagneticField.h.

Referenced by inTesla(), inTeslaUnchecked(), and ~VolumeBasedMagneticField().

bool VolumeBasedMagneticField::paramFieldOwned
private

Definition at line 50 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().