Manager for magnetic fields and their associated G4FieldManager objects.
More...
#include <gmagneto.h>
|
| | GMagneto (const std::shared_ptr< GOptions > &gopts) |
| | Construct and initialize the magnetic field registry.
|
| |
| bool | isField (const std::string &name) const |
| | Check whether a field with the given name exists.
|
| |
| std::vector< std::string > | getFieldNames () const |
| | Return the configured field names.
|
| |
| std::shared_ptr< GField > | getField (std::string name) |
| | Retrieve a field object by name.
|
| |
| std::shared_ptr< G4FieldManager > | getFieldMgr (std::string name) |
| | Retrieve the G4FieldManager associated with a given field name.
|
| |
| | GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") |
| |
| | GBase (const std::shared_ptr< GLogger > &logger) |
| |
| | GBase (const GBase &)=default |
| |
| | GBase (GBase &&) noexcept=default |
| |
| virtual | ~GBase () |
| |
| GBase & | operator= (const GBase &)=default |
| |
| GBase & | operator= (GBase &&) noexcept=default |
| |
Ownership model:
Lifecycle:
Definition at line 37 of file gmagneto.h.
◆ GMagneto()
| GMagneto::GMagneto |
( |
const std::shared_ptr< GOptions > & | gopts | ) |
|
|
explicit |
- Parameters
-
| gopts | Shared options used for configuration and logging. |
This constructor:
- Builds the list of GFieldDefinition objects from options,
- Loads each corresponding plugin library using the factory manager,
- Instantiates the field and calls load_field_definitions(),
- Creates and stores a
G4FieldManager via create_FieldManager().
Definition at line 15 of file gmagneto.cc.
◆ getField()
| std::shared_ptr< GField > GMagneto::getField |
( |
std::string | name | ) |
|
|
inline |
- Parameters
-
- Returns
- Shared pointer to the requested GField instance.
If the field is not found, an error is logged and execution is terminated by the logger.
Definition at line 82 of file gmagneto.h.
◆ getFieldMgr()
| std::shared_ptr< G4FieldManager > GMagneto::getFieldMgr |
( |
std::string | name | ) |
|
|
inline |
- Parameters
-
- Returns
- Shared pointer to the requested
G4FieldManager.
If the field manager is not found, an error is logged and execution is terminated by the logger.
Definition at line 96 of file gmagneto.h.
◆ getFieldNames()
| std::vector< std::string > GMagneto::getFieldNames |
( |
| ) |
const |
- Returns
- Sorted list of field names loaded by this manager.
Definition at line 49 of file gmagneto.cc.
◆ isField()
| bool GMagneto::isField |
( |
const std::string & | name | ) |
const |
|
inline |
- Parameters
-
- Returns
- True if
name is present in the internal field map.
Definition at line 67 of file gmagneto.h.
The documentation for this class was generated from the following files: