Skip to content

Add o2-sim-geometry-doctor, a geometry against field audit - #15683

Open
sawenzel wants to merge 1 commit into
AliceO2Group:devfrom
sawenzel:geometry-doctor
Open

Add o2-sim-geometry-doctor, a geometry against field audit#15683
sawenzel wants to merge 1 commit into
AliceO2Group:devfrom
sawenzel:geometry-doctor

Conversation

@sawenzel

@sawenzel sawenzel commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

This commit provides a new tool o2-sim-geometry-doctor that reads a placed geometry and a magnetic field and reports where the two do not fit together: logical volumes placed both inside and outside the field, mothers whose own material straddles the boundary, daughter clusters that would need a container of their own, and media asking for straight-line transport while sitting in real field.

The tool was motivated from the idea to check the consistency of geometry and Geant4 media properties against the properties of the magnetic field, and to potentially optimize this assignment in a second step. It is related to these O2 JIRA tickets:

https://its.cern.ch/jira/browse/O2-174
https://its.cern.ch/jira/browse/O2-175
https://its.cern.ch/jira/browse/O2-181

In the future it can be extended to provide automatic repair PRs.

It:

  • builds an outer bound on the field support per threshold, phi sampled by arc length and every threshold crossing bisected, and checks the bound against the field before using it
  • concludes field-free from geometry only; sampling is used only to disprove
  • takes placement extents from the shapes, testing TGeoEltu before TGeoTube
  • verifies a field read from a file against stored reference vectors and repairs the polarity inversion re-initialisation introduces
  • reads the ifield and sensitivity flags from the geometry file itself, so it links no detector code and no simulation engine
  • ships the ALICE anchor verdicts for --verify-anchors

Example:

o2-sim-geometry-doctor --geometry-file o2sim_geometry.root --field-current -5

writes geometry-doctor-proposals.json (findings with suggested actions), geometry-doctor-placements.csv (one classified row per placement) and geometry-doctor-report.txt, and prints the report.

This commit provides a new tool o2-sim-geometry-doctor that reads a placed
geometry and a magnetic field and reports where the two do not fit together:
logical volumes placed both inside and outside the field, mothers whose own
material straddles the boundary, daughter clusters that would need a container
of their own, and media asking for straight-line transport while sitting in
real field.

The tool was motivated from the idea to check the consistency of geometry and
Geant4 media properties against the properties of the magnetic field, and to
potentially optimize this assignment in a second step. It is related to these
O2 JIRA tickets:

  https://its.cern.ch/jira/browse/O2-174
  https://its.cern.ch/jira/browse/O2-175
  https://its.cern.ch/jira/browse/O2-181

In the future it can be extended to provide automatic repair PRs.

It:
- builds an outer bound on the field support per threshold, phi sampled by
  arc length and every threshold crossing bisected, and checks the bound
  against the field before using it
- concludes field-free from geometry only; sampling is used only to disprove
- takes placement extents from the shapes, testing TGeoEltu before TGeoTube
- verifies a field read from a file against stored reference vectors and
  repairs the polarity inversion re-initialisation introduces
- reads the ifield and sensitivity flags from the geometry file itself, so it
  links no detector code and no simulation engine
- ships the ALICE anchor verdicts for --verify-anchors

Example:

  o2-sim-geometry-doctor --geometry-file o2sim_geometry.root --field-current -5

writes geometry-doctor-proposals.json (findings with suggested actions),
geometry-doctor-placements.csv (one classified row per placement) and
geometry-doctor-report.txt, and prints the report.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0178JHAQ2biaX5ac9ThppBXi
@sawenzel
sawenzel requested a review from a team as a code owner August 16, 2026 18:53
@sawenzel
sawenzel requested a review from amorsch August 16, 2026 19:00
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2/fullCI_slc9 for 4a455a8 at 2026-08-17 08:56:

## 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/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

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