Skip to content

Add a CAD simulation tutorial section, generated from its sources in AliceO2 - #59

Merged
sawenzel merged 1 commit into
AliceO2Group:mainfrom
sawenzel:swenzel/cad-tutorial
Sep 12, 2026
Merged

sawenzel merged 1 commit into
AliceO2Group:mainfrom
sawenzel:swenzel/cad-tutorial

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

This PR adds a documentation section, CAD simulation tutorial, covering the route from a CAD model to hits in o2-sim, together with the job that keeps it in step with the code it documents. The section is published at docs/cadtutorial and appears in the contents as the last entry.

The pages are not maintained here. They are written and reviewed in AliceO2, under Detectors/CADSupport/doc/tutorial, beside the converter, and converted into this site's conventions by a script in this repository. Documentation that lives away from its implementation drifts from it; generating the section removes that failure mode without moving the tutorial out of the code review that keeps it correct.

The section

Fourteen pages: installing the converter, a first conversion of the shipped example model, how each solid is represented and how faithfully, selecting part of a model, materials, the magnetic field and physics cuts, the generated ROOT macro, adding the result to o2-sim as passive material and then as a sensitive detector, growing a study into a real detector class, a worked example that takes the ITS out to STEP and back and simulates hits in the result, and two reference pages on checking a conversion and on the known limits.

The conversion

.github/scripts/sync_cad_tutorial.py performs two transformations and copies the figures:

  • GitHub alerts (> [!NOTE]) become fenced note and warning blocks, which _layouts/tasks/shortcodes.liquid renders as callouts. The bold line under the alert marker is kept as the callout's own heading, because the theme's title is fixed. A code fence inside an alert cannot be carried into a fenced callout, so the script stops rather than emit a broken page.
  • Each page receives the sort and title front matter the navigation is built from. The section sorts after the existing ones.

Mermaid diagrams, tables, images and relative links pass through unchanged; the theme already renders ```mermaid fences.

.github/workflows/cad-tutorial-sync.yml runs the script weekly and on workflow_dispatch, and commits docs/cadtutorial when the output changes.

Merge order

The sources are added to AliceO2 by AliceO2Group/AliceO2#15790, which is open against dev. The generated pages in this PR are complete and self-contained, so the section is correct as it stands, but the sync job fetches from dev and will fail until that PR merges. This PR should therefore follow it.

The generated pages were checked against .markdownlint.json and the front matter and shortcode syntax against the theme's own layouts; they have not been rendered locally, as the Jekyll preview needs a container.

Overall, the site gains a complete tutorial for CAD-derived simulation geometry, and gains it in a form that cannot fall out of step with the converter.

🤖 Generated with Claude Code

https://claude.ai/code/session_017gNpas1pZ9DNBhVesoM5QZ

This adds a new documentation section, CAD simulation tutorial, and the job
that keeps it in step with its sources.

- docs/cadtutorial holds the section. It is generated, not edited here.
- The sources live in AliceO2, Detectors/CADSupport/doc/tutorial, next to the
  converter they document.
- .github/scripts/sync_cad_tutorial.py converts them: GitHub alerts become
  the theme's note and warning fences, and each page gets its front matter.
- .github/workflows/cad-tutorial-sync.yml runs it weekly and on demand, and
  commits when the result changes.

AliceO2Group/AliceO2#15790

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017gNpas1pZ9DNBhVesoM5QZ
@sawenzel
sawenzel merged commit bb9451a into AliceO2Group:main Sep 12, 2026
1 check failed
@sawenzel
sawenzel deleted the swenzel/cad-tutorial branch September 12, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant