Skip to content

feat: muon buckets sector frame + bucket splitting#5229

Open
davidedicroce wants to merge 12 commits intoacts-project:mainfrom
davidedicroce:MuonBuckets
Open

feat: muon buckets sector frame + bucket splitting#5229
davidedicroce wants to merge 12 commits intoacts-project:mainfrom
davidedicroce:MuonBuckets

Conversation

@davidedicroce
Copy link
Copy Markdown
Contributor

@davidedicroce davidedicroce commented Mar 10, 2026

This MR introduces sector-based muon bucketization for the GeoModel mockup workflow and aligns the mockup geometry IDs so digitization can consistently resolve a common sector frame.

1. MuonSpacePointDigitizer:

  • Replaced chamber-frame helper with toSectorFrame() using a representative tracking volume.
  • Grouping changed from chamber-like IDs to sector IDs (volume-level key).
  • Added configurable bucket controls:
    • bucketMaxWindow (max longitudinal extent)
    • bucketNeighborWindow (max inter-point gap before split)
    • bucketOverlapWindow (tail overlap copied to next bucket)
    • minBucketSize (small buckets removed)
  • Implemented bucket split logic in sorted-z order per sector.
  • Added representative-volume resolution and caching per sector.

2. GeoModelMuonMockupBuilder:

  • Introduced sector parsing utilities from chamber names:
    • integer extraction by underscore tokenization
    • sector number extraction
    • eta-side sign extraction
  • Added a SectorKey = (station, sector, etaSide) grouping.
  • Assigned tracking volume IDs per sector key with explicit counter and capacity checks.
  • Assigned layer blocks per chamber/child volume to avoid collisions and preserve sector-consistent IDs.
  • Updated processStation() API to pass station index and shared nextVolumeId.

3. Examples/Scripts/Python/geomodel_G4.py:

  • Added useful CLI knobs: dumpGeoModelDb, nSectors, nEtaStations, disableEndcaps

4. Examples/Detectors/MuonSpectrometerMockupDetector/src/GeoMuonMockupExperiment.cpp:

  • Switched from std::any_cast to std::get and updated exception handling to std::bad_variant_access to match current key type usage.

5. Python/Examples/src/Digitization.cpp:

  • Extended Python digitization binding to pass new bucketization window parameters.
Screenshot 2026-03-10 at 17 06 26

@dimitra97 @junggjo9

@github-actions github-actions Bot added the Component - Examples Affects the Examples module label Mar 10, 2026
@github-actions github-actions Bot added this to the next milestone Mar 10, 2026
Comment thread Examples/Algorithms/Digitization/src/MuonSpacePointDigitizer.cpp Outdated
Comment thread Examples/Detectors/GeoModelDetector/src/GeoModelMuonMockupBuilder.cpp Outdated
Comment thread Examples/Detectors/GeoModelDetector/src/GeoModelMuonMockupBuilder.cpp Outdated
@davidedicroce davidedicroce marked this pull request as draft March 10, 2026 15:45
@davidedicroce davidedicroce changed the title Muon buckets: sector frame + bucket splitting feat: muon buckets sector frame + bucket splitting Mar 10, 2026
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

📊: Physics performance monitoring for 27ca050

Full contents

physmon summary

@davidedicroce davidedicroce marked this pull request as ready for review March 10, 2026 20:29
@andiwand andiwand requested a review from dimitra97 March 16, 2026 19:57
Comment thread Examples/Algorithms/Digitization/src/MuonSpacePointDigitizer.cpp Outdated
Comment thread Examples/Algorithms/Digitization/src/MuonSpacePointDigitizer.cpp Outdated
const double var0 = cov[0];
const double var1 = cov[1];
const double maxVar = std::max({0., var0, var1});
return sigmaScale * std::sqrt(maxVar);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wait that's a bit edgy. The variances describe the measurement's uncertainty in x and y. How does this relate?

Comment on lines +132 to +133
if (trackingGeometry.findVolume(volId) != nullptr) {
return volId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How is it possible that an invalid volume identifier is in the list?

Comment thread Examples/Algorithms/Digitization/src/MuonSpacePointDigitizer.cpp Outdated
Comment thread Examples/Algorithms/Digitization/src/MuonSpacePointDigitizer.cpp Outdated
Comment thread Examples/Algorithms/Digitization/src/MuonSpacePointDigitizer.cpp Outdated
@github-actions github-actions Bot added the Stale label Apr 30, 2026
@github-actions github-actions Bot removed the Stale label May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Examples Affects the Examples module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants