14 local_logger = logging.getLogger(
'AthenaMonitoringCfg')
15 info = local_logger.info
16 info(
'SCTErrMonAlgConfig')
18 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
19 result = ComponentAccumulator()
21 from IOVDbSvc.IOVDbSvcConfig
import addFolders
22 if flags.Common.isOnline:
23 result.merge(addFolders(flags,
'/TDAQ/RunCtrl/DataTakingMode',
'TDAQ',className=
'AthenaAttributeList'))
24 info(
'SCTErrMonAlgConfig: added DATA COOL folders')
26 from AthenaMonitoring
import AthMonitorCfgHelper
27 helper = AthMonitorCfgHelper(flags,
'SCTErrMonCfg')
29 from AthenaConfiguration.ComponentFactory
import CompFactory
30 from AthenaMonitoring.AtlasReadyFilterConfig
import AtlasReadyFilterCfg
31 myMonAlg = helper.addAlgorithm(CompFactory.SCTErrMonAlg,
'SCTErrMonAlg')
32 myMonAlg.TriggerChain =
""
33 myMonAlg.ReadyFilterTool = result.popToolsAndMerge(AtlasReadyFilterCfg(flags))
35 from SCT_ConditionsTools.SCT_ConditionsToolsConfig
import SCT_ConditionsSummaryToolCfg
36 myMonAlg.SCT_ConditionsSummaryTool = result.popToolsAndMerge(
37 SCT_ConditionsSummaryToolCfg(flags))
40 myMonAlg.UseDCS = flags.InDet.useDCS
42 myMonAlg.doOnlineMon = flags.Common.isOnline
44 from LumiBlockComps.BunchCrossingCondAlgConfig
import BunchCrossingCondAlgCfg
45 result.merge(BunchCrossingCondAlgCfg(flags))
47 myMonGroup = helper.addGroup(myMonAlg,
"SCTErrMonitor",
"SCT/")
51 from ROOT
import SCT_Monitoring
as sctMon
54 myMonGroup.defineHistogram(varname=
"lumiBlock;NumberOfEventsVsLB",
57 title=
"Num of events per LB ;LumiBlock",
59 xbins=sctMon.NBINS_LBs,
61 xmax=sctMon.NBINS_LBs+0.5,
65 myMonGroup.defineHistogram(varname=
"lumiBlock;NumberOfSCTFlagErrorsVsLB",
68 title=
"Num of SCT Flag errors per LB ;LumiBlock",
70 xbins=sctMon.NBINS_LBs,
72 xmax=sctMon.NBINS_LBs+0.5,
76 myMonGroup.defineHistogram(varname=
"lumiBlock, sctFlag;FractionOfSCTFlagErrorsPerLB",
78 title=
"Frac of SCT Flag errors per LB ;LumiBlock",
80 xbins=sctMon.NBINS_LBs,
82 xmax=sctMon.NBINS_LBs+0.5,
86 myMonGroup.defineHistogram(varname=
"detailedConfBin, nBad;SCTConfDetails",
88 title=
"Exclusion from the Configuration",
90 xbins=sctMon.ConfbinsDetailed,
92 xmax=sctMon.ConfbinsDetailed-0.5,
93 xlabels=[
"Modules",
"Link 0",
"Link 1",
94 "Chips",
"Strips (10^{2})"],
98 myMonGroup.defineHistogram(varname=
"moduleOutBin, moduleOut;SCTConfOutM",
100 title=
"Num of Out Modules in All Region",
109 from ROOT
import SCT_ByteStreamErrors
110 for i
in range(SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES):
111 myMonGroup.defineHistogram(
112 varname=
"lumiBlock, n_" +
113 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
115 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
119 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
120 " per LB in All Region;LumiBlock;Num of " +
121 SCT_ByteStreamErrors.ErrorTypeDescription[i],
123 xbins=sctMon.NBINS_LBs,
125 xmax=sctMon.NBINS_LBs+0.5,
129 for i
in range(sctMon.N_ERRCATEGORY):
130 myMonGroup.defineHistogram(
131 varname=
"lumiBlock, n_" +
132 sctMon.CategoryErrorsNames[i]+
";SCT_LinksWith" +
133 sctMon.CategoryErrorsNames[i]+
"VsLbs",
135 title=
"Ave. Num of Links with " +
136 sctMon.CategoryErrorsNames[i] +
137 " per LB in All Region;LumiBlock;Num of Links with " +
138 sctMon.CategoryErrorsNames[i],
140 xbins=sctMon.NBINS_LBs,
142 xmax=sctMon.NBINS_LBs+0.5,
146 for errCate
in range(sctMon.N_ERRCATEGORY):
147 for region
in range(sctMon.N_REGIONS):
148 for layer
in range(sctMon.N_ENDCAPSx2):
149 myMonGroup.defineHistogram(
150 varname=
"eta, phi, hasError_" +
151 sctMon.CategoryErrorsNames[errCate]+
"_" +
152 sctMon.subDetNameShort[region].
Data()+
"_" +
153 str(layer//2)+
"_"+str(layer % 2) +
154 ";SCT_NumberOf"+sctMon.CategoryErrorsNames[errCate] +
155 sctMon.subDetNameShort[region].
Data()+
"_" +
156 str(layer//2)+
"_"+str(layer % 2),
159 sctMon.CategoryErrorsNames[errCate]+
" per "+sctMon.layerName[region].
Data()+str(
160 layer//2)+
"_"+str(layer % 2),
162 sctMon.subDetNameShort[region].
Data() +
163 "/errors/"+sctMon.CategoryErrorsNames[errCate],
164 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
166 sctMon.FIRST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
168 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
169 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
171 sctMon.FIRST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
173 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
177 if myMonAlg.doOnlineMon
and sctMon.CategoryErrorsNames[errCate] ==
"Errors":
178 myMonGroup.defineHistogram(
179 varname=
"eta, phi, hasError_" +
180 sctMon.CategoryErrorsNames[errCate]+
"_recent_" +
181 sctMon.subDetNameShort[region].
Data()+
"_" +
182 str(layer//2)+
"_"+str(layer % 2)+
";SummaryErrsRecent_" +
183 sctMon.subDetNameShort[region].
Data()+
"_" +
184 str(layer//2)+
"_"+str(layer % 2),
187 sctMon.CategoryErrorsNames[errCate] +
188 " per "+sctMon.layerName[region].
Data()
189 + str(layer//2)+
"_"+str(layer % 2)+
" - recent",
191 sctMon.subDetNameShort[region].
Data() +
193 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
195 sctMon.FIRST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
197 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
198 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
200 sctMon.FIRST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
202 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
204 opt=
'kLBNHistoryDepth=30,kAlwaysCreate')
207 myMonGroup.defineHistogram(varname=
"maskedLinksBin, maskedLinks;MaskedLinks",
209 title=
"Number of Masked Links for SCT,ECA,B,ECC",
210 path=
"GENERAL/errors",
211 xbins=sctMon.N_REGIONS_INC_GENERAL,
213 xmax=sctMon.N_REGIONS_INC_GENERAL-0.5,
214 xlabels=[
"EndCapC",
"Barrel",
"EndCapA",
"All"],
218 myMonGroup.defineHistogram(varname=
"flaggedWafersIndices, nFlaggedWafers;FlaggedWafers",
220 title=
"Number of flagged wafers for SCT,ECA,B,ECC",
221 path=
"GENERAL/errors",
222 xbins=sctMon.N_REGIONS_INC_GENERAL,
224 xmax=sctMon.N_REGIONS_INC_GENERAL-0.5,
225 xlabels=[
"EndCapC",
"Barrel",
"EndCapA",
"All"],
231 "Ave. Coverage of Enabled Links per LB",
232 "Ave. Coverage of Links with No Bad LinkLevelError per LB",
233 "Ave. Coverage of Links with No Bad RODLevelError per LB",
234 "Ave. Coverage of Links with No Bad Error per LB",
235 "Ave. Coverage of links Not Affected by PS Trip",
236 "Ave. Coverage of Links With No Bad Problem per LB"
238 for iProblem
in range(1, sctMon.numberOfProblemForCoverage):
239 myMonGroup.defineHistogram(
240 varname=
"lumiBlock, detectorCoverage" +
241 sctMon.coverageVarNames[iProblem]+
";SCT_Coverage" +
242 sctMon.coverageVarNames[iProblem]+
"VsLbs",
244 title=coverageTitles[iProblem] +
245 ";LumiBlock;Detector Coverage [%]",
246 path=
"DetectorCoverage",
247 xbins=sctMon.NBINS_LBs,
249 xmax=sctMon.NBINS_LBs+0.5,
252 if iProblem == sctMon.summary:
253 myMonGroup.defineHistogram(
254 varname=
"lumiBlock, detectorCoverage" +
255 sctMon.coverageVarNames[iProblem]+
"InR4P;SCT_Coverage" +
256 sctMon.coverageVarNames[iProblem]+
"InR4PVsLbs",
258 title=coverageTitles[iProblem] +
" in Ready for Physics" +
259 ";LumiBlock;Detector Coverage [%]",
260 path=
"DetectorCoverage",
261 xbins=sctMon.NBINS_LBs,
263 xmax=sctMon.NBINS_LBs+0.5,
267 myMonGroup.defineHistogram(varname=
"lumiBlock, psTripModules;SCT_ModulesWithPSTripVsLbs",
269 title=
"Ave. Num of Modules Affected by PS Trip per LB in All Region;LumiBlock;Num. of Modules Affected by PS Trip",
270 path=
"DetectorCoverage",
271 xbins=sctMon.NBINS_LBs,
273 xmax=sctMon.NBINS_LBs+0.5,
277 for region
in range(sctMon.N_REGIONS):
278 for layer
in range(sctMon.n_layers[region]*2):
279 myMonGroup.defineHistogram(
280 varname=
"eta_out, phi_out, modulemap" +
281 sctMon.subDetNameShort[region].
Data()+str(layer//2)+
"_" +
282 str(layer % 2)+
";modulemap" +
283 sctMon.subDetNameShort[region].
Data()+str(layer//2)+
"_" +
286 title=
"Module out of configuration: "+sctMon.layerName[region].
Data()+str(layer//2)+
" side "+str(
287 layer % 2) +
";Index in the direction of #eta;Index in the direction of #phi",
289 sctMon.subDetNameShort[region].
Data()+
"/Conf/",
290 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
291 xmin=(sctMon.FIRST_ETA_BIN
if region ==
292 sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
294 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
295 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
296 ymin=(sctMon.FIRST_PHI_BIN
if region ==
297 sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
299 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
304 xlabels = [SCT_ByteStreamErrors.ErrorTypeDescription[i]
305 for i
in range(SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES)]
306 for reg
in range(sctMon.N_REGIONS):
307 nLayers = sctMon.n_layers[reg]*2
308 ylabels = [str(i//2)+
"_"+str(i % 2)
for i
in range(nLayers)]
309 myMonGroup.defineHistogram(varname=
"errorType, layerSide, errorFraction;RateErrorsPerLumi",
311 sctMon.subDetNameShort[reg].
Data(),
313 title=
"Rate of Error Types for " +
314 sctMon.layerName[reg].
Data() +
317 sctMon.subDetNameShort[reg].
Data(
319 xbins=SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES,
321 xmax=SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES-0.5,
330 result.merge(helper.result())