feat: python based tracking geometry display#5303
feat: python based tracking geometry display#5303asalzburger wants to merge 2 commits intoacts-project:mainfrom
Conversation
|
benjaminhuth
left a comment
There was a problem hiding this comment.
Some comments, but nothing major.
| return split_polys, join_markers | ||
|
|
||
|
|
||
| def _dedupe_surfaces_by_geometry_id(surfaces): |
There was a problem hiding this comment.
I believe a plain python set would be a better fit here
There was a problem hiding this comment.
Hmm not sure, don't we have this in C++, and can bind the geometry identifier? Do we need a reimplementation in Python?
| project_polyhedron_vertices, | ||
| surface_to_2d_patches, | ||
| ) | ||
| from .tracking_surfaces import ( |
There was a problem hiding this comment.
More a style question, do we want to import all these functions into the acts.utilities module, or wouldn't it be clearer to have acts.utilities.projection2d.function?
There was a problem hiding this comment.
Hmm maybe this is too early, but I would find it nice to split geometry-specific and generic parts.
One could e.g. have a function/class in a non-executable script takes the subsystem-volume-id dicts and then separate the ODD / generic detector specific scripts in one or two dedicated scripts
E.g.,
Python/Utilities/display_tracking_geometry.py
Examples/Scripts/Python/display_odd.py
Examples/Scripts/Python/display_generic.py
| sensitive = collect_sensitive_surfaces(tracking_geometry) | ||
| material = collect_material_surfaces(tracking_geometry) | ||
| if category == "sensitive": | ||
| return sensitive | ||
| if category == "material": | ||
| return material | ||
| if category == "all": | ||
| return _dedupe_surfaces_by_geometry_id([*sensitive, *material]) |
There was a problem hiding this comment.
| sensitive = collect_sensitive_surfaces(tracking_geometry) | |
| material = collect_material_surfaces(tracking_geometry) | |
| if category == "sensitive": | |
| return sensitive | |
| if category == "material": | |
| return material | |
| if category == "all": | |
| return _dedupe_surfaces_by_geometry_id([*sensitive, *material]) | |
| sensitive = collect_sensitive_surfaces(tracking_geometry) | |
| material = collect_material_surfaces(tracking_geometry) | |
| if category == "sensitive": | |
| return collect_sensitive_surfaces(tracking_geometry) | |
| if category == "material": | |
| return collect_material_surfaces(tracking_geometry) | |
| if category == "all": | |
| return _dedupe_surfaces_by_geometry_id([ | |
| *collect_material_surfaces(tracking_geometry), | |
| *collect_material_surfaces(tracking_geometry) | |
| ]) |




This PR adds a utility that let you display some features of the tracking geometry, e.g. where material surface are etc. etc.
--- END COMMIT MESSAGE ---
Examples:
Or even just inspect the detector:
With output:
Any further description goes here, @-mentions are ok here!
feat,fix,refactor,docs,choreandbuildtypes.