test
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 | Friends
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 (int geomVersion, 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
 

Friends

class testMagGeometryAnalyzer
 
class testMagneticField
 

Detailed Description

Field engine providing interpolation within the full CMS region.

Author
N. Amapane - CERN

Definition at line 18 of file VolumeBasedMagneticField.h.

Constructor & Destructor Documentation

VolumeBasedMagneticField::VolumeBasedMagneticField ( int  geomVersion,
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 4 of file VolumeBasedMagneticField.cc.

Referenced by clone().

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

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

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

Member Function Documentation

MagneticField * VolumeBasedMagneticField::clone ( void  ) const
virtual

Returns a shallow copy.

Reimplemented from MagneticField.

Definition at line 32 of file VolumeBasedMagneticField.cc.

References VolumeBasedMagneticField().

32  {
33  return new VolumeBasedMagneticField(*this);
34 }
VolumeBasedMagneticField(int geomVersion, 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 60 of file VolumeBasedMagneticField.cc.

References field, and MagGeometry::findVolume().

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

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

Field value ad specified global point, in Tesla.

Implements MagneticField.

Definition at line 42 of file VolumeBasedMagneticField.cc.

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

Referenced by IsolatedPixelTrackCandidateProducer::beginRun(), and IsolatedPixelTrackCandidateL1TProducer::beginRun().

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

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

53  {
54  //same as above, but do not check range
56  return field->fieldInTesla(gp);
57 }
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:51
virtual bool isDefined(const GlobalPoint &) 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:78
bool VolumeBasedMagneticField::isDefined ( const GlobalPoint ) const
virtual

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

Reimplemented from MagneticField.

Definition at line 66 of file VolumeBasedMagneticField.cc.

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

Referenced by inTesla().

66  {
67  return (fabs(gp.z()) < maxZ && gp.perp() < maxR);
68 }
bool VolumeBasedMagneticField::isZSymmetric ( ) const

Definition at line 71 of file VolumeBasedMagneticField.cc.

References field, and MagGeometry::isZSymmetric().

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

Friends And Related Function Documentation

friend class testMagGeometryAnalyzer
friend

Definition at line 21 of file VolumeBasedMagneticField.h.

friend class testMagneticField
friend

Definition at line 20 of file VolumeBasedMagneticField.h.

Member Data Documentation

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

Definition at line 57 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

float VolumeBasedMagneticField::maxR
private

Definition at line 54 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

float VolumeBasedMagneticField::maxZ
private

Definition at line 55 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

const MagneticField* VolumeBasedMagneticField::paramField
private

Definition at line 56 of file VolumeBasedMagneticField.h.

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

bool VolumeBasedMagneticField::paramFieldOwned
private

Definition at line 58 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().