From de0987369a69cbf49d262f317935309d819c1297 Mon Sep 17 00:00:00 2001 From: Whitney Armstrong <warmstrong@anl.gov> Date: Fri, 13 Nov 2020 15:51:04 -0600 Subject: [PATCH] Added error checking, updated ecal scripts --- ecal/emcal_electrons.sh | 6 +++--- ecal/emcal_pi0s.sh | 29 +++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ecal/emcal_electrons.sh b/ecal/emcal_electrons.sh index 9e387ae0..5a8b1823 100644 --- a/ecal/emcal_electrons.sh +++ b/ecal/emcal_electrons.sh @@ -101,7 +101,7 @@ fi #root -b -q "ecal/scripts/read_eng.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\", \"results/eng_${JUGGLER_FILE_NAME_TAG}.txt\")" #root -b -q "ecal/scripts/cal_eng_res.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\")" -#mkdir -p sim_output -#cp "${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}" sim_output/. -#cp "${JUGGLER_DETECTOR}/${JUGGLER_SIM_FILE}" sim_output/. +if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then +cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/. +fi diff --git a/ecal/emcal_pi0s.sh b/ecal/emcal_pi0s.sh index fee51297..e64b76a5 100644 --- a/ecal/emcal_pi0s.sh +++ b/ecal/emcal_pi0s.sh @@ -21,7 +21,15 @@ echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}" # Datasets #git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets root -b -q "ecal/scripts/emcal_pi0.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")" +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running analysis script" + exit 1 +fi root -b -q "ecal/scripts/emcal_pi0_reader.cxx(\"${JUGGLER_FILE_NAME_TAG}.hepmc\")" +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running analysis script" + exit 1 +fi # Detector TOPSiDE git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git @@ -51,9 +59,18 @@ npsim --runType batch \ --compactFile ${JUGGLER_DETECTOR}.xml \ --inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \ --outputFile ${JUGGLER_SIM_FILE} -# Need to figure out how to pass file name to juggler from the commandline +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running npdet" + exit 1 +fi +# Need to figure out how to pass file name to juggler from the commandline xenv -x /usr/local/Juggler.xenv gaudirun.py ../ecal/options/crystal_calorimeter_reco.py +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running juggler" + exit 1 +fi + ls -l popd @@ -62,8 +79,12 @@ ls -l pwd mkdir -p results root -b -q "ecal/scripts/makeplot_pi0.C(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")" +if [[ "$?" -ne "0" ]] ; then + echo "ERROR running analysis script" + exit 1 +fi -mkdir -p sim_output -cp "${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}" sim_output/. -cp "${JUGGLER_DETECTOR}/${JUGGLER_SIM_FILE}" sim_output/. +if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then +cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/. +fi -- GitLab