51 uint32_t bunchCrossing = 0;
52 bunchCrossing = ctx.eventID().bunch_crossing_id();
54 const long long eventNumber = ctx.eventID().event_number();
62 return StatusCode::FAILURE;
66 std::vector<MonitorTT> vecMonTT;
77 bool triggerTowerHasMcmError =
false;
78 bool triggerTowerHasSubstatusError =
false;
82 for (
auto& myTower : vecMonTT) {
85 int cpET = (myTower.tower)->cpET();
86 int jepET = myTower.jepET;
87 int layer = (myTower.tower)->layer();
88 bool isEM = (layer == 0);
89 bool isHAD = (layer == 1);
90 std::string layerName = (layer == 0) ?
"EM" :
"HAD";
92 ATH_MSG_DEBUG(
"isEM " << isEM <<
" isHAD " << isHAD <<
" layerName " << layerName);
110 std::string groupName =
"groupLUTCP";
111 fill(groupName, BCID, mask_cpET_5);
113 groupName =
"groupLUTJEP";
114 fill(groupName, BCID, mask_jepET_5);
117 groupName =
"groupLUTCP_";
118 groupName.append(layerName);
123 fill(groupName, eta_TT, cpET_TT, mask_cpET_0);
141 groupName =
"groupLUTCP_"+layerName+
"_"+std::to_string(th);
150 groupName =
"groupLUTJEP_";
151 groupName.append(layerName);
156 fill(groupName, eta_TT, jepET_TT, mask_jepET_0);
174 groupName =
"groupLUTJEP_"+layerName+
"_"+std::to_string(th);
184 unsigned int tslice = (myTower.tower)->adcPeak();
185 unsigned int adcSize = ((myTower.tower)->adc()).size();
188 groupName =
"groupTimeslice_";
189 groupName.append(layerName);
192 fill(groupName, adcPeak);
194 if (tslice < adcSize) {
195 groupName =
"groupADC_";
196 groupName.append(layerName);
197 const int ADC = ((myTower.tower)->adc())[tslice];
206 int max = myTower.maxADC;
207 int maxADCPlus1 =
max + 1;
210 groupName =
"groupTimeslice_";
211 groupName.append(layerName);
214 fill(groupName, maxADC);
221 groupName =
"groupTimeslice";
226 short unsigned int peak = (myTower.tower)->peak();
228 if (cpET > 0 && tslice < adcSize) {
230 adcBCID = ((myTower.tower)->adc())[tslice];
231 uint8_t bcidWord = (myTower.tower)->bcidVec()[peak];
233 if (bcidWord ==
char(0) || bcidWord ==
char(1)) {
235 fill(groupName, bcidBits, adcBCID);
237 else if (bcidWord ==
char(2) || bcidWord ==
char(3)) {
239 fill(groupName, bcidBits, adcBCID);
241 else if (bcidWord ==
char(4) || bcidWord ==
char(5)) {
243 fill(groupName, bcidBits, adcBCID);
245 else if (bcidWord ==
char(6) || bcidWord ==
char(7)) {
247 fill(groupName, bcidBits, adcBCID);
249 if (bcidWord ==
char(5) || bcidWord ==
char(7)) {
251 fill(groupName, bcidBits, adcBCID);
253 if (bcidWord ==
char(3) || bcidWord ==
char(7)) {
255 fill(groupName, bcidBits, adcBCID);
257 if (bcidWord ==
char(1)) {
259 fill(groupName, bcidBits, adcBCID);
267 if (cpET > 0 && tslice < adcSize && peak < (myTower.tower)->sat80Vec().size()) {
269 for(
unsigned int i = 0; i < 8; i++) {
270 if (sat80Word ==
char(i))
fill(groupName, sat80Word);
278 const std::vector<short unsigned int> &vADC((myTower.tower)->adc());
282 const std::string part =
getPartition(layer, myTower.tower->eta());
283 std::vector<short unsigned int>::const_iterator it = vADC.begin();
284 std::vector<short unsigned int>::const_iterator itE = vADC.end();
286 for (
int s = 0; it!= itE && s <
m_SliceNo; ++it, ++s) {
301 groupName =
"groupErrors_";
302 groupName.append(layerName);
304 bool isPedCorrOverflow =
false;
305 bool isPedCorrUnderflow =
false;
307 for (
auto pedCorr : (myTower.tower)->correction()) {
308 if ( pedCorr >= 511 ) isPedCorrOverflow =
true;
309 else if ( pedCorr <= -512 ) isPedCorrUnderflow =
true;
315 fill(groupName, eta_TT, mask_PedCorrOverflow, mask_PedCorrUnderflow);
322 const int maxErrorsPerLB = 10;
326 if ( (myTower.tower)->errorWord()) {
329 const int crate = coolId.
crate();
330 const int module = coolId.
module();
331 const int ypos = (crate < 4) ? module + crate * 16 :
module + (crate - 4) * 16;
336 std::lock_guard<std::mutex> lock(
m_mutex);
338 for (
int bit = 0; bit < 8; ++bit) {
345 if (err.get(bit + DataError::ChannelDisabled)) {
346 fill(
"group1DMCMErrorSummary", bit_2D);
348 if (crate < 4)
fill(
"groupErrorMCMField03", bit_2D, y_2D );
349 else fill(
"groupMCMErrorField47", bit_2D, y_2D );
351 if ((m_errorLB_tt_counter[currentLumiblock]<maxErrorsPerLB) && (!triggerTowerHasMcmError)) {
352 fill(
"groupMCMErrorEventNumbers", eventMonitor, bit_2D );
354 triggerTowerHasMcmError =
true;
361 if (err.get(bit + DataError::GLinkParity)) {
362 fill(
"group1DSubStatErrorSummary", bit_2D);
364 if (crate < 4)
fill(
"groupSubStatError03", bit_2D, y_2D );
365 else fill(
"groupSubStatError47", bit_2D, y_2D );
367 if ((m_errorLB_tt_counter[currentLumiblock]<maxErrorsPerLB) && (!triggerTowerHasSubstatusError)) {
368 fill(
"groupSubStatErrorEventNumbers", eventMonitor, bit_2D );
370 triggerTowerHasSubstatusError =
true;
374 if (triggerTowerHasMcmError || triggerTowerHasSubstatusError) {
375 m_errorLB_tt_counter[currentLumiblock]+=1;
378 if (err.get(DataError::ChannelDisabled) ||
379 err.get(DataError::MCMAbsent))
380 overview[crate] |= 1;
382 if (err.get(DataError::Timeout) || err.get(DataError::ASICFull) ||
383 err.get(DataError::EventMismatch) ||
384 err.get(DataError::BunchMismatch) ||
385 err.get(DataError::FIFOCorrupt) || err.get(DataError::PinParity))
386 overview[crate] |= (1 << 1);
388 if (err.get(DataError::GLinkParity) ||
389 err.get(DataError::GLinkProtocol) ||
390 err.get(DataError::FIFOOverflow) ||
391 err.get(DataError::ModuleError) || err.get(DataError::GLinkDown) ||
392 err.get(DataError::GLinkTimeout) || err.get(DataError::BCNMismatch))
393 overview[crate] |= (1 << 2);
400 auto save = std::make_unique<ErrorVector>(overview);
404 return StatusCode::FAILURE;
407 return StatusCode::SUCCESS;