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
68b699fc
Commit
68b699fc
authored
7 years ago
by
Ercan Pilicer
Committed by
Marko Petric
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove import exceptions
parent
2be7b002
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDG4/python/DD4hep.py
+2
-2
2 additions, 2 deletions
DDG4/python/DD4hep.py
DDG4/python/DDG4.py
+6
-9
6 additions, 9 deletions
DDG4/python/DDG4.py
with
8 additions
and
11 deletions
DDG4/python/DD4hep.py
+
2
−
2
View file @
68b699fc
...
...
@@ -15,7 +15,7 @@ logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
# We compile the DDG4 plugin on the fly if it does not exist using the AClick mechanism:
def
compileAClick
(
dictionary
,
g4
=
True
):
from
ROOT
import
gInterpreter
,
gSystem
import
sys
,
imp
,
exceptions
import
sys
,
imp
import
os.path
dd4hep
=
os
.
environ
[
'
DD4hepINSTALL
'
]
inc
=
'
-I
'
+
os
.
environ
[
'
ROOTSYS
'
]
+
'
/include -I
'
+
dd4hep
+
'
/include
'
...
...
@@ -71,7 +71,7 @@ def import_root(nam):
try
:
dd4hep
=
loaddd4hep
()
import
ROOT
except
Exception
,
X
:
except
Exception
as
X
:
import
sys
logging
.
info
(
'
+--%-100s--+
'
,
100
*
'
-
'
)
logging
.
info
(
'
| %-100s |
'
,
'
Failed to load dd4hep base library:
'
)
...
...
This diff is collapsed.
Click to expand it.
DDG4/python/DDG4.py
+
6
−
9
View file @
68b699fc
...
...
@@ -121,7 +121,6 @@ def _registerGlobalFilter(self,filter):
self
.
get
().
registerGlobalFilter
(
Interface
.
toAction
(
filter
))
#---------------------------------------------------------------------------
def
_getKernelProperty
(
self
,
name
):
import
exceptions
#logging.info('_getKernelProperty: %s %s',str(type(self)),name)
ret
=
Interface
.
getPropertyKernel
(
self
.
get
(),
name
)
if
ret
.
status
>
0
:
...
...
@@ -131,16 +130,15 @@ def _getKernelProperty(self, name):
elif
hasattr
(
self
,
name
):
return
getattr
(
self
,
name
)
msg
=
'
Geant4Kernel::GetProperty [Unhandled]: Cannot access Kernel.
'
+
name
raise
exceptions
.
KeyError
(
msg
)
raise
KeyError
(
msg
)
#---------------------------------------------------------------------------
def
_setKernelProperty
(
self
,
name
,
value
):
import
exceptions
#logging.info('_setKernelProperty: %s %s',name,str(value))
if
Interface
.
setPropertyKernel
(
self
.
get
(),
name
,
str
(
value
)):
return
msg
=
'
Geant4Kernel::SetProperty [Unhandled]: Cannot set Kernel.
'
+
name
+
'
=
'
+
str
(
value
)
raise
exceptions
.
KeyError
(
msg
)
raise
KeyError
(
msg
)
#---------------------------------------------------------------------------
def
_kernel_phase
(
self
,
name
):
return
self
.
addSimplePhase
(
name
,
False
)
...
...
@@ -250,7 +248,7 @@ _import_class('CLHEP','HepRandomEngine')
#---------------------------------------------------------------------------
def
_get
(
self
,
name
):
import
exceptions
,
traceback
import
traceback
#logging.info('_get: %s %s',str(type(self)),name)
a
=
Interface
.
toAction
(
self
)
ret
=
Interface
.
getProperty
(
a
,
name
)
...
...
@@ -264,16 +262,15 @@ def _get(self, name):
# return getattr(self,name)
#traceback.print_stack()
msg
=
'
Geant4Action::GetProperty [Unhandled]: Cannot access property
'
+
a
.
name
()
+
'
.
'
+
name
raise
exceptions
.
KeyError
(
msg
)
raise
KeyError
(
msg
)
def
_set
(
self
,
name
,
value
):
import
exceptions
#logging.info('_set: %s %s',name,str(value))
a
=
Interface
.
toAction
(
self
)
if
Interface
.
setProperty
(
a
,
name
,
str
(
value
)):
return
msg
=
'
Geant4Action::SetProperty [Unhandled]: Cannot set
'
+
a
.
name
()
+
'
.
'
+
name
+
'
=
'
+
str
(
value
)
raise
exceptions
.
KeyError
(
msg
)
raise
KeyError
(
msg
)
def
_props
(
obj
):
_import_class
(
'
Sim
'
,
obj
)
...
...
@@ -383,7 +380,7 @@ class Geant4:
if
worker
:
init_action
.
setWorkerSetup
(
worker
,
worker_args
)
else
:
raise
exceptions
.
RuntimeError
(
'
Invalid argument for Geant4 worker initialization
'
)
raise
RuntimeError
(
'
Invalid argument for Geant4 worker initialization
'
)
#
if
master
:
init_action
.
setMasterSetup
(
master
,
master_args
)
...
...
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