Commit 5e798af6 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

egammaTools add tests for the new config. Fix some of the issues found

parent 92029d4a
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure the AsgElectronIsEMSelector with the quality cuts and allow for (re-)setting of all provided cuts."
__doc__ = """Configure the AsgElectronIsEMSelector with the quality cuts
and allow for (re-)setting of all provided cuts."""
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import (
ElectronIsEMMap, electronPIDmenu)
# Import the needed stuff specific to the ElectronPhotonSelectorTools
AsgElectronIsEMSelector=CompFactory.AsgElectronIsEMSelector
from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import ElectronIsEMMap, electronPIDmenu
AsgElectronIsEMSelector = CompFactory.AsgElectronIsEMSelector
def AsgElectronIsEMSelectorCfg(flags, name, quality, menu=electronPIDmenu.menuDC14):
......@@ -21,7 +24,10 @@ def AsgElectronIsEMSelectorCfg(flags, name, quality, menu=electronPIDmenu.menuDC
ntuple = ElectronIsEMMap(quality, menu)
mlog.debug('ntuple: %s', ntuple)
except KeyError:
mlog.error('Electron quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h).This function only supports standard electron IDs, and not photon or forward IDs')
mlog.error("Electron quality not found. Please use an egammaIDQuality"
"(ElectronPhotonSelectorTools/egammaPIDdefs.h)."
"This function only supports standard electron IDs,"
"and not photon or forward IDs")
raise
# Create and instance of the tool
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
__doc__ = " Configure the AsgElectronLikelihoodTool with the quality cuts and allow for (re-)setting of all provided cuts."
__doc__ = """Configure the AsgElectronLikelihoodTool with the quality
cuts and allow for (re-)setting of all provided cuts."""
from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import (
ElectronLikelihoodMap, electronLHmenu)
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
# Import the needed stuff specific to the ElectronPhotonSelectorTools
AsgElectronLikelihoodTool=CompFactory.AsgElectronLikelihoodTool
from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import ElectronLikelihoodMap, electronLHmenu
AsgElectronLikelihoodTool = CompFactory.AsgElectronLikelihoodTool
def AsgElectronLikelihoodToolCfg(flag, name, quality, menu=electronLHmenu.offlineMC16):
......@@ -22,7 +24,11 @@ def AsgElectronLikelihoodToolCfg(flag, name, quality, menu=electronLHmenu.offlin
ntuple = ElectronLikelihoodMap(quality, menu)
mlog.debug('ntuple: %s', ntuple)
except KeyError:
mlog.error("ElectronLH quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h). This function only supports standard electronLH IDs, and not standard electron IDs or photon or forward IDs")
mlog.error("ElectronLH quality not found."
"Please use an egammaIDQuality "
"(ElectronPhotonSelectorTools/egammaPIDdefs.h). "
"This function only supports standard electronLH IDs,"
"and not standard electron IDs or photon or forward IDs")
raise
# Create an instance of the tool
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure the AsgForwardElectronIsEMSelector with the quality cuts and allow for (re-)setting of all provided cuts."
__doc__ = """Configure the AsgForwardElectronIsEMSelector with the quality cuts
and allow for (re-)setting of all provided cuts."""
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from ElectronPhotonSelectorTools.ForwardElectronIsEMSelectorMapping import (
ForwardElectronIsEMMap, forwardelectronPIDmenu)
# Import the needed stuff specific to the ElectronPhotonSelectorTools
AsgForwardElectronIsEMSelector=CompFactory.AsgForwardElectronIsEMSelector
from ElectronPhotonSelectorTools.ForwardElectronIsEMSelectorMapping import ForwardElectronIsEMMap, forwardelectronPIDmenu
AsgForwardElectronIsEMSelector = CompFactory.AsgForwardElectronIsEMSelector
def AsgForwardElectronIsEMSelectorCfg(flags, name, quality, menu=forwardelectronPIDmenu.menuMC15):
......@@ -22,7 +24,11 @@ def AsgForwardElectronIsEMSelectorCfg(flags, name, quality, menu=forwardelectron
ntuple = ForwardElectronIsEMMap(quality, menu)
mlog.debug('ntuple: %s', ntuple)
except KeyError:
mlog.error("Fwd Electron quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h). This function only supports forward IDs, and not photon or standard electron IDs")
mlog.error("Fwd Electron quality not found."
"Please use an egammaIDQuality"
"(ElectronPhotonSelectorTools/egammaPIDdefs.h)."
"This function only supports forward IDs,"
"and not photon or standard electron IDs")
raise
# Create and instance of the tool
......
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure the AsgPhotonIsEMSelector with the quality cuts and allow for (re-)setting of all provided cuts."
__doc__ = """Configure the AsgPhotonIsEMSelector with the quality cuts
and allow for (re-)setting of all provided cuts."""
from ElectronPhotonSelectorTools.PhotonIsEMSelectorMapping import (
PhotonIsEMMap, photonPIDmenu)
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
# Import the needed stuff specific to the PhotonPhotonSelectorTools
AsgPhotonIsEMSelector=CompFactory.AsgPhotonIsEMSelector
from ElectronPhotonSelectorTools.PhotonIsEMSelectorMapping import PhotonIsEMMap, photonPIDmenu
AsgPhotonIsEMSelector = CompFactory.AsgPhotonIsEMSelector
def AsgPhotonIsEMSelectorCfg(flags, name, quality, menu=photonPIDmenu.menuDC14):
def AsgPhotonIsEMSelectorCfg(flags, name, quality, menu=photonPIDmenu.menuCurrentCuts):
acc = ComponentAccumulator()
......@@ -22,7 +24,11 @@ def AsgPhotonIsEMSelectorCfg(flags, name, quality, menu=photonPIDmenu.menuDC14):
ntuple = PhotonIsEMMap(quality, menu)
mlog.debug('ntuple: %s', ntuple)
except KeyError:
mlog.error("Photon quality not found. Please use an egammaIDQuality (ElectronPhotonSelectorTools/egammaPIDdefs.h). This function only supports standard photon IDs, and not electron IDs or forward IDs")
mlog.error("Photon quality not found."
"Please use an egammaIDQuality"
"(ElectronPhotonSelectorTools/egammaPIDdefs.h)."
"This function only supports standard photon IDs,"
"and not electron IDs or forward IDs")
raise
# Create and instance of the tool
......
......@@ -11,3 +11,31 @@ atlas_add_component( egammaTools
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_add_test(EMTrackMatchBuilderConfigTest
SCRIPT python -m egammaTools.EMTrackMatchBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test(EMShowerBuilderConfigTest
SCRIPT python -m egammaTools.EMShowerBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test(EMConversionBuilderConfigTest
SCRIPT python -m egammaTools.EMConversionBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test(EMPIDBuilderConfigTest
SCRIPT python -m egammaTools.EMPIDBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test(egammaSwToolConfigTest
SCRIPT python -m egammaTools.egammaSwToolConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test(egammaOQFlagsBuilderTest
SCRIPT python -m egammaTools.egammaOQFlagsBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test(egammaLargeClusterMakerTest
SCRIPT python -m egammaTools.egammaLargeClusterMakerConfig
POST_EXEC_SCRIPT nopost.sh)
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure the electron and photon selectors."
__doc__ = "Configure Conversion building"
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
EMConversionBuilder=CompFactory.EMConversionBuilder
from egammaTrackTools.egammaTrackToolsConfig import EMExtrapolationToolsCfg
EMConversionBuilder = CompFactory.EMConversionBuilder
def EMConversionBuilderCfg(flags, name='EMConversionBuilder', **kwargs):
......@@ -20,9 +20,36 @@ def EMConversionBuilderCfg(flags, name='EMConversionBuilder', **kwargs):
extraptool = EMExtrapolationToolsCfg(flags)
kwargs["ExtrapolationTool"] = extraptool.popPrivateTools()
acc.merge(extraptool)
kwargs.setdefault("ConversionContainerName", flags.Egamma.Keys.Output.ConversionVertices)
kwargs.setdefault("ConversionContainerName",
flags.Egamma.Keys.Output.ConversionVertices)
emconv = EMConversionBuilder(name, **kwargs)
acc.setPrivateTools(emconv)
return acc
if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.TestDefaults import defaultTestFiles
Configurable.configurableRun3Behavior = True
ConfigFlags.Input.Files = defaultTestFiles.RDO
ConfigFlags.fillFromArgs()
ConfigFlags.lock()
ConfigFlags.dump()
cfg = ComponentAccumulator()
mlog = logging.getLogger("EMConversionBuilderConfigTest")
mlog.info("Configuring EMConversionBuilder: ")
printProperties(mlog, cfg.popToolsAndMerge(
EMConversionBuilderCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
f = open("emshowerbuilder.pkl", "wb")
cfg.store(f)
f.close()
......@@ -19,7 +19,8 @@ def EMPIDBuilderElectronCfg(flags, name='EMPIDBuilderElectron', **kwargs):
# Electron Selectors
# Cut based
from ROOT import LikeEnum
from ElectronPhotonSelectorTools.AsgElectronIsEMSelectorsConfig import AsgElectronIsEMSelectorCfg
from ElectronPhotonSelectorTools.AsgElectronIsEMSelectorsConfig import (
AsgElectronIsEMSelectorCfg)
if "electronIsEMselectors" not in kwargs:
LooseElectronSelectorAcc = AsgElectronIsEMSelectorCfg(
flags, "LooseElectronSelector", egammaPID.ElectronIDLoosePP)
......@@ -28,9 +29,10 @@ def EMPIDBuilderElectronCfg(flags, name='EMPIDBuilderElectron', **kwargs):
TightElectronSelectorAcc = AsgElectronIsEMSelectorCfg(
flags, "TightElectronSelector", egammaPID.ElectronIDTightPP)
kwargs["electronIsEMselectors"] = [LooseElectronSelectorAcc.popPrivateTools(),
MediumElectronSelectorAcc.popPrivateTools(),
TightElectronSelectorAcc.popPrivateTools()]
kwargs["electronIsEMselectors"] = [
LooseElectronSelectorAcc.popPrivateTools(),
MediumElectronSelectorAcc.popPrivateTools(),
TightElectronSelectorAcc.popPrivateTools()]
kwargs["electronIsEMselectorResultNames"] = [
"Loose", "Medium", "Tight"]
acc.merge(LooseElectronSelectorAcc)
......@@ -38,7 +40,8 @@ def EMPIDBuilderElectronCfg(flags, name='EMPIDBuilderElectron', **kwargs):
acc.merge(TightElectronSelectorAcc)
# Likelihood
from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import AsgElectronLikelihoodToolCfg
from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig import (
AsgElectronLikelihoodToolCfg)
if "electronLHselectors" not in kwargs:
LooseLHSelectorAcc = AsgElectronLikelihoodToolCfg(
flags, "LooseLHSelector", LikeEnum.Loose)
......@@ -72,15 +75,17 @@ def EMPIDBuilderPhotonCfg(flags, name='EMPIDBuilderPhoton', **kwargs):
acc = ComponentAccumulator()
# photon Selectors
from ElectronPhotonSelectorTools.AsgPhotonIsEMSelectorsConfig import AsgPhotonIsEMSelectorCfg
from ElectronPhotonSelectorTools.AsgPhotonIsEMSelectorsConfig import (
AsgPhotonIsEMSelectorCfg)
LoosePhotonSelectorAcc = AsgPhotonIsEMSelectorCfg(
flags, "LoosePhotonSelector", egammaPID.PhotonIDLoose)
TightPhotonSelectorAcc = AsgPhotonIsEMSelectorCfg(
flags, "TightPhotonSelector", egammaPID.PhotonIDTight)
if "photonIsEMselectors" not in kwargs:
kwargs["photonIsEMselectors"] = [LoosePhotonSelectorAcc.popPrivateTools(),
TightPhotonSelectorAcc.popPrivateTools()]
kwargs["photonIsEMselectors"] = [
LoosePhotonSelectorAcc.popPrivateTools(),
TightPhotonSelectorAcc.popPrivateTools()]
kwargs["photonIsEMselectorResultNames"] = ["Loose", "Tight"]
acc.merge(LoosePhotonSelectorAcc)
......@@ -89,3 +94,34 @@ def EMPIDBuilderPhotonCfg(flags, name='EMPIDBuilderPhoton', **kwargs):
tool = EMPIDBuilder(name, **kwargs)
acc.setPrivateTools(tool)
return acc
if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.TestDefaults import defaultTestFiles
Configurable.configurableRun3Behavior = True
ConfigFlags.Input.Files = defaultTestFiles.RDO
ConfigFlags.fillFromArgs()
ConfigFlags.lock()
ConfigFlags.dump()
cfg = ComponentAccumulator()
mlog = logging.getLogger("EMPIDBuilderConfigTest")
mlog.info("Configuring EMPIDBuilderElectron: ")
printProperties(mlog, cfg.popToolsAndMerge(
EMPIDBuilderElectronCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
mlog.info("Configuring EMPIDBuilderPhoton: ")
printProperties(mlog, cfg.popToolsAndMerge(
EMPIDBuilderPhotonCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
f = open("empidbuilder.pkl", "wb")
cfg.store(f)
f.close()
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactory to instantiate all EMShowerBuilder with default configuration"
__doc__ = "Configuration for EMShowerBuilder"
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaCommon.Logging import logging
EMShowerBuilder=CompFactory.EMShowerBuilder
egammaIso, egammaShowerShape=CompFactory.getComps("egammaIso","egammaShowerShape",)
from CaloIdentifier import SUBCALO
EMShowerBuilder = CompFactory.EMShowerBuilder
egammaIso, egammaShowerShape = CompFactory.getComps(
"egammaIso", "egammaShowerShape",)
def EMShowerBuilderCfg(flags, name='EMShowerBuilder', **kwargs):
......@@ -19,7 +21,8 @@ def EMShowerBuilderCfg(flags, name='EMShowerBuilder', **kwargs):
acc = ComponentAccumulator()
kwargs.setdefault("CellsName", flags.Egamma.Keys.Input.CaloCells)
kwargs.setdefault("CaloNums", [SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.TILE])
kwargs.setdefault(
"CaloNums", [SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.TILE])
kwargs.setdefault("ShowerShapeTool", egammaShowerShape())
kwargs.setdefault("HadronicLeakageTool", egammaIso())
......@@ -27,3 +30,29 @@ def EMShowerBuilderCfg(flags, name='EMShowerBuilder', **kwargs):
acc.setPrivateTools(tool)
return acc
if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.TestDefaults import defaultTestFiles
Configurable.configurableRun3Behavior = True
ConfigFlags.Input.Files = defaultTestFiles.RDO
ConfigFlags.fillFromArgs()
ConfigFlags.lock()
ConfigFlags.dump()
cfg = ComponentAccumulator()
mlog = logging.getLogger("EMShowerBuilderConfigTest")
mlog.info("Configuring EMShowerBuilder: ")
printProperties(mlog, cfg.popToolsAndMerge(
EMShowerBuilderCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
f = open("emshowerbuilder.pkl", "wb")
cfg.store(f)
f.close()
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Instantiate EMTrackMatchBuilder with default configuration"
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
EMTrackMatchBuilder=CompFactory.EMTrackMatchBuilder
from egammaTrackTools.egammaTrackToolsConfig import EMExtrapolationToolsCacheCfg
EMTrackMatchBuilder = CompFactory.EMTrackMatchBuilder
def EMTrackMatchBuilderCfg(flags, name='EMTrackMatchBuilder', **kwargs):
......@@ -21,9 +22,13 @@ def EMTrackMatchBuilderCfg(flags, name='EMTrackMatchBuilder', **kwargs):
kwargs["ExtrapolationTool"] = extrapcache.popPrivateTools()
acc.merge(extrapcache)
kwargs.setdefault("TrackParticlesName", flags.Egamma.Keys.Input.TrackParticles) # TODO restore proper input once LRT tracking is in place Egamma.Keys.Output.GSFTrackParticles)
kwargs.setdefault("broadDeltaEta", 0.1) # candidate match is done in 2 times this so +- 0.2
kwargs.setdefault("broadDeltaPhi", 0.15) # candidate match is done in 2 times this so +- 0.3
# TODO restore proper input once LRT tracking is in place Egamma.Keys.Output.GSFTrackParticles)
kwargs.setdefault("TrackParticlesName",
flags.Egamma.Keys.Input.TrackParticles)
# candidate match is done in 2 times this so +- 0.2
kwargs.setdefault("broadDeltaEta", 0.1)
# candidate match is done in 2 times this so +- 0.3
kwargs.setdefault("broadDeltaPhi", 0.15)
kwargs.setdefault("useCandidateMatch", True)
kwargs.setdefault("useScoring", True)
kwargs.setdefault("SecondPassRescale", True)
......@@ -34,3 +39,29 @@ def EMTrackMatchBuilderCfg(flags, name='EMTrackMatchBuilder', **kwargs):
acc.setPrivateTools(tool)
return acc
if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.TestDefaults import defaultTestFiles
Configurable.configurableRun3Behavior = True
ConfigFlags.Input.Files = defaultTestFiles.RDO
ConfigFlags.fillFromArgs()
ConfigFlags.lock()
ConfigFlags.dump()
cfg = ComponentAccumulator()
mlog = logging.getLogger("EMTrackMatchBuilderConfigTest")
mlog.info("Configuring EMTrackMatchBuilder: ")
printProperties(mlog, cfg.popToolsAndMerge(
EMTrackMatchBuilderCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
f = open("emtrackmatchbuilder.pkl", "wb")
cfg.store(f)
f.close()
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure egammaLargeClusterMaker, which chooses cells to store in the AOD"
__doc__ = """ Configure egammaLargeClusterMaker,
which chooses cells to store in the AOD"""
__author__ = "Jovan Mitrevski"
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
egammaLargeClusterMaker=CompFactory.egammaLargeClusterMaker
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
egammaLargeClusterMaker = CompFactory.egammaLargeClusterMaker
def egammaLargeClusterMakerCfg(flags, **kwargs):
def egammaLargeClusterMakerCfg(flags, name="egammaLCMakerTool", **kwargs):
acc = ComponentAccumulator()
acc = ComponentAccumulator
kwargs.setdefault("CellsName", flags.Egamma.Keys.Input.CaloCells)
kwargs.setdefault("InputClusterCollection", flags.Egamma.Keys.Output.CaloClusters)
kwargs.setdefault("InputClusterCollection",
flags.Egamma.Keys.Output.CaloClusters)
acc.setPrivateTools(egammaLargeClusterMaker(**kwargs))
acc.setPrivateTools(egammaLargeClusterMaker(name, **kwargs))
return acc
if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.TestDefaults import defaultTestFiles
Configurable.configurableRun3Behavior = True
ConfigFlags.Input.Files = defaultTestFiles.RDO
ConfigFlags.fillFromArgs()
ConfigFlags.lock()
ConfigFlags.dump()
cfg = ComponentAccumulator()
mlog = logging.getLogger("egammaLargeClusterMakerTest")
mlog.info("Configuring egammaLargeClusterMaker: ")
printProperties(mlog, cfg.popToolsAndMerge(
egammaLargeClusterMakerCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
f = open("egammalargeclustermaker.pkl", "wb")
cfg.store(f)
f.close()
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure egammaLargeFWDClusterMaker, which chooses cells to store in the AOD"
__doc__ = "Configure egammaLargeFWDClusterMaker, which chooses cells to store in the AOD"
__author__ = "Jovan Mitrevski"
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
egammaLargeFWDClusterMaker=CompFactory.egammaLargeFWDClusterMaker
egammaLargeFWDClusterMaker = CompFactory.egammaLargeFWDClusterMaker
def egammaLargeFWDClusterMakerCfg(flags, **kwargs):
acc = ComponentAccumulator
acc = ComponentAccumulator()
kwargs.setdefault("CellsName", flags.Egamma.Keys.Input.CaloCells)
kwargs.setdefault("InputClusterCollection", flags.Egamma.Keys.Output.FwdCluster)
kwargs.setdefault("InputClusterCollection",
flags.Egamma.Keys.Output.FwdCluster)
kwargs.setdefault("doFWDelesurraundingWindows", True)
acc.setPrivateTools(egammaLargeFWDClusterMaker(**kwargs))
return acc
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
__doc__ = "Configure e/gamma object quality"
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
egammaOQFlagsBuilder=CompFactory.egammaOQFlagsBuilder
CaloAffectedTool=CompFactory.CaloAffectedTool
egammaOQFlagsBuilder = CompFactory.egammaOQFlagsBuilder
CaloAffectedTool = CompFactory.CaloAffectedTool
def egammaOQFlagsBuilderCfg(flags, name='egammaOQFlagsBuilder', **kwargs):
......@@ -20,6 +20,32 @@ def egammaOQFlagsBuilderCfg(flags, name='egammaOQFlagsBuilder', **kwargs):
kwargs.setdefault("affectedTool", CaloAffectedTool())
tool = egammaOQFlagsBuilder(name, **kwargs)
print(tool)
acc.setPrivateTools(tool)
return acc
if __name__ == "__main__":
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaCommon.Configurable import Configurable
from AthenaConfiguration.TestDefaults import defaultTestFiles
Configurable.configurableRun3Behavior = True
ConfigFlags.Input.Files = defaultTestFiles.RDO
ConfigFlags.fillFromArgs()
ConfigFlags.lock()
ConfigFlags.dump()
cfg = ComponentAccumulator()
mlog = logging.getLogger("egammaOQFlagsBuilderTest")
mlog.info("Configuring egammaOQFlagsBuilder: ")
printProperties(mlog, cfg.popToolsAndMerge(
egammaOQFlagsBuilderCfg(ConfigFlags)),
nestLevel=1,
printDefaults=True)
f = open("egammaoqflagsbuilder.pkl", "wb")
cfg.store(f)
f.close()