From b3d8e8673ebff363e5f1349f9a7fe3dad7efd667 Mon Sep 17 00:00:00 2001 From: Manuel Huber Date: Tue, 7 May 2024 20:17:44 +0200 Subject: [PATCH] PEN: add resolutionscale Without this Geant4 will abort when trying to scintillate in a PEN volume. --- src/legendoptics/pen.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/legendoptics/pen.py b/src/legendoptics/pen.py index c3d0d14..4ff1df8 100644 --- a/src/legendoptics/pen.py +++ b/src/legendoptics/pen.py @@ -189,6 +189,10 @@ def pyg4_pen_attach_scintillation(mat, reg) -> None: mat.addConstPropertyPint("SCINTILLATIONTIMECONSTANT1", pen_scint_timeconstant()) + # We do not know the PEN fano factor. Geant4 calculates σ = RESOLUTIONSCALE × √mean, + # so we set it to 1; otherwise Geant4 will crash. + mat.addConstPropertyPint("RESOLUTIONSCALE", 1) + # setup scintillation response just for electrons. scint_config = ScintConfig( flat_top=pen_scint_light_yield(),