Skip to content
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

Allow source modules to use random number engines from the RandomNumberGenerator service. #99

Open
knoepfel opened this issue Oct 28, 2021 · 1 comment
Labels
feature An enhancement to the project

Comments

@knoepfel
Copy link
Contributor

This issue has been migrated from https://cdcvs.fnal.gov/redmine/issues/23582 (FNAL account required)
Originally created by @kutschke on 2019-11-12 18:42:11


In the original design discussions for RandomNumberGenerator service we decided to restrict it's use to producer and analyzer modules; in particular source models could not use it.

Mu2e now has a use case to allow it. We run the CORSIKA cosmic ray air shower MC. It produces showers with a footprint many times larger than the Mu2e world. It is moderately expensive to run since it uses FLUKA to interact cosmic rays with the atmosphere and allow the shower to develop. We run CORSIKA in a stand alone job and write a CORSIKA binary format output file. Our source model reads the output file.

  1. On art event 1, read in one CORSIKA event from the input file.
  2. Choose a random part of the CORSIKA event footprint and map that onto the Mu2e world; run G4 and the rest of our workflow.
  3. On the next art event, do not read in a CORSIKA event. Choose another random part of the footprint and map it onto the Mu2e world; run G4 etc
  4. Repeat 3) until we have sampled the CORSIKA event enough; then read in a new CORSIKA event and continue.

We would like to read in one event. Randomly choose a piece of the shower footprint that is the size of the Mu2e world

@knoepfel knoepfel added the feature An enhancement to the project label Oct 28, 2021
@knoepfel
Copy link
Contributor Author

Comment by @knoepfel on 2019-11-13 14:21:25


This feature request will require some discussion among the art developers. There are some issues related to capturing and restoring the state of the RandomNumberGenerator that may be difficult to address if createEngine is callable from sources/detail templates. For now, the best approach is to create your own CLHEP random number engine inside of the source, independent of art's RandomNumberGenerator service.

This feature will not be included in art version:3.04.00.

@knoepfel knoepfel added this to Issues Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature An enhancement to the project
Projects
Status: No status
Development

No branches or pull requests

1 participant