CMS 3D CMS Logo

Public Member Functions | Private Attributes

VolumeBasedMagneticField Class Reference

#include <VolumeBasedMagneticField.h>

Inheritance diagram for VolumeBasedMagneticField:
MagneticField

List of all members.

Public Member Functions

virtual MagneticFieldclone () const
 Returns a shallow copy.
const MagVolumefindVolume (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 MagGeometryfield
bool magGeomOwned
float maxR
float maxZ
const MagneticFieldparamField
bool paramFieldOwned

Detailed Description

Field engine providing interpolation within the full CMS region.

Date:
2011/12/10 16:03:31
Revision:
1.10
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.

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;
}

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().

                                                     {
  return new VolumeBasedMagneticField(*this);
}
const MagVolume * VolumeBasedMagneticField::findVolume ( const GlobalPoint gp) const
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().

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

Member Data Documentation

Definition at line 51 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

Definition at line 48 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

Definition at line 49 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

Definition at line 50 of file VolumeBasedMagneticField.h.

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

Definition at line 52 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().