Class RMGUserInit

Class Documentation

class RMGUserInit

User initialization class.

This class manages user-defined actions, output schemes, and generator configuration for the remage simulation. It provides methods to add stepping actions, tracking actions, output schemes, and to configure the user generator.

This class does not manage instances, but stores arguments that will be forwarded several times to initialize the user-defined actions on all worker threads.

Public Functions

RMGUserInit() = default

Default constructor.

~RMGUserInit() = default

Default destructor.

RMGUserInit(RMGUserInit const&) = delete
RMGUserInit &operator=(RMGUserInit const&) = delete
RMGUserInit(RMGUserInit&&) = delete
RMGUserInit &operator=(RMGUserInit&&) = delete
inline auto GetSteppingActions() const

Retrieves the collection of stepping actions.

Returns:

A vector of functions generating G4UserSteppingAction objects.

inline auto GetTrackingActions() const

Retrieves the collection of tracking actions.

Returns:

A vector of functions generating G4UserTrackingAction objects.

inline auto GetOutputSchemes() const

Retrieves the registered output schemes.

Returns:

A vector of functions generating RMGVOutputScheme objects.

inline auto GetOptionalOutputSchemes() const

Retrieves the optional output schemes.

Returns:

A map of functions generating RMGVOutputScheme objects, keyed by scheme name.

inline auto GetUserGenerator() const

Retrieves the user generator.

Returns:

A function generating an RMGVGenerator object.

template<typename T, typename ...Args>
inline void AddSteppingAction(Args&&... args)

Adds a stepping action of type T.

Template Parameters:

T – Derived type of G4UserSteppingAction.

Parameters:

args – Arguments to forward to T’s constructor.

template<typename T, typename ...Args>
inline void AddTrackingAction(Args&&... args)

Adds a tracking action of type T.

Template Parameters:

T – Derived type of G4UserTrackingAction.

Parameters:

args – Arguments to forward to T’s constructor.

template<typename T, typename ...Args>
inline void AddOutputScheme(Args&&... args)

Adds an output scheme of type T.

Template Parameters:

T – Derived type of RMGVOutputScheme.

Parameters:

args – Arguments to forward to T’s constructor.

template<typename T, typename ...Args>
inline void AddOptionalOutputScheme(std::string name, Args&&... args)

Adds an optional output scheme of type T with a given name.

These additional output schemes can be activated with RMGManager::ActivateOptionalOutputScheme.

Template Parameters:

T – Derived type of RMGVOutputScheme.

Parameters:
  • name – The key under which the scheme will be stored.

  • args – Arguments to forward to T’s constructor.

template<typename T, typename ...Args>
inline void SetUserGenerator(Args&&... args)

Sets the user generator to an instance of type T.

Template Parameters:

T – Derived type of RMGVGenerator.

Parameters:

args – Arguments to forward to T’s constructor.

inline void RegisterDefaultOptionalOutputSchemes()

Registers the default optional output schemes.

This includes schemes for isotope filtering, particle filtering, and track output.

inline void ActivateOptionalOutputScheme(std::string name)

Activates an optional output scheme by its name.

If the scheme is not found, a fatal error is logged.

Parameters:

name – The name of the optional output scheme to activate.