3 from ElectronPhotonSelectorTools.EgammaPIDdefs
import egammaPID
4 from egammaTools.EMTrackMatchBuilderConfig
import EMTrackMatchBuilderCfg
5 from ElectronPhotonSelectorTools.AsgForwardElectronIsEMSelectorsConfig
import (
6 AsgForwardElectronIsEMSelectorCfg)
7 from AthenaCommon.Logging
import logging
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
10 from egammaTools.egammaOQFlagsBuilderConfig
import egammaOQFlagsBuilderCfg
17 if flags.Detector.GeometryITk:
18 kwargs[
"doTrackMatching"] =
True
19 kwargs[
"doCookieCutting"] =
True
21 if "forwardelectronIsEMselectors" not in kwargs:
24 "LooseForwardElectronSelector",
25 egammaPID.ForwardElectronIDLoose)
28 "MediumForwardElectronSelector",
29 egammaPID.ForwardElectronIDMedium)
32 "TightForwardElectronSelector",
33 egammaPID.ForwardElectronIDTight)
35 kwargs.setdefault(
"forwardelectronIsEMselectors",
36 [LooseFwdElectronSelector.popPrivateTools(),
37 MediumFwdElectronSelector.popPrivateTools(),
38 TightFwdElectronSelector.popPrivateTools()])
40 "forwardelectronIsEMselectorResultNames",
41 [
"Loose",
"Medium",
"Tight"])
43 acc.merge(LooseFwdElectronSelector)
44 acc.merge(MediumFwdElectronSelector)
45 acc.merge(TightFwdElectronSelector)
47 if "ObjectQualityTool" not in kwargs
and not flags.Common.isOnline:
49 kwargs[
"ObjectQualityTool"] = egOQ.popPrivateTools()
52 kwargs.setdefault(
"ElectronOutputName",
53 flags.Egamma.Keys.Output.ForwardElectrons)
54 kwargs.setdefault(
"TopoClusterName",
55 flags.Egamma.Keys.Internal.ForwardTopoClusters)
56 kwargs.setdefault(
"ClusterContainerName",
57 flags.Egamma.Keys.Output.ForwardClusters)
58 fwdAlg = CompFactory.egammaForwardBuilder(name, **kwargs)
60 acc.addEventAlgo(fwdAlg)
64 if __name__ ==
"__main__":
65 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
66 from AthenaConfiguration.TestDefaults
import defaultTestFiles
67 from AthenaConfiguration.ComponentAccumulator
import printProperties
68 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
70 flags.Input.Files = defaultTestFiles.RDO_RUN2
74 mlog = logging.getLogger(
"egammaForwardBuilderConfigTest")
75 mlog.info(
"Configuring egammaForwardBuilder: ")
78 acc.getEventAlgo(
"egammaForwardElectron"),
81 with open(
"egammaforwardbuilder.pkl",
"wb")
as f: