This example presently illustrates the following basic concepts, and in particular (indicated with ***), how to use G4 for optical photon generation and transport. Other extended example of what is possible in Geant4 with optical photons can be found at examples/extended/optical/LXe and wls
Define Random Number generator initial seed
The G4OpticalPhysics physics class is used. The messenger is the G4OpticalParametersMessenger class.
A messenger command allows to define interactively the verbose level and the maximum number of Cerenkov photons per step (see for instance OpNovice.in)
alternatively the Configuration can be read from a gdml file. The provided gdml file NoviceExample.gdml corresponds to the detector defined in OpNoviceDetectorConstruction.
Use G4ParticleGun to shoot a charge particle into a Cerenkov radiator
A messenger command allows to define interactively the polarization of an primary optical photon (see for instance optPhoton.mac)
Show how to count the number of secondary particles in an event
The Visualization Manager is set in the main(). The initialisation of the drawing is done via a set of /vis/ commands in the macro vis.mac. This macro is automatically read from the main in case of interactive running mode.
The detector has a default view which is a longitudinal view of the tank.
The tracks are drawn at the end of event, and erased at the end of run.
compile and link to generate an executable
This example handles the program arguments in a new way. It can be run with the following optional arguments:
$ OpNovice [-g gdmlfile] [-m macro ] [-u UIsession] [-t nThreads]
The -t option is available only in multi-threading mode and it allows the user to override the Geant4 default number of threads. The number of threads can be also set via G4FORCENUMBEROFTHREADS environment variable which has the top priority.
$ OpNovice -m OpNovice.in
$ OpNovice .... Idle> type your commands. For instance: Idle> /control/execute optPhoton.mac .... Idle> exit
The following macros are provided:
NoviceExample.gdml: example gdml file corresponding to OpNoviceDetectorConstruction