function for lar inside / outside NMS (l200)#21
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
==========================================
+ Coverage 61.14% 62.38% +1.24%
==========================================
Files 20 21 +1
Lines 1588 1675 +87
==========================================
+ Hits 971 1045 +74
- Misses 617 630 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7fa7fa8 to
189d6c5
Compare
ae04198 to
67177fd
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds utility functions to generate LAr confinement commands for remage simulations, specifically for confining particle generation inside or outside the minishroud (NMS) regions in the L200 geometry. The functions parse GDML geometry using pyg4ometry and output configuration commands.
Changes:
- Added
_get_matching_volumeshelper function to match volume names using wildcard patterns - Added
get_lar_minishroud_confine_commandsfunction to extract geometry parameters and generate remage confinement commands - Added
pyg4ometryimport for GDML parsing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I added the option to run in the simflow based on the new confinment option "~lar_volumes" which can be either "inside_nms" or "outside_nms". In the end it would been nice to have a flexible interace but it ends up a bit challenging, I could think of nothing not involving evaling strings. I also did not particularly want to make a new tier, although this is of course an option (handled similarly to I think this is ugly but I do not have a better suggestion |
7d4c14f to
c666099
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
why don't we implement a very simple "processor spec" where some args like the registry are always provided internally? similarly to what we do in the pygama evt tier: but simpler. the syntax could be something like confinement: ~function:do_the_thing(..., is_inside=True)where |
|
Yes but then we need to eval?
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Luigi Pertoldi ***@***.***>
Sent: Tuesday, February 10, 2026 9:14:51 PM
To: legend-exp/legend-simflow ***@***.***>
Cc: Toby Dixon ***@***.***>; Author ***@***.***>
Subject: Re: [legend-exp/legend-simflow] function for lar inside / outside NMS (l200) (PR #21)
⚠ Caution: External sender
[https://avatars.githubusercontent.com/u/20358192?s=20&v=4]gipert left a comment (legend-exp/legend-simflow#21)<#21 (comment)>
why don't we implement a very simple "processor spec" where some args like the registry are always provided internally? similarly to what we do in the pygama evt tier:
https://github.com/legend-exp/pygama/blob/a8bea112ecfa1e0640f3f313f4398bf283b068f8/src/pygama/evt/build_evt.py#L510-L561
but simpler. the syntax could be something like
confinement: ~function:do_the_thing(..., is_inside=True)
where ... is substituted with the implicit args (see pygama code)
—
Reply to this email directly, view it on GitHub<#21 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANSET4Y72TJJ24F3IFIR3LD4LJC4XAVCNFSM6AAAAACMA2223SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQOBQG42TCNJUHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
|
Anyway I think I agree lets do this for now
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Toby Dixon ***@***.***>
Sent: Tuesday, February 10, 2026 9:34:42 PM
To: legend-exp/legend-simflow ***@***.***>; legend-exp/legend-simflow ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [legend-exp/legend-simflow] function for lar inside / outside NMS (l200) (PR #21)
Yes but then we need to eval?
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Luigi Pertoldi ***@***.***>
Sent: Tuesday, February 10, 2026 9:14:51 PM
To: legend-exp/legend-simflow ***@***.***>
Cc: Toby Dixon ***@***.***>; Author ***@***.***>
Subject: Re: [legend-exp/legend-simflow] function for lar inside / outside NMS (l200) (PR #21)
⚠ Caution: External sender
[https://avatars.githubusercontent.com/u/20358192?s=20&v=4]gipert left a comment (legend-exp/legend-simflow#21)<#21 (comment)>
why don't we implement a very simple "processor spec" where some args like the registry are always provided internally? similarly to what we do in the pygama evt tier:
https://github.com/legend-exp/pygama/blob/a8bea112ecfa1e0640f3f313f4398bf283b068f8/src/pygama/evt/build_evt.py#L510-L561
but simpler. the syntax could be something like
confinement: ~function:do_the_thing(..., is_inside=True)
where ... is substituted with the implicit args (see pygama code)
—
Reply to this email directly, view it on GitHub<#21 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANSET4Y72TJJ24F3IFIR3LD4LJC4XAVCNFSM6AAAAACMA2223SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQOBQG42TCNJUHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.
Comments suppressed due to low confidence (1)
workflow/src/legendsimflow/commands.py:432
- This error message lists
~define:but the implemented prefix is~defines:. Since this string is shown to users on config errors, please correct it (and keep the list of valid prefixes consistent with the actualstartswithchecks).
msg = (
(
"the field must be a str or list[str] prefixed by "
"~define: / ~volumes.surface: / ~volumes.bulk: / ~function: or ~vertices:"
),
f"{block}.confinement",
)
raise SimflowConfigError(*msg)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@gipert if you add the better handling of the geometry, I think this is ready (apart from the detail of what outer LAr volume to use). Then we have everything for the stp tier... |


Not clear where this belongs.