g4system
Loading...
Searching...
No Matches
g4system_example.cc File Reference

Example showing how to instantiate g4system options, build a GEMC world, and build the Geant4 world. More...

#include "gworld.h"
#include "g4world.h"
#include "g4system_options.h"
Include dependency graph for g4system_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Entry point for the g4system example program.
 

Detailed Description

This example demonstrates:

  • registering g4system options via defineOptions()
  • building a GEMC world (GWorld)
  • building the Geant4 world (G4World)
  • retrieving basic diagnostics (volume count and sensitive detector list)

The example intentionally keeps the logic minimal so it can be used as a template.

Definition in file g4system_example.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )
Parameters
argcNumber of command-line arguments.
argvCommand-line arguments passed to the global option system.
Returns
EXIT_SUCCESS on completion.

The program:

  • creates a global GOptions instance configured with defineOptions()
  • instantiates a GWorld using those options
  • builds the Geant4 world via G4World
  • prints basic diagnostics to the example logger

Definition at line 40 of file g4system_example.cc.