Skip to content

Commit

Permalink
Enable reco for ILD_FCCee_v01/2 (#150)
Browse files Browse the repository at this point in the history
* style: sort inputs

* enable reco w/ ILD_FCCee_v01/2

* replace v11 CI with ILD_FCCee_v01/2 CI

* replace k4geo_DIR env var w/ K4GEO to stick with previous UI

* add explanation of different tuples of FCCee models

* outsource compact file path building to function
  • Loading branch information
Victor-Schwan authored Nov 18, 2024
1 parent d730298 commit fb10b66
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/key4hep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ jobs:
--outputFileBase=bbudsc_3evt_GaudiRec \
--detectorModel=${{ matrix.detector_model }}
# Reconstruction with the v11 model (FCCee) using EDM4hep inputs and outputs
gaudi-v11-reco:
# Reconstruction with the ILD@FCCee models using EDM4hep inputs and outputs
gaudi-ILDatFCCee-reco:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
detector_model: [ILD_l5_v11]
detector_model: [ILD_FCCee_v01, ILD_FCCee_v02]
key4hep_build: [sw-nightlies.hsf.org]
os: [ubuntu2204, el9]

Expand All @@ -109,7 +109,7 @@ jobs:
cd StandardConfig/production
ddsim --inputFiles Examples/bbudsc_3evt/bbudsc_3evt.stdhep \
--outputFile bbudsc_3evt_SIM.edm4hep.root \
--compactFile $lcgeo_DIR/ILD/compact/${{ matrix.detector_model }}/${{ matrix.detector_model }}.xml \
--compactFile $lcgeo_DIR/FCCee/ILD_FCCee/compact/${{ matrix.detector_model }}/${{ matrix.detector_model }}.xml \
--steeringFile ddsim_steer.py
echo "::endgroup::"
echo "::group::Run reconstruction"
Expand Down
25 changes: 17 additions & 8 deletions StandardConfig/production/ILDReconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
k4DataSvc,
)
from Gaudi.Configuration import INFO

from py_utils import import_from, SequenceLoader, parse_collection_patch_file

from k4FWCore.parseArgs import parser
from k4MarlinWrapper.parseConstants import parseConstants

from py_utils import SequenceLoader, import_from, parse_collection_patch_file

# only non-FCCMDI models
DETECTOR_MODELS = (
"ILD_l2_v02",
Expand All @@ -46,9 +45,14 @@
"ILD_s5_o4_v02",
)
# only FCCMDI
FCCeeMDI_DETECTOR_MODELS = (
FCCeeMDI_DETECTOR_MODELS_common_MDI = ( # only models located in $K4GEO/FCCee/ILD_FCCee/
"ILD_FCCee_v01",
"ILD_FCCee_v02",
)
FCCeeMDI_DETECTOR_MODELS = ( # only add models located in $K4GEO/ILD/ here
"ILD_l5_o1_v09",
"ILD_l5_v11",
*FCCeeMDI_DETECTOR_MODELS_common_MDI,
)

REC_COLLECTION_CONTENTS_FILE = "collections_rec_level.txt"
Expand Down Expand Up @@ -125,6 +129,14 @@
action="store_true",
)


def get_compact_file_path(detector_model: str):
"""returns the compact file path to a specified detector model starting with the path stored in the 'K4GEO' environment variable"""
if detector_model in FCCeeMDI_DETECTOR_MODELS_common_MDI:
return f"{os.path.normpath(os.environ['K4GEO'])}/FCCee/ILD_FCCee/compact/{detector_model}/{detector_model}.xml"
return f"{os.path.normpath(os.environ['K4GEO'])}/ILD/compact/{detector_model}/{detector_model}.xml"


reco_args = parser.parse_known_args()[0]

algList = []
Expand All @@ -134,10 +146,7 @@
svcList.append(evtsvc)

det_model = reco_args.detectorModel
if reco_args.compactFile:
compact_file = reco_args.compactFile
else:
compact_file = f"{os.environ['K4GEO']}/ILD/compact/{det_model}/{det_model}.xml"
compact_file = reco_args.compactFile or get_compact_file_path(det_model)

geoSvc = GeoSvc("GeoSvc")
geoSvc.detectors = [compact_file]
Expand Down

0 comments on commit fb10b66

Please sign in to comment.