Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/extended/optical/OpNovice/README.md is written in an unsupported language. File is not indexed.

0001 \page ExampleOpNovice Example OpNovice
0002 
0003 This example presently illustrates the following basic concepts, and in
0004 particular (indicated with ***), how to use G4 for optical photon
0005 generation and transport. Other extended example of what is possible
0006 in Geant4 with optical photons can be found at
0007 examples/extended/optical/LXe and wls
0008 
0009 ## main()
0010 
0011  Define Random Number generator initial seed in main().
0012 
0013 ## G4OpticalPhysics
0014 
0015  The G4OpticalPhysics physics class is used. The messenger is the
0016  G4OpticalParametersMessenger class.
0017 
0018  - Define particles; including - *** G4OpticalPhoton     ***
0019  - Define processes; including 
0020    - *** G4Cerenkov          ***
0021    - *** G4Scintillation     ***
0022    - *** G4OpAbsorption      ***
0023    - *** G4OpRayleigh        ***
0024    - *** G4OpBoundaryProcess ***
0025 
0026  A messenger command allows to define interactively the 
0027  verbose level and the maximum number of Cerenkov photons per step
0028  (see for instance OpNovice.in)
0029 
0030 ## G4VUserDetectorConstruction
0031 
0032  - Define material: Air and Water
0033  - Define simple G4box geometry
0034    - *** add G4MaterialPropertiesTable to G4Material       ***
0035    - *** define G4LogicalSurface(s)                        ***
0036    - *** define G4OpticalSurface                           ***
0037    - *** add G4MaterialPropertiesTable to G4OpticalSurface ***
0038 
0039 alternatively the Configuration can be read from a gdml file.
0040 The provided gdml file NoviceExample.gdml corresponds to the detector
0041 defined in OpNoviceDetectorConstruction.
0042 
0043  - See class OpNoviceDetectorConstruction
0044 
0045 ## G4VUserPrimaryGeneratorAction
0046 
0047  Use G4ParticleGun to shoot a charge particle into a Cerenkov radiator
0048  
0049  A messenger command allows to define interactively the polarization of an
0050  primary optical photon (see for instance optPhoton.mac)
0051     
0052  - See class OpNovicePrimaryGeneratorAction
0053 
0054 ## G4UserRunAction and G4Run
0055 
0056  - Used to accumulate statistics.
0057 
0058  - See classes OpNoviceRunAction and OpNoviceRun
0059 
0060 ## G4UserStackingAction and G4UserEventAction
0061 
0062  Show how to count the number of secondary particles in an event
0063 
0064  - See classes OpNoviceStackingAction and OpNoviceEventAction
0065 
0066 ## Visualisation
0067  
0068  The Visualization Manager is set in the main().
0069  The initialisation of the drawing is done via a set of /vis/ commands
0070  in the macro vis.mac. This macro is automatically read from 
0071  the main in case of interactive running mode.
0072         
0073  The detector has a default view which is a longitudinal view of the tank.      
0074  The tracks are drawn at the end of event, and erased at the end of run.
0075  
0076 ## How to start
0077 
0078  - Compile and link to generate an executable
0079 
0080    This example handles the program arguments in a new way.
0081    It can be run with the following optional arguments:
0082    ```
0083    $ ./OpNovice  [-g gdmlfile] [-m macro ] [-u UIsession] [-t nThreads]
0084    ```
0085 
0086    The -t option is available only in multi-threading mode
0087    and it allows the user to override the Geant4 default number of
0088    threads. The number of threads can be also set via G4FORCENUMBEROFTHREADS
0089    environment variable which has the top priority.
0090  
0091  - Execute OpNovice in 'batch' mode from macro files
0092    ```
0093    $ ./OpNovice -m OpNovice.in
0094    ```
0095 
0096  - Execute OpNovice in 'batch' mode from macro files using a gdml file
0097    to define the geometry
0098         $ OpNovice -g NoviceExample.gdml -m OpNovice.in
0099 
0100  - Execute OpNovice in 'interactive mode' with visualization
0101    ```
0102    $ ./OpNovice
0103    ....
0104    Idle> type your commands. For instance:
0105    Idle> /control/execute optPhoton.mac
0106    ....
0107    Idle> exit
0108 ```
0109 
0110 Macros
0111 ------
0112 
0113  The following macros are provided:
0114 
0115  - optPhoton.mac: Shoot optical photons with energy 3 eV
0116  - OpNovice.in: Shoot positrons with energy 500 keV.
0117  - gui.mac: Configure the graphical user interface.
0118  - vis.mac: Configure visualization.
0119 
0120 gdml files
0121 ----------
0122 NoviceExample.gdml: example gdml file corresponding to
0123 OpNoviceDetectorConstruction
0124