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
48669fca
Commit
48669fca
authored
Jul 29, 2021
by
Christos Anastopoulos
Browse files
Further clean up e/gamma selector config. Remove unneeded usages of cppyy
parent
1a6faa74
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/ForwardElectronIsEMSelectorMapping.py
View file @
48669fca
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
##=============================================================================
## Name: ForwardElectronIsEMSelectorMapping.py
# =============================================================================
# Name: ForwardElectronIsEMSelectorMapping.py
#
# Author: Tulay Cuhadar Donszelmann, Jovan Mitrevski
# Created: Dec 2011
##
## Author: Tulay Cuhadar Donszelmann, Jovan Mitrevski
## Created: Dec 2011
##
## Description: Find mapping of mask and function for ID quality
##=============================================================================
# Description: Find mapping of mask and function for ID quality
# =============================================================================
import
cppyy
cppyy
.
include
(
"ElectronPhotonSelectorTools/egammaPIDdefs.h"
)
from
ElectronPhotonSelectorTools.EgammaPIDdefs
import
egammaPID
#
import
ElectronPhotonSelectorTools.ForwardElectronIsEMLooseSelectorCutDefs
as
ForwardElectronIsEMLooseSelectorCutDefs
import
ElectronPhotonSelectorTools.ForwardElectronIsEMTightSelectorCutDefs
as
ForwardElectronIsEMTightSelectorCutDefs
import
ElectronPhotonSelectorTools.ForwardElectronIsEMMediumSelectorCutDefs
as
ForwardElectronIsEMMediumSelectorCutDefs
from
ROOT
import
egammaPID
class
forwardelectronPIDmenu
:
menuMC15
=
0
import
ElectronPhotonSelectorTools.ForwardElectronIsEMLooseSelectorCutDefs
as
ForwardElectronIsEMLooseSelectorCutDefs
import
ElectronPhotonSelectorTools.ForwardElectronIsEMMediumSelectorCutDefs
as
ForwardElectronIsEMMediumSelectorCutDefs
import
ElectronPhotonSelectorTools.ForwardElectronIsEMTightSelectorCutDefs
as
ForwardElectronIsEMTightSelectorCutDefs
# format - key: (mask, function)
ForwardElectronIsEMMapMC15
=
{
egammaPID
.
ForwardElectronIDLoose
:
(
egammaPID
.
ID_ForwardElectron
,
ForwardElectronIsEMLooseSelectorCutDefs
.
ForwardElectronIsEMLooseSelectorConfigMC15
),
egammaPID
.
ForwardElectronIDMedium
:
(
egammaPID
.
ID_ForwardElectron
,
ForwardElectronIsEMMediumSelectorCutDefs
.
ForwardElectronIsEMMediumSelectorConfigMC15
),
egammaPID
.
ForwardElectronIDTight
:
(
egammaPID
.
ID_ForwardElectron
,
ForwardElectronIsEMTightSelectorCutDefs
.
ForwardElectronIsEMTightSelectorConfigMC15
),
egammaPID
.
NoIDCut
:
(
0
,
ForwardElectronIsEMLooseSelectorCutDefs
.
ForwardElectronIsEMLooseSelectorConfigMC15
)
}
egammaPID
.
ForwardElectronIDLoose
:
(
egammaPID
.
ID_ForwardElectron
,
ForwardElectronIsEMLooseSelectorCutDefs
.
ForwardElectronIsEMLooseSelectorConfigMC15
),
egammaPID
.
ForwardElectronIDMedium
:
(
egammaPID
.
ID_ForwardElectron
,
ForwardElectronIsEMMediumSelectorCutDefs
.
ForwardElectronIsEMMediumSelectorConfigMC15
),
egammaPID
.
ForwardElectronIDTight
:
(
egammaPID
.
ID_ForwardElectron
,
ForwardElectronIsEMTightSelectorCutDefs
.
ForwardElectronIsEMTightSelectorConfigMC15
),
egammaPID
.
NoIDCut
:
(
0
,
ForwardElectronIsEMLooseSelectorCutDefs
.
ForwardElectronIsEMLooseSelectorConfigMC15
)
}
def
ForwardElectronIsEMMap
(
quality
,
menu
):
...
...
@@ -37,4 +43,3 @@ def ForwardElectronIsEMMap(quality, menu):
return
ForwardElectronIsEMMapMC15
[
quality
]
else
:
raise
ValueError
(
"Requested menu is undefined: %d"
%
menu
)
PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/python/PhotonIsEMSelectorCutDefs.py
deleted
100644 → 0
View file @
1a6faa74
This diff is collapsed.
Click to expand it.
Reconstruction/egamma/egammaAlgs/python/egammaForwardBuilderConfig.py
View file @
48669fca
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from
ROOT
import
egammaPID
from
ElectronPhotonSelectorTools.EgammaPIDdefs
import
egammaPID
from
ElectronPhotonSelectorTools.AsgForwardElectronIsEMSelectorsConfig
import
(
AsgForwardElectronIsEMSelectorCfg
)
import
cppyy
from
AthenaCommon.Logging
import
logging
from
AthenaConfiguration.ComponentFactory
import
CompFactory
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
...
...
@@ -11,8 +10,6 @@ from egammaTools.egammaOQFlagsBuilderConfig import egammaOQFlagsBuilderCfg
EMFourMomBuilder
=
CompFactory
.
EMFourMomBuilder
egammaForwardBuilder
=
CompFactory
.
egammaForwardBuilder
cppyy
.
load_library
(
'libElectronPhotonSelectorToolsDict'
)
def
egammaForwardBuilderCfg
(
flags
,
name
=
'egammaForwardElectron'
,
**
kwargs
):
...
...
Reconstruction/egamma/egammaTools/python/EMPIDBuilderBase.py
View file @
48669fca
# Copyright (C) 2002-202
0
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-202
1
CERN for the benefit of the ATLAS collaboration
# default configuration of the EMPIDBuilder
from
ROOT
import
LikeEnum
from
ROOT
import
egammaPID
from
ElectronPhotonSelectorTools.LikelihoodEnums
import
LikeEnum
from
ElectronPhotonSelectorTools.EgammaPIDdefs
import
egammaPID
from
AthenaCommon.Logging
import
logging
# import base class
from
egammaTools.egammaToolsConf
import
EMPIDBuilder
# Eventually we need to get rid of this
#import cppyy
#cppyy.load_library('libElectronPhotonSelectorToolsDict')
class
EMPIDBuilderElectronBase
(
EMPIDBuilder
):
__slots__
=
()
...
...
@@ -45,7 +41,6 @@ class EMPIDBuilderElectronBase (EMPIDBuilder):
"TightLHSelector"
,
LikeEnum
.
Tight
)
TightLHSelector
.
primaryVertexContainer
=
"PrimaryVertices"
self
.
electronIsEMselectors
=
[
LooseElectronSelector
,
MediumElectronSelector
,
...
...
Reconstruction/egamma/egammaTools/python/EMPIDBuilderConfig.py
View file @
48669fca
# Copyright (C) 2002-201
9
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-20
2
1 CERN for the benefit of the ATLAS collaboration
__doc__
=
"Configure the electron and photon selectors."
from
AthenaCommon.Logging
import
logging
from
AthenaConfiguration.ComponentFactory
import
CompFactory
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
EMPIDBuilder
=
CompFactory
.
EMPIDBuilder
from
ROOT
import
egammaPID
import
cppyy
cppyy
.
load_library
(
'libElectronPhotonSelectorToolsDict'
)
from
ElectronPhotonSelectorTools.EgammaPIDdefs
import
egammaPID
EMPIDBuilder
=
CompFactory
.
EMPIDBuilder
def
EMPIDBuilderElectronCfg
(
flags
,
name
=
'EMPIDBuilderElectron'
,
**
kwargs
):
...
...
@@ -23,14 +21,18 @@ def EMPIDBuilderElectronCfg(flags, name='EMPIDBuilderElectron', **kwargs):
from
ROOT
import
LikeEnum
from
ElectronPhotonSelectorTools.AsgElectronIsEMSelectorsConfig
import
AsgElectronIsEMSelectorCfg
if
"electronIsEMselectors"
not
in
kwargs
:
LooseElectronSelectorAcc
=
AsgElectronIsEMSelectorCfg
(
flags
,
"LooseElectronSelector"
,
egammaPID
.
ElectronIDLoosePP
)
MediumElectronSelectorAcc
=
AsgElectronIsEMSelectorCfg
(
flags
,
"MediumElectronSelector"
,
egammaPID
.
ElectronIDMediumPP
)
TightElectronSelectorAcc
=
AsgElectronIsEMSelectorCfg
(
flags
,
"TightElectronSelector"
,
egammaPID
.
ElectronIDTightPP
)
LooseElectronSelectorAcc
=
AsgElectronIsEMSelectorCfg
(
flags
,
"LooseElectronSelector"
,
egammaPID
.
ElectronIDLoosePP
)
MediumElectronSelectorAcc
=
AsgElectronIsEMSelectorCfg
(
flags
,
"MediumElectronSelector"
,
egammaPID
.
ElectronIDMediumPP
)
TightElectronSelectorAcc
=
AsgElectronIsEMSelectorCfg
(
flags
,
"TightElectronSelector"
,
egammaPID
.
ElectronIDTightPP
)
kwargs
[
"electronIsEMselectors"
]
=
[
LooseElectronSelectorAcc
.
popPrivateTools
(),
MediumElectronSelectorAcc
.
popPrivateTools
(),
TightElectronSelectorAcc
.
popPrivateTools
()]
kwargs
[
"electronIsEMselectorResultNames"
]
=
[
"Loose"
,
"Medium"
,
"Tight"
]
kwargs
[
"electronIsEMselectorResultNames"
]
=
[
"Loose"
,
"Medium"
,
"Tight"
]
acc
.
merge
(
LooseElectronSelectorAcc
)
acc
.
merge
(
MediumElectronSelectorAcc
)
acc
.
merge
(
TightElectronSelectorAcc
)
...
...
@@ -38,16 +40,20 @@ def EMPIDBuilderElectronCfg(flags, name='EMPIDBuilderElectron', **kwargs):
# Likelihood
from
ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig
import
AsgElectronLikelihoodToolCfg
if
"electronLHselectors"
not
in
kwargs
:
LooseLHSelectorAcc
=
AsgElectronLikelihoodToolCfg
(
flags
,
"LooseLHSelector"
,
LikeEnum
.
Loose
)
LooseLHSelectorAcc
=
AsgElectronLikelihoodToolCfg
(
flags
,
"LooseLHSelector"
,
LikeEnum
.
Loose
)
LooseLHSelectorAcc
.
primaryVertexContainer
=
"PrimaryVertices"
MediumLHSelectorAcc
=
AsgElectronLikelihoodToolCfg
(
flags
,
"MediumLHSelector"
,
LikeEnum
.
Medium
)
MediumLHSelectorAcc
=
AsgElectronLikelihoodToolCfg
(
flags
,
"MediumLHSelector"
,
LikeEnum
.
Medium
)
MediumLHSelectorAcc
.
primaryVertexContainer
=
"PrimaryVertices"
TightLHSelectorAcc
=
AsgElectronLikelihoodToolCfg
(
flags
,
"TightLHSelector"
,
LikeEnum
.
Tight
)
TightLHSelectorAcc
=
AsgElectronLikelihoodToolCfg
(
flags
,
"TightLHSelector"
,
LikeEnum
.
Tight
)
TightLHSelectorAcc
.
primaryVertexContainer
=
"PrimaryVertices"
kwargs
[
"electronLHselectors"
]
=
[
LooseLHSelectorAcc
.
popPrivateTools
(),
MediumLHSelectorAcc
.
popPrivateTools
(),
TightLHSelectorAcc
.
popPrivateTools
()]
kwargs
[
"electronLHselectorResultNames"
]
=
[
"LHLoose"
,
"LHMedium"
,
"LHTight"
]
kwargs
[
"electronLHselectorResultNames"
]
=
[
"LHLoose"
,
"LHMedium"
,
"LHTight"
]
acc
.
merge
(
LooseLHSelectorAcc
)
acc
.
merge
(
MediumLHSelectorAcc
)
acc
.
merge
(
TightLHSelectorAcc
)
...
...
@@ -67,8 +73,10 @@ def EMPIDBuilderPhotonCfg(flags, name='EMPIDBuilderPhoton', **kwargs):
# photon Selectors
from
ElectronPhotonSelectorTools.AsgPhotonIsEMSelectorsConfig
import
AsgPhotonIsEMSelectorCfg
LoosePhotonSelectorAcc
=
AsgPhotonIsEMSelectorCfg
(
flags
,
"LoosePhotonSelector"
,
egammaPID
.
PhotonIDLoose
)
TightPhotonSelectorAcc
=
AsgPhotonIsEMSelectorCfg
(
flags
,
"TightPhotonSelector"
,
egammaPID
.
PhotonIDTight
)
LoosePhotonSelectorAcc
=
AsgPhotonIsEMSelectorCfg
(
flags
,
"LoosePhotonSelector"
,
egammaPID
.
PhotonIDLoose
)
TightPhotonSelectorAcc
=
AsgPhotonIsEMSelectorCfg
(
flags
,
"TightPhotonSelector"
,
egammaPID
.
PhotonIDTight
)
if
"photonIsEMselectors"
not
in
kwargs
:
kwargs
[
"photonIsEMselectors"
]
=
[
LoosePhotonSelectorAcc
.
popPrivateTools
(),
...
...
Reconstruction/egamma/egammaTools/python/egammaToolsFactories.py
View file @
48669fca
...
...
@@ -5,7 +5,7 @@ all egammaTools with default configuration"""
__author__
=
"Bruno Lenzi"
from
ROOT
import
egammaPID
from
ElectronPhotonSelectorTools.EgammaPIDdefs
import
egammaPID
from
ElectronPhotonSelectorTools.ConfiguredAsgForwardElectronIsEMSelectors
\
import
ConfiguredAsgForwardElectronIsEMSelector
from
.EMPIDBuilderBase
import
EMPIDBuilderPhotonBase
...
...
@@ -144,9 +144,6 @@ PhotonPIDBuilder = ToolFactory(
# ForwardElectron Selectors
## Eventually we want to get rid of cppyy here
#cppyy.load_library('libElectronPhotonSelectorToolsDict')
LooseForwardElectronSelector
=
ToolFactory
(
ConfiguredAsgForwardElectronIsEMSelector
,
name
=
"LooseForwardElectronSelector"
,
...
...
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