ATLAS Offline Software
Loading...
Searching...
No Matches
TrigByteStreamConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2026 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('Input_NumROBs', path='EXPERT', type='TH1F',
18 title='Number of ROBs received;Number of ROBs;Events',
19 xbins=500, xmin=0, xmax=5000)
20 svc.MonTool.defineHistogram('Input_FullEvFragSize', path='EXPERT', type='TH1F',
21 title='Size of input FullEventFragment;Size [kB];Events',
22 xbins=500, xmin=0, xmax=5000)
23 svc.MonTool.defineHistogram('Input_SubDets', path='EXPERT', type='TH1F',
24 title='Source of ROBs in input;;Total number of ROBs',
25 xbins=100, xmin=0, xmax=100)
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 OutputFileName = ef.OutputFileName,
99 LoopOverFiles = ef.LoopFiles,
100 NumEvents = ef.NumEvents,
101 SkipEvents = ef.SkipEvents,
102 RunNumber = ef.RunNumber,
103 T0ProjectTag = ef.T0ProjectTag,
104 BeamType = ef.BeamType,
105 BeamEnergy = ef.BeamEnergy,
106 TriggerType = ef.TriggerType,
107 Stream = ef.Stream,
108 Lumiblock = ef.Lumiblock,
109 DetMask = ef.DetMask,
110 EFDFInterfaceLibraryName = ef.LibraryName,
111 )
112
113def TrigByteStreamCfg(flags, type_names=[]):
114 acc = ComponentAccumulator()
115
116 bytestream_conversion = getTrigByteStreamCnvSvc(flags)
117 acc.addService(bytestream_conversion, primary=True)
118
119 bytestream_input = getTrigByteStreamInputSvc(flags)
120 acc.addService(bytestream_input)
121
122 if flags.Trigger.Online.useEFByteStreamSvc:
123 ef_interface = getEFInterfaceSvc(flags)
124 acc.addService(ef_interface)
125 bytestream_conversion.EFInterfaceSvc = ef_interface.name
126 bytestream_input.EFInterfaceSvc = ef_interface.name
127
128 event_selector = CompFactory.TrigEventSelectorByteStream(
129 name='EventSelectorByteStream',
130 ByteStreamInputSvc=bytestream_input)
131 acc.addService(event_selector)
132 acc.setAppProperty("EvtSel", event_selector.name)
133
134 event_persistency = CompFactory.EvtPersistencySvc(
135 name="EventPersistencySvc",
136 CnvServices=[bytestream_conversion.name])
137 acc.addService(event_persistency)
138
139 address_provider = CompFactory.ByteStreamAddressProviderSvc(
140 TypeNames=type_names)
141 acc.addService(address_provider)
142
143 proxy = CompFactory.ProxyProviderSvc()
144 proxy.ProviderNames += [address_provider.name]
145 acc.addService(proxy)
146
147 acc.merge(SGInputLoaderCfg(flags,
148 Load=address_provider.TypeNames,
149 FailIfNoProxy=flags.Input.FailOnUnknownCollections,
150 ExtraOutputs=[("xAOD::EventInfo","StoreGateSvc+EventInfo"),("xAOD::EventAuxInfo","StoreGateSvc+EventInfoAux.")])) # EventInfo created by TrigEventSelectorByteStream
151
152 return acc
getTrigByteStreamCnvSvc(flags, name='ByteStreamCnvSvc')
TrigByteStreamCfg(flags, type_names=[])
getEFInterfaceSvc(flags, name='EFInterfaceSvc')
getTrigByteStreamInputSvc(flags, name='ByteStreamInputSvc')