ATLAS Offline Software
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 196 of file JetRecoCommon.py.

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

◆ 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 499 of file JetRecoCommon.py.

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

◆ defineHIJets()

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

Definition at line 519 of file JetRecoCommon.py.

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

◆ defineJetConstit()

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

Jet Object getters —

Definition at line 406 of file JetRecoCommon.py.

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

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

◆ defineReclusteredJets()

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

Definition at line 494 of file JetRecoCommon.py.

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

◆ defineVRTrackJets()

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

Definition at line 513 of file JetRecoCommon.py.

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

◆ doFSTracking()

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

Definition at line 182 of file JetRecoCommon.py.

182 def doFSTracking(jetRecoDict):
183  return jetRecoDict["trkopt"]=="ftf"
184 
185 # 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 179 of file JetRecoCommon.py.

179 def doTracking(jetRecoDict):
180  return jetRecoDict["trkopt"]!="notrk"
181 # 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 300 of file JetRecoCommon.py.

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

◆ getClustersKey()

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

Definition at line 251 of file JetRecoCommon.py.

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

◆ getDecorList()

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

Definition at line 375 of file JetRecoCommon.py.

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

◆ getFilterCut()

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

Definition at line 193 of file JetRecoCommon.py.

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

◆ getHLTPrefix()

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

— String getters —

Definition at line 247 of file JetRecoCommon.py.

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

◆ getJetCalibDefaultString()

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

Definition at line 264 of file JetRecoCommon.py.

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

◆ getModSpec()

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

Definition at line 371 of file JetRecoCommon.py.

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

◆ getPrefilterCleaningString()

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

Definition at line 286 of file JetRecoCommon.py.

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

◆ interpretRecoAlg()

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

— General helpers —

Definition at line 167 of file JetRecoCommon.py.

167 def interpretRecoAlg(recoAlg):
168  import re
169  jetalg, jetradius, jetextra = re.split(r'(\d+)',recoAlg)
170  return jetalg, int(jetradius), jetextra
171 
172 # 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 186 of file JetRecoCommon.py.

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

◆ jetCalibFromJetDef()

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

Definition at line 153 of file JetRecoCommon.py.

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

◆ 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 173 of file JetRecoCommon.py.

173 def jetDefNeedsTracks(jetRecoDict):
174  # For tc_a10, tc_a10t and tc_a10sd, we will be agnostic of tracking (no suffix will be added)
175  # For everything else (constitType=pf or dependence on small-R jets) we need to be aware of what tracking was used
176  return jetRecoDict["trkopt"]!="notrk" and (jetRecoDict["constitType"]!="tc" or jetRecoDict["recoAlg"] in ['a2','a4','a10'])
177 
178 # 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  if _jetDef.context == 'hi': constitstr = 'ion'
138  else: constitstr = 'ionp'
139  else:
140  clusterCalib = 'lcw' if 'LC' in constitdef.label else 'em'
141  constittype = 'pf' if 'PFlow' in constitdef.label else 'tc'
142  constitmods = ''
143  if isinstance(constitdef,JetInputConstitSeq):
144  ignore = ['EM','LC','CHS','CorrectPFO']
145  for mod in constitdef.modifiers:
146  if mod not in ignore:
147  constitmods += str.lower(mod)
148  constitstr = f'{constitmods}{constittype}_{clusterCalib}'
149  jetdefstr = f'{algstr}_{constitstr}{jetDef.suffix}'
150 
151  return jetdefstr
152 

◆ 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'] in ['ion', 'ionp']:
47  # Unique settings for heavy ions
48  # other values will be default
49  return jetRecoDict['recoAlg'] + "_" + jetRecoDict['ionopt']
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 281 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:499
python.HLT.Jet.JetRecoCommon.getDecorList
def getDecorList(jetDef)
Definition: JetRecoCommon.py:375
python.HLT.Jet.JetRecoCommon.jetCalibFromJetDef
def jetCalibFromJetDef(jetDef)
Definition: JetRecoCommon.py:153
python.HLT.Jet.JetRecoCommon.doFSTracking
def doFSTracking(jetRecoDict)
Definition: JetRecoCommon.py:182
python.HLT.Jet.JetRecoCommon.getClustersKey
def getClustersKey(recoDict)
Definition: JetRecoCommon.py:251
python.HLT.Jet.JetRecoCommon.getCalibMods
def getCalibMods(flags, jetRecoDict, rhoKey="auto")
— Modifier and decoration list getters —
Definition: JetRecoCommon.py:300
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:406
python.HLT.Jet.JetRecoCommon.getModSpec
def getModSpec(modname, modspec='')
Definition: JetRecoCommon.py:371
python.HLT.Jet.JetRecoCommon.extractRecoDict
def extractRecoDict(chainParts)
Definition: JetRecoCommon.py:56
python.HLT.Jet.JetRecoCommon.getPrefilterCleaningString
def getPrefilterCleaningString(prefilters_list)
Definition: JetRecoCommon.py:286
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:494
python.HLT.Jet.JetRecoCommon.defineVRTrackJets
def defineVRTrackJets(Rmax, Rmin, VRMassScale, Ptmin, prefix, suffix)
Definition: JetRecoCommon.py:513
python.HLT.Jet.JetRecoCommon.getJetCalibDefaultString
def getJetCalibDefaultString(recoAlg, constitType, trkopt)
Definition: JetRecoCommon.py:264
JetSoftDrop
Definition: JetSoftDrop.h:28
python.HLT.Jet.JetRecoCommon.addJetContextFlags
def addJetContextFlags(flags)
Definition: JetRecoCommon.py:196
python.HLT.Jet.JetRecoCommon.jetDefNeedsTracks
def jetDefNeedsTracks(jetRecoDict)
Definition: JetRecoCommon.py:173
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:247
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:186
python.HLT.Jet.JetRecoCommon.defineHIJets
def defineHIJets(jetRecoDict, clustersKey=None, prefix='', suffix='')
Definition: JetRecoCommon.py:519
str
Definition: BTagTrackIpAccessor.cxx:11
python.HLT.Jet.JetRecoCommon.interpretRecoAlg
def interpretRecoAlg(recoAlg)
— General helpers —
Definition: JetRecoCommon.py:167
python.HLT.Jet.JetRecoCommon.defineJets
def defineJets(flags, jetRecoDict, clustersKey=None, prefix='', suffix='', pfoPrefix=None)
Definition: JetRecoCommon.py:472
python.HLT.Jet.JetRecoCommon.getFilterCut
def getFilterCut(recoAlg)
Definition: JetRecoCommon.py:193
python.HLT.Jet.JetRecoCommon.doTracking
def doTracking(jetRecoDict)
Definition: JetRecoCommon.py:179
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65