75 def muIsolationCfg(flags, name='muIsolation', noCalo=False, **kwargs):
77 mlog = logging.getLogger(name)
78 mlog.info(
'Starting '+name+
' configuration')
82 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
83 from IsolationAlgs.IsoToolsConfig
import (
84 TrackIsolationToolCfg, MuonCaloIsolationToolCfg)
90 if flags.Detector.EnableID
or flags.Detector.EnableITk:
91 isoType.append([ isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20 ])
92 isoCor.append([ isoPar.coreTrackPtr ])
94 if 'TrackIsolationTool' not in kwargs:
95 kwargs[
'TrackIsolationTool'] = acc.popToolsAndMerge(
98 if flags.Detector.EnableCalo
and not noCalo:
100 [ isoPar.topoetcone20, isoPar.topoetcone30, isoPar.topoetcone40 ])
101 isoCor.append([ isoPar.coreCone, isoPar.pileupCorrection ])
103 if flags.HeavyIon.Egamma.doSubtractedClusters:
104 isoCor[-1] = [ x
for x
in isoCor[-1]
if x != isoPar.pileupCorrection ]
106 if (
'CaloTopoIsolationTool' not in kwargs)
or (
107 'PFlowIsolationTool' not in kwargs):
109 if 'CaloTopoIsolationTool' not in kwargs:
110 kwargs[
'CaloTopoIsolationTool'] = cisoTool
111 if flags.Reco.EnablePFlow
and 'PFlowIsolationTool' not in kwargs:
113 [ isoPar.neflowisol20, isoPar.neflowisol30, isoPar.neflowisol40 ])
114 isoCor.append([ isoPar.coreCone, isoPar.pileupCorrection ])
117 if flags.HeavyIon.Egamma.doSubtractedClusters:
118 isoCor[-1] = [ x
for x
in isoCor[-1]
if x != isoPar.pileupCorrection ]
120 kwargs[
'PFlowIsolationTool'] = cisoTool
122 kwargs[
'MuIsoTypes'] = isoType
123 kwargs[
'MuCorTypes'] = isoCor
124 kwargs[
'MuCorTypesExtra'] = isoExCor
125 kwargs[
'name'] =
'muonIsolationBuilder'
127 acc.addEventAlgo(CompFactory.IsolationBuilder(**kwargs))
129 mlog.info(
"muon isolation configured")