Investigate optical properties and parameters. Details of optical photon boundary interactions on a surface are recorded. Details of optical photon generation and transport are recorded. Group velocity may be examined.
The geometry consists of a cube "box" with a side of 2 m inside the world cube of side 20 m. Optical properties of the box, the world, and the surface may be set interactively via the commands defined in the DetectorMessenger class.
Material properties may be added using the macro commands:
/opnovice2/boxProperty NAME EN1 V1 EN2 V2 [ .. ENn Vn] /opnovice2/boxConstProperty NAME VALUE
/opnovice2/worldProperty NAME EN1 V1 EN2 V2 [ .. ENn Vn] /opnovice2/worldConstProperty NAME VALUE
/opnovice2/surfaceProperty NAME EN1 V1 EN2 V2 [ .. ENn Vn]
Multiple energy and value pairs may be specified for the energy-dependent properties.
Values are in Geant4 internal units. Energy is in MeV.
Example:
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000005 1.32 0.000008 1.34
sets the refractive index of the box to 1.3 at 2 eV, 1.32 at 5 eV, and 1.34 at 8 eV.
The FTFP_BERT physics list is used, with electromagnetic option EMZ (option4) and G4OpticalPhysics for the optical physics.
The primary kinematic consists of a single particle. The type of the particle, its energy, position, and direction, are set in the PrimaryGeneratorAction class, and can be changed via the G4 build-in commands of G4ParticleGun class (see the macros provided with this example).
The Visualization Manager is set in the main(). The initialisation of the drawing is done via the commands /vis/... in the macro vis.mac. To get visualisation:
> /control/execute vis.mac
or run the program with no command line arguments:
$ ./OpNovice2
% OpNovice2 electron.mac
% OpNovice2 .... Idle> type your commands .... Idle> exit
A table of optical photon events is printed at the end of the run.
Group velocity is printed with /tracking/verbose 1 or higher.
OpNovice2 has several predefined 1D histograms :
Histograms 11-26 are recorded for photons scattered from the +X surface of the cube. Only the first interaction is recorded.
The histograms are managed by G4Analysis classes. The histos can be individually activated with the command :
/analysis/h1/set id nbBins valMin valMax
The unit is hardcoded to be eV for energy and ns for time.
One can control the name of the histograms file with the command:
/analysis/setFileName name (default opnovice2)
It is possible to choose the format of the histogram file : root (default), hdf5, xml, csv, by changing the default file type in HistoManager.cc
It is also possible to print selected histograms on an ascii file:
/analysis/h1/setAscii id
All selected histos will be written on a file name.ascii (default opnovice2)
Several macros are included.