Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kazuya Mochizuki
athena
Commits
ca2c700e
Commit
ca2c700e
authored
Dec 02, 2019
by
scott snyder
Browse files
egammaToolsc: Basic python3 fixes.
- print function. - Relative import fixes. - iteritems
parent
483de04a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py
View file @
ca2c700e
...
...
@@ -48,7 +48,7 @@ class EMPIDBuilderElectronBase ( EMPIDBuilder ) :
except
:
mlog
.
error
(
"could not get configure tools"
)
print
traceback
.
forma
t_exc
()
traceback
.
prin
t_exc
()
return
False
self
.
electronIsEMselectors
=
[
LooseElectronSelector
,
MediumElectronSelector
,
TightElectronSelector
]
...
...
@@ -74,7 +74,7 @@ class EMPIDBuilderPhotonBase ( EMPIDBuilder ) :
except
:
mlog
.
error
(
"could not get configure tools"
)
print
traceback
.
forma
t_exc
()
traceback
.
prin
t_exc
()
return
False
self
.
photonIsEMselectors
=
[
LoosePhotonSelector
,
TightPhotonSelector
]
...
...
Reconstruction/egamma/egammaTools/python/EMTrackMatchBuilder.py
View file @
ca2c700e
# Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-201
9
CERN for the benefit of the ATLAS collaboration
__doc__
=
"ToolFactory to instantiate EMTrackMatchBuilder with default configuration"
__author__
=
"Bruno Lenzi"
import
egammaToolsConf
from
egammaTools
import
egammaToolsConf
from
egammaRec.Factories
import
FcnWrapper
,
ToolFactory
from
egammaRec
import
egammaKeys
from
RecExConfig.RecFlags
import
rec
...
...
Reconstruction/egamma/egammaTools/python/egammaOQFlagsBuilder.py
View file @
ca2c700e
# Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-201
9
CERN for the benefit of the ATLAS collaboration
import
egammaToolsConf
from
egammaTools
import
egammaToolsConf
from
egammaRec.Factories
import
FcnWrapper
,
ToolFactory
from
egammaRec
import
egammaKeys
...
...
Reconstruction/egamma/egammaTools/python/egammaSwToolConfig.py
View file @
ca2c700e
...
...
@@ -6,6 +6,7 @@ from AthenaCommon.Logging import logging
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
from
egammaTools.egammaToolsConf
import
egammaSwTool
import
six
def
_configureClusterCorrections
(
swTool
,
flags
):
"Add attributes ClusterCorrectionToolsXX to egammaSwTool object"
...
...
@@ -19,7 +20,7 @@ def _configureClusterCorrections(swTool, flags):
Econv35
=
'gam35_conv'
,
Econv55
=
'gam55_conv'
,
Econv37
=
'gam37_conv'
)
for
attrName
,
clName
in
clusterTypes
.
iteritems
(
):
for
attrName
,
clName
in
six
.
iteritems
(
clusterTypes
):
x
=
'ClusterCorrectionTools'
+
attrName
if
not
hasattr
(
swTool
,
x
)
or
getattr
(
swTool
,
x
):
continue
...
...
@@ -30,7 +31,7 @@ def _configureClusterCorrections(swTool, flags):
# Super cluster position only corrections
if
flags
.
Egamma
.
doSuperclusters
:
for
attrName
,
clName
in
clusterTypes
.
iteritems
(
):
for
attrName
,
clName
in
six
.
iteritems
(
clusterTypes
):
n
=
'ClusterCorrectionToolsSuperCluster'
+
attrName
if
not
hasattr
(
swTool
,
n
)
or
getattr
(
swTool
,
n
):
continue
...
...
Reconstruction/egamma/egammaTools/python/egammaToolsFactories.py
View file @
ca2c700e
# Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-201
9
CERN for the benefit of the ATLAS collaboration
__doc__
=
"ToolFactories to instantiate all egammaTools with default configuration"
__author__
=
"Bruno Lenzi"
import
egammaToolsConf
from
egammaTools
import
egammaToolsConf
from
egammaRec.Factories
import
FcnWrapper
,
ToolFactory
from
egammaRec
import
egammaKeys
from
egammaRec.egammaRecFlags
import
jobproperties
# to set jobproperties.egammaRecFlags
from
RecExConfig.RecFlags
import
rec
import
six
def
configureClusterCorrections
(
swTool
):
"Add attributes ClusterCorrectionToolsXX to egammaSwTool object"
from
CaloClusterCorrection.CaloSwCorrections
import
make_CaloSwCorrections
,
rfac
,
etaoff_b1
,
etaoff_e1
,
\
...
...
@@ -20,7 +22,7 @@ def configureClusterCorrections(swTool):
Gam35
=
'gam35_unconv'
,
Gam55
=
'gam55_unconv'
,
Gam37
=
'gam37_unconv'
,
Econv35
=
'gam35_conv'
,
Econv55
=
'gam55_conv'
,
Econv37
=
'gam37_conv'
)
for
attrName
,
clName
in
clusterTypes
.
iteritems
(
):
for
attrName
,
clName
in
six
.
iteritems
(
clusterTypes
):
x
=
'ClusterCorrectionTools'
+
attrName
if
not
hasattr
(
swTool
,
x
)
or
getattr
(
swTool
,
x
):
continue
...
...
@@ -31,7 +33,7 @@ def configureClusterCorrections(swTool):
#Super cluster position only corrections
if
jobproperties
.
egammaRecFlags
.
doSuperclusters
():
for
attrName
,
clName
in
clusterTypes
.
iteritems
(
):
for
attrName
,
clName
in
six
.
iteritems
(
clusterTypes
):
n
=
'ClusterCorrectionToolsSuperCluster'
+
attrName
if
not
hasattr
(
swTool
,
n
)
or
getattr
(
swTool
,
n
):
continue
...
...
@@ -78,14 +80,14 @@ egammaLargeClusterMakerTool = ToolFactory( egammaToolsConf.egammaLargeClusterMak
)
# Electron Selectors
from
EMPIDBuilderBase
import
EMPIDBuilderElectronBase
from
.
EMPIDBuilderBase
import
EMPIDBuilderElectronBase
ElectronPIDBuilder
=
ToolFactory
(
EMPIDBuilderElectronBase
,
name
=
"ElectronPIDBuilder"
)
# Photon Selectors
from
EMPIDBuilderBase
import
EMPIDBuilderPhotonBase
from
.
EMPIDBuilderBase
import
EMPIDBuilderPhotonBase
PhotonPIDBuilder
=
ToolFactory
(
EMPIDBuilderPhotonBase
,
name
=
"PhotonPIDBuilder"
)
# F
a
rwardElectron Selectors
# F
o
rwardElectron Selectors
from
ElectronPhotonSelectorTools.ConfiguredAsgForwardElectronIsEMSelectors
import
ConfiguredAsgForwardElectronIsEMSelector
import
cppyy
...
...
@@ -99,6 +101,6 @@ TightForwardElectronSelector = ToolFactory( ConfiguredAsgForwardElectronIsEMSele
#-------------------------
# Import the factories that are not defined here
from
EMShowerBuilder
import
EMShowerBuilder
from
egammaOQFlagsBuilder
import
egammaOQFlagsBuilder
from
EMTrackMatchBuilder
import
EMTrackMatchBuilder
from
.
EMShowerBuilder
import
EMShowerBuilder
from
.
egammaOQFlagsBuilder
import
egammaOQFlagsBuilder
from
.
EMTrackMatchBuilder
import
EMTrackMatchBuilder
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment