5 '''@file SCTErrMonAlg_jobOptions.py
8 @brief New style configuration of SCTErrMonAlg
14 local_logger = logging.getLogger(
'AthenaMonitoringCfg')
15 info = local_logger.info
16 info(
'SCTErrMonAlgConfig')
18 from AthenaConfiguration.ComponentAccumulator
import 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 myMonAlg = helper.addAlgorithm(CompFactory.SCTErrMonAlg,
'SCTErrMonAlg')
31 myMonAlg.TriggerChain =
""
33 from SCT_ConditionsTools.SCT_ConditionsToolsConfig
import SCT_ConditionsSummaryToolCfg
34 myMonAlg.SCT_ConditionsSummaryTool = result.popToolsAndMerge(
38 myMonAlg.UseDCS = flags.InDet.useDCS
40 myMonAlg.doOnlineMon = flags.Common.isOnline
42 from LumiBlockComps.BunchCrossingCondAlgConfig
import BunchCrossingCondAlgCfg
45 myMonGroup = helper.addGroup(myMonAlg,
"SCTErrMonitor",
"SCT/")
49 from ROOT
import SCT_Monitoring
as sctMon
52 myMonGroup.defineHistogram(varname=
"lumiBlock;NumberOfEventsVsLB",
55 title=
"Num of events per LB ;LumiBlock",
57 xbins=sctMon.NBINS_LBs,
59 xmax=sctMon.NBINS_LBs+0.5,
63 myMonGroup.defineHistogram(varname=
"lumiBlock;NumberOfSCTFlagErrorsVsLB",
66 title=
"Num of SCT Flag errors per LB ;LumiBlock",
68 xbins=sctMon.NBINS_LBs,
70 xmax=sctMon.NBINS_LBs+0.5,
74 myMonGroup.defineHistogram(varname=
"lumiBlock, sctFlag;FractionOfSCTFlagErrorsPerLB",
76 title=
"Frac of SCT Flag errors per LB ;LumiBlock",
78 xbins=sctMon.NBINS_LBs,
80 xmax=sctMon.NBINS_LBs+0.5,
84 myMonGroup.defineHistogram(varname=
"detailedConfBin, nBad;SCTConfDetails",
86 title=
"Exclusion from the Configuration",
88 xbins=sctMon.ConfbinsDetailed,
90 xmax=sctMon.ConfbinsDetailed-0.5,
91 xlabels=[
"Modules",
"Link 0",
"Link 1",
92 "Chips",
"Strips (10^{2})"],
96 myMonGroup.defineHistogram(varname=
"moduleOutBin, moduleOut;SCTConfOutM",
98 title=
"Num of Out Modules in All Region",
107 from ROOT
import SCT_ByteStreamErrors
108 for i
in range(SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES):
109 myMonGroup.defineHistogram(
110 varname=
"lumiBlock, n_" +
111 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
113 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
117 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
118 " per LB in All Region;LumiBlock;Num of " +
119 SCT_ByteStreamErrors.ErrorTypeDescription[i],
121 xbins=sctMon.NBINS_LBs,
123 xmax=sctMon.NBINS_LBs+0.5,
127 for i
in range(sctMon.N_ERRCATEGORY):
128 myMonGroup.defineHistogram(
129 varname=
"lumiBlock, n_" +
130 sctMon.CategoryErrorsNames[i]+
";SCT_LinksWith" +
131 sctMon.CategoryErrorsNames[i]+
"VsLbs",
133 title=
"Ave. Num of Links with " +
134 sctMon.CategoryErrorsNames[i] +
135 " per LB in All Region;LumiBlock;Num of Links with " +
136 sctMon.CategoryErrorsNames[i],
138 xbins=sctMon.NBINS_LBs,
140 xmax=sctMon.NBINS_LBs+0.5,
144 for errCate
in range(sctMon.N_ERRCATEGORY):
145 for region
in range(sctMon.N_REGIONS):
146 for layer
in range(sctMon.N_ENDCAPSx2):
147 myMonGroup.defineHistogram(
148 varname=
"eta, phi, hasError_" +
149 sctMon.CategoryErrorsNames[errCate]+
"_" +
150 sctMon.subDetNameShort[region].Data()+
"_" +
151 str(layer//2)+
"_"+
str(layer % 2) +
152 ";SCT_NumberOf"+sctMon.CategoryErrorsNames[errCate] +
153 sctMon.subDetNameShort[region].Data()+
"_" +
154 str(layer//2)+
"_"+
str(layer % 2),
157 sctMon.CategoryErrorsNames[errCate]+
" per "+sctMon.layerName[region].Data()+
str(
158 layer//2)+
"_"+
str(layer % 2),
160 sctMon.subDetNameShort[region].Data() +
161 "/errors/"+sctMon.CategoryErrorsNames[errCate],
162 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
164 sctMon.FIRST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
166 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
167 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
169 sctMon.FIRST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
171 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
175 if myMonAlg.doOnlineMon
and sctMon.CategoryErrorsNames[errCate] ==
"Errors":
176 myMonGroup.defineHistogram(
177 varname=
"eta, phi, hasError_" +
178 sctMon.CategoryErrorsNames[errCate]+
"_recent_" +
179 sctMon.subDetNameShort[region].Data()+
"_" +
180 str(layer//2)+
"_"+
str(layer % 2)+
";SummaryErrsRecent_" +
181 sctMon.subDetNameShort[region].Data()+
"_" +
182 str(layer//2)+
"_"+
str(layer % 2),
185 sctMon.CategoryErrorsNames[errCate] +
186 " per "+sctMon.layerName[region].Data()
187 +
str(layer//2)+
"_"+
str(layer % 2)+
" - recent",
189 sctMon.subDetNameShort[region].Data() +
191 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
193 sctMon.FIRST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
195 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
196 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
198 sctMon.FIRST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
200 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
202 opt=
'kLBNHistoryDepth=30,kAlwaysCreate')
205 myMonGroup.defineHistogram(varname=
"maskedLinksBin;Masked Links",
206 weight=
"maskedLinks",
208 title=
"Number of Masked Links for SCT,ECA,B,ECC",
209 path=
"GENERAL/errors",
210 xbins=sctMon.N_REGIONS_INC_GENERAL,
212 xmax=sctMon.N_REGIONS_INC_GENERAL-0.5,
213 xlabels=[
"EndCapC",
"Barrel",
"EndCapA",
"All"],
217 myMonGroup.defineHistogram(varname=
"flaggedWafersIndices, nFlaggedWafers;FlaggedWafers",
219 title=
"Number of flagged wafers for SCT,ECA,B,ECC",
220 path=
"GENERAL/errors",
221 xbins=sctMon.N_REGIONS_INC_GENERAL,
223 xmax=sctMon.N_REGIONS_INC_GENERAL-0.5,
224 xlabels=[
"EndCapC",
"Barrel",
"EndCapA",
"All"],
230 "Ave. Coverage of Enabled Links per LB",
231 "Ave. Coverage of Links with No Bad LinkLevelError per LB",
232 "Ave. Coverage of Links with No Bad RODLevelError per LB",
233 "Ave. Coverage of Links with No Bad Error per LB",
234 "Ave. Coverage of links Not Affected by PS Trip",
235 "Ave. Coverage of Links With No Bad Problem per LB"
237 for iProblem
in range(1, sctMon.numberOfProblemForCoverage):
238 myMonGroup.defineHistogram(
239 varname=
"lumiBlock, detectorCoverage" +
240 sctMon.coverageVarNames[iProblem]+
";SCT_Coverage" +
241 sctMon.coverageVarNames[iProblem]+
"VsLbs",
243 title=coverageTitles[iProblem] +
244 ";LumiBlock;Detector Coverage [%]",
245 path=
"DetectorCoverage",
246 xbins=sctMon.NBINS_LBs,
248 xmax=sctMon.NBINS_LBs+0.5,
251 if iProblem == sctMon.summary:
252 myMonGroup.defineHistogram(
253 varname=
"lumiBlock, detectorCoverage" +
254 sctMon.coverageVarNames[iProblem]+
"InR4P;SCT_Coverage" +
255 sctMon.coverageVarNames[iProblem]+
"InR4PVsLbs",
257 title=coverageTitles[iProblem] +
" in Ready for Physics" +
258 ";LumiBlock;Detector Coverage [%]",
259 path=
"DetectorCoverage",
260 xbins=sctMon.NBINS_LBs,
262 xmax=sctMon.NBINS_LBs+0.5,
266 myMonGroup.defineHistogram(varname=
"lumiBlock, psTripModules;SCT_ModulesWithPSTripVsLbs",
268 title=
"Ave. Num of Modules Affected by PS Trip per LB in All Region;LumiBlock;Num. of Modules Affected by PS Trip",
269 path=
"DetectorCoverage",
270 xbins=sctMon.NBINS_LBs,
272 xmax=sctMon.NBINS_LBs+0.5,
276 for region
in range(sctMon.N_REGIONS):
277 for layer
in range(sctMon.n_layers[region]*2):
278 myMonGroup.defineHistogram(
279 varname=
"eta_out, phi_out, modulemap" +
280 sctMon.subDetNameShort[region].Data()+
str(layer//2)+
"_" +
281 str(layer % 2)+
";modulemap" +
282 sctMon.subDetNameShort[region].Data()+
str(layer//2)+
"_" +
285 title=
"Module out of configuration: "+sctMon.layerName[region].Data()+
str(layer//2)+
" side "+
str(
286 layer % 2) +
";Index in the direction of #eta;Index in the direction of #phi",
288 sctMon.subDetNameShort[region].Data()+
"/Conf/",
289 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
290 xmin=(sctMon.FIRST_ETA_BIN
if region ==
291 sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
293 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
294 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
295 ymin=(sctMon.FIRST_PHI_BIN
if region ==
296 sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
298 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
303 xlabels = [SCT_ByteStreamErrors.ErrorTypeDescription[i]
304 for i
in range(SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES)]
305 for reg
in range(sctMon.N_REGIONS):
306 nLayers = sctMon.n_layers[reg]*2
307 ylabels = [
str(i//2)+
"_"+
str(i % 2)
for i
in range(nLayers)]
308 myMonGroup.defineHistogram(varname=
"errorType, layerSide, errorFraction;RateErrorsPerLumi",
310 sctMon.subDetNameShort[reg].Data(),
312 title=
"Rate of Error Types for " +
313 sctMon.layerName[reg].Data() +
316 sctMon.subDetNameShort[reg].Data(
318 xbins=SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES,
320 xmax=SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES-0.5,
329 result.merge(helper.result())