Belle II Software  release-08-01-10
GeoMagneticField Class Reference

The GeoMagneticField class. More...

#include <GeoMagneticField.h>

Inheritance diagram for GeoMagneticField:
Collaboration diagram for GeoMagneticField:

Public Member Functions

 GeoMagneticField ()
 Constructor of the GeoMagneticField class.
 
virtual ~GeoMagneticField ()
 The destructor of the GeoMagneticField class.
 
virtual void create (const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
 Creates the global ROOT objects and prepares everything for other creators. More...
 
virtual void createFromDB (const std::string &, G4LogicalVolume &, geometry::GeometryTypes) override
 Nothing to be done when creating from DB, the payload should be found automatically.
 
virtual void createPayloads (const GearDir &content, const IntervalOfValidity &iov) override
 Function to create the geometry database. More...
 
MagneticField createConfiguration (const GearDir &content)
 Create a Database configuration from Gearbox parameters.
 
 BELLE2_DEFINE_EXCEPTION (DBNotImplemented, "Cannot create geometry from Database.")
 Exception that will be thrown in createFromDB if member is not yet implemented by creator.
 

Protected Types

typedef std::map< std::string, boost::function< void(const GearDir &) > > CompTypeMap
 Typedef for the map connecting the name of the component to the method reading the parameters.
 

Protected Member Functions

void readConstantBField (const GearDir &component)
 Reads the parameters for a homogeneous magnetic field and adds the component to the global magnetic field. More...
 
void readRadialBField (const GearDir &component)
 Reads the parameters for a radial magnetic field and adds the component to the global magnetic field. More...
 
void readQuadBField (const GearDir &component)
 Reads the parameters for a quadrupole magnetic field inside beam pipes and adds the component to the global magnetic field. More...
 
void readBeamlineBField (const GearDir &component)
 Reads the 3D Bfield map and parameters near beam pipes and adds the component to the global magnetic field.
 
void readKlm1BField (const GearDir &component)
 Reads the 2D Bfield map and parameters outside of solenoid and adds the component to the global magnetic field. More...
 
void read3dBField (const GearDir &component)
 Reads the parameters for 3d magnetic field (r,phi,z). More...
 
void addConstantBField (const GearDir &component, MagneticField &fieldmap)
 Add a constant field component to a magnetic field configuration for the DB.
 
void add3dBField (const GearDir &component, MagneticField &fielmap)
 Add a 3D field component to a magnetic field configuration for the DB.
 

Protected Attributes

CompTypeMap m_componentTypeMap
 Maps the name of the component to the function reading the parameters.
 

Detailed Description

The GeoMagneticField class.

The global creator for the magnetic field of the Belle II detector. It supports homogeneous and radial fields. Special field implementations for subdetectors should be added to the Belle II magnetic field inside the subdetectors' creators.

Definition at line 35 of file GeoMagneticField.h.

Member Function Documentation

◆ create()

void create ( const GearDir content,
G4LogicalVolume &  topVolume,
geometry::GeometryTypes  type 
)
overridevirtual

Creates the global ROOT objects and prepares everything for other creators.

Parameters
contentA reference to the content part of the parameter description, which should to be used to create the ROOT objects.
topVolumeGeant4 logical top volume.
typeGeometry type.

Implements CreatorBase.

Definition at line 146 of file GeoMagneticField.cc.

147 {
148  // clear any existing BField
150 
151  //Loop over all components of the magnetic field
152  CompTypeMap::iterator findIter;
153  for (const GearDir& component : content.getNodes("Components/Component")) {
154  //Get the type of the magnetic field and call the appropriate function
155  string compType = component.getString("attribute::type");
156  B2DEBUG(10, "GeoMagneticField creator: Loading the parameters for the component type'" << compType << "'");
157 
158  findIter = m_componentTypeMap.find(compType);
159  if (findIter != m_componentTypeMap.end()) {
160  findIter->second(component);
161  } else {
162  B2ERROR("The magnetic field component type '" << compType << "' is unknown !");
163  }
164  }
165 
167 }
void initialize()
Initialize the magnetic field after adding all components.
Definition: BFieldMap.cc:21
void clear()
Clear the existing components.
Definition: BFieldMap.cc:33
static BFieldMap & Instance()
Static method to get a reference to the BFieldMap instance.
Definition: BFieldMap.cc:15
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
CompTypeMap m_componentTypeMap
Maps the name of the component to the function reading the parameters.

◆ createPayloads()

void createPayloads ( const GearDir content,
const IntervalOfValidity iov 
)
overridevirtual

Function to create the geometry database.

This function should be implemented to convert Gearbox parameters to one ore more database payloads

Parameters
contentGearDir pointing to the parameters which should be used for construction
iovinterval of validity to use when generating payloads

Reimplemented from CreatorBase.

Definition at line 139 of file GeoMagneticField.cc.

◆ read3dBField()

void read3dBField ( const GearDir component)
protected

Reads the parameters for 3d magnetic field (r,phi,z).

Parameters
componentThe GearDir pointing to the component parameter block from which the parameters should be read.

Definition at line 290 of file GeoMagneticField.cc.

◆ readConstantBField()

void readConstantBField ( const GearDir component)
protected

Reads the parameters for a homogeneous magnetic field and adds the component to the global magnetic field.

Parameters
componentThe GearDir pointing to the component parameter block from which the parameters should be read.

Definition at line 174 of file GeoMagneticField.cc.

◆ readKlm1BField()

void readKlm1BField ( const GearDir component)
protected

Reads the 2D Bfield map and parameters outside of solenoid and adds the component to the global magnetic field.

Magnetic field map in Belle I are used.

Definition at line 262 of file GeoMagneticField.cc.

◆ readQuadBField()

void readQuadBField ( const GearDir component)
protected

Reads the parameters for a quadrupole magnetic field inside beam pipes and adds the component to the global magnetic field.

Parameters
componentThe GearDir pointing to the component parameter block from which the parameters should be read.

Definition at line 218 of file GeoMagneticField.cc.

◆ readRadialBField()

void readRadialBField ( const GearDir component)
protected

Reads the parameters for a radial magnetic field and adds the component to the global magnetic field.

Parameters
componentThe GearDir pointing to the component parameter block from which the parameters should be read.

Definition at line 188 of file GeoMagneticField.cc.


The documentation for this class was generated from the following files: