174 lines
6.0 KiB
Plaintext
174 lines
6.0 KiB
Plaintext
$Id: README,v 1.6 2007/11/13 12:13:32 maire Exp $
|
|
-------------------------------------------------------------------
|
|
|
|
=========================================================
|
|
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
|
=========================================================
|
|
|
|
TestEm14
|
|
--------
|
|
|
|
How to compute cross sections from the direct evaluation of the mean
|
|
free path ( see below, item Physics).
|
|
How to plot final state of a process.
|
|
|
|
1- GEOMETRY DEFINITION
|
|
|
|
It is a single box representing a 'semi infinite' homogeneous medium.
|
|
Two parameters define the geometry :
|
|
- the material of the box,
|
|
- the (full) size of the box.
|
|
|
|
The default geometry (100 m of water) is constructed in
|
|
DetectorConstruction, but the above parameters can be changed
|
|
interactively via the commands defined in DetectorMessenger.
|
|
|
|
2- PHYSICS LIST
|
|
|
|
The physics list contains the standard electromagnetic processes.
|
|
In order not to introduce 'artificial' constraints on the step size, the
|
|
multiple scattering is not instanciated, and there is no limitation from
|
|
the maximum energy lost per step.
|
|
|
|
3- AN EVENT : THE PRIMARY GENERATOR
|
|
|
|
The primary kinematic consists of a single particle starting at the edge
|
|
of the box. The type of the particle and its energy are set in
|
|
PrimaryGeneratorAction (1 MeV gamma), and can be changed via the G4
|
|
build-in commands of ParticleGun class (see the macros provided with
|
|
this example).
|
|
|
|
4- PHYSICS
|
|
|
|
An event is killed at the first interaction of the incident paticle.
|
|
The absorption length, also called mean free path, is computed as
|
|
the mean value of the track length of the incident particle.
|
|
This is why the medium must be 'infinite' : to be sure that interaction
|
|
occurs at any events.
|
|
|
|
The result is compared with the 'input' data, i.e. with the cross
|
|
sections stored in the PhysicsTables and used by Geant4.
|
|
|
|
The energy spectrum and the angular distribution of the scattered
|
|
particle (if any) and of the created secondaries are plotted (see
|
|
SteppingAction).
|
|
|
|
A set of macros defining various run conditions are provided.
|
|
The processes are actived/inactived in order to survey the processes
|
|
individually.
|
|
|
|
5- HISTOGRAMS
|
|
|
|
The test contains 6 built-in 1D histograms, which are managed by the
|
|
HistoManager class and its Messenger. The histos can be individually
|
|
activated with the command :
|
|
/testem/histo/setHisto id nbBins valMin valMax unit
|
|
where unit is the desired unit for the histo (MeV or keV, etc..)
|
|
(see the macros xxxx.mac).
|
|
|
|
1 "scattered primary particle: energy spectrum"
|
|
2 "scattered primary particle: costheta distribution"
|
|
3 "charged secondaries: energy spectrum"
|
|
4 "charged secondaries: costheta distribution"
|
|
5 "neutral secondaries: energy spectrum"
|
|
6 "neutral secondaries: costheta distribution"
|
|
|
|
See below the note on histogram tools.
|
|
|
|
One can control the name and the type of the histograms file with
|
|
the commands:
|
|
/testem/histo/setFileName name (default testem14)
|
|
/testem/histo/setFileType name (default hbook)
|
|
|
|
It is also possible to print selected histograms on an ascii file:
|
|
/testem/histo/printHisto id
|
|
All selected histos will be written on a file name.ascii
|
|
(default testem14)
|
|
|
|
Note that, by default, histograms are disabled. To activate them,
|
|
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
|
|
|
|
6- VISUALIZATION
|
|
|
|
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
|
|
|
|
The detector has a default view which is a longitudinal view of the
|
|
box.
|
|
|
|
The tracks are drawn at the end of event, and erased at the end of run.
|
|
|
|
7- HOW TO START ?
|
|
|
|
compile and link to generate an executable
|
|
% cd geant4/examples/extended/electromagnetic/TestEm14
|
|
% gmake
|
|
|
|
execute TestEm14 in 'batch' mode from macro files :
|
|
% TestEm14 compt.mac
|
|
|
|
execute TestEm14 in 'interactive mode' with visualization :
|
|
% TestEm14
|
|
Idle> control/execute vis.mac
|
|
....
|
|
Idle> type your commands
|
|
....
|
|
Idle> exit
|
|
|
|
|
|
8- USING HISTOGRAMS
|
|
|
|
By default the histograms are not activated. To activate histograms
|
|
the environment variable G4ANALYSIS_USE should be defined. For instance
|
|
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
|
|
|
|
Before compilation of the example it is optimal to clean up old files:
|
|
gmake histclean
|
|
gmake
|
|
|
|
To use histograms, at least one of the AIDA implementations should be
|
|
available (see http://aida.freehep.org).
|
|
|
|
8a - PI
|
|
|
|
A package including AIDA and extended interfaces also using Python is PI,
|
|
available from: http://cern.ch/pi
|
|
|
|
Once installed PI or PI-Lite in a specified local area $MYPY, it is required
|
|
to add the installation path to $PATH, i.e. for example, for release 1.2.1 of
|
|
PI:
|
|
setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
|
|
|
|
CERN users can use the PATH to the LCG area on AFS.
|
|
Before running the example the command should be issued:
|
|
eval `aida-config --runtime csh`
|
|
|
|
8b - OpenScientist
|
|
|
|
OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
|
|
|
|
You have to "setup" the OpenScientist AIDA implementation before compiling
|
|
(then with G4ANALYSIS_USE set) and running your Geant4 application.
|
|
|
|
On UNIX you setup, with a csh flavoured shell :
|
|
csh> source <<OpenScientist install path>/aida-setup.csh
|
|
or with a sh flavoured shell :
|
|
sh> . <<OpenScientist install path>/aida-setup.sh
|
|
On Windows :
|
|
DOS> call <<OpenScientist install path>/aida-setup.bat
|
|
|
|
You can use various file formats for writing (AIDA-XML, hbook, root).
|
|
These formats are readable by the Lab onx interactive program
|
|
or the OpenPAW application. See the web pages.
|
|
|
|
|
|
With OpenPAW, on a run.hbook file, one can view the histograms
|
|
with something like :
|
|
OS> opaw
|
|
opaw> h/file 1 run.hbook ( or opaw> h/file 1 run.aida or run.root)
|
|
opaw> zone 2 2
|
|
opaw> h/plot 1
|
|
opaw> h/plot 2
|