6def TrigCostMonitorCfg(flags, seqName=""):
7 """
8 Component Accumulator based configuration of Trigger Cost Service and associated Auditor
9 """
10 from AthenaConfiguration.ComponentFactory import CompFactory
11 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
12 from AthenaCommon.Logging import logging
13 log = logging.getLogger('TrigCostMonitorSetup')
14
15 acc = ComponentAccumulator(seqName) if seqName else ComponentAccumulator()
16
17 if flags.Trigger.CostMonitoring.doCostMonitoring:
18 costSvc = CompFactory.TrigCostSvc(
19 MonitorAllEvents = flags.Trigger.CostMonitoring.monitorAllEvents,
20 SaveHashes = True
21 )
22 acc.addService(costSvc)
23 acc.addAuditor(CompFactory.TrigCostAuditor())
24 acc.setAppProperty("AuditAlgorithms", True)
25
26 costSupervisorAlg = CompFactory.TrigCostSupervisorAlg()
27 costSupervisorAlg.TrigCostSvc = costSvc
28 acc.addEventAlgo(costSupervisorAlg)
29
30 log.info('Enabling online trigger cost monitoring')
31 else:
32 log.info('Will NOT schedule online trigger cost monitoring')
33 return ComponentAccumulator()
34
35 return acc
36
37