14 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
17 from AthenaMonitoring
import AthMonitorCfgHelper
18 helper = AthMonitorCfgHelper(flags,
'SCTErrMonCfg')
20 from AthenaConfiguration.ComponentFactory
import CompFactory
21 myMonAlg = helper.addAlgorithm(CompFactory.SCTErrMonAlg,
'SCTErrMonAlg')
22 myMonAlg.TriggerChain =
""
24 from SCT_ConditionsTools.SCT_ConditionsToolsConfig
import SCT_ConditionsSummaryToolCfg
25 myMonAlg.SCT_ConditionsSummaryTool = result.popToolsAndMerge(
29 myMonAlg.UseDCS = flags.InDet.useDCS
31 myMonAlg.doOnlineMon = flags.Common.isOnline
33 from LumiBlockComps.BunchCrossingCondAlgConfig
import BunchCrossingCondAlgCfg
36 myMonGroup = helper.addGroup(myMonAlg,
"SCTErrMonitor",
"SCT/")
40 from ROOT
import SCT_Monitoring
as sctMon
43 myMonGroup.defineHistogram(varname=
"lumiBlock;NumberOfEventsVsLB",
46 title=
"Num of events per LB ;LumiBlock",
48 xbins=sctMon.NBINS_LBs,
50 xmax=sctMon.NBINS_LBs+0.5,
54 myMonGroup.defineHistogram(varname=
"lumiBlock;NumberOfSCTFlagErrorsVsLB",
57 title=
"Num of SCT Flag errors per LB ;LumiBlock",
59 xbins=sctMon.NBINS_LBs,
61 xmax=sctMon.NBINS_LBs+0.5,
65 myMonGroup.defineHistogram(varname=
"lumiBlock, sctFlag;FractionOfSCTFlagErrorsPerLB",
67 title=
"Frac of SCT Flag errors per LB ;LumiBlock",
69 xbins=sctMon.NBINS_LBs,
71 xmax=sctMon.NBINS_LBs+0.5,
75 myMonGroup.defineHistogram(varname=
"detailedConfBin, nBad;SCTConfDetails",
77 title=
"Exclusion from the Configuration",
79 xbins=sctMon.ConfbinsDetailed,
81 xmax=sctMon.ConfbinsDetailed-0.5,
82 xlabels=[
"Modules",
"Link 0",
"Link 1",
83 "Chips",
"Strips (10^{2})"],
87 myMonGroup.defineHistogram(varname=
"moduleOutBin, moduleOut;SCTConfOutM",
89 title=
"Num of Out Modules in All Region",
98 from ROOT
import SCT_ByteStreamErrors
99 for i
in range(SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES):
100 myMonGroup.defineHistogram(
101 varname=
"lumiBlock, n_" +
102 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
104 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
108 SCT_ByteStreamErrors.ErrorTypeDescription[i] +
109 " per LB in All Region;LumiBlock;Num of " +
110 SCT_ByteStreamErrors.ErrorTypeDescription[i],
112 xbins=sctMon.NBINS_LBs,
114 xmax=sctMon.NBINS_LBs+0.5,
118 for i
in range(sctMon.N_ERRCATEGORY):
119 myMonGroup.defineHistogram(
120 varname=
"lumiBlock, n_" +
121 sctMon.CategoryErrorsNames[i]+
";SCT_LinksWith" +
122 sctMon.CategoryErrorsNames[i]+
"VsLbs",
124 title=
"Ave. Num of Links with " +
125 sctMon.CategoryErrorsNames[i] +
126 " per LB in All Region;LumiBlock;Num of Links with " +
127 sctMon.CategoryErrorsNames[i],
129 xbins=sctMon.NBINS_LBs,
131 xmax=sctMon.NBINS_LBs+0.5,
135 for errCate
in range(sctMon.N_ERRCATEGORY):
136 for region
in range(sctMon.N_REGIONS):
137 for layer
in range(sctMon.N_ENDCAPSx2):
138 myMonGroup.defineHistogram(
139 varname=
"eta, phi, hasError_" +
140 sctMon.CategoryErrorsNames[errCate]+
"_" +
141 sctMon.subDetNameShort[region].
Data()+
"_" +
142 str(layer//2)+
"_"+
str(layer % 2) +
143 ";SCT_NumberOf"+sctMon.CategoryErrorsNames[errCate] +
144 sctMon.subDetNameShort[region].
Data()+
"_" +
145 str(layer//2)+
"_"+
str(layer % 2),
148 sctMon.CategoryErrorsNames[errCate]+
" per "+sctMon.layerName[region].
Data()+
str(
149 layer//2)+
"_"+
str(layer % 2),
151 sctMon.subDetNameShort[region].
Data() +
152 "/errors/"+sctMon.CategoryErrorsNames[errCate],
153 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
155 sctMon.FIRST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
157 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
158 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
160 sctMon.FIRST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
162 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
166 if myMonAlg.doOnlineMon
and sctMon.CategoryErrorsNames[errCate] ==
"Errors":
167 myMonGroup.defineHistogram(
168 varname=
"eta, phi, hasError_" +
169 sctMon.CategoryErrorsNames[errCate]+
"_recent_" +
170 sctMon.subDetNameShort[region].
Data()+
"_" +
171 str(layer//2)+
"_"+
str(layer % 2)+
";SummaryErrsRecent_" +
172 sctMon.subDetNameShort[region].
Data()+
"_" +
173 str(layer//2)+
"_"+
str(layer % 2),
176 sctMon.CategoryErrorsNames[errCate] +
177 " per "+sctMon.layerName[region].
Data()
178 +
str(layer//2)+
"_"+
str(layer % 2)+
" - recent",
180 sctMon.subDetNameShort[region].
Data() +
182 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
184 sctMon.FIRST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
186 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
187 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
189 sctMon.FIRST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
191 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
193 opt=
'kLBNHistoryDepth=30,kAlwaysCreate')
196 myMonGroup.defineHistogram(varname=
"maskedLinksBin;Masked Links",
197 weight=
"maskedLinks",
199 title=
"Number of Masked Links for SCT,ECA,B,ECC",
200 path=
"GENERAL/errors",
201 xbins=sctMon.N_REGIONS_INC_GENERAL,
203 xmax=sctMon.N_REGIONS_INC_GENERAL-0.5,
204 xlabels=[
"EndCapC",
"Barrel",
"EndCapA",
"All"],
208 myMonGroup.defineHistogram(varname=
"flaggedWafersIndices, nFlaggedWafers;FlaggedWafers",
210 title=
"Number of flagged wafers for SCT,ECA,B,ECC",
211 path=
"GENERAL/errors",
212 xbins=sctMon.N_REGIONS_INC_GENERAL,
214 xmax=sctMon.N_REGIONS_INC_GENERAL-0.5,
215 xlabels=[
"EndCapC",
"Barrel",
"EndCapA",
"All"],
221 "Ave. Coverage of Enabled Links per LB",
222 "Ave. Coverage of Links with No Bad LinkLevelError per LB",
223 "Ave. Coverage of Links with No Bad RODLevelError per LB",
224 "Ave. Coverage of Links with No Bad Error per LB",
225 "Ave. Coverage of links Not Affected by PS Trip",
226 "Ave. Coverage of Links With No Bad Problem per LB"
228 for iProblem
in range(1, sctMon.numberOfProblemForCoverage):
229 myMonGroup.defineHistogram(
230 varname=
"lumiBlock, detectorCoverage" +
231 sctMon.coverageVarNames[iProblem]+
";SCT_Coverage" +
232 sctMon.coverageVarNames[iProblem]+
"VsLbs",
234 title=coverageTitles[iProblem] +
235 ";LumiBlock;Detector Coverage [%]",
236 path=
"DetectorCoverage",
237 xbins=sctMon.NBINS_LBs,
239 xmax=sctMon.NBINS_LBs+0.5,
243 myMonGroup.defineHistogram(varname=
"lumiBlock, psTripModules;SCT_ModulesWithPSTripVsLbs",
245 title=
"Ave. Num of Modules Affected by PS Trip per LB in All Region;LumiBlock;Num. of Modules Affected by PS Trip",
246 path=
"DetectorCoverage",
247 xbins=sctMon.NBINS_LBs,
249 xmax=sctMon.NBINS_LBs+0.5,
253 for region
in range(sctMon.N_REGIONS):
254 for layer
in range(sctMon.n_layers[region]*2):
255 myMonGroup.defineHistogram(
256 varname=
"eta_out, phi_out, modulemap" +
257 sctMon.subDetNameShort[region].
Data()+
str(layer//2)+
"_" +
258 str(layer % 2)+
";modulemap" +
259 sctMon.subDetNameShort[region].
Data()+
str(layer//2)+
"_" +
262 title=
"Module out of configuration: "+sctMon.layerName[region].
Data()+
str(layer//2)+
" side "+
str(
263 layer % 2) +
";Index in the direction of #eta;Index in the direction of #phi",
265 sctMon.subDetNameShort[region].
Data()+
"/Conf/",
266 xbins=sctMon.N_ETA_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_ETA_BINS_EC,
267 xmin=(sctMon.FIRST_ETA_BIN
if region ==
268 sctMon.BARREL_INDEX
else sctMon.FIRST_ETA_BIN_EC)-0.5,
270 sctMon.LAST_ETA_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_ETA_BIN_EC)+0.5,
271 ybins=sctMon.N_PHI_BINS
if region == sctMon.BARREL_INDEX
else sctMon.N_PHI_BINS_EC,
272 ymin=(sctMon.FIRST_PHI_BIN
if region ==
273 sctMon.BARREL_INDEX
else sctMon.FIRST_PHI_BIN_EC)-0.5,
275 sctMon.LAST_PHI_BIN
if region == sctMon.BARREL_INDEX
else sctMon.LAST_PHI_BIN_EC)+0.5,
280 xlabels = [SCT_ByteStreamErrors.ErrorTypeDescription[i]
281 for i
in range(SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES)]
282 for reg
in range(sctMon.N_REGIONS):
283 nLayers = sctMon.n_layers[reg]*2
284 ylabels = [
str(i//2)+
"_"+
str(i % 2)
for i
in range(nLayers)]
285 myMonGroup.defineHistogram(varname=
"errorType, layerSide, errorFraction;RateErrorsPerLumi",
287 sctMon.subDetNameShort[reg].
Data(),
289 title=
"Rate of Error Types for " +
290 sctMon.layerName[reg].
Data() +
293 sctMon.subDetNameShort[reg].
Data(
295 xbins=SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES,
297 xmax=SCT_ByteStreamErrors.ErrorType.NUM_ERROR_TYPES-0.5,
306 result.merge(helper.result())