|
gfields
|
Factory class implementing an ideal multipole magnetic field. More...
#include <gfield_multipoles.h>
Public Member Functions | |
| GField_MultipolesFactory (const std::shared_ptr< GOptions > &gopt) | |
| Construct the multipole field factory using the module options. | |
| void | GetFieldValue (const double pos[3], G4double *bfield) const override |
| Evaluate the magnetic field B at a given position. | |
| void | load_field_definitions (GFieldDefinition gfd) override |
| Load and cache field-definition parameters for fast field evaluation. | |
Public Member Functions inherited from GField | |
| GField (const std::shared_ptr< GOptions > &gopt) | |
| Construct the field base with the provided options (for logging and configuration access). | |
| virtual void | GetFieldValue (const double x[3], double *bfield) const =0 |
| Compute the magnetic field vector at a given position. | |
| G4FieldManager * | create_FieldManager () |
Create a G4FieldManager configured for this field. | |
| int | get_field_parameter_int (const std::string &key) |
| Convenience accessor for integer-valued parameters stored in field_parameters. | |
| double | get_field_parameter_double (const std::string &key) |
| Convenience accessor for floating-point parameters stored in field_parameters. | |
| void | set_loggers (const std::shared_ptr< GOptions > &g) |
| Hook for configuring module loggers from options. | |
Public Member Functions inherited from GBase< GField > | |
| 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 |
Additional Inherited Members | |
Static Public Member Functions inherited from GField | |
| static GField * | instantiate (const dlhandle h, const std::shared_ptr< GOptions > g) |
| Instantiate a field object from a plugin handle. | |
Protected Attributes inherited from GField | |
| GFieldDefinition | gfield_definitions |
| Stored field definition used for configuration and logging. | |
Protected Attributes inherited from GBase< GField > | |
| std::shared_ptr< GLogger > | log |
This class is a concrete GField implementation that evaluates an idealized multipole field using common accelerator-style conventions:
r^(n-1) where n = pole_number/2.cos((n-1)*phi) and sin((n-1)*phi).The field is evaluated in a local magnet frame centered at origin and then rotated back into the lab frame by rotation_angle around rotaxis.
Two operating modes exist:
longitudinal == false): produces a 2D multipole field in the plane perpendicular to rotaxis.longitudinal == true): produces a uniform axial field aligned with rotaxis (solenoid-like); this mode is not a multipole expansion, but is provided for convenience/configuration symmetry.Units:
origin and the evaluation point pos are expected in Geant4 length units (e.g. mm).strength is expected in Tesla.rotation_angle is expected in Geant4 angle units (e.g. deg). Definition at line 39 of file gfield_multipoles.h.
|
inlineexplicit |
| gopt | Shared options object used by the base class (logging, configuration). |
The options are owned externally and are expected to outlive this object.
Definition at line 48 of file gfield_multipoles.h.
|
override |
| pos | Position in the lab frame as {x,y,z}. |
| bfield | Output array filled with {Bx,By,Bz} in Tesla. |
This method is the Geant4 entry point used by the field propagator. The implementation:
origin.-rotation_angle around rotaxis.bfield. Definition at line 26 of file gfield_multipoles.cc.
|
overridevirtual |
| gfd | Field definition populated from options. |
The input definition is copied into the base class storage and the frequently used parameters are parsed and cached into member variables (e.g. pole number, origin, rotation).
Reimplemented from GField.
Definition at line 157 of file gfield_multipoles.cc.