ATLAS Offline Software
Classes | Functions | Variables
METAssocCfg Namespace Reference

Classes

class  AssocConfig
 Configuration of builders. More...
 
class  METAssocConfig
 Top level MET configuration. More...
 

Functions

def getAssociator (configFlags, config, suffix, doPFlow=False, trkseltool=None, trkisotool=None, caloisotool=None, useFELinks=False, modConstKey="", modClusColls={})
 
def getMETAssocTool (topconfig, msglvl=INFO)
 
def getMETAssocAlg (algName='METAssociation', configs={}, tools=[], msglvl=INFO)
 

Variables

 metlog = Logging.logging.getLogger('METConfig')
 
dictionary defaultInputKey
 Define some default values. More...
 
string prefix = 'METAssocConfig: '
 

Function Documentation

◆ getAssociator()

def METAssocCfg.getAssociator (   configFlags,
  config,
  suffix,
  doPFlow = False,
  trkseltool = None,
  trkisotool = None,
  caloisotool = None,
  useFELinks = False,
  modConstKey = "",
  modClusColls = {} 
)

Definition at line 44 of file METAssocCfg.py.

44 def getAssociator(configFlags, config,suffix,doPFlow=False,
45  trkseltool=None,
46  trkisotool=None,caloisotool=None,
47  useFELinks=False,
48  modConstKey="",
49  modClusColls={}):
50  tool = None
51  doModClus = (modConstKey!="" and not doPFlow)
52  if doModClus:
53  modLCClus = modClusColls['LC{0}Clusters'.format(modConstKey)]
54  modEMClus = modClusColls['EM{0}Clusters'.format(modConstKey)]
55 
56  # Construct tool and set defaults for case-specific configuration
57  if config.objType == 'Ele':
58  tool = CompFactory.getComp("met::METElectronAssociator")('MET_ElectronAssociator_'+suffix,TCMatchMethod=1)
59  if config.objType == 'LRTEle':
60  tool = CompFactory.getComp("met::METElectronAssociator")('MET_LRTElectronAssociator_'+suffix,TCMatchMethod=1)
61  if config.objType == 'Gamma':
62  tool = CompFactory.getComp("met::METPhotonAssociator")('MET_PhotonAssociator_'+suffix,TCMatchMethod=1)
63  if config.objType == 'Tau':
64  tool = CompFactory.getComp("met::METTauAssociator")('MET_TauAssociator_'+suffix)
65  if config.objType == 'LCJet':
66  tool = CompFactory.getComp("met::METJetAssocTool")('MET_LCJetAssocTool_'+suffix)
67  if config.objType == 'EMJet':
68  tool = CompFactory.getComp("met::METJetAssocTool")('MET_EMJetAssocTool_'+suffix)
69  if config.objType == 'PFlowJet':
70  tool = CompFactory.getComp("met::METJetAssocTool")('MET_PFlowJetAssocTool_'+suffix)
71  if config.objType == 'CustomJet':
72  tool = CompFactory.getComp("met::METJetAssocTool")('MET_CustomJetAssocTool_'+suffix)
73  if config.objType == 'Muon':
74  tool = CompFactory.getComp("met::METMuonAssociator")('MET_MuonAssociator_'+suffix)
75  if config.objType == 'MuonLRT':
76  tool = CompFactory.getComp("met::METMuonAssociator")('MET_MuonLRTAssociator_'+suffix)
77  if config.objType == 'Soft':
78  tool = CompFactory.getComp("met::METSoftAssociator")('MET_SoftAssociator_'+suffix)
79  tool.DecorateSoftConst = True
80  if doModClus:
81  tool.LCModClusterKey = modLCClus
82  tool.EMModClusterKey = modEMClus
83  if config.objType == 'Truth':
84  tool = CompFactory.getComp("met::METTruthAssociator")('MET_TruthAssociator_'+suffix)
85  tool.RecoJetKey = config.inputKey
86  if doPFlow:
87  tool.PFlow = True
88  tool.FlowElementCollection = modConstKey if modConstKey!="" else defaultInputKey["PFlowObj"]
89  else:
90  tool.UseModifiedClus = doModClus
91  tool.UseFELinks = False if config.objType == 'MuonLRT' or config.objType == 'LRTEle' else useFELinks
92  # set input/output key names
93  if config.inputKey == '' and defaultInputKey[config.objType] != '':
94  tool.InputCollection = defaultInputKey[config.objType]
95  config.inputKey = tool.InputCollection
96  elif hasattr(tool, 'InputCollection'):
97  tool.InputCollection = config.inputKey
98  if doModClus:
99  tool.ClusColl = modLCClus
100  if 'EMTopo' in suffix: tool.ClusColl = modEMClus
101  tool.TrkColl = defaultInputKey['Tracks']
102  tool.UseTracks = configFlags.MET.UseTracks
103  tool.TrackSelectorTool = trkseltool
104  tool.TrackIsolationTool = trkisotool
105  tool.CaloIsolationTool = caloisotool
106 
107  return tool
108 

◆ getMETAssocAlg()

def METAssocCfg.getMETAssocAlg (   algName = 'METAssociation',
  configs = {},
  tools = [],
  msglvl = INFO 
)

Definition at line 209 of file METAssocCfg.py.

209 def getMETAssocAlg(algName='METAssociation',configs={},tools=[],msglvl=INFO):
210 
211  assocTools = []
212  assocTools += tools
213 
214  if configs=={} and tools==[]:
215  metlog.info("{} Empty list of MET association configs provided. None will be reconstructed.".format(prefix))
216  for key,conf in six.iteritems(configs):
217  metlog.info("{} Generate METAssocTool for MET_{}".format(prefix,key))
218  assoctool = getMETAssocTool(conf,msglvl)
219  assocTools.append(assoctool)
220 
221  for tool in assocTools:
222  metlog.info("{} Added METAssocTool {} to alg {}".format(prefix,tool.name,algName))
223  assocAlg = CompFactory.getComp("met::METRecoAlg")(name=algName,
224  RecoTools=assocTools)
225  return assocAlg

◆ getMETAssocTool()

def METAssocCfg.getMETAssocTool (   topconfig,
  msglvl = INFO 
)

Definition at line 195 of file METAssocCfg.py.

195 def getMETAssocTool(topconfig,msglvl=INFO):
196  assocTool = None
197  if topconfig.doTruth:
198  assocTool = CompFactory.getComp("met::METAssociationTool")('MET_TruthAssociationTool_'+topconfig.suffix,
199  METAssociators = topconfig.assoclist,
200  METSuffix = topconfig.suffix)
201  else:
202  assocTool = CompFactory.getComp("met::METAssociationTool")('MET_AssociationTool_'+topconfig.suffix,
203  METAssociators = topconfig.assoclist,
204  METSuffix = topconfig.suffix,
205  OutputLevel=msglvl)
206  return assocTool
207 
208 # Convert the provided METAssocConfigs into a concrete algorithm

Variable Documentation

◆ defaultInputKey

dictionary METAssocCfg.defaultInputKey
Initial value:
1 = {
2  'Ele' :'Electrons',
3  'LRTEle' :'LRTElectrons',
4  'Gamma' :'Photons',
5  'Tau' :'TauJets',
6  'LCJet' :'AntiKt4LCTopoJets',
7  'EMJet' :'AntiKt4EMTopoJets',
8  'PFlowJet' :'AntiKt4EMPFlowJets',
9  'Muon' :'Muons',
10  'MuonLRT' :'MuonsLRT',
11  'Soft' :'',
12  'Clusters' :'CaloCalTopoClusters',
13  'Tracks' :'InDetTrackParticles',
14  'PFlowObj' :'CHSGParticleFlowObjects',
15  'PrimVxColl':'PrimaryVertices',
16  'Truth' :'TruthEvents',
17  }

Define some default values.

Definition at line 16 of file METAssocCfg.py.

◆ metlog

METAssocCfg.metlog = Logging.logging.getLogger('METConfig')

Definition at line 7 of file METAssocCfg.py.

◆ prefix

string METAssocCfg.prefix = 'METAssocConfig: '

Definition at line 34 of file METAssocCfg.py.

vtune_athena.format
format
Definition: vtune_athena.py:14
METAssocCfg.getMETAssocTool
def getMETAssocTool(topconfig, msglvl=INFO)
Definition: METAssocCfg.py:195
METAssocCfg.getAssociator
def getAssociator(configFlags, config, suffix, doPFlow=False, trkseltool=None, trkisotool=None, caloisotool=None, useFELinks=False, modConstKey="", modClusColls={})
Definition: METAssocCfg.py:44
METAssocCfg.getMETAssocAlg
def getMETAssocAlg(algName='METAssociation', configs={}, tools=[], msglvl=INFO)
Definition: METAssocCfg.py:209