Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/extended/analysis/AnaEx01/README is written in an unsupported language. File is not indexed.

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