CMS 3D CMS Logo

VolumeBasedMagneticField.cc
Go to the documentation of this file.
3 
5  const std::vector<MagBLayer*>& theBLayers,
6  const std::vector<MagESector*>& theESectors,
7  const std::vector<MagVolume6Faces*>& theBVolumes,
8  const std::vector<MagVolume6Faces*>& theEVolumes,
9  float rMax,
10  float zMax,
11  const MagneticField* param,
12  bool isParamFieldOwned)
13  : field(new MagGeometry(geomVersion, theBLayers, theESectors, theBVolumes, theEVolumes)),
14  maxRsq(rMax * rMax),
15  maxZ(zMax),
16  paramField(param),
17  magGeomOwned(true),
18  paramFieldOwned(isParamFieldOwned) {}
19 
22  field(vbf.field),
23  maxRsq(vbf.maxRsq),
24  maxZ(vbf.maxZ),
25  paramField(vbf.paramField),
26  magGeomOwned(false),
27  paramFieldOwned(false) {
28  // std::cout << "VolumeBasedMagneticField::clone() (shallow copy)" << std::endl;
29 }
30 
32 
34  if (magGeomOwned)
35  delete field;
36  if (paramFieldOwned)
37  delete paramField;
38 }
39 
41  // If parametrization of the inner region is available, use it.
44 
45  // If point is outside magfield map, return 0 field (not an error)
46  if (!isDefined(gp))
47  return GlobalVector();
48 
49  return field->fieldInTesla(gp);
50 }
51 
53  //same as above, but do not check range
56  return field->fieldInTesla(gp);
57 }
58 
60 
62  return (fabs(gp.z()) < maxZ && gp.perp2() < maxRsq);
63 }
Vector3DBase
Definition: Vector3DBase.h:8
photonAnalyzer_cfi.rMax
rMax
Definition: photonAnalyzer_cfi.py:91
photonAnalyzer_cfi.zMax
zMax
Definition: photonAnalyzer_cfi.py:95
funct::false
false
Definition: Factorize.h:34
VolumeBasedMagneticField::maxRsq
float maxRsq
Definition: VolumeBasedMagneticField.h:52
MagneticField::isDefined
virtual bool isDefined(const GlobalPoint &) const
True if the point is within the region where the concrete field.
Definition: MagneticField.h:40
VolumeBasedMagneticField
Definition: VolumeBasedMagneticField.h:18
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
VolumeBasedMagneticField::maxZ
float maxZ
Definition: VolumeBasedMagneticField.h:53
VolumeBasedMagneticField::paramField
const MagneticField * paramField
Definition: VolumeBasedMagneticField.h:54
CosmicsPD_Skims.maxZ
maxZ
Definition: CosmicsPD_Skims.py:136
VolumeBasedMagneticField::inTesla
GlobalVector inTesla(const GlobalPoint &g) const override
Field value ad specified global point, in Tesla.
Definition: VolumeBasedMagneticField.cc:40
VolumeBasedMagneticField::isDefined
bool isDefined(const GlobalPoint &gp) const override
True if the point is within the region where the concrete field.
Definition: VolumeBasedMagneticField.cc:61
VolumeBasedMagneticField::findVolume
const MagVolume * findVolume(const GlobalPoint &gp) const
Definition: VolumeBasedMagneticField.cc:59
VolumeBasedMagneticField::clone
MagneticField * clone() const override
Returns a shallow copy.
Definition: VolumeBasedMagneticField.cc:31
VolumeBasedMagneticField::~VolumeBasedMagneticField
~VolumeBasedMagneticField() override
Definition: VolumeBasedMagneticField.cc:33
VolumeBasedMagneticField.h
Point3DBase< float, GlobalTag >
MagGeometry
Definition: MagGeometry.h:23
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
funct::true
true
Definition: Factorize.h:173
MagVolume
Definition: MagVolume.h:13
VolumeBasedMagneticField::field
const MagGeometry * field
Definition: VolumeBasedMagneticField.h:51
VolumeBasedMagneticField::magGeomOwned
bool magGeomOwned
Definition: VolumeBasedMagneticField.h:55
VolumeBasedMagneticField::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=nullptr, bool isParamFieldOwned=false)
Definition: VolumeBasedMagneticField.cc:4
GlobalVector.h
VolumeBasedMagneticField::paramFieldOwned
bool paramFieldOwned
Definition: VolumeBasedMagneticField.h:56
MagGeometry::findVolume
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
Definition: MagGeometry.cc:184
MagGeometry::fieldInTesla
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:123
MagneticField
Definition: MagneticField.h:19
MagneticField::inTeslaUnchecked
virtual GlobalVector inTeslaUnchecked(const GlobalPoint &gp) const
Definition: MagneticField.h:44
VolumeBasedMagneticField::inTeslaUnchecked
GlobalVector inTeslaUnchecked(const GlobalPoint &g) const override
Definition: VolumeBasedMagneticField.cc:52