gfields
Loading...
Searching...
No Matches
GMagneto Class Reference

Represents a world containing collections of GFields and G4FieldManagers. More...

#include <gmagneto.h>

Public Member Functions

 GMagneto (const std::shared_ptr< GOptions > &gopts)
 Constructs a GMagneto object and loads field definitions from options.
 
bool isField (const std::string &name) const
 Checks if a field with the given name exists.
 
std::shared_ptr< GFieldgetField (std::string name)
 Retrieves a GField object by its name.
 
std::shared_ptr< G4FieldManager > getFieldMgr (std::string name)
 Retrieves a G4FieldManager object by its name.
 
- Public Member Functions inherited from GBase< GMagneto >
 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 ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GMagneto >
std::shared_ptr< GLoggerlog
 

Detailed Description

GMagneto manages the lifecycle and access to magnetic field objects (GField) and their corresponding field managers (G4FieldManager).

Definition at line 14 of file gmagneto.h.

Constructor & Destructor Documentation

◆ GMagneto()

GMagneto::GMagneto ( const std::shared_ptr< GOptions > & gopts)
explicit
Parameters
goptsPointer to the GOptions object containing configuration options.

Definition at line 12 of file gmagneto.cc.

Member Function Documentation

◆ getField()

std::shared_ptr< GField > GMagneto::getField ( std::string name)
inline
Parameters
nameName of the field to retrieve.
Returns
Pointer to the GField object.
Exceptions
Logsan error and exits if the field is not found.

Definition at line 43 of file gmagneto.h.

◆ getFieldMgr()

std::shared_ptr< G4FieldManager > GMagneto::getFieldMgr ( std::string name)
inline
Parameters
nameName of the field manager to retrieve.
Returns
Pointer to the G4FieldManager object.
Exceptions
Logsan error and exits if the field manager is not found.

Definition at line 56 of file gmagneto.h.

◆ isField()

bool GMagneto::isField ( const std::string & name) const
inline
Parameters
nameName of the field to check.
Returns
True if the field exists, false otherwise.

Definition at line 35 of file gmagneto.h.


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