gfields
Loading...
Searching...
No Matches
GFieldDefinition Struct Reference

Lightweight configuration carrier used to load and configure a GField plugin. More...

#include <gfield.h>

Public Member Functions

 GFieldDefinition ()=default
 Default constructor.
 
void add_map_parameter (const std::string &key, const std::string &value)
 Add or overwrite a parameter in the field-parameter map.
 
std::string gfieldPluginName () const
 Derive the plugin name for the field definition.
 

Data Fields

std::string name
 Field name key used by GMagneto maps.
 
std::string integration_stepper
 Integration stepper name (string) used when creating the G4ChordFinder.
 
double minimum_step = 0.0
 Minimum step size used when constructing the G4ChordFinder (Geant4 length units).
 
std::string type
 Field type discriminator used to derive the plugin factory name (e.g. "multipoles").
 
std::map< std::string, std::string > field_parameters
 Field parameters stored as string expressions (often including unit expressions).
 

Friends

std::ostream & operator<< (std::ostream &stream, GFieldDefinition gfd)
 Stream formatter used for logging/debug output.
 

Detailed Description

A GFieldDefinition is typically built from user options (see gfields::get_GFieldDefinition()). It is then passed to a concrete field via load_field_definitions().

Notes on plugin naming:

  • The plugin shared-library entry point is expected to expose the C symbol GFieldFactory.
  • The library name or plugin identifier is derived from gfieldPluginName().

Definition at line 26 of file gfield.h.

Constructor & Destructor Documentation

◆ GFieldDefinition()

GFieldDefinition::GFieldDefinition ( )
default

Member Function Documentation

◆ add_map_parameter()

void GFieldDefinition::add_map_parameter ( const std::string & key,
const std::string & value )
inline
Parameters
keyParameter key (e.g. "strength").
valueParameter value expression (e.g. "2.0*tesla").

Definition at line 52 of file gfield.h.

◆ gfieldPluginName()

std::string GFieldDefinition::gfieldPluginName ( ) const
inline
Returns
Plugin name string.

Convention:

  • This method returns "gfield" + type + "Factory".
  • For example, a type of "multipoles" yields "gfieldmultipolesFactory".

Definition at line 62 of file gfield.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
GFieldDefinition gfd )
friend
Parameters
streamOutput stream.
gfdField definition to print.
Returns
The same stream for chaining.

This prints the core integration parameters and then each entry in field_parameters.

Definition at line 72 of file gfield.h.

Field Documentation

◆ field_parameters

std::map<std::string, std::string> GFieldDefinition::field_parameters

Definition at line 45 of file gfield.h.

◆ integration_stepper

std::string GFieldDefinition::integration_stepper

Definition at line 36 of file gfield.h.

◆ minimum_step

double GFieldDefinition::minimum_step = 0.0

Definition at line 39 of file gfield.h.

◆ name

std::string GFieldDefinition::name

Definition at line 33 of file gfield.h.

◆ type

std::string GFieldDefinition::type

Definition at line 42 of file gfield.h.


The documentation for this struct was generated from the following file: