Back to home page

EIC code displayed by LXR

 
 

    


Warning, /east/docs/_content/manual.md is written in an unsupported language. File is not indexed.

0001 ---
0002 title: "User Manual"
0003 layout: base
0004 name: manual
0005 ---
0006 
0007 <h1>Running eAST</h1>
0008 
0009 ---
0010 
0011 * TOC
0012 {:toc}
0013 
0014 ---
0015 
0016 
0017 ## Setting up the environment
0018 
0019 * Source the Geant4  [post-installation script](https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/postinstall.html){:target="_blank"}.
0020 * Add the location of the _HepMC3_ libraries to the environment variable `LD_LIBRARY_PATH`
0021 * For convenience, add the location of the `eAST` executable to the `PATH` variable
0022 
0023 Example (bash):
0024 
0025 ```bash
0026 # Note that the actual location of Geant4, eAST and HepMC3 will vary, depending on how you install
0027 source /opt/geant4/bin/geant4.sh
0028 export LD_LIBRARY_PATH=/opt/hepmc3/lib:$LD_LIBRARY_PATH
0029 export PATH=/opt/east/bin/:$PATH
0030 ```
0031 
0032 When using WSL2 and requiring graphics capability in Geant4, the following setting
0033 helps to get the graphcis working correctly:
0034 ```bash
0035 export LIBGL_ALWAYS_INDIRECT=
0036 ```
0037 
0038 ## Starting eAST
0039 
0040 *eAST* runs both in batch mode and interactive mode. To run it in batch mode, execute the application with a macro file,
0041 ```bash
0042 $ eAST <run.mac>
0043 ```
0044 while to run it in interactive mode, execute the application without a macro file.
0045 
0046 ```bash
0047 $ eAST
0048 ```
0049 
0050 and type UI commands once command field of the Qt window becomes available.
0051 
0052 *eAST* reads several GDML files. GDML requires GDML schema. All methods that read gdml have an option to verify that is by default turned off since validation requires an internet connection at run-time.
0053 <!--By default, schema file is downloaded while reading a GDML file from [CERN site](http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd) so that you must execute *eAST* while you are connected online.  
0054 Alternatively, you may download the schema file in advance and modify the second line of each GDML file accordingly. Please refer to [the GDML manual](http://gdml.web.cern.ch/GDML/). -->
0055 
0056 ---
0057 
0058 ## eAST UI commands
0059 
0060 *eAST* is controlled by UI commands, and it works both in interactive mode with Qt window and in batch mode with an input macro file.
0061 UI commands starting with `/eAST/` are implemented in *eAST* code and thus they are not available in Geant4 itself (or other Geant4 applications). Some of these *eAST*-specific commands are listed here.
0062 Commands that do not start with `/eAST/` are provided in Geant4 version 10.7 that can be found in [the Geant4 user's guide](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Control/commands.html){:target="_blank"}.
0063 For demonstration purposes, *eAST* includes a macro file `run.mac` that can be used for both interactive mode and batch mode.
0064 
0065 ---
0066 
0067 ## Initialization
0068 
0069 *eAST* has to be initialized by the command: `/eAST/initialize`.
0070 This command internally calls `/run/initialize` to initialize _G4(MT)RunManager_, so the user should **not** explicitly call `/run/initialize`.
0071 Prior to initialization *eAST* needs the following to be defined (as detailed in the following subsections):
0072 - Simulation geometry
0073 - Choice of Physics models
0074 
0075 Other simulation settings, e.g. primary generator settings as well as scoring and histogramming should be defined after *eAST* is initialized.
0076 
0077 ### Simulation geometry
0078 
0079 Prior to the initialization, each detector component has to be activated by its dedicated UI command. Once a component is activated, its specific commands become available.
0080 Please refer to the README file associated with each detector component for its specific UI commands.
0081 
0082 As an example, following are the UI commands for the beampipe component.
0083 
0084 ```bash
0085 # activating "beampipe"
0086 /eAST/component/beampipe <verboseLevel>
0087 # specifying input GDML files
0088 /eAST/component/beampipe/envelopeGdmlFile <envelopeGdmlFile>
0089 /eAST/component/beampipe/gdmlFile <gdmlFile>
0090 # specifying input material definition file
0091 /eAST/component/beampipe/materialFile <materialDefinitionFile>
0092 ```
0093 
0094 Important: You can use paths relative to the installation location, for example:
0095 
0096 ```bash
0097 # activating "DIRC_support"
0098 /eAST/component/DIRC_support 1
0099 # specifying input GDML files
0100 /eAST/component/DIRC_support/gdmlFile Components/Beampipe/data/DIRC_support_06-04-21.gdml
0101 ```
0102 
0103 will be expanded to
0104 
0105 ```bash
0106 /path/to/installdir/share/Components/Beampipe/data/DIRC_support_06-04-21.gdml
0107 ```
0108 
0109 if the file or folder is not found in the working directory first.
0110 
0111 ### Physics options
0112 
0113 Prior to the initialization, optional physics processes have to be defined.
0114 
0115 To add radioactive decay process
0116 
0117 ```
0118 /eAST/physics/addRDM  
0119 ```
0120 
0121 To add optical photon processes
0122 ```
0123 /eAST/physics/addOptical
0124 ```
0125 In addition to this command, optical properties of the materials and surfaces have to be defined to the volumes where optical photons should be tracked.
0126 
0127 To add a user-specific step limitation process
0128 ```
0129 /eAST/physics/addStepLimit <particle>
0130 ```
0131 where _particle_ could be "_charges_" (default), "_neutral_", "_all_" or "_e+/-_". In addition to this command, maximum step lenth(s) have to be defined after initialization (see the following section).
0132 
0133 ---
0134 
0135 ## UI commands available after initialization
0136 
0137 ### Production cuts and artificial step limits
0138 
0139 Production thresholds (a.k.a. cuts) for electron, positron, gamma and proton are by default set to 7 mm. They can be changed by :
0140 ```
0141 /eAST/physics/cuts/setCuts <length> <unit>
0142 ```
0143 To define a specific value for a region :
0144 ```
0145 /eAST/physics/cuts/setRegionCuts <regionName> <length> <unit>
0146 ```
0147 In general, a step of a track is limited either by a volume boundary crossing or discrete physics interaction (e.g. decay, inelastic scattering, etc.).
0148 Artificial limitation of the maximum step length applied to a specified particle type may be defined. Maximum step length could be assigned to a region. Artificial step limitation is useful for particles generating optical photons.
0149 ```
0150 /eAST/physics/limit/regionStepLimit <regionName> <length> <unit>
0151 ```
0152 
0153 ### Geometry sanity-check commands
0154 
0155 To display defined solid, logical volumes, physical volumes and regions :
0156 ```
0157 /eAST/geometry/listSolids <verboseLevel>
0158 /eAST/geometry/listLogicalVolumes <verboseLevel>
0159 /eAST/geometry/listPhysicalVolumes <verboseLevel>
0160 /eAST/geometry/listRegions <verboseLevel>
0161 ```
0162 
0163 To check volume overlap for a physical volume :
0164 ```
0165 /eAST/geometry/checkOverlap <physVolName> <nSpots> <maxError> <tolerance> <unit>
0166 ```
0167 
0168 ---
0169 
0170 ## UI commands for histogramming particle flux
0171 
0172 While *eAST* relies upon sensitive detector classes of each (sensitive) detector components for creation of outfut "hit" files, it also has a mechanism of measuring particle flux and creating histogram. This measuring and histogramming functionality uses "probe" functionality of Geant4 that is newly introduced with Geant4 version 10.7.
0173 
0174 ### Defining probe
0175 
0176 Please note that this section descrives a Geant4 functionality that is not specific to *eAST*. This functionality is newly introduced with Geant4 version 10.7.
0177 
0178 This functionality allows the user to locate scoring “probes” at arbitrary locations. A “probe” is a virtual cube, to which any Geant4 primitive scorers could be assigned. This is a concept alternative to a scoring mesh, where cells of three-dimensional mesh are touching each other.
0179 ```
0180 /score/create/probe <probeName> <halfWidth> <unit>
0181 ```
0182 
0183 The user can locate an arbitrary number of probes by repeating /score/probe/locate commands, but all of these probes are the same shape. Given these probes are located in an artificial “parallel world”, probes may overlap to the volumes defined in the mass geometry, as long as probes themselves are not overlapping to each other or protruding from the world volume.
0184 ```
0185 /score/probe/locate <x> <y> <z> <unit>
0186 ```
0187 
0188 Once a probe is defined, the user can associate arbitrary number of primitive scorers and filters like the ordinary scoring mesh. All probes have the same scorers but score individually. The following is a sample macro to locate 4 probes and score total flux and proton flux for each of these probes.
0189 ```
0190 /score/create/probe Probes 1 cm
0191 /score/probe/locate 0 0 0 cm
0192 /score/probe/locate 25 0 0 cm
0193 /score/probe/locate 0 25 0 cm
0194 /score/probe/locate 0 0 25 cm
0195 /score/quantity/flatSurfaceFlux volFlx
0196 /score/quantity/flatSurfaceFlux protonFlux
0197 /score/filter/particle protonFilter proton
0198 /score/close
0199 ```
0200 Please note that the size of the probe is specified by half width. In the above sample, the actual size of the probe is 2*2*2 cm^3.
0201 If probes are placed more than once, scores are dumped separately for each probe, with the order of the `/score/probe/locate` command.
0202 
0203 After a simulation run, scored data can be dumped into a file by usual Geant4 `/score/dump` commands. Also, histograms are created by `/eAST/analysis/` commands descrived in the following section.
0204 
0205 ### 1-D energy spectrum histogram directly filled by a primitive scorer
0206 
0207 The following UI command creates a 1-D energy spectrum histogram that is directly filled by the associated primitive scorer.
0208 ```
0209 /eAST/analysis/1D/spectrum <probeName> <scorerName>
0210 ```
0211 where, _probeName_ is the name of the probe defined by `/score/create/probe` command described in the previous sections.
0212 The x-axis of the histogram defined by this command is the kinetic energy of the track.
0213 If probe is located more than once, histograms are created and filled separately to each probe with their sequential order of `/score/probe/locate` command.
0214 `/eAST/analysis/1D/spectrum` command is available only for primitive scorers that score flux.
0215 
0216 `/eAST/analysis/1D/spectrum`command has to be immediately followed by `/eAST/analysis/1D/config` command to specify the histogram parameters.
0217 ```
0218 /eAST/analysis/1D/config <nBin> <minVal> <maxVal> <unit> <scale> <logVal>
0219 ```
0220 Details of each parameters should be consulted to onlne help. <scale>_is for the x-axis and it can be either “linear” or “log”. Binning of the histogram is determined by this parameter so that scale cannot be changed once configured. For the y-axis, linear-/log-scale can be chosen with the following command.
0221 ```
0222 /eAST/analysis/1D/yaxisLog <flag>
0223 ```
0224 Please note that the y-axis scale is used for plotting this histogram to a PostScript file and does not affect the dumped data.
0225 
0226 At the end of a run, each histogram is dumped to a separate file. File name should be specified by this command
0227 ```
0228 /eAST/analysis/file <fileName>
0229 ```
0230 but the actual file name will be appended by the histogram type and scorer name, and also by copy number of the probes.
0231 By default, *eAST* dumps histograms in CSV format. The file format of the histogram file is described in [the g4tools section of Geant4 Application Developers Guide](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Analysis/g4tools.html).
0232 If another format (Root or xml) is preferred, `eASTAnalysis.hh` has to be modified accordingly and *eAST* has to be recompiled.
0233 
0234 In addition to dumping to CSV files, histograms can be plotted to a PostScript file if `/eAST/analysis/plot` command is set. _fileName_ is also used for this PostScript file.