3 __doc__ =
"Configure cluster correction"
5 from AthenaCommon.Logging
import logging
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 import GaudiKernel.GaudiHandles
as GaudiHandles
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 "Add attributes ClusterCorrectionToolsXX to egammaSwTool object"
15 from CaloClusterCorrection.CaloSwCorrections
import (
16 make_CaloSwCorrectionsCfg)
19 Ele35=
'ele35', Ele55=
'ele55', Ele37=
'ele37',
20 Gam35=
'gam35_unconv', Gam55=
'gam55_unconv', Gam37=
'gam37_unconv',
21 Econv35=
'gam35_conv', Econv55=
'gam55_conv', Econv37=
'gam37_conv'
24 version = flags.Egamma.Calib.SuperClusterCorrectionVersion
25 suffix =
'EGSuperCluster'
26 attrPref =
'ClusterCorrectionToolsSuperCluster'
28 for attrName, clName
in clusterTypes.items():
29 attrName = attrPref + attrName
30 if not hasattr(swTool, attrName):
33 flags, clName, suffix=suffix,
35 cells_name=flags.Egamma.Keys.Input.CaloCells)
36 tools = acc.popToolsAndMerge(toolsAcc)
37 setattr(swTool, attrName, GaudiHandles.PrivateToolHandleArray(tools))
44 mlog = logging.getLogger(name)
45 mlog.debug(
'Start configuration')
49 egswtool = CompFactory.egammaSwTool(name, **kwargs)
55 acc.setPrivateTools(egswtool)
59 if __name__ ==
"__main__":
61 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
62 from AthenaConfiguration.ComponentAccumulator
import printProperties
63 from AthenaConfiguration.TestDefaults
import defaultTestFiles
65 flags.Input.Files = defaultTestFiles.RDO_RUN2
71 mlog = logging.getLogger(
"egammaSwToolConfigTest")
72 mlog.info(
"Configuring egammaSwTool: ")
78 f =
open(
"egammaswtool.pkl",
"wb")