gparticle
Loading...
Searching...
No Matches
Options and configuration

How gparticle is configured through structured options. More...

Collaboration diagram for Options and configuration:

Files

file  gparticle_options.h
 Public API for defining and parsing gparticle-related options.
 

Functions

GOptions gparticle::defineOptions ()
 Defines the structured options used by the gparticle module.
 
vector< GparticlePtrgparticle::getGParticles (const std::shared_ptr< GOptions > &gopts, std::shared_ptr< GLogger > &logger)
 Builds the list of generator particles from structured options.
 

Detailed Description

Function Documentation

◆ defineOptions()

GOptions gparticle::defineOptions ( )

This function returns a fully populated GOptions instance containing the option specification for -gparticle.

The -gparticle option is expected to represent a list of particle definitions. Each list item maps keys (e.g. name, p, theta, vx) to typed values, which are then used to construct Gparticle objects.

The help text produced by this option definition includes usage guidance and examples of the supported syntax.

Returns
A GOptions instance containing the gparticle option schema.

Definition at line 61 of file gparticle_options.cc.

◆ getGParticles()

std::vector< GparticlePtr > gparticle::getGParticles ( const std::shared_ptr< GOptions > & gopts,
std::shared_ptr< GLogger > & logger )

This function reads the gparticle option node from the provided GOptions instance and creates a std::vector of Gparticle shared pointers.

For each entry in the structured node:

  • mandatory fields are validated (e.g. name)
  • numeric values are interpreted together with their unit strings
  • randomization model strings are converted into gutilities::randomModel

The provided logger is passed to each Gparticle instance to ensure that particle-level diagnostics are emitted consistently.

Parameters
goptsThe parsed option container that holds the gparticle node.
loggerLogger used for diagnostics and propagated into each particle.
Returns
Vector of Gparticle instances representing the configured primaries.

Definition at line 12 of file gparticle_options.cc.