Skip to content

Commit

Permalink
Attempt to add automatic test
Browse files Browse the repository at this point in the history
  • Loading branch information
zwu0922 committed Apr 12, 2024
1 parent 0bee6c2 commit 9f73623
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RecFCCeeCalorimeter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ add_test(NAME FCCeeLAr_benchmarkCalibration
)
set_test_env(FCCeeLAr_benchmarkCalibration)

add_test(NAME FCCeeLAr_xtalkNeighbours
COMMAND k4run RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
set_test_env(FCCeeLAr_xtalkNeighbours)
37 changes: 37 additions & 0 deletions RecFCCeeCalorimeter/tests/options/runCaloXTalkNeighbours.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from Configurables import GeoSvc
from Configurables import ApplicationMgr
from Configurables import CreateFCCeeCaloXTalkNeighbours
import os
from Gaudi.Configuration import INFO, DEBUG

# Detector geometry
geoservice = GeoSvc("GeoSvc")
# if K4GEO is empty, this should use relative path to working directory
path_to_detector = os.environ.get("K4GEO", "")
print(path_to_detector)
detectors_to_use = [
'FCCee/ALLEGRO/compact/ALLEGRO_o1_v02/ALLEGRO_o1_v02.xml'
]

# prefix all xmls with path_to_detector
geoservice.detectors = [os.path.join(path_to_detector, _det) for _det in detectors_to_use]
geoservice.OutputLevel = INFO

# create the crosstalk neighbour file for ECAL barrel cells
neighbours = CreateFCCeeCaloXTalkNeighbours("xtalk_neighbours",
outputFileName="xtalk_neighbours_map_ecalB_thetamodulemerged.root",
readoutNames=["ECalBarrelModuleThetaMerged"],
systemNames=["system"],
systemValues=[4],
activeFieldNames=["layer"],
activeVolumesNumbers=[12],
OutputLevel=DEBUG)

# ApplicationMgr
ApplicationMgr(TopAlg=[],
EvtSel='NONE',
EvtMax=1,
# order is important, as GeoSvc is needed by G4SimSvc
ExtSvc=[geoservice, neighbours],
OutputLevel=INFO
)

0 comments on commit 9f73623

Please sign in to comment.