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10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Name Size       Last modified (GMT) Description
Back Parent directory       2024-12-05 15:16:16
Folder histo/       2024-12-05 15:16:16
Folder include/       2024-12-05 15:16:16
Folder ntuple/       2024-12-05 15:16:16
Folder shared/       2024-12-05 15:16:16
Folder src/       2024-12-05 15:16:16
File AnaEx01-csv.in 135 bytes       2024-12-05 15:16:16
File AnaEx01-csv.out 48012 bytes       2024-12-05 15:16:16
File AnaEx01-hdf5.in 137 bytes       2024-12-05 15:16:16
File AnaEx01-hdf5.out 46308 bytes       2024-12-05 15:16:16
File AnaEx01-root.in 147 bytes       2024-12-05 15:16:16
File AnaEx01-root.out 46448 bytes       2024-12-05 15:16:16
File AnaEx01-xml.in 135 bytes       2024-12-05 15:16:16
File AnaEx01-xml.out 46866 bytes       2024-12-05 15:16:16
C++ file AnaEx01.cc 3691 bytes       2024-12-05 15:16:16
File AnaEx01.in 593 bytes       2024-12-05 15:16:16
File CMakeLists.txt 2400 bytes       2024-12-05 15:16:16
File GNUmakefile 728 bytes       2024-12-05 15:16:16
File History 10148 bytes       2024-12-05 15:16:16
File README 5654 bytes       2024-12-05 15:16:16
File init_vis.mac 338 bytes       2024-12-05 15:16:16
File plotHisto.C 434 bytes       2024-12-05 15:16:16
File run.mac 285 bytes       2024-12-05 15:16:16
File vis.mac 2013 bytes       2024-12-05 15:16:16

  1 --------------------------------------------------
  2 
  3      =========================================================
  4      Geant4 - an Object-Oriented Toolkit for Simulation in HEP
  5      =========================================================
  6 
  7                             AnaEx01
  8                             -------
  9 
 10  Examples AnaEx01 and AnaEx02 show the usage of histogram and tuple
 11  manipulations using G4Analysis and ROOT compliant systems on the same
 12  scenario. All analysis manipulations (histo booking, filling, saving histos
 13  in a file, etc...) are located in one class : HistoManager, implementation of
 14  which is different in each example. All the other classes are same in all
 15  three examples.
 16 
 17  This example shows the usage of histogram and tuple manipulations using
 18  G4Analysis system.
 19 
 20  The example is an adaptation of examples/novice/N03. It describes a simple
 21  sampling calorimeter setup.
 22 
 23  1- Detector description
 24  -----------------------
 25 
 26  The calorimeter is a box made of a given number of layers. A layer
 27  consists of an absorber plate and of a detection gap. The layer is
 28  replicated.
 29 
 30  Six parameters define the calorimeter :
 31     - the material of the absorber,
 32     - the thickness of an absorber plate,
 33     - the material of the detection gap,
 34     - the thickness of a  gap,
 35     - the number of layers,
 36     - the transverse size of the calorimeter (the input face is a square).
 37 
 38  The default geometry is constructed in DetectorConstruction class,
 39  but all of the above parameters can be modified interactively via
 40  the commands defined in the DetectorMessenger class.
 41 
 42         |<----layer 0---------->|<----layer 1---------->|<----layer 2---------->|
 43         |                       |                       |                       |
 44         ==========================================================================
 45         ||              |       ||              |       ||              |       ||
 46         ||              |       ||              |       ||              |       ||
 47  beam   ||   absorber   |  gap  ||   absorber   |  gap  ||   absorber   |  gap  ||
 48 ======> ||              |       ||              |       ||              |       ||
 49         ||              |       ||              |       ||              |       ||
 50         ==========================================================================
 51 
 52 
 53  2- Physics list
 54  ---------------
 55 
 56    The particle's type and the physic processes which will be available
 57    in this example are set in the FTFP_BERT physics list.
 58 
 59  3- Action Initialization
 60  ------------------------
 61 
 62    A newly introduced class, ActionInitialization,
 63    instantiates and registers to Geant4 kernel all user action classes
 64    which are defined thread-local and a run action class
 65    which is defined both thread-local and global.
 66 
 67    The thread-local action classes are defined in
 68      ActionInitialization::Build()
 69    and  the global run action class is defined in
 70      ActionInitialization::BuildForMaster().
 71    Note that ActionInitialization::Build() is also used to
 72    instatiate user action clasess in sequential mode.
 73 
 74  4- An event : PrimaryGeneratorAction
 75  ------------------------------------
 76 
 77  The primary kinematic consists of a single particle which hits the
 78  calorimeter perpendicular to the input face. The type of the particle
 79  and its energy are set in the PrimaryGeneratorAction class, and can
 80  be changed via the G4 build-in commands of ParticleGun class.
 81 
 82  5- Histograms
 83  -------------
 84 
 85  AnaEx01 can produce 4 histograms :
 86 
 87   EAbs : total energy deposit in absorber per event
 88   EGap : total energy deposit in gap per event
 89   LAbs : total track length of charged particles in absorber per event
 90   LGap : total track length of charged particles in gap per event
 91 
 92  And 2 Ntuples :
 93  - Ntuple1:
 94    - one row per event : EnergyAbs EnergyGap
 95  - Ntuple2:
 96    - one row per event : TrackLAbs TrackLGap
 97 
 98  These histos and ntuples are booked in HistoManager and filled from
 99  EventAction.
100 
101  One can control the name of the histograms file and its format:
102  default name     : AnaEx01
103  The format of the histogram file can be : root (default),
104  xml, csv.
105 
106  We can define the default file type and set it to the analysis manager via
107  /analysis/setDefaultFileType root    # or csv hdf5 xml
108 
109  The file names then need not to be provided with the file extension and the same macro
110  can be used with different output types.
111 
112 
113  6- Macros:
114  ----------
115 
116  The AnaEx01.in macro uses the defaultFileType parameter (alias), which default value,
117  "root" is defined in main.
118 
119  AnaEx01-csv.in, AnaEx01-hdf5.in, AnaEx01-root.in, AnaEx01-xml.in:
120 
121  In these macros, the default value of the defaultFileType is overritten with
122 
123  /control/alias defaultFileType cvs   # or hdf5 root xml
124 
125  and then the AnaEx01.in macro is called.
126 
127  7- How to build
128  ---------------
129 
130  An additional step is needed when building the example with GNUmake
131  due to using the extra shared directory:
132   % cd path_to_AnaEx01/AnaEx01
133   % gmake setup
134   % gmake
135 
136  This will copy the files from shared in the example include and src;
137  to remove these files:
138   % gmake clean_setup
139 
140  8- How to run
141  --------------
142 
143   - Execute AnaEx01 in the 'interactive mode' with visualization
144       % ./AnaEx01
145     and type in the commands from run.mac line by line:
146       Idle> /control/verbose 2
147       Idle> /tracking/verbose 1
148       Idle> /run/beamOn 10
149       Idle> ...
150       Idle> exit
151     or
152       Idle> /control/execute run.mac
153       ....
154       Idle> exit
155 
156   - Execute AnaEx01  in the 'batch' mode from macro files
157     (without visualization)
158       % ./AnaEx01 run.mac
159       % ./AnaEx01 run.mac > run.out
160 
161   The AnaEx01.in macro is used in Geant4 testing.