Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ include(CTest)
add_test(NAME ALLEGRO_o1_v03 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/FCCee/FullSim/ALLEGRO/ALLEGRO_o1_v03/ctest_sim_digi_reco.sh --seed 42)
add_test(NAME ALLEGRO_o2_v01 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/FCCee/FullSim/ALLEGRO/ALLEGRO_o2_v01/ctest_sim_digi_reco.sh --seed 42)
add_test(NAME IDEA_o1_v03 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/FCCee/FullSim/IDEA/IDEA_o1_v03/ctest_sim_digi_reco.sh --seed 42)
add_test(NAME IDEA_o2_v01 COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/FCCee/FullSim/IDEA/IDEA_o2_v01/ctest_sim_digi_reco.sh)
set_tests_properties(ALLEGRO_o1_v03 PROPERTIES TIMEOUT 1800) # 30 minutes
# run alone to avoid OOM from parallel stacking
set_tests_properties(IDEA_o2_v01 PROPERTIES RUN_SERIAL TRUE TIMEOUT 1800)

add_test(NAME ComponentAccumulator_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/python/test/ComponentAccumulator_test.py)
set_tests_properties(ComponentAccumulator_test PROPERTIES FAIL_REGULAR_EXPRESSION failure)
14 changes: 13 additions & 1 deletion FCCee/FullSim/IDEA/IDEA_o2_v01/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,16 @@ ddsim --enableGun --gun.distribution uniform --gun.energy "10*GeV" --gun.particl
```

## Running the digitization and reconstruction
This section will be included as soon as the `IDEA_o2` specific digitization code will be merged.

```
k4run run_digi_reco.py --IOSvc.Input IDEA_sim.root --IOSvc.Output IDEA_digi_reco.root
```

This runs the tracker digitization, truth tracking, the optical calorimeter digitization
(`CreateOpticalCaloCells`) and the seed/merge/grow clustering, producing `TopoGrownClusters`.

By default `run_digi_reco.py` sets `CI = True`, which uses the reduced barrel wedge
(`IDEA_o2_v01_CI/IDEA_o2_v01_CI.xml`) and drops the dual-readout endcap collections. To run the full
detector, set `CI = False` in the file and pass the full compact file to `ddsim` as shown above.

`ctest_sim_digi_reco.sh` runs both steps on the reduced wedge and is what the CI test invokes.
22 changes: 15 additions & 7 deletions FCCee/FullSim/IDEA/IDEA_o2_v01/SteeringFile_IDEA_o2_v01.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from DDSim.DD4hepSimulation import DD4hepSimulation
from g4units import cm, mm, GeV, MeV

Expand Down Expand Up @@ -113,13 +115,19 @@
SIM.filter.mapDetFilter["SCEPCal_MainLayer"] = ""
SIM.filter.mapDetFilter["SCEPCal_TimingLayer"] = ""

## Replace SDAction for DREndcapTubes subdetector
SIM.action.mapActions["DREndcapTubes"] = "DRTubesSDAction"
## Configure the regexSD for DREndcapTubes subdetector
SIM.geometry.regexSensitiveDetector["DREndcapTubes"] = {
"Match": ["DRETS"],
"OutputLevel": 4,
}
## DREndcapTubes only exists in the full geometry; the reduced wedge drops it, so skip its
## SDAction/regexSD here -- otherwise they reference a missing detector and ddsim exits.
## Detected from the compact file on the command line; ddsim owns the argument parser, so a
## custom flag is not available.
_idea_o2_reduced = any("_CI.xml" in a for a in sys.argv)
if not _idea_o2_reduced:
## Replace SDAction for DREndcapTubes subdetector
SIM.action.mapActions["DREndcapTubes"] = "DRTubesSDAction"
## Configure the regexSD for DREndcapTubes subdetector
SIM.geometry.regexSensitiveDetector["DREndcapTubes"] = {
"Match": ["DRETS"],
"OutputLevel": 4,
}

## Replace SDAction for DRBarrelTubes subdetector
SIM.action.mapActions["DRBarrelTubes"] = "DRTubesSDAction"
Expand Down
26 changes: 26 additions & 0 deletions FCCee/FullSim/IDEA/IDEA_o2_v01/ctest_sim_digi_reco.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# CI: IDEA_o2_v01 sim + digi/reco on the reduced barrel wedge.
# ddsim a pi- into the wedge -> tracker digi, truth tracks, optical calo digi, clustering.
set -e

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

ddsim --compactFile "${K4GEO}/FCCee/IDEA/compact/IDEA_o2_v01_CI/IDEA_o2_v01_CI.xml" \
--steeringFile "${SCRIPT_DIR}/SteeringFile_IDEA_o2_v01.py" \
--enableGun --gun.particle pi- --gun.energy 10*GeV \
--gun.direction "0.966,0.259,0.01" --crossingAngleBoost 0.0 \
--numberOfEvents 5 --random.enableEventSeed --random.seed 42 \
--outputFile IDEA_o2_v01_sim.root

k4run "${SCRIPT_DIR}/run_digi_reco.py" \
--IOSvc.Input IDEA_o2_v01_sim.root \
--IOSvc.Output IDEA_o2_v01_digi_reco.root

# Sanity: at least one topo cluster must have been grown.
python3 - <<'EOF'
import sys, podio.reading
r = podio.reading.get_reader("IDEA_o2_v01_digi_reco.root")
n = sum(len(f.get("TopoGrownClusters")) for f in r.get("events"))
print("TopoGrownClusters produced:", n)
sys.exit(0 if n > 0 else 1)
EOF
Loading
Loading