Back to home page

EIC code displayed by LXR

 
 

    


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

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