#include <VolumeBasedMagneticField.h>
Public Member Functions | |
virtual MagneticField * | clone () const |
Returns a shallow copy. | |
const MagVolume * | findVolume (const GlobalPoint &gp) const |
GlobalVector | inTesla (const GlobalPoint &g) const |
Field value ad specified global point, in Tesla. | |
GlobalVector | inTeslaUnchecked (const GlobalPoint &g) const |
bool | isDefined (const GlobalPoint &gp) const |
True if the point is within the region where the concrete field. | |
bool | isZSymmetric () const |
VolumeBasedMagneticField (const VolumeBasedMagneticField &vbf) | |
Copy constructor implement a shallow copy (ie no ownership of actual engines) | |
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) | |
virtual | ~VolumeBasedMagneticField () |
Private Attributes | |
const MagGeometry * | field |
bool | magGeomOwned |
float | maxR |
float | maxZ |
const MagneticField * | paramField |
bool | paramFieldOwned |
Field engine providing interpolation within the full CMS region.
Definition at line 16 of file VolumeBasedMagneticField.h.
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.
Referenced by clone().
: field(new MagGeometry(config,theBLayers,theESectors,theBVolumes,theEVolumes)), maxR(rMax), maxZ(zMax), paramField(param), magGeomOwned(true), paramFieldOwned(isParamFieldOwned) {}
VolumeBasedMagneticField::~VolumeBasedMagneticField | ( | ) | [virtual] |
Definition at line 38 of file VolumeBasedMagneticField.cc.
References field, magGeomOwned, paramField, and paramFieldOwned.
{ if(magGeomOwned) delete field; if(paramFieldOwned) delete paramField; }
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.
: field(vbf.field), maxR(vbf.maxR), maxZ(vbf.maxZ), paramField(vbf.paramField), magGeomOwned(false), paramFieldOwned(false) { // std::cout << "VolumeBasedMagneticField::clone() (shallow copy)" << std::endl; }
MagneticField * VolumeBasedMagneticField::clone | ( | void | ) | const [virtual] |
Returns a shallow copy.
Reimplemented from MagneticField.
Definition at line 33 of file VolumeBasedMagneticField.cc.
References VolumeBasedMagneticField().
{ return new VolumeBasedMagneticField(*this); }
const MagVolume * VolumeBasedMagneticField::findVolume | ( | const GlobalPoint & | gp | ) | const |
Definition at line 61 of file VolumeBasedMagneticField.cc.
References field, and MagGeometry::findVolume().
Referenced by NavPropagator::findVolume(), SteppingHelixPropagator::getNextState(), and SteppingHelixPropagator::loadState().
{ return field->findVolume(gp); }
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::GetEtaPhiAtEcal().
{ // If parametrization of the inner region is available, use it. if (paramField && paramField->isDefined(gp)) return paramField->inTeslaUnchecked(gp); // If point is outside magfield map, return 0 field (not an error) if (!isDefined(gp)) return GlobalVector(); return field->fieldInTesla(gp); }
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.
{ //same as above, but do not check range if (paramField && paramField->isDefined(gp)) return paramField->inTeslaUnchecked(gp); return field->fieldInTesla(gp); }
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().
bool VolumeBasedMagneticField::isZSymmetric | ( | ) | const |
Definition at line 72 of file VolumeBasedMagneticField.cc.
References field, and MagGeometry::isZSymmetric().
Referenced by SteppingHelixPropagator::getNextState(), SteppingHelixPropagator::loadState(), SteppingHelixPropagator::makeAtomStep(), and SteppingHelixPropagator::refToMagVolume().
{ return field->isZSymmetric(); }
const MagGeometry* VolumeBasedMagneticField::field [private] |
Definition at line 47 of file VolumeBasedMagneticField.h.
Referenced by findVolume(), inTesla(), inTeslaUnchecked(), isZSymmetric(), and ~VolumeBasedMagneticField().
bool VolumeBasedMagneticField::magGeomOwned [private] |
Definition at line 51 of file VolumeBasedMagneticField.h.
Referenced by ~VolumeBasedMagneticField().
float VolumeBasedMagneticField::maxR [private] |
Definition at line 48 of file VolumeBasedMagneticField.h.
Referenced by isDefined().
float VolumeBasedMagneticField::maxZ [private] |
Definition at line 49 of file VolumeBasedMagneticField.h.
Referenced by isDefined().
const MagneticField* VolumeBasedMagneticField::paramField [private] |
Definition at line 50 of file VolumeBasedMagneticField.h.
Referenced by inTesla(), inTeslaUnchecked(), and ~VolumeBasedMagneticField().
bool VolumeBasedMagneticField::paramFieldOwned [private] |
Definition at line 52 of file VolumeBasedMagneticField.h.
Referenced by ~VolumeBasedMagneticField().