Warning, /DEMPgen/README.md is written in an unsupported language. File is not indexed.
0001 # DEMPgen
0002
0003 Event generator for Deep Exclusive Meson Production.
0004
0005 ## Building
0006
0007 - To build the event generator, the compiler needs acces to both a compiled installation of CERN ROOT and its source code. ROOT version 6.08.06 or later is supported, and must be installed with the MathMore package enabled. Be sure not to change the location of either the ROOT source or compiled files after installation, as this will interfere with ROOT's built in CMake configurators.
0008
0009 - CMake is also required. CMake 2.8 is the minimum supported version, and CMake 3 has been tested as well.
0010
0011 - Before attempting to build, run the setup script -
0012 - source setup.sh
0013 - OR
0014 - source setup.csh
0015
0016 Depending upon shell.
0017
0018 - Next, create a build directory and cd to it. Take note of the location of the source directory (where CMakeLists.txt should be stored) and run the commands:
0019
0020 - mdkir build
0021 - cd build
0022 - cmake ..
0023 - make -j8
0024
0025 - As a one liner -
0026 - mkdir build && cd build && cmake ../ && make -j8
0027
0028 - The event generator can now be run using the following command from the main (root) directory.
0029
0030 - ./build/DEMPgen Config.json
0031 - Data will be saved under data/OutputFiles/
0032 - As long as the path to the generator and config file are correct, DEMPgen should be executable from anywhere
0033
0034 ### Building on the JLab iFarm
0035
0036 - Building on the JLab iFarm requires you to set up some software versions beforehand, to build successfully, I did the following -
0037 - Comment out any CUE or other initialisation in your .login/.cshrc scripts
0038 - Login to an ifarm node
0039 - module use /cvmfs/oasis.opensciencegrid.org/jlab/scicomp/sw/el9/modulefiles
0040 - module load root/6.30.06-gcc11.4.0
0041 - module load cmake/3.19.4
0042
0043 - Following this, build DEMGen using the one liner above without any issues, you will need to load these modules when running the generator subsequently (this is done by default in the farm job scripts)
0044
0045 ## File/Directory Structure
0046
0047 The files within the top level directory and the directory structure of the generator are outlined below. Note that files within subdirectories are not outlined in full. Please refer to comments within each source/header files and README files within subdirectories (where applicable) for details on individual files within subdirectories.
0048
0049 ### Top Level Directory Files
0050
0051 - [Batch_Submission_EIC.sh](Batch_Submission_EIC.sh) - Shell script to generate and submit EIC event generation jobs to a local batch queueing system. See file comments and description below for details on usage.
0052 - [JLab_Batch_Submission.sh](JLab_Batch_Submission.sh) - Shell script to generate and submit EIC event generation jobs to the JLab farm batch queueing system. See file comments and description below for details on usage.
0053 - [Process_EIC.csh](Process_EIC.csh) - .csh script that creates a `.json` config file based upon inputs and runs DEMPgen with produced configuration file. See file comments and description below for details on usage.
0054 - [Process_EIC_iFarm.csh](Process_EIC_iFarm.csh) - .csh script that creates a `.json` config file based upon inputs and runs DEMPgen with produced configuration file. This version is configured for use on the JLab iFarm system. See file comments and description below for details on usage.
0055 - [Config_EIC.json](Config_EIC.json) - An example `.json` config file for EIC event generation. Used by shell scripts below. See comments within file for details on flags.
0056 - [Config_SoLID.json](Config_SoLID.json) - An example `.json` config file for SoLID event generation. See comments within file for details on flags.
0057 - [CMakeLists.txt](CMakeLists.txt)- CMakeLists.txt file.
0058 - [LICENSE](LICENSE) - Copyright and license information.
0059 - [EvGenFlowChart.xml](EvGenFlowChart.xml) - Event generation flow chart.
0060 - [Test_EIC.json](Test_EIC.json) - `.json` file with all configuration options to gereate a test EIC event sample. See `reference_README.md` within the `reference_output` directory for details.
0061 - [README.md](README.md) - The README file.
0062
0063 ### Directory Structure
0064
0065 - [data/](data/) - Stores output files from DEMPgen.
0066 - [data/input/](data/input) - Contains input cross-section files.
0067 - [debug/](debug) - Contains debug files for the SoLID module.
0068 - [include/](include) - Contains header files for the SoLID module and the following subdirectory:
0069 - [json/](include/json/) - Contains `.json` files associated with the header files for the SoLID module.
0070 - [src/](src/) - Contains source files for DEMPgen and the following subdirectories:
0071 - [eic_evgen/](src/eic_evgen/) - Contains source files, header files, and pion cross-section parameterization files for the EIC module. Also contains the following subdirectories:
0072 - [CrossSection_Params/](src/eic_evgen/CrossSection_Params/) - Contains kaon cross-section parameterization files for the EIC module.
0073 - [process_routine/](src/eic_evgen/process_routine/) - Contains the main DEMPgen processing routine.
0074 - [Dec2023_ePIC_Simulation_Campaign/](Dec2023_ePIC_Simulation_Campaign/) - Contain information about the files submitted to the ePIC simulation campaign in December 2023 respectively, see documentation within directory for more details.
0075 - [Jul2024_ePIC_Simulation_Campaign/](Jul2024_ePIC_Simulation_Campaign/) - Contain information about the files submitted to the ePIC simulation campaign in July 2024, see documentation within directory for more details.
0076 - [reference_output/](reference_output/) - Contains test sample files and the instructions on how to reproduce them, as detailed in the `reference_README.md` file within this directory.
0077
0078 ### Instructions for Comprehensive Test Run
0079
0080 Instructions for a comprehensive test run, and a reference file to compare to (using for example, diff) are included in -
0081
0082 - [reference_output/reference_README.md](reference_output/reference_README.md)
0083
0084 ## Configuration
0085
0086 The file Config_EIC.json and Config_SoLID.json contain all the configuration options for EIC and SoLID event generation respectively. Use these as a template for other configuration files, which may be given as an argument to the event generator.
0087 - Note that Config_EIC.json is used in shell scripts (see below) that run large numbers of jobs on batch queueing systems. *Do not* modify this file unless you know what you're doing with it or you really need to edit something.
0088 - Copying the template to a new file and editing that is strongly recommended in all cases.
0089
0090
0091 ### Ejectile calculation methods
0092
0093 - The EIC module of DEMPgen has two different calculation methods that may be used to calculate the ejectile properties.
0094 - These are referred to as the "Analytical" and "Solve" methods. Either can be used in a simulation run, just change the config file to switch between them.
0095 - In your config .json file, select between the two versions using the "calc_method" argument, this can be set to Analytical or Solve, e.g.
0096 - "calc_method": "Analytical"
0097 - OR
0098 - "calc_method": "Solve"
0099 - If the method is not entered exactly as above, it will not be recognised and the generator will default to the analytical method.
0100
0101 - If you are using the shell scripts provided to run a lot of simulations, modify Config_EIC.json BEFORE running the shell scripts.
0102
0103 ## Output
0104
0105 The event data is output to the configured file location relative to the build directory. The TTree in this file contains all kinematic data for all particles in the laboratory rest frame. Variables with the prefix "Vert" represent values read at the interaction vertex. Values with the prefix "Lab" represent values read after all correcting effects (multiple scattering, ionization, etc.) have been applied.
0106
0107 ## Sources and Classes
0108
0109 ### Particle Class
0110
0111 The Particle class inherits from the root TLorentzVector class so that its functions are immediately accessible through the Particle objects. It's member variables include its mass, charge, and its GEMC compatible id.
0112
0113 ### DEMPEvent Class
0114
0115 The Event class contains all particles of a single event, in one frame of reference. It includes methods enabling transformation to other frames of reference and coordinate systems.
0116
0117 ### Asymmetry Class
0118
0119 The Asymmetry class calculates asymmetry amplitudes based on Monte-Carlo data by Goloskokov and Kroll. The asymmetry objects are persistent between events.
0120
0121 ### Customrand Class
0122
0123 A class to hold various distribution functions for randomly generated variables, such as scattered electron energy. These functions should be persistent between events, and will provide fast random numbers.
0124
0125 ### ScatteredParticleGen
0126
0127 Stores the kinematic ranges for the scattered electron and generates them with random energy and direction within the range, using sphere point picking.
0128
0129 ### TargetGen
0130
0131 Generates the target neutron with Fermi momentum (when enabled) and proton for FSI (when enabled, may also have Fermi momentum).
0132
0133 ### ProductGen
0134
0135 This class reads in the kinematic variables for the incident, target, and scattered particles and uses conservation laws to solve for the remaining two particles. The pion is first given a random direction. A fast root finding algorithm then calculates the pion's momentum magnitude, which is then used to find the proton's momentum. Pion direction may also be passed as an argument for debugging purposes.
0136
0137 ### SigmaCalc
0138
0139 This class returns the cross sections and weights for the event. It acts as an interface between the current version of the event generator and header files from the old event generator (seen under branch "original"), which contain the parameterization of the cross sections.
0140
0141 ### TreeBuilder
0142
0143 Manages the ROOT TTree object to be stored in the output .root file. Contains methods to easily add all kinematics data stored in a particle or DEMPEvent object.
0144
0145 ### Matter Effects
0146
0147 Transforms particle kinematics based on three effects caused by transition through matter: Ionization, Bremsstrahlung, and Multiple Scattering.
0148
0149 ### FSI
0150
0151 Computes the effect of final state interaction between the produced pion and one of the two protons of the target nucleus. The momentum of the outgoing pion and recoiled proton, as well as the cross section of the interaction is calculated based on elastic pion-nucleon scattering.
0152
0153 ### JsonCpp
0154
0155 This project uses [JsonCpp](https://github.com/open-source-parsers/jsoncpp "JsonCpp Github") to read in configuration options. The amalgamated sources for JsonCpp are redistributed with this project in compliance with the MIT license.
0156
0157 ## Processing Scripts and json examples
0158
0159 - There are several shell scripts in the main directory that can be used to run the generator and produce some output, information on these scripts is provided below.
0160 - To remove clutter from the main directory, example .json scripts were moved to a new folder -
0161 - json_examples
0162 - Remember to set the ejectile calculation method in the Config_EIC.json file *before* running these scripts if you do not want to use the default analytical method.
0163
0164 ### Process_EIC.csh
0165
0166 !!! NOTICE !!!
0167 This script copies Config_EIC.json and formats a new file based upon this, DO NOT MODIFY Config_EIC.json (other than the calculation method) if you want to use this script!
0168 !!! NOTICE !!!
0169
0170 - To facilitate the submission of batch jobs, I created a csh script to automatically construct .json config files and run them. This script can also be utilised to run the generator manually, without the need to go and edit a json file.
0171 - The script requires 8 arguments (which is a lot, I know), but in the K+ case, it expects 9. They are as follows -
0172
0173 - Arg 1 - FileNum -> For batch running, we typically run X files of Y events, this argument is just X, if you're running manually as a test, just input 1 or whatever you fancy.
0174 - Arg 2 - NumEvents -> The number of events thrown for this file, set this to whatever you want to run. For reference, with the Pi+/K+ generator, 1B files takes ~1 hour.
0175 - Arg 3 - EBeamE -> The electron beam energy, set this to whatever you want, typically, we use 5, 10 or 18 (the nominal max for the EIC).
0176 - Arg 4 - HBeamE -> The hadron beam energy, again, set this to whatevr you want. Typically we use 41, 100 or 275 (41 and 275 being the nominal min/max).
0177 - Arg 5 - RandomSeed -> The random seed, self explanatory. Set this however you like, the batch submission job randomly generates a random seed to feed in here.
0178 - Arg 6 - OutputType -> The format of the output file, select from LUND, Pythia6 (for ECCE/Fun4All) or HEPMC3 (for ePIC), the default is HEPMC3 if your choice is invalid.
0179 - Arg 7 - InteractionPoint -> The interaction point, choose from ip6 or ip8. The default is ip6 if your choice is invalid.
0180 - Arg 8 - Ejectile -> The produced ejectile (meson) in the reaction, choose from omega, pi+, pi0 or K+.
0181 - Arg 9 - RecoilHadron -> OPTIONAL - This only matters if you select K+ as the ejectile, in this case, choose from Lambda or Sigma0 here. If your choice is invalid (or you don't specify arg9), the default is Lambda.
0182
0183 - So as an example if you executed the following -
0184
0185 - ./Process_EIC.csh 1 100000 18 275 24432 HEPMC3 ip6 K+ Lambda
0186
0187 - You would run the generator for 18 GeV e- on 275 protons for ip6, throwing 100000 events with the K+/Lambda generator.
0188
0189 ### Batch_Submission_EIC.sh
0190
0191 - This script creates and submits batch jobs. It is designed for use with the torque queueing system on Lark at the University of Regina.
0192 The jobs the script creates and submits all execute the Process_EIC.csh script described above. This script requries a very similar set of arguments -
0193
0194 - Arg 1 - NumFiles -> The batch script is designed to run X jobs of Y events, this number is just X, the number of files you want to run.
0195 - Arg 2 - NumEvents -> The number of events thrown for this file, set this to whatever you want to run. For reference, with the Pi+/K+ generator, 1B files takes ~1 hour.
0196 - Arg 3 - EBeamE -> The electron beam energy, set this to whatever you want, typically, we use 5, 10 or 18 (the nominal max for the EIC).
0197 - Arg 4 - HBeamE -> The hadron beam energy, again, set this to whatevr you want. Typically we use 41, 100 or 275 (41 and 275 being the nominal min/max).
0198 - Arg 5 - OutputType -> The format of the output file, select from LUND, Pythia6 (for ECCE/Fun4All) or HEPMC3 (for ePIC), the default is HEPMC3 if your choice is invalid.
0199 - Arg 6 - InteractionPoint -> The interaction point, choose from ip6 or ip8. The default is ip6 if your choice is invalif.
0200 - Arg 7 - Ejectile -> The produced ejectile (meson) in the reaction, choose from omega, pi+, pi0 or K+.
0201 - Arg 8 - RecoilHadron -> OPTIONAL - This only matters if you select K+ as the ejectile, in this case, choose from Lambda or Sigma0 here. If your choice is invalid (or you don't specify arg9), the default is Lambda.
0202
0203 - The script automatically generates a random seed itself using the /dev/urandom function.
0204
0205 ### Process_EIC_iFarm.csh
0206
0207 - This version is for use on the JLab iFarm/Farm.
0208 - This script uses the same arguments as Process_EIC.csh.
0209 - If you are processing interactively (i.e. on the iFarm), you will need to make sure that you have executed -
0210 - module use /group/halla/modulefiles
0211 - module load root
0212 - You should also check the path set at the top looks OK.
0213 - By default, /eic/users/${USER}/DEMPgen is assumed.
0214
0215 ### JLab_Batch_Submission.sh
0216
0217 - This version should be used to submit jobs to the Farm batch queueing system (swif2).
0218 - It uses the same arguments as Batch_Submission_EIC.sh.
0219 - You should also check the paths set throughout the script look ok (for example, in the COMMAND: ... line).
0220 - By default, /eic/users/${USER}/DEMPgen is assumed.
0221
0222 ## Acknowledgments
0223
0224 ## License
0225 DEMPgen is licensed under the GNU General Public License v3.0.