From 565be297577c76e8deae842a37bd0bfd58c25cd3 Mon Sep 17 00:00:00 2001
From: Sylvester Joosten <sjoosten@anl.gov>
Date: Thu, 19 Nov 2020 22:18:20 +0000
Subject: [PATCH] Fixed geometry resolution in reconstruction

---
 dvmp/dvmp.sh                      | 9 ++++++---
 options/tracker_reconstruction.py | 4 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dvmp/dvmp.sh b/dvmp/dvmp.sh
index 23d60a01..379dedc3 100644
--- a/dvmp/dvmp.sh
+++ b/dvmp/dvmp.sh
@@ -34,8 +34,11 @@ JUGGLER_FILE_NAME_TAG="dvmp"
 JUGGLER_GEN_FILE="results/dvmp/jpsi_central_electron-10on100-gen.hepmc"
 # FIXME use the input file name, as we will be generating a lot of these
 # in the future...
-JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
-JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
+## note: these variables need to be exported to be accessible from
+##       the juggler options.py. We should really work on a dedicated
+##       juggler launcher to get rid of these "magic" variables. FIXME
+export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
+export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 
 
 ## =============================================================================
@@ -59,7 +62,7 @@ fi
 
 ## =============================================================================
 ## Step 3: Run digitization & reconstruction
-echo "Running Geant4 simulation"
+echo "Running the digitization and reconstruction"
 # FIXME Need to figure out how to pass file name to juggler from the commandline
 xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
   gaudirun.py options/tracker_reconstruction.py
diff --git a/options/tracker_reconstruction.py b/options/tracker_reconstruction.py
index 75f104ae..a9181a0a 100644
--- a/options/tracker_reconstruction.py
+++ b/options/tracker_reconstruction.py
@@ -12,8 +12,10 @@ if "JUGGLER_DETECTOR" in os.environ :
 input_sim_file  = str(os.environ["JUGGLER_SIM_FILE"])
 output_rec_file = str(os.environ["JUGGLER_REC_FILE"])
 n_events = str(os.environ["JUGGLER_N_EVENTS"])
+detector_path = str(os.environ["DETECTOR_PATH"])
 
-geo_service  = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)])
+geo_service  = GeoSvc("GeoSvc",
+        detectors=["{}/{}.xml".format(detector_path, detector_name)])
 podioevent   = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG)
 
 from Configurables import PodioInput
-- 
GitLab