ATLAS Offline Software
Functions | Variables
IsolationBuilderConfig Namespace Reference

Functions

def egIsolationCfg (flags, name='egIsolation', noCalo=False, **kwargs)
 
def muIsolationCfg (flags, name='muIsolation', noCalo=False, **kwargs)
 

Variables

string __doc__
 
 flags = initConfigFlags()
 
 Files
 
 doWriteESD
 
 doWriteAOD
 
 mlog = logging.getLogger("isolationConfigTest")
 
 acc = MainServicesCfg(flags)
 
 nestLevel
 
 printDefaults
 

Function Documentation

◆ egIsolationCfg()

def IsolationBuilderConfig.egIsolationCfg (   flags,
  name = 'egIsolation',
  noCalo = False,
**  kwargs 
)

Definition at line 11 of file IsolationBuilderConfig.py.

11 def egIsolationCfg(flags, name='egIsolation', noCalo=False, **kwargs):
12 
13  mlog = logging.getLogger(name)
14  mlog.info('Starting '+name+' configuration')
15 
16  acc = ComponentAccumulator()
17 
18  suff = ''
19  if name.find('photon') >= 0:
20  suff = 'photon'
21  pref = 'Ph'
22  elif name.find('electron') >= 0:
23  suff = 'electron'
24  pref = 'El'
25  else:
26  mlog.error('Name '+name+' should contain electron or photon')
27  return acc
28 
29  from xAODPrimitives.xAODIso import xAODIso as isoPar
30  from IsolationAlgs.IsoToolsConfig import (
31  TrackIsolationToolCfg, ElectronTrackIsolationToolCfg,
32  EGammaCaloIsolationToolCfg)
33 
34  isoType = []
35  isoCor = []
36  isoExCor = []
37 
38  if flags.Detector.EnableID or flags.Detector.EnableITk:
39  isoType.append([ isoPar.ptcone30, isoPar.ptcone20 ])
40  isoCor.append([ isoPar.coreTrackPtr ])
41  isoExCor.append([])
42  if 'TrackIsolationTool' not in kwargs:
43  if pref == 'Ph':
44  kwargs['TrackIsolationTool'] = acc.popToolsAndMerge(
45  TrackIsolationToolCfg(flags))
46  else:
47  kwargs['TrackIsolationTool'] = acc.popToolsAndMerge(
49 
50  if flags.Detector.EnableCalo and not noCalo:
51  isoType.append(
52  [ isoPar.topoetcone20, isoPar.topoetcone30, isoPar.topoetcone40 ])
53  isoCor.append(
54  [ isoPar.core57cells, isoPar.ptCorrection, isoPar.pileupCorrection ])
55  # do not do pileup correction if HI with subtracted clusters
56  if flags.HeavyIon.Egamma.doSubtractedClusters:
57  isoCor[-1] = [ x for x in isoCor[-1] if x != isoPar.pileupCorrection ]
58  isoExCor.append([])
59  if 'CaloTopoIsolationTool' not in kwargs:
60  kwargs['CaloTopoIsolationTool'] = acc.popToolsAndMerge(
62 
63  kwargs[f'{pref}IsoTypes'] = isoType
64  kwargs[f'{pref}CorTypes'] = isoCor
65  kwargs[f'{pref}CorTypesExtra'] = isoExCor
66 
67  kwargs['name'] = suff+'IsolationBuilder'
68 
69  acc.addEventAlgo(CompFactory.IsolationBuilder(**kwargs))
70 
71  mlog.info(suff+" isolation configured")
72 
73  return acc
74 

◆ muIsolationCfg()

def IsolationBuilderConfig.muIsolationCfg (   flags,
  name = 'muIsolation',
  noCalo = False,
**  kwargs 
)

Definition at line 75 of file IsolationBuilderConfig.py.

75 def muIsolationCfg(flags, name='muIsolation', noCalo=False, **kwargs):
76 
77  mlog = logging.getLogger(name)
78  mlog.info('Starting '+name+' configuration')
79 
80  acc = ComponentAccumulator()
81 
82  from xAODPrimitives.xAODIso import xAODIso as isoPar
83  from IsolationAlgs.IsoToolsConfig import (
84  TrackIsolationToolCfg, MuonCaloIsolationToolCfg)
85 
86  isoType = []
87  isoCor = []
88  isoExCor = []
89 
90  if flags.Detector.EnableID or flags.Detector.EnableITk:
91  isoType.append([ isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20 ])
92  isoCor.append([ isoPar.coreTrackPtr ])
93  isoExCor.append([])
94  if 'TrackIsolationTool' not in kwargs:
95  kwargs['TrackIsolationTool'] = acc.popToolsAndMerge(
96  TrackIsolationToolCfg(flags))
97 
98  if flags.Detector.EnableCalo and not noCalo:
99  isoType.append(
100  [ isoPar.topoetcone20, isoPar.topoetcone30, isoPar.topoetcone40 ])
101  isoCor.append([ isoPar.coreCone, isoPar.pileupCorrection ])
102  # do not do pileup correction if HI with subtracted clusters
103  if flags.HeavyIon.Egamma.doSubtractedClusters:
104  isoCor[-1] = [ x for x in isoCor[-1] if x != isoPar.pileupCorrection ]
105  isoExCor.append([])
106  if ('CaloTopoIsolationTool' not in kwargs) or (
107  'PFlowIsolationTool' not in kwargs):
108  cisoTool = acc.popToolsAndMerge(MuonCaloIsolationToolCfg(flags))
109  if 'CaloTopoIsolationTool' not in kwargs:
110  kwargs['CaloTopoIsolationTool'] = cisoTool
111  if flags.Reco.EnablePFlow and 'PFlowIsolationTool' not in kwargs:
112  isoType.append(
113  [ isoPar.neflowisol20, isoPar.neflowisol30, isoPar.neflowisol40 ])
114  isoCor.append([ isoPar.coreCone, isoPar.pileupCorrection ])
115  # do not do pileup correction for HI reco...
116  # and pflow iso is more than experimental in such reco anyway
117  if flags.HeavyIon.Egamma.doSubtractedClusters:
118  isoCor[-1] = [ x for x in isoCor[-1] if x != isoPar.pileupCorrection ]
119  isoExCor.append([])
120  kwargs['PFlowIsolationTool'] = cisoTool
121 
122  kwargs['MuIsoTypes'] = isoType
123  kwargs['MuCorTypes'] = isoCor
124  kwargs['MuCorTypesExtra'] = isoExCor
125  kwargs['name'] = 'muonIsolationBuilder'
126 
127  acc.addEventAlgo(CompFactory.IsolationBuilder(**kwargs))
128 
129  mlog.info("muon isolation configured")
130 
131  return acc
132 
133 

Variable Documentation

◆ __doc__

string IsolationBuilderConfig.__doc__
private
Initial value:
1 = """
2  Instantiate the electron or photon isolation
3  """

Definition at line 3 of file IsolationBuilderConfig.py.

◆ acc

IsolationBuilderConfig.acc = MainServicesCfg(flags)

Definition at line 148 of file IsolationBuilderConfig.py.

◆ doWriteAOD

IsolationBuilderConfig.doWriteAOD

Definition at line 142 of file IsolationBuilderConfig.py.

◆ doWriteESD

IsolationBuilderConfig.doWriteESD

Definition at line 141 of file IsolationBuilderConfig.py.

◆ Files

IsolationBuilderConfig.Files

Definition at line 140 of file IsolationBuilderConfig.py.

◆ flags

IsolationBuilderConfig.flags = initConfigFlags()

Definition at line 139 of file IsolationBuilderConfig.py.

◆ mlog

IsolationBuilderConfig.mlog = logging.getLogger("isolationConfigTest")

Definition at line 145 of file IsolationBuilderConfig.py.

◆ nestLevel

IsolationBuilderConfig.nestLevel

Definition at line 154 of file IsolationBuilderConfig.py.

◆ printDefaults

IsolationBuilderConfig.printDefaults

Definition at line 155 of file IsolationBuilderConfig.py.

python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
IsoToolsConfig.ElectronTrackIsolationToolCfg
def ElectronTrackIsolationToolCfg(flags, **kwargs)
Definition: IsoToolsConfig.py:50
IsoToolsConfig.MuonCaloIsolationToolCfg
def MuonCaloIsolationToolCfg(flags, **kwargs)
Definition: IsoToolsConfig.py:88
IsolationBuilderConfig.egIsolationCfg
def egIsolationCfg(flags, name='egIsolation', noCalo=False, **kwargs)
Definition: IsolationBuilderConfig.py:11
python.TrackIsolationDecoratorConfig.TrackIsolationToolCfg
def TrackIsolationToolCfg(ConfigFlags, name="TrackIsolationTool", **kwargs)
Definition: TrackIsolationDecoratorConfig.py:12
IsolationBuilderConfig.muIsolationCfg
def muIsolationCfg(flags, name='muIsolation', noCalo=False, **kwargs)
Definition: IsolationBuilderConfig.py:75
IsoToolsConfig.EGammaCaloIsolationToolCfg
def EGammaCaloIsolationToolCfg(flags, **kwargs)
Definition: IsoToolsConfig.py:55