Skip to content

Add in-memory DD4hep to Acts Geo Gen3 conversion - #36

Merged
tmadlener merged 69 commits into
key4hep:mainfrom
tmadlener:dd4hep-acts-gen3-geo
Apr 27, 2026
Merged

Add in-memory DD4hep to Acts Geo Gen3 conversion#36
tmadlener merged 69 commits into
key4hep:mainfrom
tmadlener:dd4hep-acts-gen3-geo

Conversation

@tmadlener

@tmadlener tmadlener commented Dec 4, 2025

Copy link
Copy Markdown
Member

BEGINRELEASENOTES

  • Rework the ActsGeoSvc to do the conversion from DD4hep to ACTS Gen3 geometry in-memory via the ACTS blueprint API. This does not yet update any tracking functionality, it only adds geometry conversion
    • Populate a CellID to Acts::Surface mapping on the fly after geometry conversion.
    • Provide a uniform & constant magnetic field taking the value at (0, 0, 0) from the DD4hep geometry
  • Provide an extensible way of adding more detectors. For now a subset of detectors living in k4geo is handled

ENDRELEASENOTES

This is a work in progress with the main purpose of being able to share ongoing efforts. So far the efforts focus on getting (parts) of the MAIA_v0 geometry conversion tested and evaluated against upstream work happening at currently living on https://github.com/paulgessinger/acts/tree/feat/dd4hep-gen3

For the MAIA_v0 geometry, this needs key4hep/k4geo#549


/// A simple struct to hold configuration to build a tracker that is nested
/// such that a simple stacking in z does not work.
struct NestedInnerTrackerSpec {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you think something like this should exist at the library level?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am not entirely sure. I don't see a way to make this general enough to be useful without inventing another semi DSL just for this purpose. This specific thing works for our case, where there is one (or a few) endcap layers that protrude into the cylinder formed by the outermost barrel layer(s). However, we currently only have this nesting once (in a subdetector). As soon as we have, e.g. two different levels of protrusion it no longer works. The way out would be to simply call this thing twice with different configurations, but then one would have to potentially add more config, e.g. to allow for "empty" layers.

Given that it's fairly straight forward to build this on our end on top of the proposed API, I would keep it in "userland" and see if it's common enough there to merit upstreaming later.

@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch from 5933a8a to 8197a6e Compare March 10, 2026 14:07
@tmadlener

Copy link
Copy Markdown
Member Author

With the changes in paulgessinger/acts#33 we now also support planar geometries, like LUXE

@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch from 8197a6e to 17edab4 Compare March 10, 2026 18:52
@tmadlener tmadlener mentioned this pull request Mar 17, 2026
6 tasks
@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch from e76aa62 to d8ea41c Compare March 23, 2026 09:17
@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch from d8ea41c to e3604db Compare April 16, 2026 07:11
@tmadlener tmadlener changed the title [WIP] Acts Geo Gen3 DD4hep conversion Add in-memory DD4hep to Acts Geo Gen3 conversion Apr 16, 2026
Comment thread env.sh Outdated
@tmadlener

Copy link
Copy Markdown
Member Author

Key4hep nightlies are building, only tests are failing now. Looking into them. This is ready for review in any case.

@tmadlener

Copy link
Copy Markdown
Member Author

Most of the geometries do not yet use the "hierarchical" drivers that are assumed for most of the tests here. These are done in key4hep/k4geo#579

I could switch the conversion code to work with the older versions and then we switch back to this version once we have them in place.

@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch 4 times, most recently from 8f50065 to 07ea68b Compare April 21, 2026 09:54
@tmadlener

Copy link
Copy Markdown
Member Author

The artifact uploading will eventually have to move to the upstream action. See also the discussion in key4hep/key4hep-actions#39

@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch 3 times, most recently from 23f9671 to c8a1512 Compare April 21, 2026 11:52
@tmadlener

Copy link
Copy Markdown
Member Author

This is now in a quite decent stage from my point of view. It converts the advertised geometries as they currently appear in k4geo (nightlies). I have checked the produced .obj dumps that can be produced via Acts and the geometries look sensible. The minimal tests for propagation also serve as a (non-exhaustive) check that navigation through them also works.

The one thing that is not yet full working here is the SET for the ILD_FCCee models (see inline comment). I would be happy with leaving that as it is and fixing it later.

I am fairly happy with the utility functionality in the Blueprints namespace in DD4hepBlueprintConstruction.cpp now. There is not too much duplication and many of the detector specific details can be handled by simply defining a dedicated TrackerSpec. This should also make it possible to add more geometries rather easily in the future. The naming of the namespaces that contain the populateBlueprint functions is up for debate, but an entirely internal detail so this can also be fixed / generalized later.

I will update #49 with some tests for all the converted geometries to establish basic tracking. We can discuss how we want to proceed with these PRs. I would have a preference to get at least some basic functionality in on which it is then possible to iterate, but we can discuss this.

Either absorbed by other services or not part of the context of this PR
Make sure that the resulting mapping will work as expected
InnerTrackerEndcaps have to be stacked along z after the stacking on the
VertexBarrel along r
Functionality has not landed in Acts yet and we can work around it for now
Done via Claude (Opus 4.7 for plan, Sonnet 4.6 for execution)
@tmadlener
tmadlener force-pushed the dd4hep-acts-gen3-geo branch from 244f25c to f939537 Compare April 27, 2026 18:53
@tmadlener
tmadlener merged commit 9a4a55b into key4hep:main Apr 27, 2026
4 of 6 checks passed
@tmadlener
tmadlener deleted the dd4hep-acts-gen3-geo branch April 27, 2026 19:04
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.

2 participants