Warning, /geant4/examples/extended/electromagnetic/TestEm4/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleTestEm4 Example TestEm4
0002
0003 Plot energy deposited by 9 MeV photon beam in an homogeneous medium.
0004
0005 ## GEOMETRY DEFINITION
0006
0007 It is a cylinder of 5 cm radius filled with C6F6.
0008
0009 ## PHYSICS LIST
0010
0011 The particle list contains only gamma, electron,positron.
0012 The physics list contains the 'standard' electromagnetic processes.
0013
0014 ## AN EVENT : THE PRIMARY GENERATOR
0015
0016 The primary kinematic is a single 9 MeV gamma randomly shooted at the
0017 middle of the cylinder.
0018
0019 ## VISUALIZATION
0020
0021 The Visualization Manager is set in the main().
0022 The initialisation of the drawing is done via the commands
0023 `/vis/..` in the macro vis.mac. This macro is
0024 automatically read from the main in case of interactive running mode.
0025
0026 The detector has a default view which is a transversal view of the
0027 cylinder.
0028
0029 The tracks are drawn at the end of event, and erased at the end of run.
0030 Optionaly one can choose to draw all particles, only the charged one,
0031 or none. This command is defined in EventActionMessenger class.
0032
0033 ## PHYSICS SURVEY
0034
0035 The energy deposited in C6F6 is histogramed.
0036
0037 ## HOW TO START ?
0038
0039 - Execute TestEm4 in 'batch' mode from macro files
0040 ```
0041 % ./TestEm4 TestEm4.in
0042 ```
0043
0044 - Execute TestEm4 in 'interactive mode' with visualization
0045 ```
0046 % ./TestEm4
0047 ....
0048 Idle> type your commands
0049 ....
0050 Idle> exit
0051 ```
0052
0053 macro verbose.mac illustrate capability of verbosity
0054
0055 ## USING HISTOGRAMS
0056
0057 The format of the histogram file can be : root (default),
0058 xml, csv, by changing the default file type in RunAction.cc
0059
0060 ## RANDOM NUMBERS HANDLING
0061
0062 CLHEP provides several random number engines. In this example the Ranecu
0063 engine is choosen at beginning of the main (TestEm4.cc).
0064
0065 By default, G4RunManager does not save the rndm seed.
0066 To do so the user must set in BeginOfRunAction:
0067 G4RunManager::GetRunManager()->SetRandomNumberStore(true);
0068
0069 Then the rndm seed is systematically saved at beginning of run
0070 (currentRun.rndm) and beginning of event (currentEvent.rndm)
0071 Therefore, in case of abnormal end, the seed of the last event processed
0072 is available in currentEvent.rndm
0073
0074 Even in case of normal run processing, the user may wish to preserve the
0075 rndm seed of selected events. At any time in the event, put the
0076 following statement:
0077 ```cpp
0078 if (condition) G4RunManager::GetRunManager()->rndmSaveThisEvent();
0079 ```
0080 currentEvent.rndm will be copied to runXXevntYY.rndm
0081 (see SteppingAction::UserSteppingAction() )
0082
0083 To restart a run from a given rndm seed, use the UI command :
0084 ```
0085 /random/resetEngineFrom fileName
0086 ```
0087
0088 The macro rndmSeed.mac shows how to save and reset the random number
0089 seed between runs, from UI commands.
0090
0091