ATLAS Offline Software
Loading...
Searching...
No Matches
TrigCostMonitorConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3#
4
5
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 # This option will go away once the TrigConfigSvc is fully up & running
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
38def TrigCostMonitorFinalizeCfg(flags, seqName=""):
39 """
40 Component Accumulator based configuration of Trigger Cost Finalize Alg
41 """
42 from TrigEDMConfig.TriggerEDM import recordable
43 from AthenaConfiguration.ComponentFactory import CompFactory
44 from AthenaCommon.Logging import logging
45 log = logging.getLogger('TrigCostMonitorSetup')
46
47 if flags.Trigger.CostMonitoring.doCostMonitoring:
48 costFinalizeAlg = CompFactory.TrigCostFinalizeAlg()
49 costFinalizeAlg.CostWriteHandleKey = recordable(flags.Trigger.CostMonitoring.outputCollection)
50
51 log.debug('Enabling finalize of online trigger cost monitoring')
52 return costFinalizeAlg
53 else:
54 log.debug('Cost monitoring is not enabled - TrigCostFinalizeAlg will not be included')
55
56 return None
TrigCostMonitorCfg(flags, seqName="")
TrigCostMonitorFinalizeCfg(flags, seqName="")