Skip to content

Commit

Permalink
Avoid list comprehension (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvbrt authored Aug 11, 2023
1 parent 1aacc5a commit c603544
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
DETECTORS = [
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
]
GEOSERVICE.detectors = [os.path.join(DETECTORPATH, d) for d in DETECTORS]
for det in DETECTORS:
GEOSERVICE.detectors = [os.path.join(DETECTORPATH, det)]
GEOSERVICE.OutputLevel = INFO
ApplicationMgr().ExtSvc += [GEOSERVICE]

Expand Down
14 changes: 7 additions & 7 deletions RecFCCeeCalorimeter/tests/options/reproduceSegfault.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
# if FCC_DETECTORS is empty, this should use relative path to working directory
path_to_detector = os.environ.get("FCCDETECTORS", "")
print(path_to_detector)
detectors_to_use=[
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
]
# prefix all xmls with path_to_detector
geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use]
path_to_detectors = os.environ.get("FCCDETECTORS", "")
detectors = [
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
]
# prefix all xmls with path_to_detectors
for det in detectors:
geoservice.detectors += [os.path.join(path_to_detectors, det)]
geoservice.OutputLevel = INFO

# Geant4 service
Expand Down
13 changes: 7 additions & 6 deletions RecFCCeeCalorimeter/tests/options/runCaloSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
# if FCC_DETECTORS is empty, this should use relative path to working directory
path_to_detector = os.environ.get("FCCDETECTORS", "")
detectors_to_use=[
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
]
# prefix all xmls with path_to_detector
geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use]
path_to_detectors = os.environ.get("FCCDETECTORS", "")
detectors = [
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml',
]
# prefix all xmls with path_to_detectors
for det in detectors:
geoservice.detectors += [os.path.join(path_to_detectors, det)]
geoservice.OutputLevel = INFO
ApplicationMgr().ExtSvc += [geoservice]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
# Setup
# Names of cells collections
ecalBarrelCellsName = "ECalBarrelCells"
Expand All @@ -22,12 +23,13 @@
from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc")
# if FCC_DETECTORS is empty, this should use relative path to working directory
path_to_detector = os.environ.get("FCCDETECTORS", "")
detectors_to_use=[
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml'
]
# prefix all xmls with path_to_detector
geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use]
path_to_detectors = os.environ.get("FCCDETECTORS", "")
detectors = [
'Detector/DetFCCeeIDEA-LAr/compact/FCCee_DectMaster.xml'
]
# prefix all xmls with path_to_detectors
for det in detectors:
geoservice.detectors = [os.path.join(path_to_detectors, det)]
geoservice.OutputLevel = WARNING


Expand Down

0 comments on commit c603544

Please sign in to comment.