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
virtual int nominalValue () const
 The nominal field value for this map in kGauss.
 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)
virtual ~VolumeBasedMagneticField ()

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/05/23 22:21:34
Revision:
1.9
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 nominalValue(), and theNominalValue.

Referenced by clone().

                                                                            : 
  field(new MagGeometry(config,theBLayers,theESectors,theBVolumes,theEVolumes)), 
  maxR(rMax),
  maxZ(zMax),
  paramField(param),
  magGeomOwned(true),
  paramFieldOwned(isParamFieldOwned)
{ 
  theNominalValue = MagneticField::nominalValue();
}
VolumeBasedMagneticField::~VolumeBasedMagneticField ( ) [virtual]

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

                                                                                      : 
  field(vbf.field),
  maxR(vbf.maxR),
  maxZ(vbf.maxZ),
  paramField(vbf.paramField),
  magGeomOwned(false),
  paramFieldOwned(false),
  theNominalValue(vbf.theNominalValue) {
  // 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 36 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 46 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 57 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 70 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
virtual int VolumeBasedMagneticField::nominalValue ( ) const [inline, virtual]

The nominal field value for this map in kGauss.

Reimplemented from MagneticField.

Definition at line 45 of file VolumeBasedMagneticField.h.

References theNominalValue.

Referenced by VolumeBasedMagneticField().

                                   {
    return theNominalValue;
  }

Member Data Documentation

Definition at line 55 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

Definition at line 52 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

Definition at line 53 of file VolumeBasedMagneticField.h.

Referenced by isDefined().

Definition at line 54 of file VolumeBasedMagneticField.h.

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

Definition at line 56 of file VolumeBasedMagneticField.h.

Referenced by ~VolumeBasedMagneticField().

Definition at line 57 of file VolumeBasedMagneticField.h.

Referenced by nominalValue(), and VolumeBasedMagneticField().