Legend simulation geometry management system
Demonstrate a proof of principle system, managing a baseline Legend simulation geometry in Python.
Depends on PyG4ometry:
Run testscript.py for output to terminal. See the list of logical volumes and physical volumes created and how to get hold of positioning information on dedicated detector locations in the geometry as example.
The L1000Baseline object in LegendBaseline.L1000Baseline.L1000CompleteSetup knows how to build itself, how to draw itself (see pyG4ometry's VTK dependence) and how to export the geometry to GDML, suitable for a general Geant4 simulation application.
# Create, activate a virtualenv for local development
$ python3 -m venv env
$ source ./env/bin/activate
# Create editable install with development packages
(env) $ python3 -m pip install -e '.[all]'
...
# Run tests, coverage
(env) $ pytest
...
(env) $ pytest --cov=pylegendgeom
... edit/test/repeat ...
# Build/Check docs
(env) $ cd docs
(env) $ make
... open build/html/index.html in browser of your choice ..
# Run checks before committing
(env) $ pre-commit run --all-files
TODO: Looking at providing a noxfile
to
help basic use, but see SciKit-HEP's guidelines on this tool.
Note also that pyg4ometry is only packaged for Python 3.8-3.10 and limited platforms
across that. Nox runs with the python it was installed with, so may not always
match and configuration needed to do this is not totally obvious at the moment.