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
 
virtual int nominalValue () const
 The nominal field value for this map in kGauss. More...
 
 VolumeBasedMagneticField (const edm::ParameterSet &config, std::vector< MagBLayer * > theBLayers, std::vector< MagESector * > theESectors, std::vector< MagVolume6Faces * > theBVolumes, 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
virtual GlobalVector inInverseGeV (const GlobalPoint &gp) const
 Field value ad specified global point, in 1/Gev. More...
 
virtual GlobalVector inKGauss (const GlobalPoint &gp) const
 Field value ad specified global point, in KGauss. More...
 
 MagneticField ()
 
virtual ~MagneticField ()
 

Private Attributes

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

Detailed Description

Field engine providing interpolation within the full CMS region.

Date:
2009/03/19 11:14:50
Revision:
1.8
Author
N. Amapane - CERN

Definition at line 16 of file VolumeBasedMagneticField.h.

Constructor & Destructor Documentation

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

Definition at line 5 of file VolumeBasedMagneticField.cc.

References MagneticField::nominalValue(), and theNominalValue.

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 {
21 }
virtual int nominalValue() const
The nominal field value for this map in kGauss.
const MagneticField * paramField
VolumeBasedMagneticField::~VolumeBasedMagneticField ( )
virtual

Definition at line 41 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 24 of file VolumeBasedMagneticField.cc.

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

Member Function Documentation

MagneticField * VolumeBasedMagneticField::clone ( void  ) const
virtual

Returns a shallow copy.

Reimplemented from MagneticField.

Definition at line 36 of file VolumeBasedMagneticField.cc.

References VolumeBasedMagneticField().

36  {
37  return new VolumeBasedMagneticField(*this);
38 }
VolumeBasedMagneticField(const edm::ParameterSet &config, std::vector< MagBLayer * > theBLayers, std::vector< MagESector * > theESectors, std::vector< MagVolume6Faces * > theBVolumes, 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 64 of file VolumeBasedMagneticField.cc.

References field, and MagGeometry::findVolume().

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

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

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 46 of file VolumeBasedMagneticField.cc.

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

Referenced by IsolatedPixelTrackCandidateProducer::GetEtaPhiAtEcal().

46  {
47 
48  // If parametrization of the inner region is available, use it.
50 
51  // If point is outside magfield map, return 0 field (not an error)
52  if (!isDefined(gp)) return GlobalVector();
53 
54  return field->fieldInTesla(gp);
55 }
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:46
virtual bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
Definition: MagneticField.h:40
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:76
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 57 of file VolumeBasedMagneticField.cc.

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

57  {
58  //same as above, but do not check range
60  return field->fieldInTesla(gp);
61 }
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:46
virtual bool isDefined(const GlobalPoint &gp) const
True if the point is within the region where the concrete field.
Definition: MagneticField.h:40
const MagneticField * paramField
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:76
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 70 of file VolumeBasedMagneticField.cc.

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

Referenced by inTesla().

70  {
71  return (fabs(gp.z()) < maxZ && gp.perp() < maxR);
72 }
T perp() const
Definition: PV3DBase.h:66
T z() const
Definition: PV3DBase.h:58
bool VolumeBasedMagneticField::isZSymmetric ( ) const
virtual int VolumeBasedMagneticField::nominalValue ( ) const
inlinevirtual

The nominal field value for this map in kGauss.

Reimplemented from MagneticField.

Definition at line 45 of file VolumeBasedMagneticField.h.

References theNominalValue.

45  {
46  return theNominalValue;
47  }

Member Data Documentation

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

Definition at line 55 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

float VolumeBasedMagneticField::maxR
private

Definition at line 52 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

float VolumeBasedMagneticField::maxZ
private

Definition at line 53 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

const MagneticField* VolumeBasedMagneticField::paramField
private

Definition at line 54 of file VolumeBasedMagneticField.h.

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

bool VolumeBasedMagneticField::paramFieldOwned
private

Definition at line 56 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

int VolumeBasedMagneticField::theNominalValue
private

Definition at line 57 of file VolumeBasedMagneticField.h.

Referenced by nominalValue(), and VolumeBasedMagneticField().