Geant4 Cross Reference |
>> 1 $Id: README 78303 2013-12-11 10:50:38Z gcosmo $ 1 ---------------------------------------------- 2 ------------------------------------------------------------------- 2 3 3 ========================================= 4 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for S 5 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================= 6 ========================================================= 6 7 7 OpNovice 8 OpNovice 8 -------- 9 -------- 9 10 10 This example presently illustrates the followi 11 This example presently illustrates the following basic concepts, and in 11 particular (indicated with ***), how to use G4 12 particular (indicated with ***), how to use G4 for optical photon 12 generation and transport. Other extended examp 13 generation and transport. Other extended example of what is possible 13 in Geant4 with optical photons can be found at 14 in Geant4 with optical photons can be found at 14 examples/extended/optical/LXe and wls. 15 examples/extended/optical/LXe and wls. 15 16 16 main() 17 main() 17 ------ 18 ------ 18 19 19 ==> define Random Number generator initial se << 20 ==> define Random Number Engine and initial seed 20 21 21 G4Optical Physics << 22 G4VUserPhysicsList 22 ----------------- << 23 ------------------ 23 << 24 The G4OpticalPhysics physics class is used. T << 25 G4OpticalParametersMessenger class. << 26 24 27 ==> define particles; including *** G4Optical 25 ==> define particles; including *** G4OpticalPhoton *** 28 define processes; including *** G4Cerenko 26 define processes; including *** G4Cerenkov *** 29 *** G4Scintil 27 *** G4Scintillation *** 30 *** G4OpAbsor 28 *** G4OpAbsorption *** 31 *** G4OpRayle 29 *** G4OpRayleigh *** 32 *** G4OpBound 30 *** G4OpBoundaryProcess *** 33 31 34 ==> A messenger command allows to define inte << 35 verbose level and the maximum number of C << 36 (see for instance OpNovice.in) << 37 << 38 G4VUserDetectorConstruction 32 G4VUserDetectorConstruction 39 --------------------------- 33 --------------------------- 40 34 41 ==> define material: Air and Water 35 ==> define material: Air and Water 42 define simple G4box geometry 36 define simple G4box geometry 43 *** add G4MaterialPropertiesTable to G4Ma 37 *** add G4MaterialPropertiesTable to G4Material *** 44 *** define G4LogicalSurface(s) 38 *** define G4LogicalSurface(s) *** 45 *** define G4OpticalSurface 39 *** define G4OpticalSurface *** 46 *** add G4MaterialPropertiesTable to G4Op 40 *** add G4MaterialPropertiesTable to G4OpticalSurface *** 47 41 48 alternatively the Configuration can be read fr << 49 The provided gdml file NoviceExample.gdml corr << 50 defined in OpNoviceDetectorConstruction. << 51 << 52 G4VUserPrimaryGeneratorAction 42 G4VUserPrimaryGeneratorAction 53 ----------------------------- 43 ----------------------------- 54 44 55 ==> Use G4ParticleGun to shoot a charge parti 45 ==> Use G4ParticleGun to shoot a charge particle into a Cerenkov radiator 56 46 57 ==> A messenger command allows to define inte << 47 ==> A messenger command allows to define interactivly the polarization of an 58 primary optical photon (see for instance 48 primary optical photon (see for instance optPhoton.mac) 59 49 60 G4UserRunAction and G4Run << 50 G4UserRunAction 61 ------------------------- << 51 --------------- 62 52 63 Used to accumulate statistics. << 53 ==> define G4Timer (start/stop) >> 54 set verbose levels 64 55 65 G4UserStackingAction and G4UserEventAction << 56 G4UserStackingAction 66 ------------------------------------------ << 57 -------------------- 67 58 68 ==> show how to count the number of secondary 59 ==> show how to count the number of secondary particles in an event 69 60 70 Visualisation 61 Visualisation 71 ------------- 62 ------------- 72 63 73 The Visualization Manager is set in the main( 64 The Visualization Manager is set in the main(). 74 The initialisation of the drawing is done via 65 The initialisation of the drawing is done via a set of /vis/ commands 75 in the macro vis.mac. This macro is automatic 66 in the macro vis.mac. This macro is automatically read from 76 the main in case of interactive running mode. 67 the main in case of interactive running mode. 77 68 78 The detector has a default view which is a lo 69 The detector has a default view which is a longitudinal view of the tank. 79 The tracks are drawn at the end of event, and 70 The tracks are drawn at the end of event, and erased at the end of run. 80 71 81 HOW TO START 72 HOW TO START 82 ------------ 73 ------------ 83 74 84 - compile and link to generate an executable 75 - compile and link to generate an executable >> 76 % cd OpNovice >> 77 % gmake 85 78 86 This example handles the program arguments 79 This example handles the program arguments in a new way. 87 It can be run with the following optional o << 80 It can be run with the following optional arguments: 88 $ OpNovice [-g gdmlfile] [-m macro ] [-u UI << 81 % OpNovice [-m macro ] [-u UIsession] [-t nThreads] 89 82 90 The -t option is available only in multi-th 83 The -t option is available only in multi-threading mode 91 and it allows the user to override the Gean 84 and it allows the user to override the Geant4 default number of 92 threads. The number of threads can be also 85 threads. The number of threads can be also set via G4FORCENUMBEROFTHREADS 93 environment variable which has the top prio 86 environment variable which has the top priority. 94 87 95 - execute OpNovice in 'batch' mode from macro 88 - execute OpNovice in 'batch' mode from macro files 96 $ OpNovice -m OpNovice.in << 89 % OpNovice -m OpNovice.in 97 << 90 98 - execute OpNovice in 'batch' mode from macro << 99 to define the geometry << 100 $ OpNovice -g NoviceExample.gdml -m OpNovice << 101 << 102 - execute OpNovice in 'interactive mode' with 91 - execute OpNovice in 'interactive mode' with visualization 103 $ OpNovice << 92 % OpNovice 104 .... 93 .... 105 Idle> type your commands. For instance: 94 Idle> type your commands. For instance: 106 Idle> /control/execute optPhoton.mac 95 Idle> /control/execute optPhoton.mac 107 .... 96 .... 108 Idle> exit 97 Idle> exit 109 << 98 110 Macros << 111 ------ << 112 << 113 The following macros are provided: << 114 << 115 - optPhoton.mac: Shoot optical photons with e << 116 - OpNovice.in: Shoot positrons with energy 50 << 117 - gui.mac: Configure the graphical user inter << 118 - vis.mac: Configure visualization. << 119 << 120 << 121 gdml files << 122 ---------- << 123 NoviceExample.gdml: example gdml file correspo << 124 OpNoviceDetectorConstruction <<