ATLAS Offline Software
Classes | Functions | Variables
METRecoCfg Namespace Reference

Classes

class  BuildConfig
 Configuration of builders. More...
 
class  METConfig
 Top level MET configuration. More...
 
class  RefConfig
 Configuration of refiners. More...
 

Functions

def getBuilder (config, suffix, doTracks, doCells, doTriggerMET, doOriginCorrClus)
 
def getRefiner (flags, config, suffix, trkseltool=None, trkvxtool=None, trkisotool=None, caloisotool=None)
 
def getRegions (config, suffix)
 Region tools are a special case of refiners. More...
 
def getMETRecoTool (topconfig)
 
def getRegionRecoTool (topconfig)
 
def getMETRecoAlg (algName='METReconstruction', configs={})
 

Variables

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

Function Documentation

◆ getBuilder()

def METRecoCfg.getBuilder (   config,
  suffix,
  doTracks,
  doCells,
  doTriggerMET,
  doOriginCorrClus 
)

Definition at line 53 of file METRecoCfg.py.

53 def getBuilder(config,suffix,doTracks,doCells,doTriggerMET,doOriginCorrClus):
54  tool = None
55  # Construct tool and set defaults for case-specific configuration
56  if config.objType == 'SoftTrk':
57  tool = CompFactory.getComp("met::METSoftTermsTool")('MET_SoftTrkTool_'+suffix)
58  tool.InputComposition = 'Tracks'
59  tool.TrackKey = defaultInputKey[config.objType]
60  config.inputKey = defaultInputKey[config.objType]
61  if config.objType.endswith('SoftClus'):
62  tool = CompFactory.getComp("met::METSoftTermsTool")('MET_SoftClusTool_'+suffix)
63  tool.InputComposition = 'Clusters'
64  tool.CaloClusterKey = defaultInputKey[config.objType]
65  config.inputKey = defaultInputKey[config.objType]
66  if config.objType == 'SoftPFlow':
67  tool = CompFactory.getComp("met::METSoftTermsTool")('MET_SoftPFlowTool_'+suffix)
68  tool.InputComposition = 'PFlow'
69  pfotool = CompFactory.RetrievePFOTool('MET_PFOTool_'+suffix)
70  tool.PFOTool = pfotool
71  if suffix == 'Truth':
72  tool = CompFactory.getComp("met::METTruthTool")('MET_TruthTool_'+config.objType)
73  tool.InputComposition = config.objType
74  tool.InputCollection = defaultInputKey['Truth']
75  config.inputKey = defaultInputKey['Truth']
76  config.outputKey = config.objType
77  if suffix == 'Calo':
78  tool = CompFactory.getComp("met::METCaloRegionsTool")('MET_CaloRegionsTool')
79  if doCells:
80  tool.UseCells = True
81  tool.DoTriggerMET = doTriggerMET
82  tool.CaloCellKey = defaultInputKey['Calo']
83  config.inputKey = defaultInputKey['Calo']
84  else:
85  tool.UseCells = False
86  tool.DoTriggerMET = False
87  tool.CaloClusterKey = defaultInputKey['SoftClus']
88  config.inputKey = defaultInputKey['SoftClus']
89  config.outputKey = config.objType
90 
91  # set input/output key names
92  if config.inputKey == '':
93  tool.InputCollection = defaultInputKey[config.objType]
94  config.inputKey = tool.InputCollection
95  elif hasattr(tool, 'InputCollection'):
96  tool.InputCollection = config.inputKey
97  if not suffix=='Calo':
98  if config.outputKey == '':
99  tool.MissingETKey = defaultOutputKey[config.objType]
100  config.outputKey = tool.MissingETKey
101  else:
102  tool.MissingETKey = config.outputKey
103  return tool
104 

◆ getMETRecoAlg()

def METRecoCfg.getMETRecoAlg (   algName = 'METReconstruction',
  configs = {} 
)

Definition at line 273 of file METRecoCfg.py.

273 def getMETRecoAlg(algName='METReconstruction',configs={}):
274  recoTools = []
275  for key,conf in configs.items():
276  metlog.info("{} Generate METRecoTool for MET_{}".format(prefix,key))
277  recotool = getMETRecoTool(conf)
278  recoTools.append(recotool)
279  if conf.doRegions:
280  regiontool = getRegionRecoTool(conf)
281  recoTools.append(regiontool)
282  for tool in recoTools:
283  metlog.info("{} Added METRecoTool {} to alg {}".format(prefix,tool.name,algName))
284  recoAlg = CompFactory.getComp("met::METRecoAlg")(name=algName,RecoTools=recoTools)
285  return recoAlg

◆ getMETRecoTool()

def METRecoCfg.getMETRecoTool (   topconfig)

Definition at line 250 of file METRecoCfg.py.

250 def getMETRecoTool(topconfig):
251  recoTool = CompFactory.getComp("met::METRecoTool")('MET_RecoTool_'+topconfig.suffix,
252  METBuilders = topconfig.buildlist,
253  METRefiners = topconfig.reflist,
254  METContainer = topconfig.outputCollection(),
255  METComponentMap = topconfig.outputMap(),
256  WarnIfDuplicate = topconfig.duplicateWarning)
257  if topconfig.doSum:
258  recoTool.METFinalName = defaultOutputKey['Total']
259 
260  return recoTool
261 
262 # Set up a METRecoTool that builds MET regions

◆ getRefiner()

def METRecoCfg.getRefiner (   flags,
  config,
  suffix,
  trkseltool = None,
  trkvxtool = None,
  trkisotool = None,
  caloisotool = None 
)

Definition at line 113 of file METRecoCfg.py.

113 def getRefiner(flags,config,suffix,trkseltool=None,trkvxtool=None,trkisotool=None,caloisotool=None):
114  tool = None
115 
116  if config.type == 'TrackFilter':
117  tool = CompFactory.getComp("met::METTrackFilterTool")('MET_TrackFilterTool_'+suffix)
118  tool.InputPVKey = defaultInputKey['PrimaryVx']
119  tool.TrackSelectorTool=trkseltool
120  tool.TrackVxAssocTool=trkvxtool
121  #
122  tool.UseIsolationTools = False #True
123  tool.TrackIsolationTool = trkisotool
124  tool.CaloIsolationTool = caloisotool
125  #
126  tool.DoPVSel = flags.MET.UseTracks
127  tool.DoVxSep = flags.MET.UseTracks
128  tool.MissingETKey = config.outputKey
129  return tool
130 

◆ getRegionRecoTool()

def METRecoCfg.getRegionRecoTool (   topconfig)

Definition at line 263 of file METRecoCfg.py.

263 def getRegionRecoTool(topconfig):
264  regTool = CompFactory.getComp("met::METRecoTool")('MET_RegionTool_'+topconfig.suffix,
265  METBuilders = [],
266  METRefiners = topconfig.reglist,
267  METContainer = topconfig.outputCollection()+'Regions',
268  METComponentMap = topconfig.outputMap()+'Regions',
269  WarnIfDuplicate = topconfig.duplicateWarning)
270  return regTool
271 
272 # Allow user to configure reco tools directly or get more default configurations

◆ getRegions()

def METRecoCfg.getRegions (   config,
  suffix 
)

Region tools are a special case of refiners.

Definition at line 134 of file METRecoCfg.py.

134 def getRegions(config,suffix):
135  if suffix == 'Truth':
136  config.outputKey = config.objType
137  tool = CompFactory.getComp("met::METRegionsTool")('MET_'+config.outputKey+'Regions_'+suffix)
138  tool.InputMETContainer = 'MET_'+suffix
139  tool.InputMETMap = 'METMap_'+suffix
140  tool.InputMETKey = config.outputKey
141  tool.RegionValues = [ 1.5, 3.2, 10 ]
142  return tool
143 

Variable Documentation

◆ defaultInputKey

dictionary METRecoCfg.defaultInputKey
Initial value:
1 = {
2  'Ele' :'Electrons',
3  'Gamma' :'Photons',
4  'Tau' :'TauJets',
5  'Jet' :'AntiKt4EMTopoJets',
6  'Muon' :'Muons',
7  'SoftTrk' :'InDetTrackParticles',
8  'SoftClus' :'CaloCalTopoClusters',
9  'SoftPFlow':'JetETMissNeutralParticleFlowObjects',
10  'PrimaryVx':'PrimaryVertices',
11  'Truth' :'TruthEvents',
12  'Calo' :'AllCalo',
13  'LCOCSoftClus':'LCOriginTopoClusters',
14  'EMOCSoftClus':'EMOriginTopoClusters',
15  }

Define some default values.

Definition at line 12 of file METRecoCfg.py.

◆ defaultOutputKey

dictionary METRecoCfg.defaultOutputKey
Initial value:
1 = {
2  'Ele' :'RefEle',
3  'Gamma' :'RefGamma',
4  'Tau' :'RefTau',
5  'Jet' :'RefJet',
6  'Muon' :'Muons',
7  'SoftTrk' :'SoftTrk',
8  'SoftClus' :'SoftClus',
9  'SoftPFlow':'SoftPFlow',
10  'Total' :'Final',
11  'Truth' :'Truth',
12  'Calo' :'Calo'
13  }

Definition at line 28 of file METRecoCfg.py.

◆ metlog

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

Definition at line 7 of file METRecoCfg.py.

◆ prefix

string METRecoCfg.prefix = 'METRecoConfig: '

Definition at line 42 of file METRecoCfg.py.

METRecoCfg.getRefiner
def getRefiner(flags, config, suffix, trkseltool=None, trkvxtool=None, trkisotool=None, caloisotool=None)
Definition: METRecoCfg.py:113
METRecoCfg.getMETRecoAlg
def getMETRecoAlg(algName='METReconstruction', configs={})
Definition: METRecoCfg.py:273
vtune_athena.format
format
Definition: vtune_athena.py:14
METRecoCfg.getBuilder
def getBuilder(config, suffix, doTracks, doCells, doTriggerMET, doOriginCorrClus)
Definition: METRecoCfg.py:53
METRecoCfg.getRegions
def getRegions(config, suffix)
Region tools are a special case of refiners.
Definition: METRecoCfg.py:134
METRecoCfg.getRegionRecoTool
def getRegionRecoTool(topconfig)
Definition: METRecoCfg.py:263
METRecoCfg.getMETRecoTool
def getMETRecoTool(topconfig)
Definition: METRecoCfg.py:250