ATLAS Offline Software
Loading...
Searching...
No Matches
TrigByteStreamConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3#
4
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
8from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
9
10def getTrigByteStreamInputSvc(flags, name='ByteStreamInputSvc'):
11 svc = CompFactory.TrigByteStreamInputSvc(name)
12
13 # Enable checking the CTP ROB with module ID 1 (the RoIB ROB), ATR-25217
14 svc.CheckCTPFragmentModuleID = 1 # ROB ID 0x770001
15
16 svc.MonTool = GenericMonitoringTool(flags, 'MonTool', HistPath='HLTFramework/'+name)
17 svc.MonTool.defineHistogram('L1Result_NumROBs', path='EXPERT', type='TH1F',
18 title='Number of ROBs received in L1 result;Number of ROBs;Events',
19 xbins=100, xmin=0, xmax=100)
20 svc.MonTool.defineHistogram('L1Result_FullEvFragSize', path='EXPERT', type='TH1F',
21 title='Size of L1 result FullEventFragment;Size [kB];Events',
22 xbins=100, xmin=0, xmax=100)
23 svc.MonTool.defineHistogram('L1Result_SubDets', path='EXPERT', type='TH1F',
24 title='Source of ROBs in L1 result passed to HLT;;Total number of ROBs',
25 xbins=4, xmin=0, xmax=4)
26 svc.MonTool.defineHistogram('TIME_getNext', path='EXPERT', type='TH1F',
27 title='Time of DataCollector::getNext() calls;Time [ms];Calls',
28 xbins=400, xmin=0, xmax=200)
29 svc.MonTool.defineHistogram('TIME_getNext;TIME_getNext_extRange', path='EXPERT', type='TH1F',
30 title='Time of DataCollector::getNext() calls;Time [ms];Calls',
31 xbins=400, xmin=0, xmax=2000, opt='kCanRebin')
32 svc.MonTool.defineHistogram('getNext_LBN,getNext_noEvent;NoEventFraction', path='EXPERT', type='TProfile',
33 title='Fraction of getNext calls returning NO_EVENT;Lumi Block;Event fraction',
34 xbins=100, xmin=0, xmax=100, opt='kCanRebin')
35 return svc
36
37def getTrigByteStreamCnvSvc(flags, name='ByteStreamCnvSvc'):
38 svc = CompFactory.TrigByteStreamCnvSvc(name)
39 svc.MonTool = GenericMonitoringTool(flags, 'MonTool', HistPath='HLTFramework/'+name)
40 svc.MonTool.defineHistogram('TIME_eventDone', path='EXPERT', type='TH1F',
41 title='Time of DataCollector::eventDone() calls;Time [ms];Calls',
42 xbins=400, xmin=0, xmax=2)
43 svc.MonTool.defineHistogram('TIME_eventDone;TIME_eventDone_extRange', path='EXPERT', type='TH1F',
44 title='Time of DataCollector::eventDone() calls;Time [ms];Calls',
45 xbins=400, xmin=0, xmax=200, opt='kCanRebin')
46 svc.MonTool.defineHistogram('StreamTags', path='EXPERT', type='TH1F',
47 title='Stream Tags produced by HLT;;Events',
48 xbins=10, xmin=0, xmax=10)
49 svc.MonTool.defineHistogram('StreamTagCorrA,StreamTagCorrB;StreamTagsCorr', path='EXPERT', type='TH2F',
50 title='Stream Tags (produced by HLT) correlation',
51 xbins=10, xmin=0, xmax=10, ybins=10, ymin=0, ymax=10)
52 svc.MonTool.defineHistogram('StreamTagsNum', path='EXPERT', type='TH1F',
53 title='Number of Stream Tags produced by HLT;Number of Stream Tags;Events',
54 xbins=20, xmin=0, xmax=20)
55 svc.MonTool.defineHistogram('StreamTagsType', path='EXPERT', type='TH1F',
56 title='Type of Stream Tags produced by HLT;;Events',
57 xbins=7, xmin=0, xmax=7,
58 xlabels=["physics", "calibration", "express", "monitoring", "debug", "reserved", "unknown"])
59 svc.MonTool.defineHistogram('StreamTagsPebRobsNum', path='EXPERT', type='TH1F',
60 title='Number of ROBs in PEB stream tags;Number of ROBs;Entries',
61 xbins=200, xmin=0, xmax=200,
62 cutmask="StreamTagIsPeb")
63 svc.MonTool.defineHistogram('StreamTagsPebSubDetsNum', path='EXPERT', type='TH1F',
64 title='Number of SubDetectors in PEB stream tags;Number of SubDetectors;Entries',
65 xbins=100, xmin=0, xmax=100,
66 cutmask="StreamTagIsPeb")
67 svc.MonTool.defineHistogram('StreamTagsPebSubDetsFromRobList', path='EXPERT', type='TH1F',
68 title='SubDetectors in PEB stream tags ROB list;;Entries',
69 xbins=20, xmin=0, xmax=20)
70 svc.MonTool.defineHistogram('StreamTagsPebSubDetsFromSubDetList', path='EXPERT', type='TH1F',
71 title='SubDetectors in PEB stream tags SubDetector list;;Entries',
72 xbins=20, xmin=0, xmax=20)
73 svc.MonTool.defineHistogram('ResultSizeTotal', path='EXPERT', type='TH1F',
74 title='HLT result total size (sum of all modules);Size [kB];Events',
75 xbins=200, xmin=0, xmax=2000, opt='kCanRebin')
76 svc.MonTool.defineHistogram('ResultSizeFullEvFrag', path='EXPERT', type='TH1F',
77 title='HLT output FullEventFragment size;Size [kB];Events',
78 xbins=200, xmin=0, xmax=2000, opt='kCanRebin')
79 svc.MonTool.defineHistogram('ResultModuleID,ResultModuleSize;ResultSizeByModule', path='EXPERT', type='TH2F',
80 title='HLT result size by module;Module ID;Size [kB]',
81 xbins=10, xmin=0, xmax=10, ybins=400, ymin=0, ymax=4000)
82 svc.MonTool.defineHistogram('StreamTags,ResultSizeStream;ResultSizeByStream', path='EXPERT', type='TH2F',
83 title='HLT result size by stream;;Size [kB]',
84 xbins=10, xmin=0, xmax=10, ybins=400, ymin=0, ymax=4000)
85 svc.MonTool.defineHistogram('OnlineErrorCode', path='EXPERT', type='TH1F',
86 title='Online error codes;;Events',
87 xbins=1, xmin=0, xmax=1)
88 svc.MonTool.defineHistogram('TIME_monitorRawEvent', path='EXPERT', type='TH1F',
89 title='Time of monitorRawEvent() calls;Time [us];Calls',
90 xbins=1000, xmin=0, xmax=1000)
91 return svc
92
93def getEFInterfaceSvc(flags, name='EFInterfaceSvc'):
94 ef = flags.Trigger.Online.EFInterface
95 return CompFactory.EFInterfaceSvc(
96 name,
97 Files = ef.Files,
98 LoopOverFiles= ef.LoopFiles,
99 NumEvents = ef.NumEvents,
100 SkipEvents = ef.SkipEvents,
101 RunNumber = ef.RunNumber,
102 )
103
104def TrigByteStreamCfg(flags, type_names=[]):
105 acc = ComponentAccumulator()
106
107 bytestream_conversion = getTrigByteStreamCnvSvc(flags)
108 acc.addService(bytestream_conversion, primary=True)
109
110 bytestream_input = getTrigByteStreamInputSvc(flags)
111 acc.addService(bytestream_input)
112
113 if flags.Trigger.Online.useEFByteStreamSvc:
114 ef_interface = getEFInterfaceSvc(flags)
115 acc.addService(ef_interface)
116 bytestream_conversion.EFInterfaceSvc = ef_interface.name
117 bytestream_input.EFInterfaceSvc = ef_interface.name
118
119 event_selector = CompFactory.TrigEventSelectorByteStream(
120 name='EventSelectorByteStream',
121 ByteStreamInputSvc=bytestream_input)
122 acc.addService(event_selector)
123 acc.setAppProperty("EvtSel", event_selector.name)
124
125 event_persistency = CompFactory.EvtPersistencySvc(
126 name="EventPersistencySvc",
127 CnvServices=[bytestream_conversion.name])
128 acc.addService(event_persistency)
129
130 address_provider = CompFactory.ByteStreamAddressProviderSvc(
131 TypeNames=type_names)
132 acc.addService(address_provider)
133
134 proxy = CompFactory.ProxyProviderSvc()
135 proxy.ProviderNames += [address_provider.name]
136 acc.addService(proxy)
137
138 acc.merge(SGInputLoaderCfg(flags,
139 Load=address_provider.TypeNames,
140 FailIfNoProxy=flags.Input.FailOnUnknownCollections,
141 ExtraOutputs=[("xAOD::EventInfo","StoreGateSvc+EventInfo"),("xAOD::EventAuxInfo","StoreGateSvc+EventInfoAux.")])) # EventInfo created by TrigEventSelectorByteStream
142
143 return acc
getTrigByteStreamCnvSvc(flags, name='ByteStreamCnvSvc')
TrigByteStreamCfg(flags, type_names=[])
getEFInterfaceSvc(flags, name='EFInterfaceSvc')
getTrigByteStreamInputSvc(flags, name='ByteStreamInputSvc')