4 Instantiate the pflow isolation for egamma in derivation
7 from AthenaCommon.Logging
import logging
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
13 mlog = logging.getLogger(name)
14 mlog.info(
'Starting Isolation steering')
19 from IsolationAlgs.IsoDensityConfig
import (
20 NFlowInputAlgCfg, DensityForIsoAlgCfg)
22 suff =
'CSSK' if inType.find(
'CSSK') >= 0
else ''
29 margs[
'FlowElementsInConeTool'] = CompFactory.xAOD.FlowElementsInConeTool(
30 name=suff+
'FlowElementsInConeTool')
32 kwargs[
'CustomConfigurationNameEl'] = suff
33 kwargs[
'CustomConfigurationNamePh'] = suff
34 margs[
'EFlowEDCentralContainer'] =
'NeutralParticle'+suff+
'FlowIsoCentralEventShape'
35 margs[
'EFlowEDForwardContainer'] =
'NeutralParticle'+suff+
'FlowIsoForwardEventShape'
36 margs[
'FlowElementsInConeTool'].PFlowKey=suff+
'NeutralParticleFlowObjects'
37 from IsolationAlgs.IsoToolsConfig
import EGammaCaloIsolationToolCfg
41 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
42 isoType = [ [ isoPar.neflowisol20, isoPar.neflowisol30, isoPar.neflowisol40 ] ]
43 isoCor = [ [ isoPar.coreCone, isoPar.pileupCorrection ] ]
44 isoExCor = [ [ isoPar.coreConeSC ] ]
45 kwargs[
'ElIsoTypes'] = isoType
46 kwargs[
'ElCorTypes'] = isoCor
47 kwargs[
'ElCorTypesExtra'] = isoExCor
48 kwargs[
'PhIsoTypes'] = isoType
49 kwargs[
'PhCorTypes'] = isoCor
50 kwargs[
'PhCorTypesExtra'] = isoExCor
52 kwargs[
'name'] = suff+
'PFlowIsolationBuilder'
54 acc.addEventAlgo(CompFactory.IsolationBuilder(**kwargs))
56 mlog.info(
"PFlow isolation configured")
62 mlog = logging.getLogger(name)
63 mlog.info(
'Starting LRT electron calo Isolation steering')
68 from IsolationAlgs.IsoDensityConfig
import (
69 NFlowInputAlgCfg, DensityForIsoAlgCfg)
76 the_pflowElementsTool = CompFactory.xAOD.FlowElementsInConeTool(
77 name=
'FlowElementsInConeTool')
79 from IsolationAlgs.IsoToolsConfig
import EGammaCaloIsolationToolCfg
81 FlowElementsInConeTool = the_pflowElementsTool))
84 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
85 isoType = [ [ isoPar.topoetcone20, isoPar.topoetcone30, isoPar.topoetcone40 ],
86 [ isoPar.neflowisol20, isoPar.neflowisol30, isoPar.neflowisol40 ] ]
87 isoCor = [ [ isoPar.core57cells, isoPar.ptCorrection, isoPar.pileupCorrection ],
88 [ isoPar.coreCone, isoPar.pileupCorrection ] ]
89 isoExCor = [ [ ], [ isoPar.coreConeSC ] ]
91 acc.addEventAlgo(CompFactory.IsolationBuilder(**kwargs,
92 name =
'LRTElectronCaloIsolationBuilder',
93 ElectronCollectionContainerName =
'LRT'+flags.Egamma.Keys.Output.Electrons,
96 ElCorTypesExtra = isoExCor,
97 CaloTopoIsolationTool = cisoTool,
98 PFlowIsolationTool = cisoTool))
100 mlog.info(
"LRTElectron calo isolation configured")
106 mlog = logging.getLogger(name)
107 mlog.info(
'Starting LRT muon calo Isolation steering')
112 from IsolationAlgs.IsoDensityConfig
import (
113 NFlowInputAlgCfg, DensityForIsoAlgCfg)
119 the_pflowElementsTool = CompFactory.xAOD.FlowElementsInConeTool(
120 name=
'FlowElementsInConeTool')
122 from IsolationAlgs.IsoToolsConfig
import MuonCaloIsolationToolCfg
124 FlowElementsInConeTool = the_pflowElementsTool ))
126 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
127 misoType = [ [ isoPar.topoetcone20, isoPar.topoetcone30, isoPar.topoetcone40 ],
128 [ isoPar.neflowisol20, isoPar.neflowisol30, isoPar.neflowisol40 ] ]
129 misoCor = [ [ isoPar.coreCone, isoPar.pileupCorrection ],
130 [ isoPar.coreCone, isoPar.pileupCorrection ] ]
131 misoExCor = [ [ ], [ ] ]
133 acc.addEventAlgo(CompFactory.IsolationBuilder(name=
"LRTMuonCaloIsolationBuilder",
134 MuonCollectionContainerName =
"MuonsLRT",
135 MuCorTypesExtra = misoExCor,
136 MuCorTypes = misoCor,
137 CaloTopoIsolationTool = cisoTool,
138 PFlowIsolationTool = cisoTool,
139 MuIsoTypes = misoType ))
141 mlog.info(
"MuonLRT calo isolation configured")
145 if __name__ ==
"__main__":
146 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
147 from AthenaConfiguration.ComponentAccumulator
import printProperties
148 from AthenaConfiguration.TestDefaults
import defaultTestFiles
149 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
151 flags.Input.Files = defaultTestFiles.RDO_RUN2
152 flags.Output.doWriteESD =
True
153 flags.Output.doWriteAOD =
True
156 mlog = logging.getLogger(
"isolationConfigTest")
157 mlog.info(
"Configuring isolation: ")
163 acc.printConfig(withDetails=
True,
166 acc.getEventAlgo(
'PFlowIsolationBuilder'),
170 acc.getEventAlgo(
'LRTElectronCaloIsolationBuilder'),
174 acc.getEventAlgo(
'LRTMuonCaloIsolationBuilder'),
178 with open(
"isolationconfig.pkl",
"wb")
as f: