From d0a9b7edb38941f280a48fabf31896df7d66ee19 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Thu, 30 Jun 2022 10:30:29 -0500
Subject: [PATCH] Use has_ecal_barrel_scfi in full_cal_reco

---
 .../clustering/options/full_cal_reco.py       | 22 +++++++++++++------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/benchmarks/clustering/options/full_cal_reco.py b/benchmarks/clustering/options/full_cal_reco.py
index 99370ba9..e2d29aed 100644
--- a/benchmarks/clustering/options/full_cal_reco.py
+++ b/benchmarks/clustering/options/full_cal_reco.py
@@ -9,11 +9,19 @@ import ROOT
 from Configurables import ApplicationMgr, EICDataSvc, PodioInput, PodioOutput, GeoSvc
 from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad
 
-detector_name = str(os.environ.get("JUGGLER_DETECTOR_CONFIG", "athena"))
+detector_name = str(os.environ.get("JUGGLER_DETECTOR", "athena"))
+detector_config = str(os.environ.get("JUGGLER_DETECTOR_CONFIG", detector_name))
 detector_version = str(os.environ.get("JUGGLER_DETECTOR_VERSION", "master"))
 
 detector_path = str(os.environ.get("DETECTOR_PATH", "."))
-compact_path = os.path.join(detector_path, detector_name)
+compact_path = os.path.join(detector_path, detector_config)
+
+# Detector features that affect reconstruction
+has_ecal_barrel_scfi = False
+if 'athena' in detector_name:
+    has_ecal_barrel_scfi = True
+if 'ecce' in detector_name and 'imaging' in detector_config:
+    has_ecal_barrel_scfi = True
 
 # input arguments from calibration file
 with open(f'{detector_path}/calibrations/emcal_barrel_calibration.json') as f:
@@ -36,7 +44,7 @@ output_rec = str(os.environ["JUGGLER_REC_FILE"])
 n_events = int(os.environ["JUGGLER_N_EVENTS"])
 
 # geometry service
-geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(compact_path)], OutputLevel=INFO)
+geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(compact_path)], OutputLevel=WARNING)
 # data service
 podioevent = EICDataSvc("EventDataSvc", inputs=input_sims)
 
@@ -56,12 +64,12 @@ from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco
 # branches needed from simulation root file
 sim_coll = [
     "MCParticles",
+    "EcalBarrelHits",
+    "EcalBarrelHitsContributions",
     "EcalEndcapNHits",
     "EcalEndcapNHitsContributions",
     "EcalEndcapPHits",
     "EcalEndcapPHitsContributions",
-    "EcalBarrelHits",
-    "EcalBarrelHitsContributions",
     "HcalBarrelHits",
     "HcalBarrelHitsContributions",
     "HcalEndcapPHits",
@@ -70,7 +78,7 @@ sim_coll = [
     "HcalEndcapNHitsContributions",
 ]
 
-if 'athena' in detector_name:
+if has_ecal_barrel_scfi:
     sim_coll += [
         "EcalBarrelScFiHits",
         "EcalBarrelScFiHitsContributions",
@@ -173,7 +181,7 @@ ci_ecal_clreco = RecoCoG("ci_ecal_clreco",
 algs.append(ci_ecal_clreco)
 
 # Central Barrel Ecal
-if 'athena' in detector_name:
+if has_ecal_barrel_scfi:
     # Imaging calorimeter
     cb_ecal_daq = dict(
         dynamicRangeADC=3*MeV,
-- 
GitLab