4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from libpyeformat_helper
import SourceIdentifier, SubDetector
8 def eFexByteStreamToolCfg(flags, name, *, writeBS=False, TOBs=True, xTOBs=False, multiSlice=False, decodeInputs=False):
11 tool = CompFactory.eFexByteStreamTool(name)
16 tool.eEMContainerReadKey =
"L1_eEMxRoI" if xTOBs
else "L1_eEMRoI"
17 tool.eTAUContainerReadKey =
"L1_eTauxRoI" if xTOBs
else "L1_eTauRoI"
18 tool.eEMContainerWriteKey =
""
19 tool.eTAUContainerWriteKey =
""
22 tool.eEMContainerReadKey =
""
23 tool.eTAUContainerReadKey =
""
24 if TOBs
or xTOBs
or multiSlice:
25 efex_roi_moduleids = [0x1000,0x1100]
26 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_ROI, moduleid))
for moduleid
in efex_roi_moduleids]
28 tool.eEMContainerWriteKey =
"L1_eEMRoI"
29 tool.eTAUContainerWriteKey =
"L1_eTauRoI"
31 tool.eEMxContainerWriteKey =
"L1_eEMxRoI"
32 tool.eTAUxContainerWriteKey =
"L1_eTauxRoI"
34 tool.eEMSliceContainerWriteKey =
"L1_eEMxRoIOutOfTime"
35 tool.eTAUSliceContainerWriteKey =
"L1_eTauxRoIOutOfTime"
38 inputId =
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_DAQ, 0x1000))
39 for shelf
in range(0,2):
40 for module
in range(0,12):
41 efex_raw_ids += [inputId + shelf*0x100 + module*0x010 ]
42 tool.ROBIDs += efex_raw_ids
43 tool.eTowerContainerWriteKey =
"L1_eFexDataTowers"
45 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
46 if flags.Trigger.doHLT:
47 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
50 monTool.defineHistogram(
'efexDecoderErrorTitle,efexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
51 title=
'Decoder Errors;Title;Location',
52 xbins=1,xmin=0,xmax=1,
53 ybins=1,ymin=0,ymax=1,
54 opt=[
'kCanRebin'],merge=
"merge")
55 tool.MonTool = monTool
59 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
60 helper = L1CaloMonitorCfgHelper(flags,
None,name)
64 helper.defineHistogram(
'efexDecoderErrorTitle,efexDecoderErrorLocation;h_efex_errors', type=
'TH2I',
65 path=
"Developer/ByteStreamDecoders",
66 fillGroup = f
'{name}MonTool',
67 title=
'eFEX Decoder Errors;Title;Location',
68 xbins=1,xmin=0,xmax=1,
69 ybins=1,ymin=0,ymax=1,
70 opt=[
'kCanRebin',
'kAlwaysCreate'],merge=
"merge")
71 helper.defineHistogram(
'lbn,decoderError;h_efex_errors_vs_lbn', type=
'TH2I',
72 path=
"Expert/ByteStreamDecoders",
73 hanConfig={
"algorithm":
"Histogram_Empty",
"description":
"Should be empty. Please report any errors to eFEX software experts."},
74 fillGroup = f
'{name}MonTool',
75 title=
'eFEX Decoder Errors;LB;Error',
76 xbins=1,xmin=0,xmax=1,
77 ybins=1,ymin=0,ymax=1,
78 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
"merge")
79 tool.MonTool = helper.fillGroups[f
'{name}MonTool']
80 acc.merge(helper.result())
83 acc.setPrivateTools(tool)
89 tool = CompFactory.jFexRoiByteStreamTool(name)
90 tool.ConvertExtendedTOBs = xTOBs
91 jfex_roi_moduleids = [0x2000]
92 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_ROI, moduleid))
for moduleid
in jfex_roi_moduleids]
95 tool.jJRoIContainerReadKey =
"L1_jFexSRJetxRoI" if xTOBs
else "L1_jFexSRJetRoI"
96 tool.jLJRoIContainerReadKey =
"L1_jFexLRJetxRoI" if xTOBs
else "L1_jFexLRJetRoI"
97 tool.jTauRoIContainerReadKey =
"L1_jFexTauxRoI" if xTOBs
else "L1_jFexTauRoI"
98 tool.jEMRoIContainerReadKey =
"L1_jFexFwdElxRoI" if xTOBs
else "L1_jFexFwdElRoI"
99 tool.jTERoIContainerReadKey =
"L1_jFexSumETxRoI" if xTOBs
else "L1_jFexSumETRoI"
100 tool.jXERoIContainerReadKey =
"L1_jFexMETxRoI" if xTOBs
else "L1_jFexMETRoI"
102 tool.jJRoIContainerWriteKey =
""
103 tool.jLJRoIContainerWriteKey =
""
104 tool.jTauRoIContainerWriteKey=
""
105 tool.jEMRoIContainerWriteKey =
""
106 tool.jTERoIContainerWriteKey =
""
107 tool.jXERoIContainerWriteKey =
""
110 tool.jJRoIContainerReadKey =
""
111 tool.jLJRoIContainerReadKey =
""
112 tool.jTauRoIContainerReadKey =
""
113 tool.jEMRoIContainerReadKey =
""
114 tool.jTERoIContainerReadKey =
""
115 tool.jXERoIContainerReadKey =
""
117 tool.jJRoIContainerWriteKey =
"L1_jFexSRJetxRoI" if xTOBs
else "L1_jFexSRJetRoI"
118 tool.jLJRoIContainerWriteKey =
"L1_jFexLRJetxRoI" if xTOBs
else "L1_jFexLRJetRoI"
119 tool.jTauRoIContainerWriteKey=
"L1_jFexTauxRoI" if xTOBs
else "L1_jFexTauRoI"
120 tool.jEMRoIContainerWriteKey =
"L1_jFexFwdElxRoI" if xTOBs
else "L1_jFexFwdElRoI"
121 tool.jTERoIContainerWriteKey =
"L1_jFexSumETxRoI" if xTOBs
else "L1_jFexSumETRoI"
122 tool.jXERoIContainerWriteKey =
"L1_jFexMETxRoI" if xTOBs
else "L1_jFexMETRoI"
124 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
125 if flags.Trigger.doHLT:
126 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
131 from AthenaMonitoring
import AthMonitorCfgHelper
132 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
133 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
135 acc.merge(helper.result())
137 monTool.defineHistogram(
'jfexDecoderErrorTitle,jfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
138 title=
'jFEX TOB Decoder Errors;Type;Location',
141 opt=[
'kCanRebin'],merge=
"merge")
142 tool.MonTool = monTool
144 acc.setPrivateTools(tool)
150 tool = CompFactory.gFexByteStreamTool(name)
151 gfex_roi_moduleids = [0x3000]
152 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_ROI, moduleid))
for moduleid
in gfex_roi_moduleids]
155 tool.gFexRhoOutputContainerReadKey =
"L1_gFexRhoRoI"
156 tool.gFexSRJetOutputContainerReadKey =
"L1_gFexSRJetRoI"
157 tool.gFexLRJetOutputContainerReadKey =
"L1_gFexLRJetRoI"
158 tool.gScalarEJwojOutputContainerReadKey =
"L1_gScalarEJwoj"
159 tool.gMETComponentsJwojOutputContainerReadKey =
"L1_gMETComponentsJwoj"
160 tool.gMHTComponentsJwojOutputContainerReadKey =
"L1_gMHTComponentsJwoj"
161 tool.gMSTComponentsJwojOutputContainerReadKey =
"L1_gMSTComponentsJwoj"
162 tool.gMETComponentsNoiseCutOutputContainerReadKey =
"L1_gMETComponentsNoiseCut"
163 tool.gMETComponentsRmsOutputContainerReadKey =
"L1_gMETComponentsRms"
164 tool.gScalarENoiseCutOutputContainerReadKey =
"L1_gScalarENoiseCut"
165 tool.gScalarERmsOutputContainerReadKey =
"L1_gScalarERms"
168 tool.gFexRhoOutputContainerWriteKey =
""
169 tool.gFexSRJetOutputContainerWriteKey =
""
170 tool.gFexLRJetOutputContainerWriteKey =
""
171 tool.gScalarEJwojOutputContainerWriteKey =
""
172 tool.gMETComponentsJwojOutputContainerWriteKey =
""
173 tool.gMHTComponentsJwojOutputContainerWriteKey =
""
174 tool.gMSTComponentsJwojOutputContainerWriteKey =
""
175 tool.gMETComponentsNoiseCutOutputContainerWriteKey =
""
176 tool.gMETComponentsRmsOutputContainerWriteKey =
""
177 tool.gScalarENoiseCutOutputContainerWriteKey =
""
178 tool.gScalarERmsOutputContainerWriteKey =
""
181 tool.gFexRhoOutputContainerReadKey =
""
182 tool.gFexSRJetOutputContainerReadKey =
""
183 tool.gFexLRJetOutputContainerReadKey =
""
184 tool.gScalarEJwojOutputContainerReadKey =
""
185 tool.gMETComponentsJwojOutputContainerReadKey =
""
186 tool.gMHTComponentsJwojOutputContainerReadKey =
""
187 tool.gMSTComponentsJwojOutputContainerReadKey =
""
188 tool.gMETComponentsNoiseCutOutputContainerReadKey =
""
189 tool.gMETComponentsRmsOutputContainerReadKey =
""
190 tool.gScalarENoiseCutOutputContainerReadKey =
""
191 tool.gScalarERmsOutputContainerReadKey =
""
194 tool.gFexRhoOutputContainerWriteKey =
"L1_gFexRhoRoI"
195 tool.gFexSRJetOutputContainerWriteKey =
"L1_gFexSRJetRoI"
196 tool.gFexLRJetOutputContainerWriteKey =
"L1_gFexLRJetRoI"
197 tool.gScalarEJwojOutputContainerWriteKey =
"L1_gScalarEJwoj"
198 tool.gMETComponentsJwojOutputContainerWriteKey =
"L1_gMETComponentsJwoj"
199 tool.gMHTComponentsJwojOutputContainerWriteKey =
"L1_gMHTComponentsJwoj"
200 tool.gMSTComponentsJwojOutputContainerWriteKey =
"L1_gMSTComponentsJwoj"
201 tool.gMETComponentsNoiseCutOutputContainerWriteKey =
"L1_gMETComponentsNoiseCut"
202 tool.gMETComponentsRmsOutputContainerWriteKey =
"L1_gMETComponentsRms"
203 tool.gScalarENoiseCutOutputContainerWriteKey =
"L1_gScalarENoiseCut"
204 tool.gScalarERmsOutputContainerWriteKey =
"L1_gScalarERms"
207 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
208 if flags.Trigger.doHLT:
209 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
214 from AthenaMonitoring
import AthMonitorCfgHelper
215 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
216 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
218 acc.merge(helper.result())
220 monTool.defineHistogram(
'gfexDecoderErrorTitle,gfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
221 title=
'gFEX TOB Decoder Errors;Type;Location',
224 opt=[
'kCanRebin'],merge=
"merge")
225 tool.MonTool = monTool
228 acc.setPrivateTools(tool)
234 tool = CompFactory.jFexInputByteStreamTool(name)
235 jfex_roi_moduleids = [0x2000,0x2010,0x2020,0x2030,0x2040,0x2050]
236 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_DAQ, moduleid))
for moduleid
in jfex_roi_moduleids]
241 tool.jTowersReadKey =
"L1_jFexDataTowers"
243 tool.jTowersWriteKey =
""
246 tool.jTowersReadKey =
""
248 tool.jTowersWriteKey =
"L1_jFexDataTowers"
250 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
251 if flags.Trigger.doHLT:
252 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
257 from AthenaMonitoring
import AthMonitorCfgHelper
258 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
259 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
261 acc.merge(helper.result())
263 monTool.defineHistogram(
'jfexDecoderErrorTitle,jfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
264 title=
'jFEX InputData Decoder Errors;Type;Location',
267 opt=[
'kCanRebin'],merge=
"merge")
268 tool.MonTool = monTool
271 acc.setPrivateTools(tool)
277 tool = CompFactory.gFexInputByteStreamTool(name)
278 gfex_roi_moduleids = [0x3000]
279 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_DAQ, moduleid))
for moduleid
in gfex_roi_moduleids]
283 tool.gTowersReadKey =
"L1_gFexDataTowers"
285 tool.gTowersWriteKey =
""
288 tool.gTowersReadKey =
""
290 tool.gTowersWriteKey =
"L1_gFexDataTowers"
292 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
293 if flags.Trigger.doHLT:
294 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
299 from AthenaMonitoring
import AthMonitorCfgHelper
300 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
301 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
303 acc.merge(helper.result())
305 monTool.defineHistogram(
'gfexDecoderErrorTitle,gfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
306 title=
'gFEX InputData Decoder Errors;Type;Location',
309 opt=[
'kCanRebin'],merge=
"merge")
310 tool.MonTool = monTool
312 acc.setPrivateTools(tool)