Skip to content
Snippets Groups Projects
Commit fd283781 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin
Browse files

add diffractive_vmp

parent 5bc48369
No related branches found
No related tags found
1 merge request!211add diffractive_vmp
......@@ -105,6 +105,7 @@ common:detector:
- runner_system_failure
include:
- local: 'benchmarks/diffractive_vm/config.yml'
- local: 'benchmarks/dis/config.yml'
#- local: 'benchmarks/dvmp/config.yml'
- local: 'benchmarks/dvcs/config.yml'
......@@ -116,6 +117,7 @@ include:
summary:
stage: finish
needs:
- "diffractive_vm:results"
- "dis:results"
- "dvcs:results"
- "tcs:results"
......
This diff is collapsed.
{
"name": "DIFFRACTIVE_VM",
"title": "Diffractive VM Benchmark",
"description": "Benchmark for diffractive vector meson prodcution physics",
"target": "0.8"
}
diffractive_vm:compile:
stage: compile
extends: .compile_benchmark
script:
- compile_analyses.py diffractive_vm
diffractive_vm:generate:
stage: generate
extends: .phy_benchmark
needs: ["common:detector", "diffractive_vm:compile"]
parallel:
matrix:
- VM: phi
- VM: jpsi
timeout: 1 hours
script:
# FIXME eAu beams
- bash benchmarks/diffractive_vm/get.sh --config diffractive_${VM} --leading ${VM} --ebeam 18 --pbeam 110
diffractive_vm:simulate:
stage: simulate
extends: .phy_benchmark
needs: ["diffractive_vm:generate"]
parallel:
matrix:
- VM: phi
- VM: jpsi
timeout: 96 hour
script:
# FIXME eAu beams
- bash benchmarks/diffractive_vm/diffractive_vm.sh --config diffractive_${VM} --leading ${VM} --ebeam 18 --pbeam 110
retry:
max: 2
when:
- runner_system_failure
diffractive_vm:results:
stage: collect
needs: ["diffractive_vm:simulate"]
script:
- collect_tests.py diffractive_vm
#!/bin/bash
source strict-mode.sh
## =============================================================================
## Run the Diffractive VMP benchmarks in 5 steps:
## 1. Parse the command line and setup environment
## 2. Detector simulation through ddsim
## 3. Digitization and reconstruction through Juggler
## 4. Root-based Physics analyses
## 5. Finalize
## =============================================================================
## make sure we launch this script from the project root directory
PROJECT_ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/../..
pushd ${PROJECT_ROOT}
echo "Running the Diffractive VMP benchmarks"
## =============================================================================
## Step 1: Setup the environment variables
##
## First parse the command line flags.
## This sets the following environment variables:
## - CONFIG: The specific generator configuration
## - EBEAM: The electron beam energy
## - PBEAM: The ion beam energy
## - LEADING: Leading particle of interest (J/psi)
export REQUIRE_LEADING=1
source parse_cmd.sh $@
## We also need the following benchmark-specific variables:
##
## - BENCHMARK_TAG: Unique identified for this benchmark process.
## - BEAM_TAG: Identifier for the chosen beam configuration
## - INPUT_PATH: Path for generator-level input to the benchmarks
## - TMP_PATH: Path for temporary data (not exported as artifacts)
## - RESULTS_PATH: Path for benchmark output figures and files
##
## You can read dvmp/env.sh for more in-depth explanations of the variables.
source benchmarks/diffractive_vm/env.sh
## Get a unique file names based on the configuration options
GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${LEADING}_${JUGGLER_N_EVENTS}.hepmc
SIM_FILE=${TMP_PATH}/sim-${CONFIG}.edm4hep.root
SIM_LOG=${TMP_PATH}/sim-${CONFIG}.log
REC_FILE=${TMP_PATH}/rec-${CONFIG}.root
REC_LOG=${TMP_PATH}/sim-${CONFIG}.log
PLOT_TAG=${CONFIG}
## =============================================================================
## Step 2: Run the simulation
echo "Running Geant4 simulation"
ls -lrth
ls -lrth input
echo ${TMP_PATH}
ls -lrth ${TMP_PATH}
ddsim --runType batch \
--part.minimalKineticEnergy 100*GeV \
--filter.tracker edep0 \
-v WARNING \
--numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml \
--inputFiles ${GEN_FILE} \
--outputFile ${SIM_FILE}
if [ "$?" -ne "0" ] ; then
echo "ERROR running ddsim"
exit 1
fi
## =============================================================================
## Step 3: Run digitization & reconstruction
echo "Running the digitization and reconstruction"
## FIXME Need to figure out how to pass file name to juggler from the commandline
## the tracker_reconstruction.py options file uses the following environment
## variables:
## - JUGGLER_SIM_FILE: input detector simulation
## - JUGGLER_REC_FILE: output reconstructed data
## - JUGGLER_N_EVENTS: number of events to process (part of global environment)
## - DETECTOR: detector package (part of global environment)
export JUGGLER_SIM_FILE=${SIM_FILE}
export JUGGLER_REC_FILE=${REC_FILE}
if [ ${RECO} == "eicrecon" ] ; then
eicrecon ${JUGGLER_SIM_FILE} -Ppodio:output_file=${JUGGLER_REC_FILE}
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running eicrecon"
exit 1
fi
fi
if [[ ${RECO} == "juggler" ]] ; then
gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler"
exit 1
fi
fi
## =============================================================================
## Step 4: Analysis
## write a temporary configuration file for the analysis script
CONFIG="${TMP_PATH}/${PLOT_TAG}.json"
cat << EOF > ${CONFIG}
{
"rec_file": "${REC_FILE}",
"vm_name": "${LEADING}",
"detector": "${DETECTOR_CONFIG}",
"ebeam": ${EBEAM},
"pbeam": ${PBEAM},
"output_prefix": "${RESULTS_PATH}/${PLOT_TAG}",
"test_tag": "${LEADING}_${BEAM_TAG}"
}
EOF
#cat ${CONFIG}
## run the analysis script with this configuration
root -b -q "benchmarks/diffractive_vm/analysis/diffractive_vm.cxx+(\"${CONFIG}\")"
if [ "$?" -ne "0" ] ; then
echo "ERROR running vm_mass script"
exit 1
fi
## =============================================================================
## Step 5: finalize
echo "Finalizing Diffractive VMP benchmark"
## Copy over reconstruction artifacts as long as we don't have
## too many events
if [ "${JUGGLER_N_EVENTS}" -lt "500" ] ; then
cp ${REC_FILE} ${RESULTS_PATH}
fi
## cleanup output files
#rm -f ${REC_FILE} ${SIM_FILE} ## --> not needed for CI
## =============================================================================
## All done!
echo "Diffractive VMP benchmarks complete"
#!/bin/bash
source strict-mode.sh
## =============================================================================
## Local configuration variables for this particular benchmark
## It defines the following additional variables:
##
## - BENCHMARK_TAG: Tag to identify this particular benchmark
## - BEAM_TAG Tag to identify the beam configuration
## - INPUT_PATH: Path for generator-level input to the benchmarks
## - TMP_PATH: Path for temporary data (not exported as artifacts)
## - RESULTS_PATH: Path for benchmark output figures and files
##
## This script assumes that EBEAM and PBEAM are set as part of the
## calling script (usually as command line argument).
##
## =============================================================================
## Tag for the local benchmark. Should be the same as the directory name for
## this particular benchmark set (for clarity).
## This tag is used for the output artifacts directory (results/${JUGGLER_TAG})
## and a tag in some of the output files.
export BENCHMARK_TAG="diffractive_vm"
echo "Setting up the local environment for the ${BENCHMARK_TAG^^} benchmarks"
## Extra beam tag to identify the desired beam configuration
export BEAM_TAG="${EBEAM}on${PBEAM}"
if [[ ! -d "input" ]] ; then
echo " making local link to input "
mkdir_local_data_link input
fi
## Data path for input data (generator-level hepmc file)
INPUT_PATH="input/${BENCHMARK_TAG}/${BEAM_TAG}"
#export INPUT_PATH=`realpath ${INPUT_PATH}`
mkdir -p ${INPUT_PATH}
echo "INPUT_PATH: ${INPUT_PATH}"
## Data path for temporary data (not exported as artifacts)
TMP_PATH=${LOCAL_DATA_PATH}/tmp/${BEAM_TAG}
#export TMP_PATH=`realpath ${TMP_PATH}`
mkdir -p ${TMP_PATH}
echo "TMP_PATH: ${TMP_PATH}"
## Data path for benchmark output (plots and reconstructed files
## if not too big).
RESULTS_PATH="results/${BENCHMARK_TAG}/${BEAM_TAG}"
mkdir -p ${RESULTS_PATH}
export RESULTS_PATH=`realpath ${RESULTS_PATH}`
echo "RESULTS_PATH: ${RESULTS_PATH}"
## =============================================================================
## That's all!
echo "Local environment setup complete."
#!/bin/bash
source strict-mode.sh
## =============================================================================
## Standin for a proper pythia generation process, similar to how we
## generate events for DVMP
## Runs in 5 steps:
## 1. Parse the command line and setup the environment
## 2. Check if we can download the file
## 3. Finalize
## =============================================================================
## =============================================================================
## make sure we launch this script from the project root directory
PROJECT_ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/../..
pushd ${PROJECT_ROOT}
## =============================================================================
## Step 1: Setup the environment variables
## First parse the command line flags.
## This sets the following environment variables:
## - CONFIG: The specific generator configuration --> not currenlty used FIXME
## - EBEAM: The electron beam energy --> not currently used FIXME
## - PBEAM: The ion beam energy --> not currently used FIXME
export REQUIRE_LEADING=1
source parse_cmd.sh $@
## To run the generator, we need the following global variables:
##
## - LOCAL_PREFIX: Place to cache local packages and data
## - JUGGLER_N_EVENTS: Number of events to process
## - JUGGLER_RNG_SEED: Random seed for event generation.
##
## defined in common_bench repo
## You can ready bin/env.sh for more in-depth explanations of the variables
## and how they can be controlled.
## We also need the following benchmark-specific variables:
##
## - BENCHMARK_TAG: Unique identified for this benchmark process.
## - INPUT_PATH: Path for generator-level input to the benchmarks
## - TMP_PATH: Path for temporary data (not exported as artifacts)
##
## You can read dvmp/env.sh for more in-depth explanations of the variables.
source benchmarks/diffractive_vm/env.sh
## Get a unique file name prefix based on the configuration options
GEN_TAG=gen-${CONFIG}_${LEADING}_${JUGGLER_N_EVENTS} ## Generic file prefix
## =============================================================================
## Step 2: Check if we can find the file
if [ -f "${INPUT_PATH}/${GEN_TAG}.hepmc" ]; then
echo "Found cached generator output for $GEN_TAG, no need to rerun"
exit 0
fi
## =============================================================================
## Step 3: Copy the file
events_per_file=100
nfiles=$(( (${JUGGLER_N_EVENTS} + ${events_per_file} - 1) / ${events_per_file} ))
for ix in $(seq -f "%03g" 0 10); do
DATA_URL=S3/eictest/EPIC/EVGEN/EXCLUSIVE/DIFFRACTIVE_${LEADING^^}_ABCONV/Sartre/Coherent/sartre_bnonsat_Au_${LEADING}_ab_eAu_1_${ix}.hepmc.gz
mc config host add S3 https://dtn01.sdcc.bnl.gov:9000 ${S3_ACCESS_KEY} ${S3_SECRET_KEY}
mc cp ${DATA_URL} ${TMP_PATH}/${GEN_TAG}.hepmc.gz
if [[ "$?" -ne "0" ]] ; then
echo "ERROR downloading file"
exit 1
fi
gunzip -c ${TMP_PATH}/${GEN_TAG}.hepmc.gz >> ${TMP_PATH}/${GEN_TAG}.hepmc
done
## =============================================================================
## Step 4: Finally, move relevant output into the artifacts directory and clean up
## =============================================================================
echo "Moving generator output to ${INPUT_PATH}/${GEN_TAG}.hepmc"
mv ${TMP_PATH}/${GEN_TAG}.hepmc ${INPUT_PATH}/${GEN_TAG}.hepmc
## this step only matters for local execution
echo "Cleaning up"
## does nothing
## =============================================================================
## All done!
echo "$BENCHMARK_TAG event generation complete"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment