5 '''@file MTMonitoring.py
6 @authors P-A. Delsart, Jona Bossio
8 @brief Python configuration for the Run III Trigger Jet Monitoring
11 from AthenaCommon.Logging
import logging
12 logger = logging.getLogger(__name__)
14 from TrigDecisionTool.TrigDecisionToolConfig
import getRun3NavigationContainerFromInput
16 from JetMonitoring.JetStandardHistoSpecs
import knownHistos
32 OfflineJetCollections = dict()
34 OfflineJetCollections[
'pp'] = {
35 'AntiKt4EMTopoJets' : {
'MatchTo' :
'AntiKt4EMPFlowJets' },
36 'AntiKt4EMPFlowJets' : {
'MatchTo' :
'NONE' },
40 OfflineJetCollections[
'HI'] = {
41 'AntiKt4HIJets' : {
'MatchTo' :
'AntiKt4HIJets' },
52 L1JetCollections = dict()
54 match_smallRL1_OfflineJets_List = [
'AntiKt4EMPFlowJets',
'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf']
56 match_largeRL1_OfflineJets_List = [
'AntiKt4EMPFlowJets',
'HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf']
57 match_HIL1_OfflineJets_List = [
'AntiKt4HIJets',
'HLT_AntiKt4HIJets']
59 L1JetCollections[
'pp'] = {
62 'MatchTo' : match_smallRL1_OfflineJets_List},
64 'L1_jFexSRJetRoI': {
'MatchTo': match_smallRL1_OfflineJets_List},
66 'L1_gFexSRJetRoI': {
'MatchTo': match_smallRL1_OfflineJets_List},
68 'L1_gFexLRJetRoI': {
'MatchTo': match_largeRL1_OfflineJets_List},
71 L1JetCollections[
'HI'] = {
72 'LVL1JetRoIs' : {
'MatchTo' : match_HIL1_OfflineJets_List},
73 'L1_jFexSRJetRoI': {
'MatchTo': match_HIL1_OfflineJets_List},
74 'L1_gFexSRJetRoI': {
'MatchTo': match_HIL1_OfflineJets_List},
77 for case
in L1JetCollections.keys():
79 items = L1JetCollections[case].
items()
80 except (AttributeError, TypeError):
81 raise RuntimeError(
'L1JetCollections for %s is not a mapping type'%case)
86 except (AttributeError, TypeError):
87 raise RuntimeError(
'L1JetCollections value for %s is not a mapping type'%case)
89 if 'MatchTo' not in d:
90 errmsg =
'L1Collections entry %s has no (possibly empty) MatchType list' % (
92 raise RuntimeError(errmsg)
101 l1Coll2MatcherKey = {
102 'LVL1JetRoIs':
'L1JetContainerName1',
103 'L1_jFexSRJetRoI':
'L1jFexSRJetRoIContainerName',
104 'L1_gFexSRJetRoI':
'L1gFexJetRoIContainerName',
105 'L1_gFexLRJetRoI':
'L1gFexJetRoIContainerName',
108 for case
in L1JetCollections.keys():
109 for k, d
in L1JetCollections[case].
items():
111 if k
not in l1Coll2MatcherKey:
112 errmsg =
'Match(es) to an L1 container requested entry '\
113 '%s but no C++ MatcherAlg attribute name provided' % (
str(k),)
114 raise RuntimeError(errmsg)
120 Chain2L1JetCollDict = dict()
122 Chain2L1JetCollDict[
'pp'] = {
123 'L1_J15': [
'LVL1JetRoIs'],
124 'L1_J20': [
'LVL1JetRoIs'],
125 'L1_J100': [
'LVL1JetRoIs'],
127 'L1_jJ40': [
'L1_jFexSRJetRoI'],
128 'L1_jJ50': [
'L1_jFexSRJetRoI'],
129 'L1_jJ160': [
'L1_jFexSRJetRoI'],
130 'L1_jJ85p0ETA21_3jJ40p0ETA25': [
'L1_jFexSRJetRoI'],
131 'L1_3jJ70p0ETA23': [
'L1_jFexSRJetRoI'],
132 'L1_4jJ40': [
'L1_jFexSRJetRoI'],
134 'L1_gJ20': [
'L1_gFexSRJetRoI'],
135 'L1_gJ50': [
'L1_gFexSRJetRoI'],
136 'L1_gJ100': [
'L1_gFexSRJetRoI'],
138 'L1_gJ160': [
'L1_gFexSRJetRoI'],
140 'L1_gLJ80': [
'L1_gFexLRJetRoI'],
141 'L1_gLJ120': [
'L1_gFexLRJetRoI'],
142 'L1_gLJ140': [
'L1_gFexLRJetRoI'],
144 'L1_SC111-CjJ40': [
'L1_jFexSRJetRoI'],
145 'L1_HT190-jJ40s5pETA21': [
'L1_jFexSRJetRoI'],
148 Chain2L1JetCollDict[
'HI'] = {
149 'L1_J15': [
'LVL1JetRoIs'],
150 'L1_J20': [
'LVL1JetRoIs'],
151 'L1_J100': [
'LVL1JetRoIs'],
153 'L1_jJ40': [
'L1_jFexSRJetRoI'],
154 'L1_jJ60': [
'L1_jFexSRJetRoI'],
155 'L1_jJ90': [
'L1_jFexSRJetRoI'],
157 'L1jJ40p30ETA49': [
'L1_jFexSRJetRoI'],
161 Legacy2PhaseIjJThresholdDict = {
179 Legacy2PhaseIgJThresholdDict = {
198 Legacy2PhaseIgLJThresholdDict = {
209 JetCollections = dict()
211 JetCollections[
'pp'] = {
212 'HLT_AntiKt4EMTopoJets_subjesIS' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
213 'HLT_AntiKt4EMTopoJets_subjesIS_fastftag' : {
'MatchTo' :
'NONE'},
214 'HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
215 'HLT_AntiKt4EMTopoJets_subjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
216 'HLT_AntiKt4EMPFlowJets_subjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
217 'HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf' : {
'MatchTo' :
'AntiKt4EMPFlowJets'},
218 'HLT_AntiKt4EMPFlowJets_nojcalib_ftf' : {
'MatchTo' :
'NONE'},
219 'HLT_AntiKt10EMTopoRCJets_subjesIS' : {
'MatchTo' :
'NONE'},
220 'HLT_AntiKt10LCTopoJets_subjes' : {
'MatchTo' :
'NONE'},
221 'HLT_AntiKt10LCTopoTrimmedPtFrac4SmallR20Jets_jes' : {
'MatchTo' :
'NONE'},
222 'HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_nojcalib_ftf' : {
'MatchTo' :
'NONE'},
223 'HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf' : {
'MatchTo' :
'NONE'},
226 JetCollections[
'HI'] = {
227 'HLT_AntiKt4HIJets' : {
'MatchTo':
'AntiKt4HIJets'},
228 'HLT_AntiKt4EMPFlowJets_jes_ftf' : {
'MatchTo':
'AntiKt4HIJets'}
234 Chains2Monitor = dict()
235 from TrigConfigSvc.TriggerConfigAccess
import getHLTMonitoringAccess
240 ListOfMonChains = monAccess.monitoredChains(signatures=
"jetMon", monLevels = [
"shifter",
"t0"])
242 default_dict = {
"HLTColl":
"NONE",
"RefChain":
"NONE" ,
"OfflineColl":
"NONE"}
243 Chains2Monitor[monMode] = dict((chain, default_dict.copy())
for chain
in ListOfMonChains)
246 for chainName
in Chains2Monitor[
'HI']:
247 if '_ion_' in chainName:
248 Chains2Monitor[
'HI'][chainName][
"HLTColl"] =
"HLT_AntiKt4HIJets"
249 Chains2Monitor[
'HI'][chainName][
"OfflineColl"] =
"AntiKt4HIJets"
251 Chains2Monitor[
'HI'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMPFlowJets_jes_ftf"
252 if not inputFlags.Common.doExpressProcessing:
253 Chains2Monitor[
'HI'][chainName][
"OfflineColl"] =
"AntiKt4EMPFlowJets"
255 Chains2Monitor[
'HI'][chainName][
"OfflineColl"] =
"AntiKt4HIJets"
258 if Chains2Monitor[
'HI'].
get(
'HLT_j60_ion_L1jJ40'): Chains2Monitor[
'HI'][
'HLT_j60_ion_L1jJ40'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
259 if Chains2Monitor[
'HI'].
get(
'HLT_j75_ion_L1jJ60'): Chains2Monitor[
'HI'][
'HLT_j75_ion_L1jJ60'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
260 if Chains2Monitor[
'HI'].
get(
'HLT_j85_ion_L1jJ60'): Chains2Monitor[
'HI'][
'HLT_j85_ion_L1jJ60'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
261 if Chains2Monitor[
'HI'].
get(
'HLT_j150_ion_L1jJ90'): Chains2Monitor[
'HI'][
'HLT_j150_ion_L1jJ90'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
262 if Chains2Monitor[
'HI'].
get(
'HLT_j200_ion_L1jJ90'): Chains2Monitor[
'HI'][
'HLT_j200_ion_L1jJ90'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
264 if Chains2Monitor[
'HI'].
get(
'HLT_j50f_ion_L1jJ40p30ETA49'): Chains2Monitor[
'HI'][
'HLT_j50f_ion_L1jJ40p30ETA49'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
265 if Chains2Monitor[
'HI'].
get(
'HLT_j60f_ion_L1jJ40p30ETA49'): Chains2Monitor[
'HI'][
'HLT_j60f_ion_L1jJ40p30ETA49'].
update({
"RefChain":
"HLT_noalg_L1jTE50",
"OfflineColl":
"AntiKt4HIJets"})
267 elif monMode ==
"pp":
269 for chainName
in Chains2Monitor[
'pp']:
270 Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMTopoJets_subjesIS"
271 if '_pf_' in chainName
and 'a10' not in chainName:
272 Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf"
273 Chains2Monitor[
'pp'][chainName][
"OfflineColl"] =
"AntiKt4EMPFlowJets"
274 elif 'a10' in chainName:
275 if 'a10t' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10LCTopoTrimmedPtFrac4SmallR20Jets_jes"
276 elif 'sd_cssk_pf' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf"
277 elif 'a10r' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10EMTopoRCJets_subjesIS"
278 else: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10LCTopoJets_subjes"
279 elif '_noalg_' in chainName:
280 Chains2Monitor[
'pp'][chainName][
"RefChain"] =
"HLT_j45_pf_ftf_preselj20_L1jJ40"
281 Chains2Monitor[
'pp'][chainName][
"OfflineColl"] =
"AntiKt4EMPFlowJets"
282 if 'gLJ' in chainName: Chains2Monitor[
'pp'][chainName][
"HLTColl"] =
"HLT_AntiKt10EMPFlowCSSKSoftDropBeta100Zcut10Jets_jes_ftf"
287 if Chains2Monitor[
'pp'].
get(
'HLT_j420_L1J100'): Chains2Monitor[
'pp'][
'HLT_j420_L1J100'].
update({
"RefChain":
"HLT_j85_L1J20",
"OfflineColl":
"AntiKt4EMPFlowJets"})
288 if Chains2Monitor[
'pp'].
get(
'HLT_3j200_L1J100'): Chains2Monitor[
'pp'][
'HLT_3j200_L1J100'].
update({
"RefChain":
"HLT_j85_L1J20",
"OfflineColl":
"AntiKt4EMPFlowJets"})
289 if Chains2Monitor[
'pp'].
get(
'HLT_4j120_L13J50'): Chains2Monitor[
'pp'][
'HLT_4j120_L13J50'].
update({
"RefChain":
"HLT_j85_L1J20",
"OfflineColl":
"AntiKt4EMPFlowJets"})
290 if Chains2Monitor[
'pp'].
get(
'HLT_5j80_pf_ftf_presel5j50_L14J15'): Chains2Monitor[
'pp'][
'HLT_5j80_pf_ftf_presel5j50_L14J15'].
update({
"RefChain":
"HLT_j45_pf_ftf_preselj20_L1J15",
"OfflineColl":
"AntiKt4EMPFlowJets"})
291 if Chains2Monitor[
'pp'].
get(
'HLT_j400_pf_ftf_L1J100'): Chains2Monitor[
'pp'][
'HLT_j400_pf_ftf_L1J100'].
update({
"RefChain":
"HLT_j85_pf_ftf_preselj50_L1J20",
"OfflineColl":
"AntiKt4EMPFlowJets"})
292 if Chains2Monitor[
'pp'].
get(
'HLT_j400_pf_ftf_preselj225_L1J100'): Chains2Monitor[
'pp'][
'HLT_j400_pf_ftf_preselj225_L1J100'].
update({
"RefChain":
"HLT_j85_pf_ftf_preselj50_L1J20",
"OfflineColl":
"AntiKt4EMPFlowJets"})
294 if Chains2Monitor[
'pp'].
get(
'HLT_j420_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_j420_L1jJ160'].
update({
"RefChain":
"HLT_j85_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
295 if Chains2Monitor[
'pp'].
get(
'HLT_3j200_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_3j200_L1jJ160'].
update({
"RefChain":
"HLT_j85_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
296 if Chains2Monitor[
'pp'].
get(
'HLT_4j120_L13jJ90'): Chains2Monitor[
'pp'][
'HLT_4j120_L13jJ90'].
update({
"RefChain":
"HLT_j85_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
297 if Chains2Monitor[
'pp'].
get(
'HLT_5j80_pf_ftf_presel5j50_L14jJ40'): Chains2Monitor[
'pp'][
'HLT_5j80_pf_ftf_presel5j50_L14jJ40'].
update({
"RefChain":
"HLT_j45_pf_ftf_preselj20_L1jJ40",
"OfflineColl":
"AntiKt4EMPFlowJets"})
298 if Chains2Monitor[
'pp'].
get(
'HLT_j400_pf_ftf_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_j400_pf_ftf_L1jJ160'].
update({
"RefChain":
"HLT_j85_pf_ftf_preselj50_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
299 if Chains2Monitor[
'pp'].
get(
'HLT_j400_pf_ftf_preselj225_L1jJ160'): Chains2Monitor[
'pp'][
'HLT_j400_pf_ftf_preselj225_L1jJ160'].
update({
"RefChain":
"HLT_j85_pf_ftf_preselj50_L1jJ50",
"OfflineColl":
"AntiKt4EMPFlowJets"})
302 errmsg =
'Returned empty Chains2Monitor due to invalid monMode'
303 raise RuntimeError(errmsg)
304 return Chains2Monitor
311 etaMin,etaMax = 0,2.5
313 if 'eta490_j' in chain:
314 etaMin,etaMax = 0,4.9
316 etaParts = chain.split(
'eta')
317 etaMinTemp = etaParts[0].
split(
'_')
318 etaMin = etaMinTemp[len(etaMinTemp)-1]
319 etaMin =
int(etaMin)/10
320 etaMax = etaParts[1].
split(
'_')[0]
321 etaMax =
int(etaMax)/10
324 etaMin,etaMax = 3.2,4.9
330 xbins, xmin, xmax = 160,0.,800000.
332 if varname ==
"pt" or varname ==
"et":
334 if 'jJ500' in chain
or 'J400' in chain:
return 160,xmin,800000
335 else:
return 100,xmin,500000
338 threshold =
int(re.search(
r'\d+',chain.split(
"_")[1].
split(
'j')[1]).
group())
340 return 40, 0., 100000.
342 return 36, 20000., 200000.
345 xmin = 50000.+100000.*(
int(threshold/100)-1)
346 if threshold % 100 == 0:
347 xmin = 1000.*(threshold - 100.)
348 xmax = xmin + 200000.
358 xbins, xmin, xmax = 35, 30000., 100000.
359 return xbins, xmin, xmax
362 parts = chain.split(
'HT')
363 threshold = parts[1].
split(
'_')[0]
364 if 'XX' in threshold:
365 threshold = threshold.split(
'XX')[0]
366 xmin =
int(0.9 *
int(threshold))
368 xbins =
int((xmax-xmin)/binwidth)-1
369 return xbins, xmin, xmax
377 xvar = f
"{network_prefix}_p{f}"
378 varname = f
"ftag_p{f}"
379 fillerTools += [HistoSpec(varname, xvar=xvar, bins=(70, -0.2, 1.2), title=f
"{varname};{varname};;Entries")]
380 fastDipsSelectSpec = SelectSpec(f
"{network_prefix}_{cutname}",
'20<pt:GeV&|eta|<3.2', path=
'NoTriggerSelection/'+cutname, FillerTools=fillerTools)
381 conf.appendHistos(fastDipsSelectSpec)
386 from JetMonitoring.JetMonitoringConfig
import JetMonAlgSpec, HistoSpec, EventHistoSpec, SelectSpec, ToolSpec
387 from AthenaConfiguration.ComponentFactory
import CompFactory
390 ExtraOfflineHists = [
397 "TrackWidthPt1000[0]",
402 ExtraSmallROnlineHists = [
403 HistoSpec(
'et:GeV;eta', (100,0,750, 50,-5,5) , title=
'#eta vs E_{T};E_{T} [GeV];#eta;Entries'),
414 ExtraLargeROnlineHists = [
417 ExtraOnlineNJetHists = [
430 OfflineScaleMomenta = [
"ConstitScale",
"EMScale",
"PileupScale",
"EtaJESScale"]
431 OnlineScaleMomenta = [
"ConstitScale" ]
432 for var
in [
"pt",
"eta",
"m" ]:
433 for offlinescale
in OfflineScaleMomenta:
434 ExtraOfflineHists.append(
"Jet"+offlinescale+
"Momentum_"+var)
435 for onlinescale
in OnlineScaleMomenta:
436 ExtraSmallROnlineHists.append(
"Jet"+onlinescale+
"Momentum_"+var)
438 OnlineScaleMomenta.append(
"")
439 OfflineScaleMomenta.append(
"")
444 Schedules JetCopier tool to make a shallow copy of
445 the original offline/HLT jet container, for the JetMatcherAlg to decorate.
446 This prevents our jet monitoring from decorating
447 the original jet containers, which may end up being
448 persistified in AOD/ESD (ATLASRECTS-7168,ATR-27980,ATR-26076)
450 jcopy = CompFactory.JetCopier(
457 jprovider = CompFactory.JetRecAlg(
458 "jetalg_copy_"+outjets,
461 OutputContainer = outjets,
468 Schedules L1JetCopyAlgorithm to make a shallow copy of
469 the original L1 jet container, for the JetMatcherAlg to decorate.
470 This prevents our jet monitoring from decorating
471 the original jet containers, which may end up being
472 persistified in AOD/ESD (ATLASRECTS-7168,ATR-27980,ATR-26076).
473 The L1JetCopyAlgorithm is a templated class (e.g. L1JetCopyAlgorithm<JTM_JetRoIContainer>).
474 The python class name is what is generated by Athena during build time.
475 The template types are defined in JTMContainers.h.
478 jcopy_alg_name =
"l1jetcopy_alg_"+injets
479 if injets ==
"LVL1JetRoIs":
480 jcopy_alg = CompFactory.L1JetCopyAlgorithm_JTM_JetRoIContainer_(jcopy_alg_name)
481 elif injets ==
"L1_jFexSRJetRoI":
482 jcopy_alg = CompFactory.L1JetCopyAlgorithm_JTM_jFexSRJetRoIContainer_(jcopy_alg_name)
483 elif injets
in [
"L1_gFexSRJetRoI",
"L1_gFexLRJetRoI"]:
484 jcopy_alg = CompFactory.L1JetCopyAlgorithm_JTM_gFexJetRoIContainer_(jcopy_alg_name)
486 raise ValueError(f
"L1 jet container {injets} not recognised")
487 jcopy_alg.JetInContainerName = injets
488 jcopy_alg.JetOutContainerName = outjets
494 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
498 if inputFlags.Reco.EnableHI: monMode =
'HI'
506 for chain,chaindict
in Chains2Monitor[monMode].
items():
507 if chaindict[
'HLTColl']
not in JetCollections[case]:
508 JetCollections[case][chaindict[
'HLTColl']] = {
'MatchTo':
'NONE'}
511 CopiedJetCollections = copy.deepcopy(JetCollections)
512 for hltColl,collDict
in JetCollections[monMode].
items():
513 if collDict[
'MatchTo'] !=
'NONE':
514 copiedhltColl = f
'{hltColl}_{copySuffix}'
515 CopiedJetCollections[monMode][copiedhltColl] = CopiedJetCollections[monMode].pop(hltColl)
517 jetcopyalg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
519 cfg.addEventAlgo(jetcopyalg)
520 for jetcalibscale
in OnlineScaleMomenta:
521 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
522 name =
'Matching_{}{}_{}'.
format(hltColl,scalestring,collDict[
'MatchTo'])
523 alg = CompFactory.JetMatcherAlg(name,
524 JetContainerName1=copiedhltColl,
525 JetContainerName2=collDict[
'MatchTo'],
526 JetCalibScale=jetcalibscale)
528 alg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
530 cfg.addEventAlgo(alg)
533 CopiedOfflineJetCollections = copy.deepcopy(OfflineJetCollections)
534 for offjetColl,collDict
in OfflineJetCollections[monMode].
items():
535 if collDict[
'MatchTo'] !=
'NONE':
536 copiedjetcoll = f
'{offjetColl}_{copySuffix}'
537 CopiedOfflineJetCollections[monMode][copiedjetcoll] = CopiedOfflineJetCollections[monMode].pop(offjetColl)
539 cfg.addEventAlgo(jetcopyalg)
540 for jetcalibscale
in OfflineScaleMomenta:
541 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
542 name =
'Matching_{}{}_{}'.
format(offjetColl,scalestring,collDict[
'MatchTo'])
543 alg = CompFactory.JetMatcherAlg(name,
544 JetContainerName1=copiedjetcoll,
545 JetContainerName2=collDict[
'MatchTo'],
546 JetCalibScale=jetcalibscale)
548 alg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
550 cfg.addEventAlgo(alg)
554 CopiedL1JetCollections = copy.deepcopy(L1JetCollections)
555 for l1jetColl,collDict
in L1JetCollections[monMode].
items():
556 copiedl1jetColl = f
'{l1jetColl}_{copySuffix}'
557 CopiedL1JetCollections[monMode][copiedl1jetColl] = CopiedL1JetCollections[monMode].pop(l1jetColl)
559 l1jetcopyalg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
561 cfg.addEventAlgo(l1jetcopyalg)
562 for matchjetcoll
in collDict[
'MatchTo']:
564 kwds = {
'name':
'Matching_{}_{}'.
format(l1jetColl,matchjetcoll),
565 l1Coll2MatcherKey[l1jetColl]: copiedl1jetColl,
566 'JetContainerName2': matchjetcoll,
570 alg = CompFactory.JetMatcherAlg(**kwds)
571 alg.ExtraInputs.add((
'xAOD::TrigCompositeContainer',
573 cfg.addEventAlgo(alg)
577 from AthenaMonitoring
import AthMonitorCfgHelper
578 helper = AthMonitorCfgHelper(inputFlags,
'TrigJetMonitorAlgorithm')
580 from AthenaMonitoring.EventFlagFilterToolConfig
import EventFlagFilterToolCfg
581 from AthenaMonitoring.BadLBFilterToolConfig
import LArBadLBFilterToolCfg
583 for jetcoll
in CopiedL1JetCollections[monMode]:
585 alg=l1jetconf.toAlg(helper)
589 for chain,jetcolls
in Chain2L1JetCollDict[monMode].
items():
590 for jetcoll
in jetcolls:
592 alg=l1chainconf.toAlg(helper)
596 for jetcoll
in CopiedOfflineJetCollections[monMode]:
597 offlineMonitorConf =
jetMonitoringConfig(inputFlags,jetcoll,CopiedOfflineJetCollections,monMode)
598 alg=offlineMonitorConf.toAlg(helper)
602 for jetcoll
in CopiedJetCollections[monMode]:
606 monitorConf.toAlg(helper)
609 for chain,chainDict
in Chains2Monitor[monMode].
items():
610 jetcoll = chainDict[
'HLTColl']
614 alg=chainMonitorConfT.toAlg(helper)
618 alg=chainMonitorConfF.toAlg(helper)
621 if chainDict[
'RefChain'] !=
'NONE' and chainDict[
'OfflineColl'] !=
'NONE':
623 effMonitorConf.toAlg(helper)
625 cfg.merge(helper.result())
632 path =
'NoTriggerSelection' if isOnline
else 'standardHistos/'
633 minNjetBin = 1
if isOnline
else 0
635 TopLevelDir =
'HLT/JetMon/'
636 TopLevelDir +=
'Online/' if isOnline
else 'Offline/'
638 jetcollFolder = jetcoll
639 jetcollFolder=jetcoll.replace(f
"_{copySuffix}",
"")
640 Conf = JetMonAlgSpec(jetcoll+
"Mon",JetContainerName = jetcoll, defaultPath = path, topLevelDir=TopLevelDir, bottomLevelDir=jetcollFolder, failureOnMissingContainer=
False)
643 knownHistos[
'phi_tight'] = HistoSpec(
'phi_tight',
644 (50,-math.pi,math.pi),
645 title=
'#phi;#phi;Entries',
710 SelectSpec(
'central',
'|eta|<3.2', path, FillerTools = [
"pt",
"et",
"m"] ),
711 SelectSpec(
'forward',
'3.2<|eta|', path, FillerTools = [
"pt",
"et",
"m"] ),
712 SelectSpec(
'lowmu',
'avgMu<30', path, isEventVariable=
True, FillerTools = [
"pt",
"et",
"m",
"phi",
"eta"]),
713 SelectSpec(
'highmu',
'30<avgMu', path, isEventVariable=
True, FillerTools = [
"pt",
"et",
"m",
"phi",
"eta"]),
715 EventHistoSpec(
'njets', (25,minNjetBin,25), title=
'NJets;NJets;Entries' ),
716 EventHistoSpec(
'njetsPt20', (25,minNjetBin,25), title=
'NJetsPt20;NJetsPt20;Entries' ),
717 EventHistoSpec(
'njetsPt50', (25,minNjetBin,25), title=
'NJetsPt50;NJetsPt50;Entries' ),
726 path =
'NoTriggerSelection' if isOnline
else 'standardHistos/'
728 TopLevelDir =
'HLT/JetMon/'
729 TopLevelDir +=
'Online/' if isOnline
else 'Offline/'
731 jetcollFolder = jetcoll
732 jetcollFolder=jetcoll.replace(f
"_{copySuffix}",
"")
733 Conf = JetMonAlgSpec(jetcoll+
"Mon",JetContainerName = jetcoll, defaultPath = path, topLevelDir=TopLevelDir, bottomLevelDir=jetcollFolder, failureOnMissingContainer=
False)
736 knownHistos[
'phi_tight'] = HistoSpec(
'phi_tight',
737 (50,-math.pi,math.pi),
738 title=
'#phi;#phi;Entries',
795 HistoSpec(
'pt:GeV;m:GeV', (100,0,400, 100,0,400) , title=
'p_{T} vs mass;p_{T} [GeV];m [GeV];Entries'),
796 HistoSpec(
'eta;et:GeV', (100,-5,5, 100,0,400) , title=
'#eta vs e_{T};#eta;E_{T} [GeV];Entries'),
797 HistoSpec(
'phi;et:GeV', (60,-math.pi,math.pi, 100,0,400) , title=
'#phi vs E_{T};#phi;E_{T} [GeV];Entries'),
800 SelectSpec(
'central',
'|eta|<3.2', path, FillerTools = [
"pt",
"et",
"m"] ),
801 SelectSpec(
'forward',
'3.2<|eta|', path, FillerTools = [
"pt",
"et",
"m"] ),
802 SelectSpec(
'pt60',
'60<pt:GeV', path, FillerTools = [
"m",
"phi",
"eta",
"eta;phi"]),
809 '''Function to configures some algorithms in the monitoring system.'''
811 isOnline =
True if 'HLT' in jetcoll
else False
818 jetCollMonDetails = jetCollDict[monMode][jetcoll]
822 if 'AntiKt4' in jetcoll
or 'a4tcem' in jetcoll:
824 for hist
in ExtraSmallROnlineHists: conf.appendHistos(hist)
826 conf.appendHistos(
"Jvt")
827 conf.appendHistos(
"JVFCorr")
828 conf.appendHistos(
"JvtRpt")
829 conf.appendHistos(
"SumPtTrkPt500[0]")
830 conf.appendHistos(
"NumTrkPt1000[0]")
831 conf.appendHistos(
"TrackWidthPt1000[0]")
833 conf.appendHistos(
"SumPtChargedPFOPt500[0]")
834 conf.appendHistos(
"fCharged")
835 if "subresjesgscIS" in jetcoll:
839 if 'fastftag' in jetcoll:
844 if 'EMTopo' in jetcoll:
845 conf.appendHistos(
"Timing")
847 for hist
in ExtraLargeROnlineHists: conf.appendHistos(hist)
849 if jetCollMonDetails[
'MatchTo'] !=
'NONE':
850 def defineHistoForHLTJetMatch(conf, parentAlg, monhelper , path):
852 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+
'/'+conf.bottomLevelDir+
'/NoTriggerSelection/')
854 for histname
in [
'ptdiff',
'energydiff',
'massdiff' ]:
855 group.defineHistogram(histname,title=histname, type=
"TH1F",
856 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
857 xbins=100 , xmin=-100000., xmax=100000. ,)
859 for histname
in [
'ptresp',
'energyresp',
'massresp' ]:
860 group.defineHistogram(histname,title=histname, type=
"TH1F",
861 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
862 xbins=100 , xmin=-2., xmax=2. ,)
864 group.defineHistogram(
'ptresp,ptref;ptresp_vs_ptRef',title=
'ptresponse vs ptRef', type=
"TH2F",
865 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
866 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=0., ymax=500000.,)
868 group.defineHistogram(
'ptresp,etaref;ptresp_vs_etaRef',title=
'ptresponse vs etaRef', type=
"TH2F",
869 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
870 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=-5., ymax=5.,)
872 group.defineHistogram(
'ptref,ptresp;ptRef_vs_ptresp',title=
'ptRef vs ptresponse', type=
"TH2F",
873 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
874 xbins=100 , xmin=0., xmax=400000., ybins=80, ymin=-2., ymax=2.,)
876 group.defineHistogram(
'etaref,ptresp;etaRef_vs_ptresp',title=
'etaRef vs ptresponse', type=
"TH2F",
877 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
878 xbins=100 , xmin=-5., xmax=5., ybins=80, ymin=-2., ymax=2.,)
880 matchedJetColl = jetCollMonDetails[
'MatchTo']
883 jetmatchKey =
'{}.matched_{}'.
format(jetcoll,matchedJetColl)
884 jetptdiffKey =
'{}.ptdiff_{}'.
format(jetcoll,matchedJetColl)
885 jetenergydiffKey =
'{}.energydiff_{}'.
format(jetcoll,matchedJetColl)
886 jetmassdiffKey =
'{}.massdiff_{}'.
format(jetcoll,matchedJetColl)
887 jetptrespKey =
'{}.ptresp_{}'.
format(jetcoll,matchedJetColl)
888 jetenergyrespKey =
'{}.energyresp_{}'.
format(jetcoll,matchedJetColl)
889 jetmassrespKey =
'{}.massresp_{}'.
format(jetcoll,matchedJetColl)
890 jetptrefKey =
'{}.ptRef_{}'.
format(jetcoll,matchedJetColl)
891 jetetarefKey =
'{}.etaRef_{}'.
format(jetcoll,matchedJetColl)
892 name =
'jetMatched_{}_{}'.
format(jetcoll,matchedJetColl)
893 conf.appendHistos(ToolSpec(
'JetHistoMatchedFiller', name,
894 JetMatchedKey=jetmatchKey, JetPtDiffKey=jetptdiffKey,
895 JetEnergyDiffKey=jetenergydiffKey,
896 JetMassDiffKey=jetmassdiffKey, JetPtRespKey=jetptrespKey,
897 JetEnergyRespKey=jetenergyrespKey, JetMassRespKey=jetmassrespKey,
898 JetPtRefKey=jetptrefKey,JetEtaRefKey=jetetarefKey,
899 defineHistoFunc=defineHistoForHLTJetMatch,Group=
'matchedJets_'+jetcoll)
902 for hist
in ExtraOfflineHists: conf.appendHistos(hist)
903 if 'AntiKt4' in jetcoll
and monMode==
"pp":
904 conf.appendHistos(SelectSpec(
'LooseBadFailedJets',
'LooseBad',
912 conf.appendHistos(
"SumPtChargedPFOPt500[0]")
913 conf.appendHistos(
"fCharged")
914 elif 'EMTopo' in jetcoll:
915 conf.appendHistos(
"Timing")
916 if jetCollMonDetails[
'MatchTo'] !=
'NONE':
917 def defineHistoForOfflineJetMatch(conf, parentAlg, monhelper , path):
919 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+
'/'+conf.bottomLevelDir+
'/standardHistos/')
921 for histname
in [
'ptdiff',
'energydiff',
'massdiff' ]:
922 group.defineHistogram(histname,title=histname, type=
"TH1F",
923 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
924 xbins=100 , xmin=-100000., xmax=100000. ,)
926 for histname
in [
'ptresp',
'energyresp',
'massresp' ]:
927 group.defineHistogram(histname,title=histname, type=
"TH1F",
928 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
929 xbins=100 , xmin=-2., xmax=2. ,)
931 group.defineHistogram(
'ptresp,ptref;ptresp_vs_ptRef',title=
'ptresp vs ptRef', type=
"TH2F",
932 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
933 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=0., ymax=500000.,)
935 group.defineHistogram(
'ptresp,etaref;ptresp_vs_etaRef',title=
'ptresp vs etaRef', type=
"TH2F",
936 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
937 xbins=10 , xmin=-2., xmax=2., ybins=10, ymin=-5., ymax=5.,)
939 group.defineHistogram(
'ptref,ptresp;ptRef_vs_ptresp',title=
'ptRef vs ptresponse', type=
"TH2F",
940 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
941 xbins=100 , xmin=0., xmax=400000., ybins=80, ymin=-2., ymax=2.,)
943 group.defineHistogram(
'etaref,ptresp;etaRef_vs_ptresp',title=
'etaRef vs ptresponse', type=
"TH2F",
944 path=
'MatchedJets_{}'.
format(jetCollMonDetails[
'MatchTo']),
945 xbins=100 , xmin=-5., xmax=5., ybins=80, ymin=-2., ymax=2.,)
947 matchedJetColl = jetCollMonDetails[
'MatchTo']
948 jetmatchKey =
'{}.matched_{}'.
format(jetcoll,matchedJetColl)
949 jetptdiffKey =
'{}.ptdiff_{}'.
format(jetcoll,matchedJetColl)
950 jetenergydiffKey =
'{}.energydiff_{}'.
format(jetcoll,matchedJetColl)
951 jetmassdiffKey =
'{}.massdiff_{}'.
format(jetcoll,matchedJetColl)
952 jetptrespKey =
'{}.ptresp_{}'.
format(jetcoll,matchedJetColl)
953 jetenergyrespKey =
'{}.energyresp_{}'.
format(jetcoll,matchedJetColl)
954 jetmassrespKey =
'{}.massresp_{}'.
format(jetcoll,matchedJetColl)
955 jetptrefKey =
'{}.ptRef_{}'.
format(jetcoll,matchedJetColl)
956 jetetarefKey =
'{}.etaRef_{}'.
format(jetcoll,matchedJetColl)
957 name =
'jetMatched_{}_{}'.
format(jetcoll,matchedJetColl)
958 conf.appendHistos(ToolSpec(
'JetHistoMatchedFiller',name,
959 JetMatchedKey=jetmatchKey, JetPtDiffKey=jetptdiffKey,
960 JetEnergyDiffKey=jetenergydiffKey,
961 JetMassDiffKey=jetmassdiffKey, JetPtRespKey=jetptrespKey,
962 JetEnergyRespKey=jetenergyrespKey,
963 JetMassRespKey=jetmassrespKey,
964 JetPtRefKey=jetptrefKey, JetEtaRefKey=jetetarefKey,
965 defineHistoFunc=defineHistoForOfflineJetMatch,Group=
'matchedJets_'+jetcoll)
972 from TrigJetMonitoring.L1JetMonitoringConfig
import L1JetMonAlg
973 name = jetColl
if chain==
'' else jetColl+
'_'+chain
976 jetColl = jetColl.replace(f
"_{copySuffix}",
"")
978 if not jetDict[monMode][jetCollKey][
'MatchTo']:
979 conf = L1JetMonAlg(name,jetColl,jetCollKey,chain)
981 assert len(jetDict[monMode][jetCollKey][
'MatchTo']) == 2
983 conf = L1JetMonAlg(name,jetColl,jetCollKey,chain,
984 matched,jetDict[monMode][jetCollKey][
'MatchTo'][0],
985 jetDict[monMode][jetCollKey][
'MatchTo'][1])
990 '''Function to configures some algorithms in the monitoring system.'''
992 jetcollFolder = jetcoll
997 jetMonAlgSpecName = chain+
"TrigMon"
998 if not onlyUsePassingJets:
999 chainFolder = chainFolder +
"/ExpertHistos"
1000 jetMonAlgSpecName = jetMonAlgSpecName +
"_ExpertHistos"
1004 return parts[1].
split(
'_')[0]
1006 def getEtaRangeString(chain):
1007 etaMin, etaMax = 0, 32
1008 if 'eta490_j' in chain:
1009 etaMin, etaMax = 0, 49
1010 elif 'eta' in chain:
1011 etaParts = chain.split(
'eta')
1012 etaMinTemp = etaParts[0].
split(
'_')
1013 etaMin = etaMinTemp[len(etaMinTemp)-1]
1014 etaMax = etaParts[1].
split(
'_')[0]
1017 if 'f_ion' in chain:
1018 etaMin, etaMax = 32, 49
1019 return 'Eta{}_{}'.
format(etaMin,etaMax)
1021 def getNjetHistName(chain):
1022 NjetHistName =
'NONE'
1023 parts = chain.split(
'j')
1025 multiplicity = parts[0].
split(
'_')[1]
1026 if (chain.count(
'_j')-chain.count(
'_jes')) > 1
or multiplicity !=
'':
1031 trigConf = JetMonAlgSpec(
1033 JetContainerName = jetcoll,
1034 TriggerChain = chain,
1035 defaultPath = chainFolder,
1036 topLevelDir=
"HLT/JetMon/Online/",
1037 bottomLevelDir=jetcollFolder,
1038 failureOnMissingContainer=
True,
1039 onlyPassingJets=onlyUsePassingJets,
1040 isExpressStreamJob=inputFlags.Common.doExpressProcessing,
1043 trigConf.appendHistos(
1052 for hist
in ExtraOnlineNJetHists: trigConf.appendHistos(EventHistoSpec(hist, (20,0,25), title=hist+
';'+hist+
';Entries'))
1054 if 'ht' not in chain
and 'HT' not in chain
and 'dijet' not in chain
and 'DIJET' not in chain
and 'fbdj' not in chain
and 'noalg' not in chain:
1055 NjetHistName = getNjetHistName(chain)
1056 from JetMonitoring.JetStandardHistoSpecs
import knownEventVar
1057 if knownEventVar.get(NjetHistName,
None)
is not None and NjetHistName
not in ExtraOnlineNJetHists:
1058 trigConf.appendHistos(
1059 EventHistoSpec(NjetHistName, (25,0,25), title=NjetHistName+
';'+NjetHistName+
';Entries' ),
1061 NjetHistName = NjetHistName.replace(
'Et',
'Pt')
1062 if knownEventVar.get(NjetHistName,
None)
is not None and NjetHistName
not in ExtraOnlineNJetHists:
1063 trigConf.appendHistos(
1064 EventHistoSpec(NjetHistName, (25,0,25), title=NjetHistName+
';'+NjetHistName+
';Entries' ),
1066 if 'ftf' in chain
and 'a10' not in chain:
1067 trigConf.appendHistos(
"Jvt")
1068 trigConf.appendHistos(
"JVFCorr")
1069 trigConf.appendHistos(
"JvtRpt")
1071 if 'ht' in chain
or 'HT' in chain:
1072 def defineHistoForHTChain(conf, parentAlg, monhelper , path):
1074 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+jetcollFolder+
'/')
1077 group.defineHistogram(
"jetHT;HT",title=
"Jet HT;H_{T} [GeV];Entries", type=
"TH1F", path=chainFolder, xbins=xbins , xmin=xmin, xmax=xmax ,)
1078 trigConf.appendHistos(ToolSpec(
'JetHistoHTFiller',
'JetHistoHTFiller_'+chain,MinPt=30.,MaxEta=3.2,FailureOnMissingContainer=
False,
1079 defineHistoFunc=defineHistoForHTChain,Group=
'jetHT_'+jetcoll))
1084 '''Function to configures some algorithms in the monitoring system.'''
1086 jetcollFolder = onlinejetcoll
1094 def defineHistoForJetTrigg(conf, parentAlg, monhelper , path):
1096 group = monhelper.addGroup(parentAlg, conf.Group, conf.topLevelDir+jetcollFolder+
'/')
1098 append =
"offlineCut_"+conf.name.split(
"_")[-1]
if "offlineCut" in conf.name
else "noOfflineCut"
1099 histname =
"trigEff_vs_"+conf.Var.Name+
"_"+append
1101 group.defineHistogram(
'trigPassed,jetVar;'+histname, title=histname, type=
"TEfficiency",
1103 xbins=xbins , xmin=xmin, xmax=xmax,)
1106 validchain = chain.replace(
'noalg',
'j0')
1107 parts = validchain.split(
'j')
1108 multiplicity = parts[0].
split(
'_')[1]
1109 if multiplicity !=
'': index =
int(multiplicity) - 1
1113 from JetMonitoring.JetMonitoringConfig
import retrieveVarToolConf
1114 trigConf = JetMonAlgSpec(
1116 JetContainerName = offlinejetcoll,
1117 TriggerChain = refChain,
1118 defaultPath = chainFolder,
1119 topLevelDir =
"HLT/JetMon/Online/",
1120 bottomLevelDir = jetcollFolder,
1121 failureOnMissingContainer =
True,
1122 onlyPassingJets =
False,
1124 trigConf.appendHistos(
1125 SelectSpec(
'eff',
'{}<|eta|<{}'.
format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
1127 ToolSpec(
'JetHistoTriggEfficiency', chain,
1129 Group=
'jetTrigGroup_'+chain,
1132 ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg),
1137 trigConf.appendHistos(
1138 SelectSpec(
'm50',
'50<m:GeV&{}<|eta|<{}'.
format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
1139 ToolSpec(
'JetHistoTriggEfficiency', chain+
'_offlineCut_m50',
1140 Group=
'jetTrigGroup_'+chain+
'_m50',
1142 ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg
1145 SelectSpec(
'et500',
'500<et:GeV&{}<|eta|<{}'.
format(etaMin,etaMax), chainFolder, SelectedIndex=index, FillerTools = [
1146 ToolSpec(
'JetHistoTriggEfficiency', chain+
'_offlineCut_et500',
1147 Group=
'jetTrigGroup_'+chain+
'_et500',
1150 ProbeTrigChain=chain,defineHistoFunc=defineHistoForJetTrigg
1157 if __name__==
'__main__':
1162 parser = argparse.ArgumentParser()
1163 parser.add_argument(
'--runTruthReco', action=
'store_true', dest=
'runTruthReco', default=
False)
1164 parser.add_argument(
'--genOfflineR10PF', action=
'store_true', dest=
'genOfflineR10PF', default=
False)
1165 parser.add_argument(
'--printDetailedConfig', action=
'store_true', dest=
'printDetailedConfig', default=
False)
1166 parser.add_argument(
'--input', action=
'store', dest=
'inputFile')
1167 args = parser.parse_args()
1168 RunTruth = args.runTruthReco
1169 GenOfflineR10PF = args.genOfflineR10PF
1170 PrintDetailedConfig = args.printDetailedConfig
1173 if args.inputFile
is not None: inputFile = args.inputFile
1175 logger.error(
'ERROR: No input file provided, exiting')
1179 from AthenaCommon.Logging
import log
1184 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
1186 flags.Input.Files = [inputFile]
1187 flags.Input.isMC =
True
1188 flags.Output.HISTFileName =
'AthenaMTMonitorOutput.root'
1192 if flags.Reco.EnableHI: monMode =
'HI'
1200 for chain,chaindict
in Chains2Monitor[monMode].
items():
1201 if chaindict[
'HLTColl']
not in JetCollections[case]:
1202 JetCollections[case][chaindict[
'HLTColl']] = {
'MatchTo':
'NONE'}
1205 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
1206 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
1210 outputlist = [
"xAOD::EventInfo#*",
"xAOD::VertexContainer#*",
"xAOD::JetContainer#AntiKt4*Jets",
"xAOD::JetAuxContainer#AntiKt4*JetsAux.-PseudoJet",
"xAOD::JetContainer#HLT_*",
"xAOD::JetAuxContainer#HLT_*Aux.-PseudoJet",
"xAOD::ShallowAuxContainer#HLT_*Aux.-PseudoJet"]
1213 from JetRecConfig.StandardSmallRJets
import AntiKt4Truth
1215 from JetRecConfig.JetRecConfig
import JetRecCfg
1219 key =
"{0}Jets".
format(AntiKt4Truth.basename)
1220 outputlist += [
"xAOD::JetContainer#"+key,
"xAOD::JetAuxContainer#"+key+
"Aux.-PseudoJet"]
1224 from JetRecConfig.JetDefinition
import JetConstitSeq, JetDefinition, xAODType
1225 EMPFlowCSSK = JetConstitSeq(
"EMPFlowCSSK", xAODType.ParticleFlow, [
"CorrectPFO",
"CS",
"SK",
"CHS"],
"JetETMissParticleFlowObjects",
"CSSKParticleFlowObjects", label=
"EMPFlowCSSK")
1226 AntiKt10EMPFlowCSSK = JetDefinition(
"AntiKt",1.0,EMPFlowCSSK,ptmin=2e3,)
1227 AntiKt10EMPFlowCSSK.modifiers = [
"ConstitFourMom",
"Sort",
"Filter:2000"]
1228 from JetRecConfig.JetGrooming
import JetSoftDrop
1229 from JetRecConfig.StandardLargeRJets
import standardrecomods,substrmods
1230 AntiKt10EMPFlowCSSKSoftDrop = JetSoftDrop(AntiKt10EMPFlowCSSK,modifiers=standardrecomods+substrmods,ZCut=0.1,Beta=1.0)
1232 from JetRecConfig.JetRecConfig
import JetRecCfg
1233 comp =
JetRecCfg(AntiKt10EMPFlowCSSKSoftDrop,flags)
1236 key =
"{0}Jets".
format(AntiKt10EMPFlowCSSKSoftDrop.basename)
1237 outputlist += [
"xAOD::JetContainer#"+key,
"xAOD::JetAuxContainer#"+key+
"Aux.-PseudoJet"]
1240 if RunTruth
or GenOfflineR10PF:
1242 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
1249 from AthenaMonitoring
import AthMonitorCfgHelper
1250 helper = AthMonitorCfgHelper(flags,
'TrigJetMonitorAlgorithm')
1251 cfg.merge(helper.result())
1254 for hltColl,collDict
in JetCollections[monMode].
items():
1255 if collDict[
'MatchTo'] !=
'NONE':
1256 for jetcalibscale
in OnlineScaleMomenta:
1257 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
1258 name =
'Matching_{}{}_{}'.
format(hltColl,scalestring,collDict[
'MatchTo'])
1259 alg = CompFactory.JetMatcherAlg(name, JetContainerName1=hltColl,JetContainerName2=collDict[
'MatchTo'],JetCalibScale=jetcalibscale)
1261 cfg.addEventAlgo(alg,sequenceName=
'AthMonSeq_TrigJetMonitorAlgorithm')
1264 for offjetColl,collDict
in OfflineJetCollections[monMode].
items():
1265 if collDict[
'MatchTo'] !=
'NONE':
1266 for jetcalibscale
in OfflineScaleMomenta:
1267 scalestring =
"_"+jetcalibscale
if jetcalibscale !=
"" else ""
1268 name =
'Matching_{}{}_{}'.
format(offjetColl,scalestring,collDict[
'MatchTo'])
1269 alg = CompFactory.JetMatcherAlg(name, JetContainerName1=offjetColl,JetContainerName2=collDict[
'MatchTo'],JetCalibScale=jetcalibscale)
1271 cfg.addEventAlgo(alg,sequenceName=
'AthMonSeq_TrigJetMonitorAlgorithm')
1274 for l1jetColl,collDict
in L1JetCollections[monMode].
items():
1275 for matchjetcoll
in collDict[
'MatchTo']:
1276 if matchjetcoll !=
'NONE':
1277 name =
'Matching_{}_{}'.
format(l1jetColl,matchjetcoll)
1278 alg = CompFactory.JetMatcherAlg(name, L1JetContainerName1=l1jetColl,JetContainerName2=matchjetcoll,MatchL1=
True)
1280 cfg.addEventAlgo(alg,sequenceName=
'AthMonSeq_TrigJetMonitorAlgorithm')
1283 for jetcoll
in L1JetCollections[monMode]:
1285 l1jetconf.toAlg(helper)
1288 for chain,jetcoll
in Chain2L1JetCollDict[monMode].
items():
1290 l1chainconf.toAlg(helper)
1293 for jetcoll
in OfflineJetCollections[monMode]:
1295 offlineMonitorConf.toAlg(helper)
1298 for jetcoll
in JetCollections[monMode]:
1302 monitorConf.toAlg(helper)
1305 for chain,chainDict
in Chains2Monitor[monMode].
items():
1306 jetcoll = chainDict[
'HLTColl']
1310 chainMonitorConfT.toAlg(helper)
1313 chainMonitorConfF.toAlg(helper)
1315 if chainDict[
'RefChain'] !=
'NONE' and chainDict[
'OfflineColl'] !=
'NONE':
1317 chainDict[
'OfflineColl'], chain,
1318 chainDict[
'RefChain'])
1319 effMonitorConf.toAlg(helper)
1321 cfg.merge(helper.result())
1324 cfg.printConfig(withDetails=PrintDetailedConfig)