Skip to content

Commit 73d54aa

Browse files
sawenzelclaude
andcommitted
Replace the sim_alignment task by align-geom.mAlignPaths
This simplifies the alignment procedure for MC by getting rid of the sim_alignment task. o2-sim now uses MCH/MisCalib/Align when these objects are available and falls back to MCH/Calib/Align when not. This builds upon #2566 but makes it leaner, and fixes a failure in the nightly productions. - Fixes the crashes in the nightly GRID test, introduced since AliceO2Group/AliceO2#16215. - Keeps only standard objects in the local CCDB cache, so the task ordering of #2566 is no longer needed. - Requires AliceO2Group/AliceO2#16216 (daily-20261129 or later). - Allows switching the residual off with -confKey "align-geom.mAlignPaths=MCH:MCH/Calib/Align". https://its.cern.ch/jira/browse/O2-7374 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 68f4255 commit 73d54aa

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

‎MC/bin/o2dpg_sim_config.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ def add(cfg, flatconfig):
204204

205205
add(config, {"MFTBase.buildAlignment" : "true"})
206206

207+
# residual MCH misalignment for simulation only, not reconstruction (falls back to MCH/Calib/Align where absent)
208+
add(config, {"align-geom.mAlignPaths" : "MCH:MCH/MisCalib/Align"})
209+
207210
# Keep the ZEM calorimeters, drop the +-113 m beam line that makes the ZDC
208211
# expensive to transport. --with-ZDC asks for the whole thing, and an explicit
209212
# "--skipModules ZDC" still removes the module altogether.

‎MC/bin/o2dpg_sim_workflow.py‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -663,17 +663,6 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
663663
GEOM_PREFETCH_TASK['cmd'] = 'chmod +x ${PWD}/geomprefetcher_script.sh; ${PWD}/geomprefetcher_script.sh'
664664
workflow['stages'].append(GEOM_PREFETCH_TASK)
665665

666-
# Fix (residual) geometry alignment for simulation stage
667-
# Detectors that prefer to apply special alignments (for example residual effects) should be listed here and download these files.
668-
# These object will take precedence over ordinary align objects **and** will only be applied in transport simulation
669-
# and digitization (Det/Calib/Align is only read in simulation since reconstruction tasks use GLO/Config/AlignedGeometry automatically).
670-
SIM_ALIGNMENT_PREFETCH_TASK = createTask(name='sim_alignment', needs=['geomprefetch'], cpu='0')
671-
SIM_ALIGNMENT_PREFETCH_TASK['cmd'] = '${O2_ROOT}/bin/o2-ccdb-downloadccdbfile --host http://alice-ccdb.cern.ch -p MID/MisCalib/Align --timestamp ' + str(args.timestamp) + ' --created-not-after ' \
672-
+ str(args.condition_not_after) + ' -d ${ALICEO2_CCDB_LOCALCACHE}/MID/Calib/Align --no-preserve-path ; '
673-
SIM_ALIGNMENT_PREFETCH_TASK['cmd'] += '${O2_ROOT}/bin/o2-ccdb-downloadccdbfile --host http://alice-ccdb.cern.ch -p MCH/MisCalib/Align --timestamp ' + str(args.timestamp) + ' --created-not-after ' \
674-
+ str(args.condition_not_after) + ' -d ${ALICEO2_CCDB_LOCALCACHE}/MCH/Calib/Align --no-preserve-path '
675-
workflow['stages'].append(SIM_ALIGNMENT_PREFETCH_TASK)
676-
677666
# create/publish the GRPs and other GLO objects for consistent use further down the pipeline
678667
orbitsPerTF=int(args.orbitsPerTF)
679668
GRP_TASK = createTask(name='grpcreate', needs=["geomprefetch"], cpu='0')
@@ -698,7 +687,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
698687
vtxmode_sgngen = 'kNoVertex' if args.make_evtpool else 'kCollContext'
699688

700689
# preproduce the collision context / timeframe structure for all timeframes at once
701-
precollneeds=[GRP_TASK['name'], SIM_ALIGNMENT_PREFETCH_TASK['name']]
690+
precollneeds=[GRP_TASK['name']]
702691
# max number of QED events simulated per timeframe.
703692
# A large pool of QED events (0.6*INTRATE) is needed to avoid repetition of events in the same or
704693
# neighbouring ITS readout frames, which would fire already activated pixel, discarding the event.

‎MC/bin/tests/test_sim_config_embedding.py‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""Offline tests: MC-DATA embedding switches the TPC looper generator and the QED background off."""
2+
"""Offline tests: default transport config keys (MC-DATA embedding switches, residual alignment) and the QED background."""
33
import argparse
44
import os
55
import sys
@@ -32,6 +32,18 @@ def test_explicit_key_wins(self):
3232
self.assertEqual(cfg["GenTPCLoopers"].get("loopersVeto"), "false")
3333

3434

35+
class TestAlignPaths(unittest.TestCase):
36+
37+
def test_mch_residual_alignment_by_default(self):
38+
cfg = simconfig.create_geant_config(args(), "")
39+
self.assertEqual(cfg["align-geom"].get("mAlignPaths"), "MCH:MCH/MisCalib/Align")
40+
self.assertIn("align-geom.mAlignPaths=MCH:MCH/MisCalib/Align;", simconfig.constructConfigKeyArg(cfg))
41+
42+
def test_explicit_key_wins(self):
43+
cfg = simconfig.create_geant_config(args(), "align-geom.mAlignPaths=MCH:MCH/Other/Align")
44+
self.assertEqual(cfg["align-geom"].get("mAlignPaths"), "MCH:MCH/Other/Align")
45+
46+
3547
class TestQED(unittest.TestCase):
3648
PB = 1000822080
3749

0 commit comments

Comments
 (0)