3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
7 from AthenaCommon.Logging
import logging
8 log = logging.getLogger(
'TrigServicesConfig')
15 msgLimit = -100
if flags.Exec.OutputLevel>DEBUG
else 0
17 msgsvc = CompFactory.getComp(msgSvcType)(
19 OutputLevel = flags.Exec.OutputLevel,
20 Format =
"%t % F%40W%C%6W%R%e%4W%s%8W%R%T %0W%M",
22 printEventIDLevel = WARNING,
25 enableSuppression =
False,
26 suppressRunningOnly =
True,
29 defaultLimit = msgLimit,
30 verboseLimit = msgLimit,
31 debugLimit = msgLimit,
33 warningLimit = msgLimit,
50 '''Enable COOL folder updates'''
55 montool.defineHistogram(
'TIME_CoolFolderUpdate', path=
'EXPERT', type=
'TH1F',
56 title=
'Time for conditions update;time [ms]',
57 xbins=100, xmin=0, xmax=200)
59 cool_helper = CompFactory.TrigCOOLUpdateHelper(
62 CoolFolderMap =
'/TRIGGER/HLT/COOLUPDATE',
64 Folders = [
'/Indet/Onl/Beampos',
65 '/TRIGGER/LUMI/HLTPrefLumi',
66 '/TRIGGER/HLT/PrescaleKey'] )
68 from IOVDbSvc.IOVDbSvcConfig
import addFolders
69 acc.merge(
addFolders(flags, cool_helper.CoolFolderMap,
'TRIGGER_ONL',
70 className=
'CondAttrListCollection') )
72 acc.setPrivateTools( cool_helper )
77 '''online ROB data provider service'''
78 svc = CompFactory.HltROBDataProviderSvc(name,
79 doCostMonitoring = (flags.Trigger.CostMonitoring.doCostMonitoring
and
80 flags.Trigger.CostMonitoring.monitorROBs) )
83 svc.MonTool.defineHistogram(
'TIME_ROBReserveData', path=
'EXPERT', type=
'TH1F',
84 title=
'Time to reserve ROBs for later retrieval;time [mu s]',
85 xbins=100, xmin=0, xmax=1000)
86 svc.MonTool.defineHistogram(
'NUMBER_ROBReserveData', path=
'EXPERT', type=
'TH1F',
87 title=
'Number of reserved ROBs for later retrieval;number',
88 xbins=100, xmin=0, xmax=500)
89 svc.MonTool.defineHistogram(
'TIME_ROBRequest', path=
'EXPERT', type=
'TH1F',
90 title=
'Time for ROB retrievals;time [mu s]',
91 xbins=400, xmin=0, xmax=200000)
92 svc.MonTool.defineHistogram(
'NUMBER_ROBRequest', path=
'EXPERT', type=
'TH1F',
93 title=
'Number of retrieved ROBs;number',
94 xbins=100, xmin=0, xmax=1000)
95 svc.MonTool.defineHistogram(
'TIME_CollectAllROBs', path=
'EXPERT', type=
'TH1F',
96 title=
'Time for retrieving complete event data;time [mu s]',
97 xbins=400, xmin=0, xmax=200000)
98 svc.MonTool.defineHistogram(
'NUMBER_CollectAllROBs', path=
'EXPERT', type=
'TH1F',
99 title=
'Number of received ROBs for collect call;number',
100 xbins=100, xmin=0, xmax=2500)
106 '''online event loop manager'''
108 svc = CompFactory.HltEventLoopMgr(
110 setMagFieldFromPtree = flags.Trigger.Online.BFieldAutoConfig
114 if flags.Trigger.doLVL1
and flags.Trigger.writeBS:
115 svc.RewriteLVL1 =
True
116 if flags.Trigger.enableL1MuonPhase1
or flags.Trigger.enableL1CaloPhase1:
117 svc.L1TriggerResultRHKey =
'L1TriggerResult'
118 if flags.Trigger.enableL1CaloLegacy
or not flags.Trigger.enableL1MuonPhase1:
119 svc.RoIBResultRHKey =
'RoIBResult'
124 svc.MonTool.defineHistogram(
'TotalTime', path=
'EXPERT', type=
'TH1F',
125 title=
'Total event processing time (all events);Time [ms];Events',
126 xbins=200, xmin=0, xmax=10000)
127 svc.MonTool.defineHistogram(
'TotalTime;TotalTime_extRange', path=
'EXPERT', type=
'TH1F',
128 title=
'Total event processing time (all events);Time [ms];Events',
129 xbins=200, xmin=0, xmax=20000, opt=
'kCanRebin')
131 svc.MonTool.defineHistogram(
'TotalTimeAccepted', path=
'EXPERT', type=
'TH1F',
132 title=
'Total event processing time (accepted events);Time [ms];Events',
133 xbins=200, xmin=0, xmax=10000)
134 svc.MonTool.defineHistogram(
'TotalTimeAccepted;TotalTimeAccepted_extRange', path=
'EXPERT', type=
'TH1F',
135 title=
'Total event processing time (accepted events);Time [ms];Events',
136 xbins=200, xmin=0, xmax=20000, opt=
'kCanRebin')
138 svc.MonTool.defineHistogram(
'TotalTimeRejected', path=
'EXPERT', type=
'TH1F',
139 title=
'Total event processing time (rejected events);Time [ms];Events',
140 xbins=200, xmin=0, xmax=10000)
141 svc.MonTool.defineHistogram(
'TotalTimeRejected;TotalTimeRejected_extRange', path=
'EXPERT', type=
'TH1F',
142 title=
'Total event processing time (rejected events);Time [ms];Events',
143 xbins=200, xmin=0, xmax=20000, opt=
'kCanRebin')
145 svc.MonTool.defineHistogram(
'SlotIdleTime', path=
'EXPERT', type=
'TH1F',
146 title=
'Time between freeing and assigning a scheduler slot;Time [ms];Events',
147 xbins=400, xmin=0, xmax=400)
148 svc.MonTool.defineHistogram(
'SlotIdleTime;SlotIdleTime_extRange', path=
'EXPERT', type=
'TH1F',
149 title=
'Time between freeing and assigning a scheduler slot;Time [ms];Events',
150 xbins=400, xmin=0, xmax=800, opt=
'kCanRebin')
152 svc.MonTool.defineHistogram(
'TIME_clearStore', path=
'EXPERT', type=
'TH1F',
153 title=
'Time of clearStore() calls;Time [ms];Calls',
154 xbins=200, xmin=0, xmax=50)
155 svc.MonTool.defineHistogram(
'TIME_clearStore;TIME_clearStore_extRange', path=
'EXPERT', type=
'TH1F',
156 title=
'Time of clearStore() calls;Time [ms];Calls',
157 xbins=200, xmin=0, xmax=200, opt=
'kCanRebin')
159 svc.MonTool.defineHistogram(
'PopSchedulerTime', path=
'EXPERT', type=
'TH1F',
160 title=
'Time spent waiting for a finished event from the Scheduler;Time [ms];drainScheduler() calls',
161 xbins=250, xmin=0, xmax=250)
162 svc.MonTool.defineHistogram(
'PopSchedulerNumEvt', path=
'EXPERT', type=
'TH1F',
163 title=
'Number of events popped out of scheduler at the same time;Time [ms];drainScheduler() calls',
164 xbins=50, xmin=0, xmax=50)
166 from TrigSteerMonitor.TrigSteerMonitorConfig
import getTrigErrorMonTool
169 if flags.Trigger.CostMonitoring.doCostMonitoring:
170 svc.TrigErrorMonTool.TrigCostSvc = CompFactory.TrigCostSvc()
183 loop_mgr.CoolUpdateTool = cool_helper
185 from TriggerJobOpts.TriggerHistSvcConfig
import TriggerHistSvcConfig
188 from TrigOutputHandling.TrigOutputHandlingConfig
import HLTResultMTMakerCfg
191 from TriggerJobOpts.TriggerByteStreamConfig
import ByteStreamReadCfg
193 loop_mgr.EvtSel = acc.getService(
'EventSelectorByteStream')
194 loop_mgr.OutputCnvSvc = acc.getService(
'ByteStreamCnvSvc')
197 if flags.Trigger.doLVL1
and flags.Trigger.writeBS:
198 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig
import L1TriggerByteStreamEncoderCfg
201 from TrigSteerMonitor.TrigSteerMonitorConfig
import SchedulerMonSvcCfg
203 loop_mgr.MonitorScheduler =
True
205 acc.addService(loop_mgr, primary=
True)
206 acc.setAppProperty(
"EventLoop", loop_mgr.name)
211 if __name__==
"__main__":
212 from TrigPSC.PscDefaultFlags
import defaultOnlineFlags