Example program demonstrating option parsing for the gparticle module.
More...
#include "gparticle_options.h"
#include "G4RunManagerFactory.hh"
#include "QBBC.hh"
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
| | Program entry point.
|
| |
This example shows how to:
Usage example (shell):
./gparticle_example -
gparticle=
"[{name: e-, p: 5000*MeV, theta: 23*deg}]"
Notes:
- This program initializes a
G4RunManager and sets a simple physics list.
- The example does not run an event loop; it focuses on configuration parsing and object construction.
Definition in file gparticle_example.cc.
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
The program performs the following steps:
- Creates a GOptions instance that includes the gparticle option definitions.
- Creates a logger for the module (using the GPARTICLE_LOGGER channel).
- Creates a
G4RunManager using the factory API.
- Installs a minimal physics list (
QBBC).
- Parses the configured particles by calling gparticle::getGParticles().
- Cleans up the run manager and exits.
- Parameters
-
| argc | Number of command-line arguments. |
| argv | Command-line arguments. |
- Returns
- Process exit code.
Definition at line 47 of file gparticle_example.cc.