Skip to content

Add optional per-sector seeding to the TPC digitizer - #16085

Merged
sawenzel merged 5 commits into
AliceO2Group:devfrom
sawenzel:tpc-digi-sector-seeding-v2
Nov 10, 2026
Merged

sawenzel merged 5 commits into
AliceO2Group:devfrom
sawenzel:tpc-digi-sector-seeding-v2

Conversation

@sawenzel

@sawenzel sawenzel commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

This adds an optional per-sector seeding to the TPC digitizer and is a preparation for multithreaded TPC digitization.

The random rings of ElectronTransport, GEMAmplification and SAMPAProcessing are process-wide singletons whose positions carry over from one sector to the next, so the digits depend on the number of TPC lanes. With --tpc-sector-seeding, each Digitizer owns these objects, fills their rings once from DigiParams.seed and moves them to positions derived from the seed, the sector and the timeframe. A first commit turns the remaining static workspaces into per-digitizer members, so that several digitizers can later run side by side.

Without the option the output is unchanged (digits, labels and common mode checked on PbPb and pp). With it, the digits are identical for 1, 4 and 8 lanes, at no measurable cost in time or memory.

Stacked on #16083; only the last two commits belong to this PR.

https://its.cern.ch/jira/browse/O2-7309

Assisted by Claude Code.

@sawenzel

sawenzel commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

Added commits after internal review.

@sawenzel
sawenzel force-pushed the tpc-digi-sector-seeding-v2 branch from 25f1c9c to f9b05b7 Compare November 9, 2026 17:53
sawenzel and others added 5 commits November 10, 2026 10:50
This replaces two shared static workspaces of the TPC digitizer by members, in preparation for a multithreaded digitizer.

- The shaped-signal buffer of Digitizer::process and the label sorting buffer of DigitGlobalPad::fillOutputContainer are now members.
- The SAMPAProcessing used for the output is passed down from DigitContainer, which uses the singleton unless one is set.

https://its.cern.ch/jira/browse/O2-7309

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This adds an option that makes the TPC digits independent of the lane assignment, as a preparation for MT digitization.

- The random rings of ElectronTransport, GEMAmplification and SAMPAProcessing kept their positions from one sector to the next, so the digits depended on the number of TPC lanes.
- With --tpc-sector-seeding, each Digitizer owns these three objects, fills their rings once from DigiParams.seed, and moves the rings to positions derived from the seed, the sector and the timeframe.
- RandomRing can now be filled from a given generator and moved to a random position.
- Without the option, the output is unchanged.

https://its.cern.ch/jira/browse/O2-7309

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This addresses a review comment on the random ring repositioning.

- setRandomPosition() can place the ring at any index.
- getNextValueVc() now wraps to the start when a vector would run past the end.

https://its.cern.ch/jira/browse/O2-7309

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This addresses a review comment on the repeated fillOutputContainer calls.

- The eight cases now pass the mode as a type to one lambda.

https://its.cern.ch/jira/browse/O2-7309

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sawenzel
sawenzel force-pushed the tpc-digi-sector-seeding-v2 branch from f9b05b7 to 7e6c65d Compare November 10, 2026 09:53
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 7e6c65d at 2026-11-10 18:33:

## sw/BUILD/lhapdf-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/o2codechecker-latest/log
100% tests passed, 0 tests failed out of 1


## sw/BUILD/ThePEG-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/Herwig-latest/log
make[1]: *** [Makefile:1254: herwigopts.c] Error 127
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:589: all-recursive] Error 1

Full log here.

@sawenzel
sawenzel merged commit 1320d76 into AliceO2Group:dev Nov 10, 2026
9 of 11 checks passed
@sawenzel
sawenzel deleted the tpc-digi-sector-seeding-v2 branch November 10, 2026 21:55
sawenzel added a commit to AliceO2Group/O2DPG that referenced this pull request Nov 12, 2026
This adds two options to o2dpg_sim_workflow.py that change how TPC is digitized. Both are off by default.

- --tpc-mt-digitizer runs TPC digitization in one device with NWORKERS_TF threads instead of NWORKERS_TF lanes.
- It also computes the distortions with NWORKERS_TF threads, and it needs TPC digit chunking.
- --tpc-sector-seeding seeds the lane digitizer per sector, so that the digits do not depend on the number of lanes.
- The metrics tool reads the worker count of the tpcdigi task from --tpc-digi-threads too.
- Both options need an O2 version with the sector seeding and the multithreaded TPC digitizer.

https://its.cern.ch/jira/browse/O2-7309
AliceO2Group/AliceO2#16085

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants