5 @brief Configuration for the heavy-ion part of MinBias monitoring
8 from .utils
import getMinBiasChains
9 from AthenaCommon.Logging
import logging
11 log = logging.getLogger(
'TrigHIMonitoringMT')
15 head = l1.rstrip(
'0123456789')
17 return head.replace(
'j',
''),
int(tail)
21 _, l1 = chain.split(
'L1')
24 l1_te_items = dict(map(split_num,
filter(
lambda x:
'TE' in x, l1.split(
'_'))))
26 xmax = l1_te_items.pop(
'VTE', 20e3
if 'hi_ucc' in chain
else 100) * 1.2
29 xbins = xmax
if 'hi_ucc' not in chain
else 240
33 ranges = {
'xbins':
int(xbins),
'xmin': 0.,
'xmax': xmax}
34 ranges_fwd = {
'xbins':
int(xbins),
'xmin': 0.,
'xmax': xmax / 3.}
36 return ranges, ranges_fwd
40 from AthenaMonitoring
import AthMonitorCfgHelper
41 monConfig = AthMonitorCfgHelper(flags,
'HLTHeavyIonMonitoring')
43 from AthenaConfiguration.ComponentFactory
import CompFactory
44 alg = monConfig.addAlgorithm(CompFactory.HLTHeavyIonMonAlg,
'HLTHeavyIonMonAlgo')
46 from TrigConfigSvc.TriggerConfigAccess
import getHLTMonitoringAccess
54 log.info(f
'Monitoring {len(hiChains)} MinBias heavy-ion chains')
55 log.debug([name
for name, _
in hiChains])
57 alg.triggerListMon = [name
for name, _
in hiChains]
59 for chain, group
in hiChains:
60 hiSumETGroup = monConfig.addGroup(alg, f
'{chain}_sumEt', topPath=f
'HLT/MinBiasMon/{group}/SumEt/{chain}/')
64 hiSumETGroup.defineHistogram(
'sum_L1TE', title=
'TE sum from legacy L1;L1 Legacy E_{T} [GeV];Events', **ranges)
65 hiSumETGroup.defineHistogram(
'sum_L1jTE', title=
'TE sum from jFex L1;L1 jFEX E_{T} [GeV];Events', **ranges)
66 hiSumETGroup.defineHistogram(
'sum_L1FWDAjTE', title=
'FwdTE sum from jFex L1 (side A);L1 jFEX FWD_{A} E_{T} [GeV];Events', **ranges_fwd)
67 hiSumETGroup.defineHistogram(
'sum_L1FWDCjTE', title=
'FwdTE sum from jFex L1 (side C);L1 jFEX FWD_{C} E_{T} [GeV];Events', **ranges_fwd)
68 hiSumETGroup.defineHistogram(
'sum_FCalAEt', title=
'FCal sum from HLT (side A);HLT FCal_{A} E_{T} [GeV];Events', **ranges_fwd)
69 hiSumETGroup.defineHistogram(
'sum_FCalCEt', title=
'FCal sum from HLT (side C);HLT FCal_{C} E_{T} [GeV];Events', **ranges_fwd)
72 ranges |= {
'ybins': ranges[
'xbins'],
'ymin': ranges[
'xmin'],
'ymax': ranges[
'xmax']}
73 ranges_fwd |= {
'ybins': ranges_fwd[
'xbins'],
'ymin': ranges_fwd[
'xmin'],
'ymax': ranges_fwd[
'xmax']}
74 hiSumETGroup.defineHistogram(
'sum_L1TE,sum_L1jTE', type=
'TH2F', title=
'Legacy vs Phase-I TE;L1 Legacy E_{T} [GeV];L1 jFEX E_{T} [GeV];Events', **ranges)
75 hiSumETGroup.defineHistogram(
'sum_L1FWDAjTE,sum_L1FWDCjTE', type=
'TH2F', title=
'FwdTE A-C side corr.;L1 jFEX FWD_{A} E_{T} [GeV];L1 jFEX FWD_{C} E_{T} [GeV];Events', **ranges_fwd)
76 hiSumETGroup.defineHistogram(
'sum_FCalAEt,sum_FCalCEt', type=
'TH2F', title=
'FCal sum A-C side corr.;HLT FCal_{A} E_{T} [GeV];HLT FCal_{C} E_{T} [GeV];Events', **ranges_fwd)
77 hiSumETGroup.defineHistogram(
'sum_L1FWDAjTE,sum_FCalAEt', type=
'TH2F', title=
'FwdTE vs FCal, A side;L1 jFEX FWD_{A} E_{T} [GeV];HLT FCal_{A} E_{T} [GeV];Events', **ranges_fwd)
78 hiSumETGroup.defineHistogram(
'sum_L1FWDCjTE,sum_FCalCEt', type=
'TH2F', title=
'FwdTE vs FCal, C side;L1 jFEX FWD_{C} E_{T} [GeV];HLT FCal_{C} E_{T} [GeV];Events', **ranges_fwd)
80 return monConfig.result()
83 if __name__ ==
"__main__":
85 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
87 flags.DQ.Environment =
"AOD"
88 flags.Concurrency.NumConcurrentEvents = 5
90 flags.Output.HISTFileName =
"TestHIMonitorOutput.root"
92 from AthenaCommon.Logging
import logging
93 log = logging.getLogger(__name__)
94 log.info(
"Input %s",
str(flags.Input.Files))
98 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
99 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
108 cfg.printConfig(withDetails=
True)
109 with open(
"cfg.pkl",
"wb")
as f: