Skip to content

Split Graf3d and the Geant 3 TGeometry shapes#22845

Open
hageboeck wants to merge 12 commits into
root-project:masterfrom
hageboeck:splitOffTGeometry
Open

Split Graf3d and the Geant 3 TGeometry shapes#22845
hageboeck wants to merge 12 commits into
root-project:masterfrom
hageboeck:splitOffTGeometry

Conversation

@hageboeck

@hageboeck hageboeck commented Jul 17, 2026

Copy link
Copy Markdown
Member

As discussed in PPP200, it would make sense if the Geant 3 geometry shapes switch on/off at the same time as other geometries, that is, using -Dgeom=On/Off.

To achieve this, the shapes have been moved into their own library "TGeometry". Graf3d only retains classes such as TPolyMarker3D, TPolyLine3D and similar, since these are used in other parts of ROOT. The implementations of the shapes and the (pre-TGeo) geometry classes aren't used anywhere, so they can be in their own library.

The commits are ordered in a few steps:

  1. First, clean up includes and dependencies between ROOT libraries to decouple as best as possible the TGeometry things from all the rest of ROOT.
  2. Then, remove #include <TGeometry.h> from TPolyMarker3D and similar.
  3. Move the TGeometry-related classes into their own library.
  4. Add a test for the interaction between TGeometry and g3d
  5. Add release notes.

Note:
I clang-formatted as best as I could, but I did not format the commit that moved all the files. This would have created unnecessary noise.

  • TODO: Add this new library to the exported targets and to root-config
  • Move more classes into the new library

@hageboeck hageboeck self-assigned this Jul 17, 2026
@hageboeck
hageboeck force-pushed the splitOffTGeometry branch from abe1097 to 932a89d Compare July 17, 2026 15:09
@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 18h 22m 19s ⏱️
 3 874 tests  3 874 ✅ 0 💤 0 ❌
78 801 runs  78 801 ✅ 0 💤 0 ❌

Results for commit 932a89d.

- Splot depended on graf3d, but it didn't use any of its classes.
- Montecarlo was including graf3d headers. It is sufficient to include
  in the .cxx, though.
Markers and lines in Graf3D are coupled to TGeometry, but this coupling
can be broken by not including TGeometry.
This would only break one single feature, which is that markers and
lines transform based on the currently active geometry. This remains
supported by declaring a transform function in graf3d/g3d. This
transform function can be accessed from TGeometry, eventually allowing
for putting TGeometry and all its shapes into a dedicated library.
@hageboeck
hageboeck force-pushed the splitOffTGeometry branch from 932a89d to 156ccba Compare July 20, 2026 12:31
@hageboeck
hageboeck marked this pull request as ready for review July 20, 2026 12:45
@hageboeck
hageboeck force-pushed the splitOffTGeometry branch from 8336b6f to da07b04 Compare July 20, 2026 13:36
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