-
Notifications
You must be signed in to change notification settings - Fork 168
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
feat: configurable particle gun #1093
feat: configurable particle gun #1093
Conversation
particleConfig: list | ||
partilce configuration: number of particles, particle type, charge flip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argubaly this could be separate arguments, like numParticles
, particlePdg
and particleCargeFlip
or something.
Codecov Report
@@ Coverage Diff @@
## main #1093 +/- ##
=======================================
Coverage 48.61% 48.61%
=======================================
Files 341 341
Lines 17499 17499
Branches 8261 8261
=======================================
Hits 8508 8508
Misses 3218 3218
Partials 5773 5773 Continue to review full report at Codecov.
|
Thanks, @asalzburger! I'll give it a go. |
def runParticleGun( | ||
outputDirCsv = None, | ||
outputDirRoot = None, | ||
pConfig = [1 * u.GeV, 10 * u.GeV, True], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better named momentumConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing your own code? 😄
Changes will be incorporated into other PR |
* configurable particle gun * Python particle_gun and fatras examples can now be chained * `addParticleGun` and `addFatras` adds the required modules to the `Sequence`. * `runParticleGun` and `runFatras` rewritten to use `add*` to reproduce exactly the previous behaviour. * `ROOT_HASH_CHECKS=on pytest` run as before without change. * Optionally `runParticleGun` and `runFatras` can now accept `outputDir` as `pathlib.Path` or `str` (like `add*`) * Other Python examples not yet changed. Let's see how this one goes down. * rename `pConfig`->`momentumConfig` as per Andi's comment in #1093 * use Path where possible (#1128 (comment)) * use `namedtuple` to pass particle gun parameters * Keep ParametricParticleGenerator defaults if not specified by caller. Rely on defaults in examples. * allow `addParticleGun(MomentumConfig())` etc to be specified without keyword Co-authored-by: Andreas Salzburger <[email protected]> Co-authored-by: Tim Adye <[email protected]> Co-authored-by: robertlangenberg <[email protected]>
Update the Python in `Examples/Scripts/Python` to allow configuration of various full-chain examples. Continuing the work of acts-project#1098 in order to complete the proposal originally discussed in acts-project#1093.
This is my first attempt of updating the python scripts to be more flexible if needed.
Also tagging: @timadye