From 1803de0a686f36a02012799d63bdf4d97904081d Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Fri, 7 Oct 2022 01:01:47 +0000
Subject: [PATCH] feat: eicrecon for track_finding, track_fitting, ecal

---
 benchmarks/ecal/run_emcal_benchmarks.py     | 12 ++++++------
 benchmarks/track_finding/multiple_tracks.sh |  7 +++----
 benchmarks/track_fitting/single_tracks.sh   |  7 +++----
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/benchmarks/ecal/run_emcal_benchmarks.py b/benchmarks/ecal/run_emcal_benchmarks.py
index b0c27a4f..933bbf61 100755
--- a/benchmarks/ecal/run_emcal_benchmarks.py
+++ b/benchmarks/ecal/run_emcal_benchmarks.py
@@ -104,12 +104,12 @@ if 'rec' in procs:
     os.environ['JUGGLER_COMPACT_PATH'] = args.compact
     os.environ['JUGGLER_N_EVENTS'] = '{}'.format(args.nev)
 
-    for opt in opt_scripts:
-        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))
-            exit(1)
+    os.environ['JANA_HOME'] = '/usr/local/lib/EICrecon'
+    rec_cmd = ['eicrecon', f'-Ppodio:output_file={rec_file}']
+    return_code = subprocess.run(rec_cmd).returncode
+    if return_code is not None and return_code < 0:
+        print('ERROR running eicrecon ({})!'.format(opt))
+        exit(1)
     process = subprocess.run(['rootls', '-t', rec_file])
 
 
diff --git a/benchmarks/track_finding/multiple_tracks.sh b/benchmarks/track_finding/multiple_tracks.sh
index fc1c19c1..387d6086 100644
--- a/benchmarks/track_finding/multiple_tracks.sh
+++ b/benchmarks/track_finding/multiple_tracks.sh
@@ -80,10 +80,9 @@ rootls -t ${JUGGLER_SIM_FILE}
 
 if [[ -z "${ANALYSIS_ONLY}" ]] ;
 then
-  # Need to figure out how to pass file name to juggler from the commandline
-  gaudirun.py benchmarks/track_finding/options/track_reconstruction.py
-  if [[ "$?" -ne "0" ]] ; then
-    echo "ERROR running juggler"
+  JANA_HOME=/usr/local/lib/EICrecon eicrecon -Ppodio:output_file=${JUGGLER_REC_FILE} ${JUGGLER_SIM_FILE}
+  if [ "$?" -ne "0" ] ; then
+    echo "ERROR running eicrecon"
     exit 1
   fi
 fi
diff --git a/benchmarks/track_fitting/single_tracks.sh b/benchmarks/track_fitting/single_tracks.sh
index 89b8f2cc..a4aa83a4 100644
--- a/benchmarks/track_fitting/single_tracks.sh
+++ b/benchmarks/track_fitting/single_tracks.sh
@@ -83,10 +83,9 @@ rootls -t ${JUGGLER_SIM_FILE}
 
 if [[ -z "${ANALYSIS_ONLY}" ]] ;
 then
-  # Need to figure out how to pass file name to juggler from the commandline
-  gaudirun.py benchmarks/track_fitting/options/track_reconstruction.py
-  if [[ "$?" -ne "0" ]] ; then
-    echo "ERROR running juggler"
+  JANA_HOME=/usr/local/lib/EICrecon eicrecon -Ppodio:output_file=${JUGGLER_REC_FILE} ${JUGGLER_SIM_FILE}
+  if [ "$?" -ne "0" ] ; then
+    echo "ERROR running eicrecon"
     exit 1
   fi
 fi
-- 
GitLab