ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerHistSvcConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3#
4
5from AthenaCommon.Logging import logging
6log = logging.getLogger('TriggerHistSvcConfig')
7
8def setTHistSvcOutput(outputList):
9 """Build the Output list of the THistSvc ensuring minimum set of output files"""
10
11 if not any('EXPERT' in o for o in outputList):
12 outputList += ["EXPERT DATAFILE='expert-monitoring.root' OPT='RECREATE'"]
13
14 return
15
16
17def TriggerHistSvcConfig(flags):
18 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
19 from AthenaConfiguration.ComponentFactory import CompFactory
20
21 acc = ComponentAccumulator()
22
23 if flags.Trigger.Online.useOnlineTHistSvc:
24 log.info("Configuring online TrigMonTHistSvc")
25 histSvc = CompFactory.TrigMonTHistSvc("THistSvc") # no outputs in online
26 elif flags.Trigger.Online.useOnlineWebdaqHistSvc:
27 log.info("Configuring online Webdaq HistSvc")
28 histSvc = CompFactory.WebdaqHistSvc("THistSvc")
29 log.info("Configuring WebdaqInfoSvc for IS publication")
30 acc.addService( CompFactory.WebdaqInfoSvc("WebdaqInfoSvc"), create=True )
31 else:
32 log.info("Configuring offline THistSvc")
33 output = []
34 if flags.Trigger.L1MuonSim.WriteNSWDebugNtuple:
35 output += ["NSWL1Simulation DATAFILE='NSWL1Simulation.root' OPT='RECREATE'"]
36
37 # add default outputs
38 setTHistSvcOutput(output)
39 histSvc = CompFactory.THistSvc("THistSvc", Output = output)
40
41 acc.addService( histSvc )
42 return acc