ATLAS Offline Software
Loading...
Searching...
No Matches
python.HLT.Jet.JetRecoCommon Namespace Reference

Functions

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

Variables

 log = logging.getLogger(__name__)
dict etaRangeAbbrev
 Common jet eta ranges —
dict cleaningDict

Function Documentation

◆ addJetContextFlags()

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

Definition at line 196 of file JetRecoCommon.py.

196def 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()

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

Definition at line 106 of file JetRecoCommon.py.

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

◆ defineGroomedJets()

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

Definition at line 499 of file JetRecoCommon.py.

499def 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()

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

Definition at line 519 of file JetRecoCommon.py.

519def 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()

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

Jet Object getters —

Definition at line 406 of file JetRecoCommon.py.

406def 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()

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

Definition at line 472 of file JetRecoCommon.py.

472def 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()

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

Definition at line 494 of file JetRecoCommon.py.

494def 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()

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

Definition at line 513 of file JetRecoCommon.py.

513def 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()

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

Definition at line 182 of file JetRecoCommon.py.

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

◆ doTracking()

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

Definition at line 179 of file JetRecoCommon.py.

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

◆ extractRecoDict()

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

Definition at line 56 of file JetRecoCommon.py.

56def 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()

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

— Modifier and decoration list getters —

Definition at line 300 of file JetRecoCommon.py.

300def 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()

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

Definition at line 251 of file JetRecoCommon.py.

251def 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()

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

Definition at line 375 of file JetRecoCommon.py.

375def 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()

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

Definition at line 193 of file JetRecoCommon.py.

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

◆ getHLTPrefix()

python.HLT.Jet.JetRecoCommon.getHLTPrefix ( )

— String getters —

Definition at line 247 of file JetRecoCommon.py.

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

◆ getJetCalibDefaultString()

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

Definition at line 264 of file JetRecoCommon.py.

264def 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()

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

Definition at line 371 of file JetRecoCommon.py.

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

◆ getPrefilterCleaningString()

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

Definition at line 286 of file JetRecoCommon.py.

286def 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()

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

— General helpers —

Definition at line 167 of file JetRecoCommon.py.

167def 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()

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

Definition at line 186 of file JetRecoCommon.py.

186def 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()

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

Definition at line 153 of file JetRecoCommon.py.

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

◆ jetChainParts()

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

— Extracting jet chain parts —

Definition at line 34 of file JetRecoCommon.py.

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

◆ jetDefNeedsTracks()

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

Definition at line 173 of file JetRecoCommon.py.

173def 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()

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

— Interpreting JetDefinition

Definition at line 118 of file JetRecoCommon.py.

118def 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()

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

Definition at line 80 of file JetRecoCommon.py.

80def 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()

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

— General reco dict handling —

Definition at line 45 of file JetRecoCommon.py.

45def 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

dict python.HLT.Jet.JetRecoCommon.cleaningDict
Initial value:
1= {
2 'CLEANlb': 'LooseBad',
3 'CLEANllp': 'LooseBadLLP',
4}

Definition at line 281 of file JetRecoCommon.py.

◆ etaRangeAbbrev

dict python.HLT.Jet.JetRecoCommon.etaRangeAbbrev
Initial value:
1= {
2 "j":"0eta320", # default
3 "a":"0eta490",
4 "c":"0eta240",
5 "C":"0eta210",
6 "f":"320eta490"
7}

Common jet eta ranges —

Definition at line 23 of file JetRecoCommon.py.

◆ log

python.HLT.Jet.JetRecoCommon.log = logging.getLogger(__name__)

Definition at line 19 of file JetRecoCommon.py.