Skip to content

feat: move ROOT surface material map I/O to plugins#4400

Merged
asalzburger merged 38 commits intoacts-project:mainfrom
asalzburger:chore-move-material-map-io-to-plugins
Jul 12, 2025
Merged

feat: move ROOT surface material map I/O to plugins#4400
asalzburger merged 38 commits intoacts-project:mainfrom
asalzburger:chore-move-material-map-io-to-plugins

Conversation

@asalzburger
Copy link
Contributor

@asalzburger asalzburger commented Jul 8, 2025

This PR moves the I/O for material map reading/writing into Plugins/Root and removes the duplicated code from RootMaterialWriter and RootMaterialDecorator.

It also harmonizes the usage/definition of SurfaceMaterialMaps. VolumeMaterialMaps, and DetectorMaterialMaps consistently by declaring them once.

It is backward compatible, and introduces a new, common ROOT I/O material backend that can be shared between all material classes (homongeneous, binned, grid, indexed).

This PR also allows UnitTests to be added for Material writing, the first ones are done with it, and it removes roughly 100 SonarCloud issues, mainly related to how we call and use ROOT.

This will be followed by a PRs doing the same for Volume material and updated Grid based surface material.

The reading gis kept backward-compatible.

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

@asalzburger asalzburger added this to the next milestone Jul 8, 2025
@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins labels Jul 8, 2025
@asalzburger asalzburger changed the title feat: move material map io to plugins feat: move surface material map io to plugins Jul 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2025

📊: Physics performance monitoring for c94bc8a

Full contents

physmon summary

@asalzburger asalzburger changed the title feat: move surface material map io to plugins feat: move surface material map I/O to plugins Jul 10, 2025
Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach, but have a few comments on the implementation.

@asalzburger asalzburger force-pushed the chore-move-material-map-io-to-plugins branch from b4e65eb to 899d502 Compare July 12, 2025 04:51
@asalzburger
Copy link
Contributor Author

Mac OsX did strike again - the combination of capital / small letters and git is horrendous when removing.

I just changed "IO" to "Io" in the tests, so I suppose the "approval" is still valid.

@asalzburger asalzburger merged commit d036765 into acts-project:main Jul 12, 2025
38 of 40 checks passed
@sonarqubecloud
Copy link

@paulgessinger
Copy link
Member

paulgessinger commented Jul 13, 2025

This breaks the Athena build. I'm reverting this until we have a fix in #4424

Failing job: https://gitlab.cern.ch/acts/acts-athena-ci/-/jobs/58703357#L1885

In file included from /builds/acts/acts-athena-ci/athena/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialJsonWriterTool.h:16,
                 from /builds/acts/acts-athena-ci/athena/Tracking/Acts/ActsGeometry/src/components/ActsGeometry_entries.cxx:11:
/builds/acts/acts-athena-ci/athena/Tracking/Acts/ActsGeometryInterfaces/ActsGeometryInterfaces/IActsMaterialJsonWriterTool.h:24:80: error: 'DetectorMaterialMaps' in 'class Acts::MaterialMapJsonConverter' does not name a type
   24 |   write(const ActsGeometryContext& gctx, const Acts::MaterialMapJsonConverter::DetectorMaterialMaps& detMaterial) const = 0;
      |                                                                                ^~~~~~~~~~~~~~~~~~~~
/builds/acts/acts-athena-ci/athena/Tracking/Acts/ActsGeometry/ActsGeometry/ActsMaterialJsonWriterTool.h:39:80: error: 'DetectorMaterialMaps' in 'class Acts::MaterialMapJsonConverter' does not name a type
   39 |   write(const ActsGeometryContext& gctx, const Acts::MaterialMapJsonConverter::DetectorMaterialMaps& detMaterial) const override;
      |                                                                                ^~~~~~~~~~~~~~~~~~~~
[908/1143] Building CXX object Tracking/Acts/ActsGeometry/CMakeFiles/ActsGeometryLib.dir/src/ActsTrackingGeometrySvc.cxx.o

paulgessinger added a commit to paulgessinger/acts that referenced this pull request Jul 13, 2025
paulgessinger added a commit to paulgessinger/acts that referenced this pull request Jul 13, 2025
@asalzburger
Copy link
Contributor Author

Interesting ... do we have a dependency in Athena on ActsExamples?

@asalzburger
Copy link
Contributor Author

Ah no, it was the consistent naming as we use the Plugins/Json for reading the map.

@paulgessinger
Copy link
Member

We could reintroduce the old aliases as deprecated for the moment, or mark this breaking and prepare a patch.

mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Jul 14, 2025
This PR moves the I/O for material map reading/writing into
`Plugins/Root` and removes the duplicated code from `RootMaterialWriter`
and `RootMaterialDecorator`.

It also harmonizes the usage/definition of `SurfaceMaterialMaps`.
`VolumeMaterialMaps`, and `DetectorMaterialMaps` consistently by
declaring them once.

It is backward compatible, and introduces a new, common ROOT I/O
material backend that can be shared between all material classes
(homongeneous, binned, grid, indexed).

This PR also allows UnitTests to be added for Material writing, the
first ones are done with it, and it removes roughly 100 SonarCloud
issues, mainly related to how we call and use ROOT.

This will be followed by a PRs doing the same for Volume material and
updated Grid based surface material.

The reading gis kept backward-compatible.


--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

- Use a *conventional commits* prefix: [quick
summary](https://www.conventionalcommits.org/en/v1.0.0/#summary)
- We mostly use `feat`, `fix`, `refactor`, `docs`, `chore` and `build`
types.
- A milestone will be assigned by one of the maintainers

---------

Co-authored-by: Paul Gessinger <hello@paulgessinger.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Jul 14, 2025
mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Jul 14, 2025
This PR moves the I/O for material map reading/writing into
`Plugins/Root` and removes the duplicated code from `RootMaterialWriter`
and `RootMaterialDecorator`.

It also harmonizes the usage/definition of `SurfaceMaterialMaps`.
`VolumeMaterialMaps`, and `DetectorMaterialMaps` consistently by
declaring them once.

It is backward compatible, and introduces a new, common ROOT I/O
material backend that can be shared between all material classes
(homongeneous, binned, grid, indexed).

This PR also allows UnitTests to be added for Material writing, the
first ones are done with it, and it removes roughly 100 SonarCloud
issues, mainly related to how we call and use ROOT.

This will be followed by a PRs doing the same for Volume material and
updated Grid based surface material.

The reading gis kept backward-compatible.


--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

- Use a *conventional commits* prefix: [quick
summary](https://www.conventionalcommits.org/en/v1.0.0/#summary)
- We mostly use `feat`, `fix`, `refactor`, `docs`, `chore` and `build`
types.
- A milestone will be assigned by one of the maintainers

---------

Co-authored-by: Paul Gessinger <hello@paulgessinger.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Jul 14, 2025
kodiakhq bot pushed a commit that referenced this pull request Jul 14, 2025
Reintroduction of #4400 with the previous typedefs added back in as deprecated.

Co-authored-by: Andreas Salzburger <asalzburger@gmail.com>
@paulgessinger paulgessinger modified the milestones: next, v42.1.0 Jul 21, 2025
mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Aug 7, 2025
This PR moves the I/O for material map reading/writing into
`Plugins/Root` and removes the duplicated code from `RootMaterialWriter`
and `RootMaterialDecorator`.

It also harmonizes the usage/definition of `SurfaceMaterialMaps`.
`VolumeMaterialMaps`, and `DetectorMaterialMaps` consistently by
declaring them once.

It is backward compatible, and introduces a new, common ROOT I/O
material backend that can be shared between all material classes
(homongeneous, binned, grid, indexed).

This PR also allows UnitTests to be added for Material writing, the
first ones are done with it, and it removes roughly 100 SonarCloud
issues, mainly related to how we call and use ROOT.

This will be followed by a PRs doing the same for Volume material and
updated Grid based surface material.

The reading gis kept backward-compatible.


--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

- Use a *conventional commits* prefix: [quick
summary](https://www.conventionalcommits.org/en/v1.0.0/#summary)
- We mostly use `feat`, `fix`, `refactor`, `docs`, `chore` and `build`
types.
- A milestone will be assigned by one of the maintainers

---------

Co-authored-by: Paul Gessinger <hello@paulgessinger.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Aug 7, 2025
mimodekjaer pushed a commit to mimodekjaer/acts that referenced this pull request Aug 7, 2025
Reintroduction of acts-project#4400 with the previous typedefs added back in as deprecated.

Co-authored-by: Andreas Salzburger <asalzburger@gmail.com>
njacazio pushed a commit to AliceO2Group/acts that referenced this pull request Nov 8, 2025
This PR moves the I/O for material map reading/writing into
`Plugins/Root` and removes the duplicated code from `RootMaterialWriter`
and `RootMaterialDecorator`.

It also harmonizes the usage/definition of `SurfaceMaterialMaps`.
`VolumeMaterialMaps`, and `DetectorMaterialMaps` consistently by
declaring them once.

It is backward compatible, and introduces a new, common ROOT I/O
material backend that can be shared between all material classes
(homongeneous, binned, grid, indexed).

This PR also allows UnitTests to be added for Material writing, the
first ones are done with it, and it removes roughly 100 SonarCloud
issues, mainly related to how we call and use ROOT.

This will be followed by a PRs doing the same for Volume material and
updated Grid based surface material.

The reading gis kept backward-compatible.


--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

- Use a *conventional commits* prefix: [quick
summary](https://www.conventionalcommits.org/en/v1.0.0/#summary)
- We mostly use `feat`, `fix`, `refactor`, `docs`, `chore` and `build`
types.
- A milestone will be assigned by one of the maintainers

---------

Co-authored-by: Paul Gessinger <hello@paulgessinger.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
njacazio pushed a commit to AliceO2Group/acts that referenced this pull request Nov 8, 2025
njacazio pushed a commit to AliceO2Group/acts that referenced this pull request Nov 8, 2025
Reintroduction of acts-project#4400 with the previous typedefs added back in as deprecated.

Co-authored-by: Andreas Salzburger <asalzburger@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Core Affects the Core module Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants