Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions | Variables
python.HLT.Jet.JetRecoCommon Namespace Reference

Functions

def jetChainParts (chainParts)
 — Extracting jet chain parts — More...
 
def jetRecoDictToString (jetRecoDict)
 — General reco dict handling — More...
 
def extractRecoDict (chainParts)
 
def jetRecoDictFromString (jet_def_string)
 
def cloneAndUpdateJetRecoDict (jetRecoDict, **kwargs)
 
def jetDefToString (jetDef)
 — Interpreting JetDefinitionMore...
 
def jetCalibFromJetDef (jetDef)
 
def interpretRecoAlg (recoAlg)
 — General helpers — More...
 
def jetDefNeedsTracks (jetRecoDict)
 
def doTracking (jetRecoDict)
 
def doFSTracking (jetRecoDict)
 
def isPFlow (jetRecoDict)
 
def getFilterCut (recoAlg)
 
def addJetContextFlags (flags)
 
def getHLTPrefix ()
 — String getters — More...
 
def getClustersKey (recoDict)
 
def getJetCalibDefaultString (recoAlg, constitType, trkopt)
 
def getPrefilterCleaningString (prefilters_list)
 
def getCalibMods (flags, jetRecoDict, rhoKey="auto")
 — Modifier and decoration list getters — More...
 
def getModSpec (modname, modspec='')
 
def getDecorList (jetDef)
 
def defineJetConstit (jetRecoDict, clustersKey=None, pfoPrefix=None)
 Jet Object getters — More...
 
def defineJets (flags, jetRecoDict, clustersKey=None, prefix='', suffix='', pfoPrefix=None)
 
def defineReclusteredJets (jetRecoDict, smallRjets, inputlabel, prefix, suffix)
 
def defineGroomedJets (jetRecoDict, ungroomedDef)
 
def defineVRTrackJets (Rmax, Rmin, VRMassScale, Ptmin, prefix, suffix)
 
def defineHIJets (jetRecoDict, clustersKey=None, prefix='', suffix='')
 

Variables

 log
 
 etaRangeAbbrev
 Common jet eta ranges — More...
 
 cleaningDict
 

Function Documentation

◆ addJetContextFlags()

def python.HLT.Jet.JetRecoCommon.addJetContextFlags (   flags)

Definition at line 195 of file JetRecoCommon.py.

195 def addJetContextFlags(flags):
196 
197  flags.addFlag("Jet.Context.notrk", lambda prevFlags : prevFlags.Jet.Context.default )
198 
199 
200  def _buildContextDic(prevFlags, trkopt):
201  # *****************
202  idFlags = prevFlags.Trigger.InDetTracking
203  (tracksname,verticesname) = {
204  'ftf': (idFlags.fullScan.tracks_FTF,
205  idFlags.fullScan.vertex),
206  'roiftf': (idFlags.jetSuper.tracks_FTF,
207  idFlags.jetSuper.vertex),
208  }[trkopt]
209 
210  tvaname = f"JetTrackVtxAssoc_{trkopt}"
211  label = f"GhostTrack_{trkopt}"
212  ghosttracksname = f"PseudoJet{label}"
213 
214  contextDic = prevFlags.Jet.Context.default.clone(
215  Tracks = tracksname,
216  Vertices = verticesname,
217  TVA = tvaname,
218  GhostTracks = ghosttracksname,
219  GhostTracksLabel = label ,
220  JetTracks = f'JetSelectedTracks_{trkopt}',
221  )
222  # also declare some JetInputExternal corresponding to trkopt
223  # This ensures the JetRecConfig helpers know about them.
224  # We declare simplistic JetInputExternal, without algoBuilder, because the rest of the trigger config is in charge of producing these containers.
225  from JetRecConfig.StandardJetConstits import stdInputExtDic
226  if tracksname not in stdInputExtDic:
227  from JetRecConfig.JetDefinition import JetInputExternal
228  from xAODBase.xAODType import xAODType
229  stdInputExtDic[tracksname] = JetInputExternal( tracksname, xAODType.TrackParticle )
230  stdInputExtDic[verticesname] = JetInputExternal( verticesname, xAODType.Vertex )
231 
232 
233  return contextDic
234 
235 
236 
237  flags.addFlag("Jet.Context.ftf", lambda prevFlags : _buildContextDic(prevFlags,"ftf") )
238  flags.addFlag("Jet.Context.roiftf", lambda prevFlags : _buildContextDic(prevFlags,"roiftf") )
239 
240 
241 
242 

◆ cloneAndUpdateJetRecoDict()

def python.HLT.Jet.JetRecoCommon.cloneAndUpdateJetRecoDict (   jetRecoDict,
**  kwargs 
)

Definition at line 106 of file JetRecoCommon.py.

106 def cloneAndUpdateJetRecoDict(jetRecoDict,**kwargs):
107  newJetRecoDict = copy.copy(jetRecoDict)
108  newJetRecoDict.update(dict(**kwargs))
109  newJetRecoDict["jetDefStr"] = jetRecoDictToString(newJetRecoDict)
110  return newJetRecoDict
111 

◆ defineGroomedJets()

def python.HLT.Jet.JetRecoCommon.defineGroomedJets (   jetRecoDict,
  ungroomedDef 
)

Definition at line 497 of file JetRecoCommon.py.

497 def defineGroomedJets(jetRecoDict,ungroomedDef):#,ungroomedJetsName):
498  from JetRecConfig.JetGrooming import JetTrimming, JetSoftDrop
499  groomAlg = jetRecoDict["recoAlg"][3:] if 'sd' in jetRecoDict["recoAlg"] else jetRecoDict["recoAlg"][-1]
500  suffix = "_"+ jetRecoDict["jetCalib"]
501  if jetDefNeedsTracks(jetRecoDict):
502  suffix += "_"+jetRecoDict["trkopt"]
503 
504  groomDef = {
505  "sd":JetSoftDrop(ungroomedDef,ZCut=0.1,Beta=1.0,suffix=suffix,context=jetRecoDict['trkopt']),
506  "t" :JetTrimming(ungroomedDef,RClus=0.2,PtFrac=0.04,suffix=suffix,context=jetRecoDict['trkopt']),
507  }[groomAlg]
508  return groomDef
509 
510 #Jet Definition for VR track jets

◆ defineHIJets()

def python.HLT.Jet.JetRecoCommon.defineHIJets (   jetRecoDict,
  clustersKey = None,
  prefix = '',
  suffix = '' 
)

Definition at line 517 of file JetRecoCommon.py.

517 def defineHIJets(jetRecoDict,clustersKey=None,prefix='',suffix=''):
518  minpt = {2:7000, 3:7000, 4:7000, 6:7000, 10:50000}
519  jetalg, jetradius, jetextra = interpretRecoAlg(jetRecoDict["recoAlg"])
520  actualradius = float(jetradius)/10
521  constitMods = [] # modifiers
522  jetConstit = []
523  jetConstit = JetInputConstitSeq( "HLT_HIConstit",xAODType.CaloCluster, constitMods, inputname=clustersKey, outputname=clustersKey,label='HI')
524  from JetRecConfig.StandardJetConstits import stdConstitDic
525  stdConstitDic.setdefault(jetConstit.name, jetConstit)
526 
527  jetDef = JetDefinition( "AntiKt", actualradius, jetConstit, ptmin=minpt[jetradius], prefix=prefix, suffix=suffix)
528  return jetDef

◆ defineJetConstit()

def python.HLT.Jet.JetRecoCommon.defineJetConstit (   jetRecoDict,
  clustersKey = None,
  pfoPrefix = None 
)

Jet Object getters —

Definition at line 404 of file JetRecoCommon.py.

404 def defineJetConstit(jetRecoDict,clustersKey=None,pfoPrefix=None):
405  constitMods = []
406  # Get the details of the constituent definition:
407  # type, mods and the input container name
408 
409  if jetRecoDict["constitType"] == "pf":
410  if pfoPrefix is None:
411  raise RuntimeError("JetRecoCommon: Cannot define PF jets without pfo prefix!")
412 
413  constitMods = ["CorrectPFO"]
414  # apply constituent pileup suppression
415  if "vs" in jetRecoDict["constitMod"]:
416  constitMods.append("Vor")
417  if "cs" in jetRecoDict["constitMod"]:
418  constitMods.append("CS")
419  if "sk" in jetRecoDict["constitMod"]:
420  constitMods.append("SK")
421  constitMods += ["CHS"]
422 
423  inputPFO = pfoPrefix+"ParticleFlowObjects"
424  modstring = ''.join(constitMods[1:-1])
425  if modstring == '':
426  modstring='CHS'
427 
428  inputxAODType = xAODType.FlowElement
429  if not constitMods:
430  jetConstit = JetInputConstitSeq( "HLT_EMPFlow", inputxAODType, constitMods, inputname=inputPFO, outputname=pfoPrefix+"CHSParticleFlowObjects", label="EMPFlow", jetinputtype="EMPFlow")
431  else:
432  jetConstit = JetInputConstitSeq( "HLT_EMPFlow"+modstring, inputxAODType, constitMods, inputname=inputPFO, outputname=pfoPrefix+modstring+"ParticleFlowObjects",label='EMPFlow'+(modstring if modstring!='CHS' else ''), jetinputtype="EMPFlow" )
433 
434 
435  if jetRecoDict["constitType"] == "tc":
436  # apply constituent pileup suppression
437  if "vs" in jetRecoDict["constitMod"]:
438  constitMods.append("Vor")
439  if "cs" in jetRecoDict["constitMod"]:
440  constitMods.append("CS")
441  if "sk" in jetRecoDict["constitMod"]:
442  constitMods.append("SK")
443  # build a modifier identifier :
444  modstring = ''.join(constitMods)
445  # prepend the cluster calib state :
446  if jetRecoDict["clusterCalib"] == "em":
447  constitMods = ["EM"] + constitMods
448  elif jetRecoDict["clusterCalib"] == "lcw":
449  constitMods = ["LC"] + constitMods
450  else:
451  log.error("cluster calib state not recognised : ",jetRecoDict["clusterCalib"])
452  if not clustersKey:
453  raise ValueError("cluster key must be provided for topocluster jets.")
454 
455 
456  if not constitMods:
457  jetConstit = JetInputConstitSeq( "HLT_EMTopo",xAODType.CaloCluster, constitMods, inputname=clustersKey, outputname=clustersKey+modstring,label='EMTopo'+modstring)
458  else:
459  jetConstit = JetInputConstitSeq( "HLT_"+constitMods[0]+"Topo",xAODType.CaloCluster, constitMods, inputname=clustersKey, outputname=clustersKey+modstring,label=constitMods[0]+'Topo'+modstring)
460 
461  # declare our new JetInputConstitSeq in the standard dictionary
462  from JetRecConfig.StandardJetConstits import stdConstitDic
463  stdConstitDic.setdefault(jetConstit.name, jetConstit)
464 
465  return jetConstit
466 
467 
468 # Arbitrary min pt for fastjet, set to be low enough for MHT(?)
469 # Could/should adjust higher for large-R

◆ defineJets()

def python.HLT.Jet.JetRecoCommon.defineJets (   flags,
  jetRecoDict,
  clustersKey = None,
  prefix = '',
  suffix = '',
  pfoPrefix = None 
)

Definition at line 470 of file JetRecoCommon.py.

470 def defineJets(flags,jetRecoDict,clustersKey=None,prefix='',suffix='',pfoPrefix=None):
471  minpt = {
472  "default": {
473  4: 7000,
474  10: 50000 },
475  "lowpt": { # used for HI UPC jet reco, ATR-28158
476  4: 4000,
477  10: 50000 }
478  }
479 
480  filter_type = "lowpt" if flags.Trigger.Jet.LowPtFilter else "default"
481  jetalg, jetradius, jetextra = interpretRecoAlg(jetRecoDict["recoAlg"])
482  actualradius = float(jetradius)/10
483  jetConstit = defineJetConstit(jetRecoDict,clustersKey,pfoPrefix)
484 
485  suffix="_"+jetRecoDict["jetCalib"]+'_'*(suffix.strip()!='')+suffix
486  if jetDefNeedsTracks(jetRecoDict):
487  suffix += "_"+jetRecoDict["trkopt"]
488 
489  jetDef = JetDefinition( "AntiKt", actualradius, jetConstit, ptmin=minpt[filter_type][jetradius], prefix=prefix, suffix=suffix, context=jetRecoDict["trkopt"])
490  return jetDef
491 

◆ defineReclusteredJets()

def python.HLT.Jet.JetRecoCommon.defineReclusteredJets (   jetRecoDict,
  smallRjets,
  inputlabel,
  prefix,
  suffix 
)

Definition at line 492 of file JetRecoCommon.py.

492 def defineReclusteredJets(jetRecoDict,smallRjets,inputlabel,prefix,suffix):
493  rcJetConstit = JetInputConstit("RCJet", xAODType.Jet, smallRjets, label=inputlabel+'RC', lock=True)
494  rcJetDef = JetDefinition( "AntiKt", 1.0, rcJetConstit, prefix=prefix, suffix=suffix, context=jetRecoDict['trkopt'])
495  return rcJetDef
496 

◆ defineVRTrackJets()

def python.HLT.Jet.JetRecoCommon.defineVRTrackJets (   Rmax,
  Rmin,
  VRMassScale,
  Ptmin,
  prefix,
  suffix 
)

Definition at line 511 of file JetRecoCommon.py.

511 def defineVRTrackJets(Rmax, Rmin, VRMassScale, Ptmin, prefix, suffix):
512  jetconstit = JetInputConstit("PV0Track", xAODType.TrackParticle, "PV0JetSelectedTracks_ftf")
513  VRTrackJetDef = JetDefinition("AntiKt", Rmax, jetconstit, ptmin=Ptmin, VRMinR=Rmin, VRMassSc=VRMassScale, prefix=prefix, suffix=suffix, lock=True)
514  return VRTrackJetDef
515 
516 

◆ doFSTracking()

def python.HLT.Jet.JetRecoCommon.doFSTracking (   jetRecoDict)

Definition at line 181 of file JetRecoCommon.py.

181 def doFSTracking(jetRecoDict):
182  return jetRecoDict["trkopt"]=="ftf"
183 
184 # Check if constituent type is pflow. Concurrently check that the tracking option is valid.

◆ doTracking()

def python.HLT.Jet.JetRecoCommon.doTracking (   jetRecoDict)

Definition at line 178 of file JetRecoCommon.py.

178 def doTracking(jetRecoDict):
179  return jetRecoDict["trkopt"]!="notrk"
180 # Check if full scan track reconstruction is enabled

◆ extractRecoDict()

def python.HLT.Jet.JetRecoCommon.extractRecoDict (   chainParts)

Definition at line 56 of file JetRecoCommon.py.

56 def extractRecoDict(chainParts):
57  # interpret the reco configuration only
58  # eventually should just be a subdict in the chainDict
59  recoDict = {}
60  for p in chainParts:
61  for k in recoKeys:
62  # Look for our key in the chain part
63  if k in p.keys():
64  # found the key, check for consistency with other chain parts of this chain
65  if k in recoDict.keys():
66  if p[k] != recoDict[k]:
67  raise RuntimeError('Inconsistent reco setting for %s' % k)
68  # copy this entry to the reco dictionary
69  recoDict[k] = p[k]
70 
71  # set proper jetCalib key in default case
72  if recoDict['jetCalib'] == "default":
73  recoDict['jetCalib'] = getJetCalibDefaultString(recoDict['recoAlg'],recoDict['constitType'],recoDict['trkopt'])
74 
75  recoDict['jetDefStr'] = jetRecoDictToString(recoDict)
76 
77  return recoDict
78 
79 # Inverse of the above, essentially only for CF tests

◆ getCalibMods()

def python.HLT.Jet.JetRecoCommon.getCalibMods (   flags,
  jetRecoDict,
  rhoKey = "auto" 
)

— Modifier and decoration list getters —

Definition at line 299 of file JetRecoCommon.py.

299 def getCalibMods(flags,jetRecoDict,rhoKey="auto"):
300 
301  # Minimum modifier set for calibration w/o track GSC
302  # Should eventually build in more mods, depend on track info etc
303  jetalg = jetRecoDict["recoAlg"]
304  if jetRecoDict["jetCalib"] == "nojcalib" or jetalg=="a10r":
305  calibMods = []
306  else:
307  dotracking = doTracking(jetRecoDict)
308  if not dotracking and "gsc" in jetRecoDict["jetCalib"]:
309  raise ValueError("Track GSC requested but no track source provided!")
310 
311  if not dotracking and "subres" in jetRecoDict["jetCalib"]:
312  raise ValueError("Pileup residual calibration requested but no track source provided!")
313 
314  if jetRecoDict["constitType"] == "tc":
315  calibKey = flags.Trigger.Jet.emtopoCalibKey
316  calibContext,calibSeq = {
317  ("a4","subjes"): (calibKey,"JetArea_EtaJES_GSC"), # Calo GSC only ( + insitu in data)
318  ("a4","subjesIS"): (calibKey,"JetArea_EtaJES_GSC"), # Calo GSC only (no insitu)
319  ("a4","subjesgscIS"): (calibKey,"JetArea_EtaJES_GSC"), # Calo+Trk GSC ( + insitu in data)
320  ("a4","subresjesgscIS"): (calibKey,"JetArea_Residual_EtaJES_GSC"), # pu residual + calo+trk GSC ( + insitu in data)
321  ("a4","subjesgsc"): (calibKey,"JetArea_EtaJES_GSC"), # Calo+Trk GSC (no insitu)
322  ("a4","subresjesgsc"): (calibKey,"JetArea_Residual_EtaJES_GSC"), # pu residual + calo+trk GSC (no insitu)
323  ("a10","subjes"): ("TrigUngroomed","JetArea_EtaJES"),
324  ("a10t","jes"): ("TrigTrimmed","EtaJES_JMS"),
325  }[(jetRecoDict["recoAlg"],jetRecoDict["jetCalib"])]
326 
327  pvname = ""
328  gscDepth = "EM3"
329  if "gsc" in jetRecoDict["jetCalib"]:
330  gscDepth = "trackWIDTH"
331  pvname = flags.Trigger.InDetTracking.fullScan.vertex_jet
332 
333  elif jetRecoDict["constitType"] == "pf":
334  gscDepth = "auto"
335  if 'sd' in jetRecoDict["recoAlg"]:
336  calibContext = flags.Trigger.Jet.pflowLJCalibKey # large-R pflow
337  calibSeq = "EtaJES_JMS"
338  else:
339  calibKey = flags.Trigger.Jet.pflowCalibKey # small-R pflow
340  gscDepth = "trackWIDTH"
341  if "gsc" not in jetRecoDict["jetCalib"]:
342  gscDepth = "EM3" # calo-only GSC
343  calibContext,calibSeq = {
344  ("a4","jes"): (calibKey,"EtaJES_GSC"), # w/o jet area sub, w/o pu residual + calo GSC only (no insitu)
345  ("a4","subjesgsc"): (calibKey,"JetArea_EtaJES_GSC"), # w/o pu residual + calo+trk GSC
346  ("a4","subresjesgsc"): (calibKey,"JetArea_Residual_EtaJES_GSC"), # pu residual + calo+trk GSC
347  ("a4","subjesgscIS"): (calibKey,"JetArea_EtaJES_GSC"), # w/o pu residual + calo+trk GSC
348  ("a4","subresjesgscIS"): (calibKey,"JetArea_Residual_EtaJES_GSC"), # pu residual + calo+trk GSC
349  }[(jetRecoDict["recoAlg"],jetRecoDict["jetCalib"])]
350  pvname = flags.Trigger.InDetTracking.fullScan.vertex_jet
351  if jetRecoDict["jetCalib"].endswith("IS") and (not flags.Input.isMC):
352  calibSeq += "_Insitu"
353 
354  dataSource = "mc" if flags.Input.isMC else "data"
355  calibSpec = ":".join( [calibContext, dataSource, calibSeq, rhoKey, pvname, gscDepth] )
356 
357  if jetalg=="a4":
358  calibMods = ["EMScaleMom",
359  "ConstitFourMom_copy",
360  "CaloEnergies", # Needed for GSC
361  "Calib:"+calibSpec]
362  else:
363  calibMods = ["ConstitFourMom_copy",
364  "Calib:"+calibSpec]
365 
366  return calibMods
367 
368 # Make generating the list a bit more comprehensible
369 # TODO document where and how this is used.

◆ getClustersKey()

def python.HLT.Jet.JetRecoCommon.getClustersKey (   recoDict)

Definition at line 250 of file JetRecoCommon.py.

250 def getClustersKey(recoDict):
251  if recoDict['ionopt'] == 'ion':
252  return "HLT_HICaloClustersFS"
253  clusterCalib = recoDict["clusterCalib"]
254  if clusterCalib == "em":
255  from ..CommonSequences.FullScanDefs import em_clusters
256  return em_clusters
257  elif clusterCalib == "lcw":
258  from ..CommonSequences.FullScanDefs import lc_clusters
259  return lc_clusters
260  else:
261  raise ValueError("Invalid value for calib: '{}'".format(clusterCalib))
262 

◆ getDecorList()

def python.HLT.Jet.JetRecoCommon.getDecorList (   jetDef)

Definition at line 374 of file JetRecoCommon.py.

374 def getDecorList(jetDef):
375  # Basic jet info provided by the jet builder
376  decorlist = []
377 
378  # return empty list for non-calibrated jets
379  if jetCalibFromJetDef(jetDef) == 'nojcalib': return decorlist
380 
381  decorlist += [ 'AlgorithmType', 'InputType',
382  'ActiveArea', 'ActiveArea4vec_eta', 'ActiveArea4vec_m',
383  'ActiveArea4vec_phi', 'ActiveArea4vec_pt',
384  'EMFrac','HECFrac','EnergyPerSampling','N90Constituents','constit','Tile0Frac']
385 
386  if jetDef.context == 'ftf':
387  decorlist += ["GhostTrack_ftf",
388  "NumTrkPt500","NumTrkPt1000",
389  "SumPtTrkPt500","SumPtTrkPt1000",
390  "TrackWidthPt1000",
391  "JVFCorr", "JvtRpt", "Jvt"]
392  if 'PFlow' in jetDef.basename:
393  decorlist += ["SumPtChargedPFOPt500"]
394  return decorlist
395 
396 

◆ getFilterCut()

def python.HLT.Jet.JetRecoCommon.getFilterCut (   recoAlg)

Definition at line 192 of file JetRecoCommon.py.

192 def getFilterCut(recoAlg):
193  return {"a2":4000, "a4":4000, "a10":50000, "a10r": 50000, "a10t":50000, "a10sd":50000}[recoAlg]
194 

◆ getHLTPrefix()

def python.HLT.Jet.JetRecoCommon.getHLTPrefix ( )

— String getters —

Definition at line 246 of file JetRecoCommon.py.

246 def getHLTPrefix():
247  prefix = "HLT_"
248  return prefix
249 

◆ getJetCalibDefaultString()

def python.HLT.Jet.JetRecoCommon.getJetCalibDefaultString (   recoAlg,
  constitType,
  trkopt 
)

Definition at line 263 of file JetRecoCommon.py.

263 def getJetCalibDefaultString(recoAlg, constitType, trkopt):
264  if recoAlg == 'a4' or recoAlg == 'a2':
265  if constitType == 'tc':
266  return 'subresjesgscIS' if trkopt == 'ftf' else 'subjesIS'
267  elif constitType == 'pf':
268  return 'subresjesgscIS'
269  elif recoAlg == 'a10':
270  return 'subjes'
271  elif recoAlg == 'a10t':
272  return 'jes'
273  elif recoAlg == 'a10sd':
274  return 'jes'
275  elif recoAlg == 'a10r':
276  return 'subjesIS' # calibration for the small-R jets used to reconstruct the reclustered jets
277  else:
278  raise RuntimeError(f'No default calibration is defined for {recoAlg}, {constitType}, {trkopt}')
279 

◆ getModSpec()

def python.HLT.Jet.JetRecoCommon.getModSpec (   modname,
  modspec = '' 
)

Definition at line 370 of file JetRecoCommon.py.

370 def getModSpec(modname,modspec=''):
371  return (TriggerJetMods.stdJetModifiers[modname],str(modspec))
372 
373 # Get list of jet attributes to be calculated for jet

◆ getPrefilterCleaningString()

def python.HLT.Jet.JetRecoCommon.getPrefilterCleaningString (   prefilters_list)

Definition at line 285 of file JetRecoCommon.py.

285 def getPrefilterCleaningString(prefilters_list):
286  found_cleanings= [ci for ck, ci in cleaningDict.items() if ck in prefilters_list]
287  if len(found_cleanings) <= 1: # Only one supported cleaning decoration at the moment
288  return 'noCleaning' if len(found_cleanings) == 0 else found_cleanings[0]
289  else:
290  raise RuntimeError(
291  'Multijet jet cleanings found in jet trigger reco dictionary {}. Multiple jet cleanings are currently unsupported'.format(found_cleanings))
292 
293 

◆ interpretRecoAlg()

def python.HLT.Jet.JetRecoCommon.interpretRecoAlg (   recoAlg)

— General helpers —

Definition at line 166 of file JetRecoCommon.py.

166 def interpretRecoAlg(recoAlg):
167  import re
168  jetalg, jetradius, jetextra = re.split(r'(\d+)',recoAlg)
169  return jetalg, int(jetradius), jetextra
170 
171 # Check if jet definition needs tracks or if it should be agnostic of the tracking choice

◆ isPFlow()

def python.HLT.Jet.JetRecoCommon.isPFlow (   jetRecoDict)

Definition at line 185 of file JetRecoCommon.py.

185 def isPFlow(jetRecoDict):
186  isPFlow = jetRecoDict["constitType"] == "pf"
187  if isPFlow and not doFSTracking(jetRecoDict):
188  raise ValueError("This is a PFlow chain but an incompatible tracking option is given!")
189  return isPFlow
190 
191 # return the min jet pT in MeV for the configured recoAlg

◆ jetCalibFromJetDef()

def python.HLT.Jet.JetRecoCommon.jetCalibFromJetDef (   jetDef)

Definition at line 152 of file JetRecoCommon.py.

152 def jetCalibFromJetDef(jetDef):
153  jetCalib = jetDef.suffix[1:]
154  if jetCalib.endswith('_ftf'):
155  jetCalib = jetCalib[:-4]
156  return jetCalib
157 

◆ jetChainParts()

def python.HLT.Jet.JetRecoCommon.jetChainParts (   chainParts)

— Extracting jet chain parts —

Definition at line 34 of file JetRecoCommon.py.

34 def jetChainParts(chainParts):
35  jChainParts = []
36  for p in chainParts:
37  if p['trigType'] == 'j':
38  jChainParts.append(p)
39  return jChainParts
40 

◆ jetDefNeedsTracks()

def python.HLT.Jet.JetRecoCommon.jetDefNeedsTracks (   jetRecoDict)

Definition at line 172 of file JetRecoCommon.py.

172 def jetDefNeedsTracks(jetRecoDict):
173  # For tc_a10, tc_a10t and tc_a10sd, we will be agnostic of tracking (no suffix will be added)
174  # For everything else (constitType=pf or dependence on small-R jets) we need to be aware of what tracking was used
175  return jetRecoDict["trkopt"]!="notrk" and (jetRecoDict["constitType"]!="tc" or jetRecoDict["recoAlg"] in ['a2','a4','a10'])
176 
177 # Check if track reconstruction is enabled

◆ jetDefToString()

def python.HLT.Jet.JetRecoCommon.jetDefToString (   jetDef)

— Interpreting JetDefinition

Definition at line 118 of file JetRecoCommon.py.

118 def jetDefToString(jetDef):
119  _jetDef = jetDef
120  poststr = ''
121  if isinstance(jetDef,GroomingDefinition):
122  _jetDef = jetDef.ungroomeddef
123  # We don't support multiple configurations of a given grooming
124  if jetDef.groomSpecAsStr().startswith('Trimmed'):
125  poststr = 't'
126  elif jetDef.groomSpecAsStr().startswith('SoftDrop'):
127  poststr = 'sd'
128  else:
129  raise ValueError('Unsupported grooming type for HLT')
130  elif jetDef.inputdef.jetinputtype == JetInputType.Jet:
131  # Reclustered
132  poststr = 'r'
133 
134  algstr = f'{str.lower(_jetDef.algorithm[0])}{formatRvalue(_jetDef._radius)}{poststr}'
135  constitdef = _jetDef.inputdef
136  if constitdef.label == 'HI':
137  constitstr = 'ion'
138  else:
139  clusterCalib = 'lcw' if 'LC' in constitdef.label else 'em'
140  constittype = 'pf' if 'PFlow' in constitdef.label else 'tc'
141  constitmods = ''
142  if isinstance(constitdef,JetInputConstitSeq):
143  ignore = ['EM','LC','CHS','CorrectPFO']
144  for mod in constitdef.modifiers:
145  if mod not in ignore:
146  constitmods += str.lower(mod)
147  constitstr = f'{constitmods}{constittype}_{clusterCalib}'
148  jetdefstr = f'{algstr}_{constitstr}{jetDef.suffix}'
149 
150  return jetdefstr
151 

◆ jetRecoDictFromString()

def python.HLT.Jet.JetRecoCommon.jetRecoDictFromString (   jet_def_string)

Definition at line 80 of file JetRecoCommon.py.

80 def jetRecoDictFromString(jet_def_string):
81 
82  # Translate the definition string into an approximation
83  # of the "recoParts" in the jet chainParts.
84  jetRecoDict = {}
85  from TriggerMenuMT.HLT.Menu.SignatureDicts import JetChainParts,JetChainParts_Default
86  for key in recoKeys:
87  keyFound = False
88  tmp_key = key
89  for part in jet_def_string.split('_'):
90  if part in JetChainParts[tmp_key]:
91  jetRecoDict[key] = part
92  keyFound = True
93  if not keyFound:
94  jetRecoDict[key] = JetChainParts_Default[key]
95 
96  # set proper jetCalib key in default case
97  if jetRecoDict['jetCalib'] == "default":
98  jetRecoDict['jetCalib'] = getJetCalibDefaultString(jetRecoDict['recoAlg'],jetRecoDict['constitType'],jetRecoDict['trkopt'])
99 
100  jetRecoDict['jetDefStr'] = jetRecoDictToString(jetRecoDict)
101 
102  return jetRecoDict
103 
104 # Assist with grooming and reclustering workflows, we need to
105 # ensure that the name is updated consistently

◆ jetRecoDictToString()

def python.HLT.Jet.JetRecoCommon.jetRecoDictToString (   jetRecoDict)

— General reco dict handling —

Definition at line 45 of file JetRecoCommon.py.

45 def jetRecoDictToString(jetRecoDict):
46  if jetRecoDict['ionopt']=='ion':
47  # Unique settings for heavy ions
48  # other values will be default
49  return jetRecoDict['recoAlg'] + "_ion"
50  strtemp = "{recoAlg}_{constitMod}{constitType}_{clusterCalib}_{jetCalib}"
51  if doTracking(jetRecoDict):
52  strtemp += "_{trkopt}"
53  return strtemp.format(**jetRecoDict)
54 
55 # Extract the jet reco dict from the chainDict

Variable Documentation

◆ cleaningDict

python.HLT.Jet.JetRecoCommon.cleaningDict

Definition at line 280 of file JetRecoCommon.py.

◆ etaRangeAbbrev

python.HLT.Jet.JetRecoCommon.etaRangeAbbrev

Common jet eta ranges —

Definition at line 23 of file JetRecoCommon.py.

◆ log

python.HLT.Jet.JetRecoCommon.log

Definition at line 19 of file JetRecoCommon.py.

vtune_athena.format
format
Definition: vtune_athena.py:14
python.HLT.Jet.JetRecoCommon.defineGroomedJets
def defineGroomedJets(jetRecoDict, ungroomedDef)
Definition: JetRecoCommon.py:497
python.HLT.Jet.JetRecoCommon.getDecorList
def getDecorList(jetDef)
Definition: JetRecoCommon.py:374
python.HLT.Jet.JetRecoCommon.jetCalibFromJetDef
def jetCalibFromJetDef(jetDef)
Definition: JetRecoCommon.py:152
python.HLT.Jet.JetRecoCommon.doFSTracking
def doFSTracking(jetRecoDict)
Definition: JetRecoCommon.py:181
python.HLT.Jet.JetRecoCommon.getClustersKey
def getClustersKey(recoDict)
Definition: JetRecoCommon.py:250
python.HLT.Jet.JetRecoCommon.getCalibMods
def getCalibMods(flags, jetRecoDict, rhoKey="auto")
— Modifier and decoration list getters —
Definition: JetRecoCommon.py:299
python.HLT.Jet.JetRecoCommon.cloneAndUpdateJetRecoDict
def cloneAndUpdateJetRecoDict(jetRecoDict, **kwargs)
Definition: JetRecoCommon.py:106
python.HLT.Jet.JetRecoCommon.defineJetConstit
def defineJetConstit(jetRecoDict, clustersKey=None, pfoPrefix=None)
— Jet Object getters —
Definition: JetRecoCommon.py:404
python.HLT.Jet.JetRecoCommon.getModSpec
def getModSpec(modname, modspec='')
Definition: JetRecoCommon.py:370
python.HLT.Jet.JetRecoCommon.extractRecoDict
def extractRecoDict(chainParts)
Definition: JetRecoCommon.py:56
python.HLT.Jet.JetRecoCommon.getPrefilterCleaningString
def getPrefilterCleaningString(prefilters_list)
Definition: JetRecoCommon.py:285
python.HLT.Jet.JetRecoCommon.jetDefToString
def jetDefToString(jetDef)
— Interpreting JetDefinition —
Definition: JetRecoCommon.py:118
python.HLT.Jet.JetRecoCommon.defineReclusteredJets
def defineReclusteredJets(jetRecoDict, smallRjets, inputlabel, prefix, suffix)
Definition: JetRecoCommon.py:492
python.HLT.Jet.JetRecoCommon.defineVRTrackJets
def defineVRTrackJets(Rmax, Rmin, VRMassScale, Ptmin, prefix, suffix)
Definition: JetRecoCommon.py:511
python.HLT.Jet.JetRecoCommon.getJetCalibDefaultString
def getJetCalibDefaultString(recoAlg, constitType, trkopt)
Definition: JetRecoCommon.py:263
JetSoftDrop
Definition: JetSoftDrop.h:28
python.HLT.Jet.JetRecoCommon.addJetContextFlags
def addJetContextFlags(flags)
Definition: JetRecoCommon.py:195
python.HLT.Jet.JetRecoCommon.jetDefNeedsTracks
def jetDefNeedsTracks(jetRecoDict)
Definition: JetRecoCommon.py:172
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.HLT.Jet.JetRecoCommon.jetRecoDictToString
def jetRecoDictToString(jetRecoDict)
— General reco dict handling —
Definition: JetRecoCommon.py:45
python.HLT.Jet.JetRecoCommon.getHLTPrefix
def getHLTPrefix()
— String getters —
Definition: JetRecoCommon.py:246
python.HLT.Jet.JetRecoCommon.jetRecoDictFromString
def jetRecoDictFromString(jet_def_string)
Definition: JetRecoCommon.py:80
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.HLT.Jet.JetRecoCommon.jetChainParts
def jetChainParts(chainParts)
— Extracting jet chain parts —
Definition: JetRecoCommon.py:34
python.HLT.Jet.JetRecoCommon.isPFlow
def isPFlow(jetRecoDict)
Definition: JetRecoCommon.py:185
python.HLT.Jet.JetRecoCommon.defineHIJets
def defineHIJets(jetRecoDict, clustersKey=None, prefix='', suffix='')
Definition: JetRecoCommon.py:517
str
Definition: BTagTrackIpAccessor.cxx:11
python.HLT.Jet.JetRecoCommon.interpretRecoAlg
def interpretRecoAlg(recoAlg)
— General helpers —
Definition: JetRecoCommon.py:166
python.HLT.Jet.JetRecoCommon.defineJets
def defineJets(flags, jetRecoDict, clustersKey=None, prefix='', suffix='', pfoPrefix=None)
Definition: JetRecoCommon.py:470
python.HLT.Jet.JetRecoCommon.getFilterCut
def getFilterCut(recoAlg)
Definition: JetRecoCommon.py:192
python.HLT.Jet.JetRecoCommon.doTracking
def doTracking(jetRecoDict)
Definition: JetRecoCommon.py:178
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65