Skip to content

feat: ingest EventHeader into digi, generate UID to reseed RNG #1934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

wdconinc
Copy link
Contributor

@wdconinc wdconinc commented Jun 27, 2025

Briefly, what does this PR introduce?

One challenge of multi-threaded/concurrent running is that the random number generators are called in no predictable order; this affects both events which can come out of order, or algorithms within the same event which can be called in different orders for different branches. That results in non-reproducibility.

This PR ingests the event header into digitization algorithms (which is our main use for random sampling). The event header is combined with the algorithm name into a random seed for that event/algorithm combination. With this seed, the random number generator is reseeded.

Outside the scope of this PR is reverting back to a single random service instead of the various algorithm specific approaches.

Still TODO in this algorithm:

  • expose the top-level seed used to generate event-level seeds as a property for setting through JANA.

What kind of change does this PR introduce?

  • Bug fix (issue: lack of reproducibility for multi-threaded running)
  • New feature (issue #__)
  • Documentation update
  • Other: __

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?

Yes. It results in a different random number sequence, so all distributions will be shuffled.

@github-actions github-actions bot added topic: calorimetry relates to calorimetry topic: PID Relates to PID reconstruction topic: far-forward Far forward reconstruction topic: far-backward Reconstruction related to far backward detectors topic: barrel topic: forward topic: backward topic: digitization labels Jun 27, 2025
@github-actions github-actions bot added the topic: tracking Relates to tracking reconstruction label Jun 27, 2025
@wdconinc
Copy link
Contributor Author

@wdconinc

This comment was marked as resolved.

@wdconinc

This comment was marked as resolved.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

@github-actions github-actions bot dismissed their stale review July 1, 2025 13:58

No Clang-Tidy warnings found so I assume my comments were addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: backward topic: barrel topic: calorimetry relates to calorimetry topic: digitization topic: far-backward Reconstruction related to far backward detectors topic: far-forward Far forward reconstruction topic: forward topic: infrastructure topic: PID Relates to PID reconstruction topic: tracking Relates to tracking reconstruction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants