From f1758e62a72cba8293be906a7e391b48b5131db4 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Sat, 25 Dec 2021 23:45:34 +0000
Subject: [PATCH] Remove xenv references

---
 benchmarks/clustering/full_cal_clusters.sh           | 3 +--
 benchmarks/ecal/run_emcal_benchmarks.py              | 4 +---
 benchmarks/far_forward/far_forward_protons.sh        | 2 +-
 benchmarks/imaging_ecal/run_emcal_barrel.sh          | 3 +--
 benchmarks/imaging_ecal/run_emcal_barrel_pion_rej.sh | 3 +--
 benchmarks/imaging_ecal/run_imcal_pion0.sh           | 3 +--
 benchmarks/imaging_shower_ML/sim_rec_tag.py          | 2 --
 benchmarks/rich/forward_hadrons.sh                   | 3 +--
 benchmarks/track_finding/multiple_tracks.sh          | 2 +-
 benchmarks/track_fitting/single_tracks.sh            | 2 +-
 benchmarks/tracking/central_pions.sh                 | 2 +-
 11 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/benchmarks/clustering/full_cal_clusters.sh b/benchmarks/clustering/full_cal_clusters.sh
index ee6d64c6..30137359 100644
--- a/benchmarks/clustering/full_cal_clusters.sh
+++ b/benchmarks/clustering/full_cal_clusters.sh
@@ -120,8 +120,7 @@ mkdir -p results
 
 # Run Juggler
 FULL_CAL_OPTION_DIR=benchmarks/clustering/options
-xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
-    gaudirun.py ${FULL_CAL_OPTION_DIR}/full_cal_reco.py
+gaudirun.py ${FULL_CAL_OPTION_DIR}/full_cal_reco.py
 if [[ "$?" -ne "0" ]] ; then
   echo "ERROR running digitization (juggler)"
   exit 1
diff --git a/benchmarks/ecal/run_emcal_benchmarks.py b/benchmarks/ecal/run_emcal_benchmarks.py
index c70ca0be..f5ef2801 100755
--- a/benchmarks/ecal/run_emcal_benchmarks.py
+++ b/benchmarks/ecal/run_emcal_benchmarks.py
@@ -98,10 +98,8 @@ if 'rec' in procs:
     os.environ['JUGGLER_COMPACT_PATH'] = args.compact
     os.environ['JUGGLER_N_EVENTS'] = '{}'.format(args.nev)
 
-    juggler_xenv = os.path.join(os.environ.get('JUGGLER_INSTALL_PREFIX', '../local'), 'Juggler.xenv')
-
     for opt in opt_scripts:
-        rec_cmd = ['xenv', '-x', juggler_xenv, 'gaudirun.py', os.path.join(sdir, 'options', opt)]
+        rec_cmd = ['gaudirun.py', os.path.join(sdir, 'options', opt)]
         return_code = subprocess.run(rec_cmd).returncode
         if return_code is not None and return_code < 0:
             print('ERROR running juggler ({})!'.format(opt))
diff --git a/benchmarks/far_forward/far_forward_protons.sh b/benchmarks/far_forward/far_forward_protons.sh
index 44da60d2..f91eec96 100644
--- a/benchmarks/far_forward/far_forward_protons.sh
+++ b/benchmarks/far_forward/far_forward_protons.sh
@@ -96,7 +96,7 @@ rootls -t ${JUGGLER_SIM_FILE}
 if [[ -z "${ANALYSIS_ONLY}" ]] ;
 then
   # Need to figure out how to pass file name to juggler from the commandline
-  xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/far_forward/options/far_forward_reconstruction.py
+  gaudirun.py benchmarks/far_forward/options/far_forward_reconstruction.py
   if [[ "$?" -ne "0" ]] ; then
     echo "ERROR running juggler"
     exit 1
diff --git a/benchmarks/imaging_ecal/run_emcal_barrel.sh b/benchmarks/imaging_ecal/run_emcal_barrel.sh
index 843e0feb..d54844fb 100644
--- a/benchmarks/imaging_ecal/run_emcal_barrel.sh
+++ b/benchmarks/imaging_ecal/run_emcal_barrel.sh
@@ -105,8 +105,7 @@ mkdir -p results
 
 CB_EMCAL_OPTION_DIR=benchmarks/imaging_ecal/options
 # Run Juggler
-xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
-    gaudirun.py ${CB_EMCAL_OPTION_DIR}/hybrid_cluster.py
+gaudirun.py ${CB_EMCAL_OPTION_DIR}/hybrid_cluster.py
 # gaudirun.py ${CB_EMCAL_OPTION_DIR}/imaging_topocluster.py
 if [[ "$?" -ne "0" ]] ; then
   echo "ERROR running juggler"
diff --git a/benchmarks/imaging_ecal/run_emcal_barrel_pion_rej.sh b/benchmarks/imaging_ecal/run_emcal_barrel_pion_rej.sh
index c4adc401..a43aaede 100755
--- a/benchmarks/imaging_ecal/run_emcal_barrel_pion_rej.sh
+++ b/benchmarks/imaging_ecal/run_emcal_barrel_pion_rej.sh
@@ -106,8 +106,7 @@ mkdir -p results
 
 CB_EMCAL_OPTION_DIR=benchmarks/imaging_ecal/options
 # Run Juggler
-xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
-    gaudirun.py ${CB_EMCAL_OPTION_DIR}/hybrid_cluster.py
+gaudirun.py ${CB_EMCAL_OPTION_DIR}/hybrid_cluster.py
 # gaudirun.py ${CB_EMCAL_OPTION_DIR}/imaging_topocluster.py
 if [[ "$?" -ne "0" ]] ; then
   echo "ERROR running juggler"
diff --git a/benchmarks/imaging_ecal/run_imcal_pion0.sh b/benchmarks/imaging_ecal/run_imcal_pion0.sh
index cac64c8c..64cf9d07 100644
--- a/benchmarks/imaging_ecal/run_imcal_pion0.sh
+++ b/benchmarks/imaging_ecal/run_imcal_pion0.sh
@@ -101,8 +101,7 @@ mkdir -p results
 
 CB_EMCAL_OPTION_DIR=benchmarks/imaging_ecal/options
 # Run Juggler
-xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
-    gaudirun.py ${CB_EMCAL_OPTION_DIR}/imaging_2dcluster.py
+gaudirun.py ${CB_EMCAL_OPTION_DIR}/imaging_2dcluster.py
 if [[ "$?" -ne "0" ]] ; then
   echo "ERROR running juggler"
   exit 1
diff --git a/benchmarks/imaging_shower_ML/sim_rec_tag.py b/benchmarks/imaging_shower_ML/sim_rec_tag.py
index 59360629..0cd6ce6b 100755
--- a/benchmarks/imaging_shower_ML/sim_rec_tag.py
+++ b/benchmarks/imaging_shower_ML/sim_rec_tag.py
@@ -84,9 +84,7 @@ if 'rec' in procs:
         'IMCAL_ML_COMBINE': str(args.combine_method),
     })
 
-    juggler_xenv = os.path.join(os.environ.get('JUGGLER_INTALL_PREFIX', '../local'), 'Juggler.xenv')
     rec_cmd = [
-        'xenv', '-x', juggler_xenv,   # v35+ do not need xenv anymore
         'gaudirun.py', os.path.join(sdir, 'options', 'imaging_ml_data.py')
     ]
     return_code = subprocess.run(rec_cmd, env=run_env).returncode
diff --git a/benchmarks/rich/forward_hadrons.sh b/benchmarks/rich/forward_hadrons.sh
index 03f83143..d71bcece 100644
--- a/benchmarks/rich/forward_hadrons.sh
+++ b/benchmarks/rich/forward_hadrons.sh
@@ -71,8 +71,7 @@ if [[ "$?" -ne "0" ]] ; then
 fi
 
 # @TODO changeable simulation file name and detector xml file name
-xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
-  gaudirun.py benchmarks/rich/options/rich_reco.py
+gaudirun.py benchmarks/rich/options/rich_reco.py
 if [[ "$?" -ne "0" ]] ; then
   echo "ERROR running juggler"
   exit 1
diff --git a/benchmarks/track_finding/multiple_tracks.sh b/benchmarks/track_finding/multiple_tracks.sh
index aca95428..b1a2ffcf 100644
--- a/benchmarks/track_finding/multiple_tracks.sh
+++ b/benchmarks/track_finding/multiple_tracks.sh
@@ -80,7 +80,7 @@ rootls -t ${JUGGLER_SIM_FILE}
 if [[ -z "${ANALYSIS_ONLY}" ]] ;
 then
   # Need to figure out how to pass file name to juggler from the commandline
-  xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/track_finding/options/track_reconstruction.py
+  gaudirun.py benchmarks/track_finding/options/track_reconstruction.py
   if [[ "$?" -ne "0" ]] ; then
     echo "ERROR running juggler"
     exit 1
diff --git a/benchmarks/track_fitting/single_tracks.sh b/benchmarks/track_fitting/single_tracks.sh
index 0761afed..85a05d97 100644
--- a/benchmarks/track_fitting/single_tracks.sh
+++ b/benchmarks/track_fitting/single_tracks.sh
@@ -83,7 +83,7 @@ rootls -t ${JUGGLER_SIM_FILE}
 if [[ -z "${ANALYSIS_ONLY}" ]] ;
 then
   # Need to figure out how to pass file name to juggler from the commandline
-  xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/track_fitting/options/track_reconstruction.py
+  gaudirun.py benchmarks/track_fitting/options/track_reconstruction.py
   if [[ "$?" -ne "0" ]] ; then
     echo "ERROR running juggler"
     exit 1
diff --git a/benchmarks/tracking/central_pions.sh b/benchmarks/tracking/central_pions.sh
index a4b724cf..e006db0f 100644
--- a/benchmarks/tracking/central_pions.sh
+++ b/benchmarks/tracking/central_pions.sh
@@ -96,7 +96,7 @@ rootls -t ${JUGGLER_SIM_FILE}
 if [[ -z "${ANALYSIS_ONLY}" ]] ;
 then
   # Need to figure out how to pass file name to juggler from the commandline
-  xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/tracking/options/track_reconstruction.py
+  gaudirun.py benchmarks/tracking/options/track_reconstruction.py
   if [[ "$?" -ne "0" ]] ; then
     echo "ERROR running juggler"
     exit 1
-- 
GitLab