Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-20 08:28:44

0001 #!/bin/bash
0002 source strict-mode.sh
0003 
0004 source benchmarks/Exclusive-Diffraction-Tagging/options.sh
0005 
0006 function print_the_help {
0007   echo "USAGE: ${0} [--sim] [--rec] [--analysis] [--all]"
0008   print_step_options_help
0009   exit
0010 }
0011 
0012 parse_step_options "$@"
0013 
0014 # assuming something like .local/bin/env.sh has already been sourced.
0015 
0016 FILE_NAME_TAG="dvcs"
0017 XROOTD_BASEURL="root://dtn-eic.jlab.org//volatile/eic/EPIC"
0018 INPUT_FILE="EVGEN/EXCLUSIVE/DVCS_ABCONV/10x100/DVCS.1.ab.hiDiv.10x100.hepmc3.tree.root"
0019 
0020 export JUGGLER_MC_FILE="${XROOTD_BASEURL}/${INPUT_FILE}"
0021 export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root"
0022 export JUGGLER_REC_FILE="${LOCAL_DATA_PATH}/rec_${FILE_NAME_TAG}.root"
0023 
0024 echo "FILE_NAME_TAG       = ${FILE_NAME_TAG}"
0025 echo "JUGGLER_N_EVENTS    = ${JUGGLER_N_EVENTS}"
0026 echo "DETECTOR    = ${DETECTOR}"
0027 
0028 
0029 ## To run the reconstruction, we need the following global variables:
0030 ## - DETECTOR:       the detector package we want to use for this benchmark
0031 ## - DETECTOR_PATH:          full path to the detector definitions
0032 
0033 ### Step 1. Run the simulation (geant4)
0034 if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then
0035   ## run geant4 simulations
0036   npsim --runType batch \
0037     --part.minimalKineticEnergy 1000*GeV  \
0038     --filter.tracker edep0 \
0039     -v ERROR \
0040     --numberOfEvents ${JUGGLER_N_EVENTS} \
0041     --compactFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml \
0042     --inputFiles "${JUGGLER_MC_FILE}" \
0043     --outputFile  ${JUGGLER_SIM_FILE}
0044   if [[ "$?" -ne "0" ]] ; then
0045     echo "ERROR running npsim"
0046     exit 1
0047   fi
0048 fi
0049 
0050 ### Step 2. Run the reconstruction (eicrecon)
0051 if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
0052   eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
0053   if [[ "$?" -ne "0" ]] ; then
0054     echo "ERROR running eicrecon"
0055     exit 1
0056   fi
0057   root_filesize=$(stat --format=%s "${JUGGLER_REC_FILE}")
0058   if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then 
0059     # file must be less than 10 MB to upload
0060     if [[ "${root_filesize}" -lt "10000000" ]] ; then 
0061       cp ${JUGGLER_REC_FILE} results/.
0062     fi
0063   fi
0064 fi
0065 
0066 ### Step 3. Run the analysis code
0067 if [[ -n "${DO_ANALYSIS}" || -n "${DO_ALL}" ]] ; then
0068   echo "Running analysis scripts"
0069   rootls -t  ${JUGGLER_REC_FILE}
0070 
0071   # Store all plots here (preferribly png and pdf files)
0072   mkdir -p results/dvcs
0073 
0074   # here you can add as many scripts as you want.
0075   root -b -q "benchmarks/Exclusive-Diffraction-Tagging/dvcs/analysis/dvcs_tests.cxx+(\"${JUGGLER_REC_FILE}\")"
0076   if [[ "$?" -ne "0" ]] ; then
0077     echo "ERROR running root script"
0078     exit 1
0079   fi
0080 fi
0081 
0082 
0083