From c677c6523b4bfdd840c3b9915d5168a6f3bdd5e8 Mon Sep 17 00:00:00 2001
From: "jihee.kim" <jihee.kim@anl.gov>
Date: Mon, 5 Apr 2021 14:30:37 -0500
Subject: [PATCH] Added running geant4 simulation and juggler

---
 calorimeters/run_emcal_barrel_pions.sh | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/calorimeters/run_emcal_barrel_pions.sh b/calorimeters/run_emcal_barrel_pions.sh
index fd399640..8ce7ee4a 100755
--- a/calorimeters/run_emcal_barrel_pions.sh
+++ b/calorimeters/run_emcal_barrel_pions.sh
@@ -42,6 +42,31 @@ if [[ "$?" -ne "0" ]] ; then
   exit 1
 fi
 
+# Run geant4 simulations
+npsim --runType batch \
+      -v WARNING \
+      --part.minimalKineticEnergy 0.5*GeV  \
+      --numberOfEvents ${JUGGLER_N_EVENTS} \
+      --compactFile topside/${JUGGLER_DETECTOR}.xml \
+      --inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
+      --outputFile sim_output/${JUGGLER_SIM_FILE}
+
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running npdet"
+  exit 1
+fi
+
+# Run Juggler
+xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
+        gaudirun.py calorimeters/options/emcal_barrel_reco.py
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running juggler"
+  exit 1
+fi
+
 # Directory for plots
 mkdir -p results
 
+# Move ROOT output file
+mv ${JUGGLER_REC_FILE} sim_output/
+
-- 
GitLab