Warning, /geant4/examples/extended/analysis/AnaEx02/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleAnaEx02 Example AnaEx02
0002
0003 Examples AnaEx01 and AnaEx02 show the usage of histogram and tuple
0004 manipulations using G4Analysis and ROOT compliant systems on the same
0005 scenario. All analysis manipulations (histo booking, filling, saving histos
0006 in a file, etc...) are located in one class : HistoManager, implementation of
0007 which is different in each example. All the other classes are same in all
0008 three examples.
0009
0010 This example shows the usage of histogram and tuple manipulations using
0011 ROOT system. Please install ROOT before building this example:
0012 http://root.cern
0013
0014 The example is an adaptation of examples/novice/N03. It describes a simple
0015 sampling calorimeter setup.
0016
0017 ## Detector description
0018
0019 The calorimeter is a box made of a given number of layers. A layer
0020 consists of an absorber plate and of a detection gap. The layer is
0021 replicated.
0022
0023 Six parameters define the calorimeter :
0024 - the material of the absorber,
0025 - the thickness of an absorber plate,
0026 - the material of the detection gap,
0027 - the thickness of a gap,
0028 - the number of layers,
0029 - the transverse size of the calorimeter (the input face is a square).
0030
0031 The default geometry is constructed in DetectorConstruction class,
0032 but all of the above parameters can be modified interactively via
0033 the commands defined in the DetectorMessenger class.
0034
0035 <pre>
0036 |<----layer 0---------->|<----layer 1---------->|<----layer 2---------->|
0037 | | | |
0038 ==========================================================================
0039 || | || | || | ||
0040 || | || | || | ||
0041 beam || absorber | gap || absorber | gap || absorber | gap ||
0042 ======> || | || | || | ||
0043 || | || | || | ||
0044 ==========================================================================
0045
0046 </pre>
0047
0048 ## Physics list
0049
0050 The particle's type and the physic processes which will be available
0051 in this example are set in the FTFP_BERT physics list.
0052
0053 ## Action Initialization
0054
0055 A newly introduced class, ActionInitialization,
0056 instantiates and registers to Geant4 kernel all user action classes
0057 which are defined thread-local and a run action class
0058 which is defined both thread-local and global.
0059
0060 The thread-local action classes are defined in
0061 ActionInitialization::Build()
0062 and the global run action class is defined in
0063 ActionInitialization::BuildForMaster().
0064 Note that ActionInitialization::Build() is also used to
0065 instatiate user action clasess in sequential mode.
0066
0067 ## An event : PrimaryGeneratorAction
0068
0069 The primary kinematic consists of a single particle which hits the
0070 calorimeter perpendicular to the input face. The type of the particle
0071 and its energy are set in the PrimaryGeneratorAction class, and can
0072 be changed via the G4 build-in commands of ParticleGun class.
0073
0074
0075 ## Histograms
0076
0077 To produce histograms, ROOT system must be installed
0078
0079 AnaEx02 can produce 4 histograms :
0080
0081 - EAbs : total energy deposit in absorber per event
0082 - EGap : total energy deposit in gap per event
0083 - LAbs : total track length of charged particles in absorber per event
0084 - LGap : total track length of charged particles in gap per event
0085
0086 And 2 Ntuples :
0087 - Ntuple1:
0088 - one row per event : EnergyAbs EnergyGap
0089 - Ntuple2:
0090 - one row per event : TrackLAbs TrackLGap
0091
0092 These histos and ntuples are booked in HistoManager and filled from
0093 EventAction.
0094
0095 One can control the name of the histograms file :
0096 - default name : AnaEx02
0097 Format : root
0098
0099 See HistoManager constructor
0100
0101 ## How to build
0102
0103 An additional step is needed when building the example with GNUmake
0104 due to using the extra shared directory:
0105 ```
0106 % cd path_to_AnaEx02/AnaEx02
0107 % gmake setup
0108 % gmake
0109 ```
0110
0111 This will copy the files from shared in the example include and src;
0112 to remove these files:
0113 ```
0114 % gmake clean_setup
0115 ```
0116
0117 ## HOW TO RUN
0118
0119 - Execute AnaEx02 in the 'interactive mode' with visualization
0120 ```
0121 % ./AnaEx02
0122 and type in the commands from run.mac line by line:
0123 Idle> /control/verbose 2
0124 Idle> /tracking/verbose 1
0125 Idle> /run/beamOn 10
0126 Idle> ...
0127 Idle> exit
0128 ```
0129 or
0130 ```
0131 Idle> /control/execute run.mac
0132 ....
0133 Idle> exit
0134 ```
0135
0136 - Execute AnaEx02 in the 'batch' mode from macro files
0137 (without visualization)
0138 ```
0139 % ./AnaEx02 run.mac
0140 % ./AnaEx02 run.mac > run.out
0141 ```
0142
0143 The AnaEx02.in macro is used in Geant4 testing.