gphysics
Loading...
Searching...
No Matches

Minimal example showing how to define gphysics options and instantiate GPhysics. More...

#include "gphysics.h"
#include "gphysics_options.h"
#include "goptions.h"
Include dependency graph for gphysics_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Program entry point.
 

Detailed Description

This example demonstrates the typical integration pattern:

The example is intentionally minimal and does not attach the resulting physics list to a Geant4 run manager. It is meant as a compilation and usage reference for the module API.

Usage:

./gphysics_example -phys_list FTFP_BERT
./gphysics_example -showPhysics

Definition in file gphysics_example.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

This function:

  • Parses command line arguments into a GOptions instance configured with gphysics::defineOptions().
  • Instantiates GPhysics, which will either:
    • Print available physics lists/constructors if showPhysics is enabled, or
    • Build the reference physics list selected by phys_list.
Parameters
argcNumber of command line arguments.
argvArray of command line argument strings.
Returns
Process exit code (EXIT_SUCCESS on normal completion).

Definition at line 43 of file gphysics_example.cc.