Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
d08e0130
Commit
d08e0130
authored
2 years ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
DDSim: Userfunction: catch and log exceptions
parent
c417b5be
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDG4/python/DDSim/Helper/Physics.py
+8
-1
8 additions, 1 deletion
DDG4/python/DDSim/Helper/Physics.py
with
8 additions
and
1 deletion
DDG4/python/DDSim/Helper/Physics.py
+
8
−
1
View file @
d08e0130
...
@@ -5,8 +5,11 @@ import os
...
@@ -5,8 +5,11 @@ import os
from
DDSim.Helper.ConfigHelper
import
ConfigHelper
from
DDSim.Helper.ConfigHelper
import
ConfigHelper
from
g4units
import
mm
from
g4units
import
mm
import
logging
import
ddsix
as
six
import
ddsix
as
six
logger
=
logging
.
getLogger
(
__name__
)
class
Physics
(
ConfigHelper
):
class
Physics
(
ConfigHelper
):
"""
Configuration for the PhysicsList
"""
"""
Configuration for the PhysicsList
"""
...
@@ -139,7 +142,11 @@ class Physics(ConfigHelper):
...
@@ -139,7 +142,11 @@ class Physics(ConfigHelper):
rg
.
RangeCut
=
self
.
rangecut
rg
.
RangeCut
=
self
.
rangecut
for
func
in
self
.
_userFunctions
:
for
func
in
self
.
_userFunctions
:
func
(
kernel
)
try
:
func
(
kernel
)
except
Exception
as
e
:
logger
.
error
(
"
Exception in UserFunction: %r
"
,
e
)
raise
RuntimeError
(
"
Exception in UserFunction: %r
"
%
e
)
return
seq
return
seq
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment