Skip to content

Add missing detector type flags#994

Merged
veprbl merged 35 commits intomainfrom
add-missing-det-type-tags
Apr 6, 2026
Merged

Add missing detector type flags#994
veprbl merged 35 commits intomainfrom
add-missing-det-type-tags

Conversation

@ruse-traveler
Copy link
Copy Markdown
Contributor

@ruse-traveler ruse-traveler commented Nov 14, 2025

Briefly, what does this PR introduce?

This PR adds appropriate DD4hep DetType flags to all calorimeters missing them. An example of how to extract these flags from calorimeter and tracker hits (where the latter includes PID output) is provided in snippets here.

Note that when this PR was opened, there was no FAR flag defined, and so I opted to label the FF calorimeters as ENDCAP. However, DD4hep#1573 adds this (alongside BACKWARD). We should follow up to add these once we pick up this DD4hep version.

What kind of change does this PR introduce?

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

@github-actions github-actions Bot added topic: barrel Mid-rapidity detectors topic: forward Positive-rapidity detectors (hadron-going side) topic: backward Negative-rapidity detectors (electron-going side) topic: calorimetry topic: PID Particle identification topic: far-forward Deterctors for small-angle particles topic: far-backward labels Nov 14, 2025
@veprbl
Copy link
Copy Markdown
Member

veprbl commented Nov 17, 2025

Have you tested querying these values? I don't think this works without explicit calls to dd4hep::xml::setDetectorTypeFlag() in each constructor.

@ruse-traveler
Copy link
Copy Markdown
Contributor Author

Have you tested querying these values? I don't think this works without explicit calls to dd4hep::xml::setDetectorTypeFlag() in each constructor.

Oof! I haven't tried it out yet, but I'll report back when I do! If need be, I'll do a pass to add explicit calls where needed...

@ruse-traveler
Copy link
Copy Markdown
Contributor Author

Have you tested querying these values? I don't think this works without explicit calls to dd4hep::xml::setDetectorTypeFlag() in each constructor.

Confirmed: you do indeed need an explicit call in each constructor. I just pushed a round of commits to add these calls to all sensitive detectors.

I also now have a working example of how to extract the type flags during reconstruction/analysis. I'll do a pass with it to make sure I've haven't missed/messed up anything, and then post here and add the example to either snippets or benchmarks...

@ruse-traveler
Copy link
Copy Markdown
Contributor Author

It took a minute to work through it, but it looks like things are working mostly as expected! For some reason, the type flags don't seem to be propagated for the DIRC, pfRICH, FHCal insert, and far backward detectors. I haven't figured out why yet...

detRegionRxEta epic994 py8ncdis18x275minq1Knevt1K d5m12y2025 detTypeRxEta epic994 py8ncdis18x275minq1Knevt1K d5m12y2025 detRegionRxZ epic994 py8ncdis18x275minq1Knevt1K d5m12y2025 detTypeRxZ epic994 py8ncdis18x275minq1Knevt1K d5m12y2025

@wdconinc
Copy link
Copy Markdown
Contributor

wdconinc commented Dec 6, 2025

Note that since only FORWARD is defined as a flag

Can you consider if it makes sense to upstream an addition to dd4hep? Symmetric colliders have forward in both directions, so this is EIC-inspired but in some sense of broader relevance too (for all those other asymmetric colliders in development.......).

@ruse-traveler
Copy link
Copy Markdown
Contributor Author

Note that since only FORWARD is defined as a flag

Can you consider if it makes sense to upstream an addition to dd4hep? Symmetric colliders have forward in both directions, so this is EIC-inspired but in some sense of broader relevance too (for all those other asymmetric colliders in development.......).

Yeah! I definitely think it makes sense upstream it to dd4hep! I suppose the FCC-eh proposal (or LHeC) might some other big use cases 🤷

(Though I also read a fun paper about running a muon collider with asymmetric beam energies a little bit ago...)

@ruse-traveler
Copy link
Copy Markdown
Contributor Author

All right! I think I squashed the ACTS warnings with the latest round of commits (thanks to some help from Copilot), and also resolved the merge conflict. This should be ready for another review!

@veprbl
Copy link
Copy Markdown
Member

veprbl commented Jan 30, 2026

Marking irrelevant detectors as beampipe (itself) messes with Acts geometry conversion.

Comment thread compact/tracking/definitions_craterlake.xml Outdated
Copy link
Copy Markdown
Contributor Author

@ruse-traveler ruse-traveler left a comment

Choose a reason for hiding this comment

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

Descoping to only add calorimeter tags.

Comment thread compact/far_backward/lumi/spec_tracker.xml Outdated
Comment thread compact/far_backward/lumi/spec_tracker.xml Outdated
Comment thread compact/far_backward/lumi/spec_tracker.xml Outdated
Comment thread compact/far_backward/beamline_electron.xml Outdated
Comment thread compact/far_backward/beamline_electron.xml Outdated
Comment thread src/TrapEndcapTracker_geo.cpp Outdated
Comment thread src/TrapEndcapTracker_geo.cpp Outdated
Comment thread src/TrapEndcapTracker_geo.cpp Outdated
Comment thread src/TrapEndcapTracker_geo.cpp Outdated
Comment thread src/TrapEndcapTracker_geo.cpp Outdated
Copy link
Copy Markdown
Contributor Author

@ruse-traveler ruse-traveler left a comment

Choose a reason for hiding this comment

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

Descoping to only add calorimeter tags.

Co-authored-by: Derek M Anderson <derek.murphy.anderson@protonmail.com>
Co-authored-by: Derek M Anderson <derek.murphy.anderson@protonmail.com>
Co-authored-by: Derek M Anderson <derek.murphy.anderson@protonmail.com>
@ruse-traveler
Copy link
Copy Markdown
Contributor Author

Following up on the discussion yesterday in the Reco WG meeting, I've descoped the PR to only add calorimeter tags. I've checked that the relevant tags are being applied correctly (see the attached plots here), but I'm seeing the check-tracking-geometry (epic_craterlake) is failing with this error:

20:16:52    Acts           VERBOSE   Volume: 'EcalBarrelTrackerSubAssembly' is a compound volume -> resolve the sub volumes
terminate called after throwing an instance of 'std::logic_error'
  what():  Barrel was already given for this hierarchy! Please create a new DD4hep_SubDetectorAssembly for the next hierarchy.

Which I don't quite understand, since the changes now should only calorimeter tags...

typeRxZ compareTypeFlags_afterDescoping py8ncdis18x275q1Knevt1K regionRxZ compareTypeFlags_afterDescoping py8ncdis18x275q1Knevt1K

@veprbl
Copy link
Copy Markdown
Member

veprbl commented Apr 1, 2026

Perhaps, this is because BIC is also a tracking detector.

@ruse-traveler
Copy link
Copy Markdown
Contributor Author

Perhaps, this is because BIC is also a tracking detector.

Yeah, that was it 🫤 I was getting into hot water with the setTypeFlag(...) calls in src/BarrelCalorimeterImaging_geo.cpp. I reverted those changes, and confirmed that test_ACTS.cxx runs successfully on craterlake after the reversion. I think we can live with the AstroPix hits not having a type for now.

In the process, I caught that (1) I wasn't propagating the type flags through to the BIC ScFi hits, and (2) I hadn't updated the newer FEMC files. After doing that, I'm seeing the correct types everywhere I would expect them! From my side, I think this is ready to go.

typeRxEta compareTypeFlags_afterFixingFEMCTypos_onlyScFiHits py8ncdis18x275q1Knevt100 d3m4y2026 typeRxZ compareTypeFlags_afterFixingFEMCTypos_onlyScFiHits py8ncdis18x275q1Knevt100 d3m4y2026

Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

LGTM

@veprbl veprbl merged commit a3ea846 into main Apr 6, 2026
162 checks passed
@veprbl veprbl deleted the add-missing-det-type-tags branch April 6, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: backward Negative-rapidity detectors (electron-going side) topic: barrel Mid-rapidity detectors topic: calorimetry topic: far-backward topic: far-forward Deterctors for small-angle particles topic: forward Positive-rapidity detectors (hadron-going side) topic: PID Particle identification topic: tracking

Projects

Development

Successfully merging this pull request may close these issues.

3 participants