$Id: README 73919 2013-09-17 07:38:47Z gcosmo $
--------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
AnaEx01
-------
This example shows the usage of histogram and tuple manipulations using
G4Analysis system. All analysis manipulations
(histo booking, filling, saving histos in a file, etc...)
are located in one class : HistoManager.
The example is an adaptation of examples/novice/N03. It describes a simple
sampling calorimeter setup.
1- Detector description
-----------------------
The calorimeter is a box made of a given number of layers. A layer
consists of an absorber plate and of a detection gap. The layer is
replicated.
Six parameters define the calorimeter :
- the material of the absorber,
- the thickness of an absorber plate,
- the material of the detection gap,
- the thickness of a gap,
- the number of layers,
- the transverse size of the calorimeter (the input face is a square).
The default geometry is constructed in DetectorConstruction class,
but all of the above parameters can be modified interactively via
the commands defined in the DetectorMessenger class.
|<----layer 0---------->|<----layer 1---------->|<----layer 2---------->|
| | | |
==========================================================================
|| | || | || | ||
|| | || | || | ||
|| absorber | gap || absorber | gap || absorber | gap ||
|| | || | || | ||
|| | || | || | ||
beam || | || | || | ||
======> || | || | || | ||
|| | || | || | ||
|| | || | || | ||
|| | || | || | ||
|| | || | || | ||
|| | || | || | ||
==========================================================================
2- Action Initialization
------------------------------------
A newly introduced class, ActionInitialization,
instantiates and registers to Geant4 kernel all user action classes
which are defined thread-local and a run action class
which is defined both thread-local and global.
The thread-local action classes are defined in
ActionInitialization::Build()
and the global run action class is defined in
ActionInitialization::BuildForMaster().
Note that ActionInitialization::Build() is also used to
instatiate user action clasess in sequential mode.
3- An event : PrimaryGeneratorAction
------------------------------------
The primary kinematic consists of a single particle which hits the
calorimeter perpendicular to the input face. The type of the particle
and its energy are set in the PrimaryGeneratorAction class, and can
be changed via the G4 build-in commands of ParticleGun class.
4- Histograms
-------------
AnaEx01 can produce 4 histograms :
histo 1 : total energy deposit in absorber per event
histo 2 : total energy deposit in gap per event
histo 3 : total track length of charged particles in absorber per event
histo 4 : total track length of charged particles in gap per event
And 2 Ntuples :
- ntuple 1:
- one row per event : EnergyAbs EnergyGap
- ntuple 1:
- one row per event : TrackLAbs TrackLGap
These histos and ntuples are booked in HistoManager and filled from
EventAction.
One can control the name of the histograms file and its format:
default name : AnaEx01
The format of the histogram file can be : root (default),
hbook, xml, csv. Include correct g4nnn.hh in HistoManager.hh
Using hbook format
------------------
Need a special treatement : the Cern Library must be installed and the
environment variable CERNLIB correctly set. Then, *before* compiling,
activate G4_USE_HBOOK in GNUmakefile and g4hbook.hh in HistoManager.hh