4 from TrigBjetHypo.TrigBjetMonitoringConfig
import TrigBjetBtagHypoToolMonitoring
5 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaCommon.Logging
import logging
8 log = logging.getLogger(
'TrigBjetBtagHypoTool')
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']
89 nolegname = re.sub(
"(^leg.*?_)",
"", name)
90 if 'bJetMon:online' in chainDict[
'monGroups']:
100 """ decodes the b-tagging thresholds """
102 log.debug(
"decoded b-jet threshold: b%s", threshold_btag)
104 tagger =
"offperf" if threshold_btag ==
"offperf" else re.findall(
"(.*)[0-9]{2}",threshold_btag)[0]
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)
111 btagger =
"GN120220813"
112 bbtagger =
"dl1dbb20230314"
114 bbcut = bbTaggingWP.get(threshold_btag)
117 threshold_btag = threshold_btag.split(
"bb", maxsplit=1)[0]
120 if "dl1d" in threshold_btag:
121 btagger =
"DL1d20211216"
124 if "gn1" in threshold_btag:
125 btagger =
"GN120220813"
127 if "gn2" in threshold_btag:
128 btagger =
"GN220240122"
129 bcut = bTaggingWP[threshold_btag]
131 return [btagger, bcut] , [bbtagger, bbcut]
137 tool = CompFactory.TrigBjetBtagHypoTool( name )
138 if MonTool
is not None:
139 tool.MonTool = MonTool
141 [btagger, bcut] , [bbtagger, bbcut] =
decodeThreshold( conf_dict[
'bTag'] )
142 tool.monitoredFloats = {f
'{btagger}_p{x}':f
'btag_p{x}' for x
in 'cub'}
144 if conf_dict[
'bTag'] ==
"offperf":
147 tool.vetoBadBeamspot =
False
150 btagTool = CompFactory.BJetThreeValueCheck(
157 if MonTool
is not None:
158 btagTool.MonTool = MonTool
159 tool.checks.append(btagTool)
161 if bbcut
is not None:
162 bbTool = CompFactory.BJetTwoValueCheck(
164 numerator=f
'{bbtagger}_pb',
165 denominator=f
'{bbtagger}_pbb',
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']})