ATLAS Offline Software
Functions
TrigBjetBtagHypoTool Namespace Reference

Functions

def TrigBjetBtagHypoToolFromDict (flags, chainDict)
 
def decodeThreshold (threshold_btag)
 
def getBjetBtagHypoConfiguration (name, conf_dict, MonTool)
 

Function Documentation

◆ decodeThreshold()

def TrigBjetBtagHypoTool.decodeThreshold (   threshold_btag)
decodes the b-tagging thresholds 

Definition at line 99 of file TrigBjetBtagHypoTool.py.

99 def decodeThreshold( threshold_btag ):
100  """ decodes the b-tagging thresholds """
101 
102  log.debug("decoded b-jet threshold: b%s", threshold_btag)
103 
104  tagger = "offperf" if threshold_btag == "offperf" else re.findall("(.*)[0-9]{2}",threshold_btag)[0]
105 
106  allowedTaggers = ["offperf", "dl1d", "gn182bb", "gn177bb", "gn175bb", "gn1","gn2"]
107  if tagger not in allowedTaggers:
108  log.debug("tagger = %s not amidst allowed taggers ",threshold_btag)
109  raise RuntimeError("Can't recognize tagger during TrigBjetHypoTool configuration. Tagger = "+threshold_btag)
110 
111  btagger = "GN120220813" # default tagger for boffperf chain monitoring
112  bbtagger = "dl1dbb20230314"
113 
114  bbcut = bbTaggingWP.get(threshold_btag)
115 
116  # remove the bb part to get the b-only cut
117  threshold_btag = threshold_btag.split("bb", maxsplit=1)[0]
118 
119  # for chains wanting to use DL1d
120  if "dl1d" in threshold_btag:
121  btagger = "DL1d20211216"
122 
123  # for chains wanting to use GN1
124  if "gn1" in threshold_btag:
125  btagger = "GN120220813"
126 
127  if "gn2" in threshold_btag:
128  btagger = "GN220240122"
129  bcut = bTaggingWP[threshold_btag]
130 
131  return [btagger, bcut] , [bbtagger, bbcut]
132 

◆ getBjetBtagHypoConfiguration()

def TrigBjetBtagHypoTool.getBjetBtagHypoConfiguration (   name,
  conf_dict,
  MonTool 
)

Definition at line 135 of file TrigBjetBtagHypoTool.py.

135 def getBjetBtagHypoConfiguration( name,conf_dict, MonTool ):
136 
137  tool = CompFactory.TrigBjetBtagHypoTool( name )
138  if MonTool is not None:
139  tool.MonTool = MonTool
140 
141  [btagger, bcut] , [bbtagger, bbcut] = decodeThreshold( conf_dict['bTag'] )
142  tool.monitoredFloats = {f'{btagger}_p{x}':f'btag_p{x}' for x in 'cub'}
143 
144  if conf_dict['bTag'] == "offperf":
145  # we shoudln't be worried about rates blowing up due to bad
146  # b-tagging in the boffperf chains
147  tool.vetoBadBeamspot = False
148  return tool
149 
150  btagTool = CompFactory.BJetThreeValueCheck(
151  f'{name}_btag',
152  b=f'{btagger}_pb',
153  c=f'{btagger}_pc',
154  u=f'{btagger}_pu',
155  cFraction=0.018,
156  threshold=bcut)
157  if MonTool is not None:
158  btagTool.MonTool = MonTool
159  tool.checks.append(btagTool)
160 
161  if bbcut is not None:
162  bbTool = CompFactory.BJetTwoValueCheck(
163  f'{name}_bbtag',
164  numerator=f'{bbtagger}_pb',
165  denominator=f'{bbtagger}_pbb',
166  threshold=bbcut)
167  if MonTool is not None:
168  bbTool.MonTool = MonTool
169  tool.checks.append(bbTool)
170  tool.monitoredFloats.update({
171  f'{bbtagger}_p{x}':f'bbtag_p{x}' for x in ['b','bb']})
172 
173  return tool

◆ TrigBjetBtagHypoToolFromDict()

def TrigBjetBtagHypoTool.TrigBjetBtagHypoToolFromDict (   flags,
  chainDict 
)

Definition at line 76 of file TrigBjetBtagHypoTool.py.

76 def TrigBjetBtagHypoToolFromDict( flags, chainDict ):
77 
78  chainPart = chainDict['chainParts'][0]
79  conf_dict = { 'threshold' : chainPart['threshold'],
80  'multiplicity' : '1' if len(chainPart['multiplicity']) == 0 else chainPart['multiplicity'],
81  'bTag' : chainPart['bTag'][1:],
82  'bConfig' : 'EF' if len(chainPart['bConfig']) == 0 else chainPart['bConfig'][0],
83  'minEta' : chainPart['etaRange'].split('eta')[0],
84  'maxEta' : chainPart['etaRange'].split('eta')[1]}
85  name = chainDict['chainName']
86  # TODO the chain dict can be probably passed over down the line here
87 
88  MonTool = None
89  nolegname = re.sub("(^leg.*?_)", "", name)
90  if 'bJetMon:online' in chainDict['monGroups']:
91  MonTool = TrigBjetBtagHypoToolMonitoring(flags, f'TrigBjetOnlineMonitoring/{nolegname}')
92  tool = getBjetBtagHypoConfiguration( name,conf_dict, MonTool )
93 
94  return tool
95 
96 
TrigBjetBtagHypoTool.TrigBjetBtagHypoToolFromDict
def TrigBjetBtagHypoToolFromDict(flags, chainDict)
Definition: TrigBjetBtagHypoTool.py:76
TrigBjetMonitoringConfig.TrigBjetBtagHypoToolMonitoring
def TrigBjetBtagHypoToolMonitoring(flags, histPath)
Definition: TrigBjetMonitoringConfig.py:4
TrigBjetBtagHypoTool.decodeThreshold
def decodeThreshold(threshold_btag)
Definition: TrigBjetBtagHypoTool.py:99
TrigBjetBtagHypoTool.getBjetBtagHypoConfiguration
def getBjetBtagHypoConfiguration(name, conf_dict, MonTool)
Definition: TrigBjetBtagHypoTool.py:135
Trk::split
@ split
Definition: LayerMaterialProperties.h:38