Skip to content

Commit

Permalink
Merge branch 'main' into beta_yields
Browse files Browse the repository at this point in the history
  • Loading branch information
ramirezdiego authored Jun 27, 2024
2 parents d3ae87f + de0d8bf commit c70a7b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions fuse/plugins/micro_physics/yields.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NestYields(FuseBasePlugin):
"""Plugin that calculates the number of photons, electrons and excitons
produced by energy deposit using nestpy."""

__version__ = "0.2.1"
__version__ = "0.2.2"

depends_on = ("interactions_in_roi", "electric_field_values")
provides = "quanta"
Expand Down Expand Up @@ -132,22 +132,18 @@ def _quanta_from_NEST(en, model, e_field, A, Z, create_s2, **kwargs):
# https://github.com/NESTCollaboration/nestpy/blob/e82c71f864d7362fee87989ed642cd875845ae3e/src/nestpy/helpers.py#L94-L100
if model == 0 and en > 2e2:
log.warning(
f"Energy deposition of {en} keV beyond NEST validity "
"for NR model of 200 keV - Remove Interaction"
f"Energy deposition of {en} keV beyond NEST validity " "for NR model of 200 keV"
)
return -1, -1, -1

if model == 7 and en > 3e3:
log.warning(
f"Energy deposition of {en} keV beyond NEST validity "
"for gamma model of 3 MeV - Remove Interaction"
f"Energy deposition of {en} keV beyond NEST validity " "for gamma model of 3 MeV"
)
return -1, -1, -1

if model == 8 and en > 3e3:
log.warning(
f"Energy deposition of {en} keV beyond NEST validity "
"for beta model of 3 MeV - Remove Interaction"
f"Energy deposition of {en} keV beyond NEST validity " "for beta model of 3 MeV"
)
return -1, -1, -1

y = nc.GetYields(
interaction=nestpy.INTERACTION_TYPE(model),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_MicroPhysics_alt_Yields.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def yields_dummy_func(x):
To be used as a dummy function for the BetaYields plugin. Needs to
be defined outside the test class to be picklable.
"""
return 40
return 40, 30


class TestAlternativeYields(unittest.TestCase):
Expand Down

0 comments on commit c70a7b2

Please sign in to comment.