k4SimGeant4
Loading...
Searching...
No Matches
SimG4MagneticFieldFromMapTool Class Reference

SimG4MagneticFieldFromMapTool.h. More...

#include <SimG4Components/src/SimG4MagneticFieldFromMapTool.h>

Inheritance diagram for SimG4MagneticFieldFromMapTool:
Collaboration diagram for SimG4MagneticFieldFromMapTool:

Public Member Functions

 SimG4MagneticFieldFromMapTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor.
 
virtual ~SimG4MagneticFieldFromMapTool ()
 Destructor.
 
virtual StatusCode initialize () final
 Initialize method.
 
virtual StatusCode finalize () final
 Finalize method.
 
virtual const G4MagneticField * field () const final
 Get the magnetic field.
 
G4MagIntegratorStepper * stepper (const std::string &, G4MagneticField *) const
 Get the stepper.
 
- Public Member Functions inherited from ISimG4MagneticFieldTool
 DeclareInterfaceID (ISimG4MagneticFieldTool, 1, 0)
 

Private Member Functions

StatusCode loadRootMap ()
 Load map from the ROOT file.
 
StatusCode loadComsolMap ()
 Load map from the COMSOL export file.
 

Private Attributes

G4MagneticField * m_field = nullptr
 Pointer to the actual Geant4 magnetic field.
 
Gaudi::Property< bool > m_fieldOn {this, "FieldOn", false, "Switch to turn field off"}
 Switch to turn field on or off (default is off). Set with property FieldOn.
 
Gaudi::Property< double > m_minEps {this, "MinimumEpsilon", 0, "Minimum epsilon (see G4 documentation)"}
 Minimum epsilon (relative error of position / momentum, see G4 doc for more details).
 
Gaudi::Property< double > m_maxEps {this, "MaximumEpsilon", 0, "Maximum epsilon (see G4 documentation)"}
 Maximum epsilon (relative error of position / momentum, see G4 doc for more details).
 
Gaudi::Property< double > m_deltaChord {this, "DeltaChord", 0, "Missing distance for the chord finder"}
 This parameter governs accuracy of volume intersection, see G4 doc for more details. Set with property DeltaChord.
 
Gaudi::Property< double > m_deltaOneStep {this, "DeltaOneStep", 0, "Delta(one-step)"}
 This parameter is roughly the position error which is acceptable in an integration step, see G4 doc for details.
 
Gaudi::Property< double > m_maxStep {this, "MaximumStep", 1. * m, "Maximum step length in field (see G4 documentation)"}
 Upper limit of the step size, see G4 doc for more details. Set with property MaximumStep.
 
Gaudi::Property< double > m_minStep {this, "MinimumStep", 0.01 * mm, "Minimum step length in field (see G4 documentation)"}
 Lower limit of the step size, see G4 doc for more details. Set with property MinimumStep.
 
Gaudi::Property< std::string > m_integratorStepper {this, "IntegratorStepper", "NystromRK4", "Integrator stepper name"}
 Name of the integration stepper, defaults to NystromRK4.
 
Gaudi::Property< std::string > m_mapFilePath {this, "MapFile", "", "Path to file containing fieldmap"}
 Path to the input file containing fieldmap.
 
Gaudi::Property< double > m_addFieldBz {this, "AddFieldBz", 0., "Additional constant field, z component (default: 0.)"}
 Additional constant field, z component (spans whole z range of the map)
 
Gaudi::Property< double > m_addFieldMaxR {this, "AddFieldMaxR", -1., "Maximum radius of additional constant field (default: no limit)"}
 Maximum radius of the additional constant field (default: no limit)
 
Gaudi::Property< double > m_addFieldMaxZ {this, "AddFieldMaxZ", -1., "Maximum z coordinate of additional constant field (default: no limit)"}
 Maximum z coordinate of the additional constant field (default: no limit)
 
Gaudi::Property< double > m_fieldMaxR {this, "FieldMaxR", -1., "Field maximum radius (default: no limit)"}
 Maximum field radius (default: no limit)
 
Gaudi::Property< double > m_fieldMaxZ {this, "FieldMaxZ", -1., "Field maximum z coordinate (default: no limit)"}
 Maximum field z coordinate (default: no limit)
 

Detailed Description

SimG4MagneticFieldFromMapTool.h.

Implementation of ISimG4MagneticFieldTool that generates field from fieldmap

Author
Juraj Smiesko
Date
2022-11-29

Constructor & Destructor Documentation

◆ SimG4MagneticFieldFromMapTool()

SimG4MagneticFieldFromMapTool::SimG4MagneticFieldFromMapTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard constructor.

◆ ~SimG4MagneticFieldFromMapTool()

SimG4MagneticFieldFromMapTool::~SimG4MagneticFieldFromMapTool ( )
virtual

Destructor.

Member Function Documentation

◆ field()

const G4MagneticField * SimG4MagneticFieldFromMapTool::field ( ) const
finalvirtual

Get the magnetic field.

Returns
pointer to G4MagneticField

Implements ISimG4MagneticFieldTool.

◆ finalize()

StatusCode SimG4MagneticFieldFromMapTool::finalize ( )
finalvirtual

Finalize method.

◆ initialize()

StatusCode SimG4MagneticFieldFromMapTool::initialize ( )
finalvirtual

Initialize method.

◆ loadComsolMap()

StatusCode SimG4MagneticFieldFromMapTool::loadComsolMap ( )
private

Load map from the COMSOL export file.

◆ loadRootMap()

StatusCode SimG4MagneticFieldFromMapTool::loadRootMap ( )
private

Load map from the ROOT file.

◆ stepper()

G4MagIntegratorStepper * SimG4MagneticFieldFromMapTool::stepper ( const std::string & name,
G4MagneticField * field ) const

Get the stepper.

Returns
pointer to G4MagIntegratorStepper (ownership is transferred to the caller)

Member Data Documentation

◆ m_addFieldBz

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_addFieldBz {this, "AddFieldBz", 0., "Additional constant field, z component (default: 0.)"}
private

Additional constant field, z component (spans whole z range of the map)

◆ m_addFieldMaxR

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_addFieldMaxR {this, "AddFieldMaxR", -1., "Maximum radius of additional constant field (default: no limit)"}
private

Maximum radius of the additional constant field (default: no limit)

◆ m_addFieldMaxZ

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_addFieldMaxZ {this, "AddFieldMaxZ", -1., "Maximum z coordinate of additional constant field (default: no limit)"}
private

Maximum z coordinate of the additional constant field (default: no limit)

◆ m_deltaChord

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_deltaChord {this, "DeltaChord", 0, "Missing distance for the chord finder"}
private

This parameter governs accuracy of volume intersection, see G4 doc for more details. Set with property DeltaChord.

◆ m_deltaOneStep

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_deltaOneStep {this, "DeltaOneStep", 0, "Delta(one-step)"}
private

This parameter is roughly the position error which is acceptable in an integration step, see G4 doc for details.

Set with property DeltaOneStep

◆ m_field

G4MagneticField* SimG4MagneticFieldFromMapTool::m_field = nullptr
private

Pointer to the actual Geant4 magnetic field.

◆ m_fieldMaxR

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_fieldMaxR {this, "FieldMaxR", -1., "Field maximum radius (default: no limit)"}
private

Maximum field radius (default: no limit)

◆ m_fieldMaxZ

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_fieldMaxZ {this, "FieldMaxZ", -1., "Field maximum z coordinate (default: no limit)"}
private

Maximum field z coordinate (default: no limit)

◆ m_fieldOn

Gaudi::Property<bool> SimG4MagneticFieldFromMapTool::m_fieldOn {this, "FieldOn", false, "Switch to turn field off"}
private

Switch to turn field on or off (default is off). Set with property FieldOn.

◆ m_integratorStepper

Gaudi::Property<std::string> SimG4MagneticFieldFromMapTool::m_integratorStepper {this, "IntegratorStepper", "NystromRK4", "Integrator stepper name"}
private

Name of the integration stepper, defaults to NystromRK4.

◆ m_mapFilePath

Gaudi::Property<std::string> SimG4MagneticFieldFromMapTool::m_mapFilePath {this, "MapFile", "", "Path to file containing fieldmap"}
private

Path to the input file containing fieldmap.

◆ m_maxEps

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_maxEps {this, "MaximumEpsilon", 0, "Maximum epsilon (see G4 documentation)"}
private

Maximum epsilon (relative error of position / momentum, see G4 doc for more details).

Set with property MaximumEpsilon

◆ m_maxStep

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_maxStep {this, "MaximumStep", 1. * m, "Maximum step length in field (see G4 documentation)"}
private

Upper limit of the step size, see G4 doc for more details. Set with property MaximumStep.

◆ m_minEps

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_minEps {this, "MinimumEpsilon", 0, "Minimum epsilon (see G4 documentation)"}
private

Minimum epsilon (relative error of position / momentum, see G4 doc for more details).

Set with property MinimumEpsilon

◆ m_minStep

Gaudi::Property<double> SimG4MagneticFieldFromMapTool::m_minStep {this, "MinimumStep", 0.01 * mm, "Minimum step length in field (see G4 documentation)"}
private

Lower limit of the step size, see G4 doc for more details. Set with property MinimumStep.


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