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.gEspressoOutputContainerReadKey =
"L1_gEspresso"
160 tool.gMETComponentsJwojOutputContainerReadKey =
"L1_gMETComponentsJwoj"
161 tool.gMHTComponentsJwojOutputContainerReadKey =
"L1_gMHTComponentsJwoj"
162 tool.gMSTComponentsJwojOutputContainerReadKey =
"L1_gMSTComponentsJwoj"
163 tool.gMETComponentsNoiseCutOutputContainerReadKey =
"L1_gMETComponentsNoiseCut"
164 tool.gMETComponentsRmsOutputContainerReadKey =
"L1_gMETComponentsRms"
165 tool.gScalarENoiseCutOutputContainerReadKey =
"L1_gScalarENoiseCut"
166 tool.gScalarERmsOutputContainerReadKey =
"L1_gScalarERms"
169 tool.gFexRhoOutputContainerWriteKey =
""
170 tool.gFexSRJetOutputContainerWriteKey =
""
171 tool.gFexLRJetOutputContainerWriteKey =
""
172 tool.gScalarEJwojOutputContainerWriteKey =
""
173 tool.gEspressoOutputContainerWriteKey =
""
174 tool.gMETComponentsJwojOutputContainerWriteKey =
""
175 tool.gMHTComponentsJwojOutputContainerWriteKey =
""
176 tool.gMSTComponentsJwojOutputContainerWriteKey =
""
177 tool.gMETComponentsNoiseCutOutputContainerWriteKey =
""
178 tool.gMETComponentsRmsOutputContainerWriteKey =
""
179 tool.gScalarENoiseCutOutputContainerWriteKey =
""
180 tool.gScalarERmsOutputContainerWriteKey =
""
183 tool.gFexRhoOutputContainerReadKey =
""
184 tool.gFexSRJetOutputContainerReadKey =
""
185 tool.gFexLRJetOutputContainerReadKey =
""
186 tool.gScalarEJwojOutputContainerReadKey =
""
187 tool.gEspressoOutputContainerReadKey =
""
188 tool.gMETComponentsJwojOutputContainerReadKey =
""
189 tool.gMHTComponentsJwojOutputContainerReadKey =
""
190 tool.gMSTComponentsJwojOutputContainerReadKey =
""
191 tool.gMETComponentsNoiseCutOutputContainerReadKey =
""
192 tool.gMETComponentsRmsOutputContainerReadKey =
""
193 tool.gScalarENoiseCutOutputContainerReadKey =
""
194 tool.gScalarERmsOutputContainerReadKey =
""
197 tool.gFexRhoOutputContainerWriteKey =
"L1_gFexRhoRoI"
198 tool.gFexSRJetOutputContainerWriteKey =
"L1_gFexSRJetRoI"
199 tool.gFexLRJetOutputContainerWriteKey =
"L1_gFexLRJetRoI"
200 tool.gScalarEJwojOutputContainerWriteKey =
"L1_gScalarEJwoj"
201 tool.gEspressoOutputContainerWriteKey =
"L1_gEspresso"
202 tool.gMETComponentsJwojOutputContainerWriteKey =
"L1_gMETComponentsJwoj"
203 tool.gMHTComponentsJwojOutputContainerWriteKey =
"L1_gMHTComponentsJwoj"
204 tool.gMSTComponentsJwojOutputContainerWriteKey =
"L1_gMSTComponentsJwoj"
205 tool.gMETComponentsNoiseCutOutputContainerWriteKey =
"L1_gMETComponentsNoiseCut"
206 tool.gMETComponentsRmsOutputContainerWriteKey =
"L1_gMETComponentsRms"
207 tool.gScalarENoiseCutOutputContainerWriteKey =
"L1_gScalarENoiseCut"
208 tool.gScalarERmsOutputContainerWriteKey =
"L1_gScalarERms"
211 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
212 if flags.Trigger.doHLT:
213 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
218 from AthenaMonitoring
import AthMonitorCfgHelper
219 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
220 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
222 acc.merge(helper.result())
224 monTool.defineHistogram(
'gfexDecoderErrorTitle,gfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
225 title=
'gFEX TOB Decoder Errors;Type;Location',
228 opt=[
'kCanRebin'],merge=
"merge")
229 tool.MonTool = monTool
232 acc.setPrivateTools(tool)
238 tool = CompFactory.jFexInputByteStreamTool(name)
239 jfex_roi_moduleids = [0x2000,0x2010,0x2020,0x2030,0x2040,0x2050]
240 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_DAQ, moduleid))
for moduleid
in jfex_roi_moduleids]
245 tool.jTowersReadKey =
"L1_jFexDataTowers"
247 tool.jTowersWriteKey =
""
250 tool.jTowersReadKey =
""
252 tool.jTowersWriteKey =
"L1_jFexDataTowers"
254 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
255 if flags.Trigger.doHLT:
256 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
261 from AthenaMonitoring
import AthMonitorCfgHelper
262 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
263 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
265 acc.merge(helper.result())
267 monTool.defineHistogram(
'jfexDecoderErrorTitle,jfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
268 title=
'jFEX InputData Decoder Errors;Type;Location',
271 opt=[
'kCanRebin'],merge=
"merge")
272 tool.MonTool = monTool
275 acc.setPrivateTools(tool)
281 tool = CompFactory.gFexInputByteStreamTool(name)
282 gfex_roi_moduleids = [0x3000]
283 tool.ROBIDs = [
int(SourceIdentifier(SubDetector.TDAQ_CALO_FEAT_EXTRACT_DAQ, moduleid))
for moduleid
in gfex_roi_moduleids]
287 tool.gTowersReadKey =
"L1_gFexDataTowers"
289 tool.gTowersWriteKey =
""
292 tool.gTowersReadKey =
""
294 tool.gTowersWriteKey =
"L1_gFexDataTowers"
296 if flags.Output.HISTFileName !=
'' or flags.Trigger.doHLT:
297 if flags.Trigger.doHLT:
298 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
303 from AthenaMonitoring
import AthMonitorCfgHelper
304 helper = AthMonitorCfgHelper(flags,
'HLTFramework')
305 monTool = helper.addGroup(
None, f
'{name}MonTool', f
'/HLT/HLTFramework/L1BSConverters/{name}')
307 acc.merge(helper.result())
309 monTool.defineHistogram(
'gfexDecoderErrorTitle,gfexDecoderErrorLocation;errors', path=topDir, type=
'TH2I',
310 title=
'gFEX InputData Decoder Errors;Type;Location',
313 opt=[
'kCanRebin'],merge=
"merge")
314 tool.MonTool = monTool
316 acc.setPrivateTools(tool)