36 std::vector<std::string> partitionsEM = {
"LArFCAL1C",
"LArEMECC",
"LArOverlapC",
"LArEMBC",
"LArEMBA",
"LArOverlapA",
"LArEMECA",
"LArFCAL1A"};
39 std::vector<std::string> partitionsHAD = {
"LArFCAL23C",
"LArHECC",
"TileEBC",
"TileLBC",
"TileLBA",
"TileEBA",
"LArHECA",
"LArFCAL23A"};
42 return StatusCode::SUCCESS;
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 triggerTowerHasError =
false;
81 for (
auto& myTower : vecMonTT) {
84 int cpET = (myTower.tower)->cpET();
85 int jepET = myTower.jepET;
87 bool isEM = (
layer == 0);
88 bool isHAD = (
layer == 1);
89 std::string layerName = (
layer == 0) ?
"EM" :
"HAD";
91 ATH_MSG_DEBUG(
"isEM " << isEM <<
" isHAD " << isHAD <<
" layerName " << layerName);
183 unsigned int tslice = (myTower.tower)->adcPeak();
184 unsigned int adcSize = ((myTower.tower)->
adc()).
size();
193 if (tslice < adcSize) {
196 const int ADC = ((myTower.tower)->
adc())[tslice];
205 int max = myTower.maxADC;
206 int maxADCPlus1 =
max + 1;
225 short unsigned int peak = (myTower.tower)->peak();
227 if (cpET > 0 && tslice < adcSize) {
229 adcBCID = ((myTower.tower)->
adc())[tslice];
230 uint8_t bcidWord = (myTower.tower)->bcidVec()[peak];
232 if (bcidWord ==
char(0) || bcidWord ==
char(1)) {
236 else if (bcidWord ==
char(2) || bcidWord ==
char(3)) {
240 else if (bcidWord ==
char(4) || bcidWord ==
char(5)) {
244 else if (bcidWord ==
char(6) || bcidWord ==
char(7)) {
248 if (bcidWord ==
char(5) || bcidWord ==
char(7)) {
252 if (bcidWord ==
char(3) || bcidWord ==
char(7)) {
256 if (bcidWord ==
char(1)) {
266 if (cpET > 0 && tslice < adcSize && peak < (myTower.tower)->sat80Vec().size()) {
268 for(
unsigned int i = 0;
i < 8;
i++) {
277 const std::vector<short unsigned int> &vADC((myTower.tower)->adc());
282 std::vector<short unsigned int>::const_iterator
it = vADC.begin();
283 std::vector<short unsigned int>::const_iterator
itE = vADC.end();
303 bool isPedCorrOverflow =
false;
304 bool isPedCorrUnderflow =
false;
306 for (
auto pedCorr : (myTower.tower)->correction()) {
307 if ( pedCorr >= 511 ) isPedCorrOverflow =
true;
308 else if ( pedCorr <= -512 ) isPedCorrUnderflow =
true;
314 fill(
groupName, eta_TT, mask_PedCorrOverflow, mask_PedCorrUnderflow);
321 const int maxErrorsPerLB = 10;
325 if ( (myTower.tower)->errorWord()) {
328 const int crate = coolId.
crate();
330 const int ypos = (crate < 4) ?
module + crate * 16 :
module + (crate - 4) * 16;
336 std::lock_guard<std::mutex> lock(
m_mutex);
339 for (
int bit = 0; bit < 8; ++bit) {
342 if (
err.get(bit + DataError::ChannelDisabled)) {
343 if (crate < 4)
fill(
"groupErrorField03", bit_2D, y_2D );
344 else fill(
"groupErrorField47", bit_2D, y_2D );
345 if (m_errorLB_tt_counter[currentLumiblock]<maxErrorsPerLB && (!triggerTowerHasError)) {
346 fill(
"groupASICErrorEventNumbers", eventMonitor, bit_2D );
347 m_errorLB_tt_counter[currentLumiblock]+=1;
348 triggerTowerHasError =
true;
352 if (
err.get(bit + DataError::GLinkParity)) {
353 if (crate < 4)
fill(
"groupStatus03", bit_2D, y_2D );
354 else fill(
"groupStatus47", bit_2D, y_2D );
355 fill(
"group1DErrorSummary", bit_2D);
357 if ((m_errorLB_tt_counter[currentLumiblock]<maxErrorsPerLB) && (!triggerTowerHasError)) {
358 fill(
"groupErrorEventNumbers", eventMonitor, bit_2D );
359 m_errorLB_tt_counter[currentLumiblock]+=1;
360 triggerTowerHasError =
true;
366 if (
err.get(DataError::ChannelDisabled) ||
367 err.get(DataError::MCMAbsent))
368 overview[crate] |= 1;
371 err.get(DataError::EventMismatch) ||
372 err.get(DataError::BunchMismatch) ||
373 err.get(DataError::FIFOCorrupt) ||
err.get(DataError::PinParity))
374 overview[crate] |= (1 << 1);
376 if (
err.get(DataError::GLinkParity) ||
377 err.get(DataError::GLinkProtocol) ||
378 err.get(DataError::FIFOOverflow) ||
379 err.get(DataError::ModuleError) ||
err.get(DataError::GLinkDown) ||
380 err.get(DataError::GLinkTimeout) ||
err.get(DataError::BCNMismatch))
381 overview[crate] |= (1 << 2);
394 auto save = std::make_unique<ErrorVector>(overview);
398 return StatusCode::FAILURE;
405 return StatusCode::SUCCESS;
409 std::vector<MonitorTT> &vecMonTT)
const
412 const double phi =
tt->phi();
417 const std::vector<uint_least8_t>& jepETvec =
tt->lut_jep();
418 if (jepETvec.size() > 0) jepET =
tt->jepET();
421 const std::vector<short unsigned int> &
ADC(
tt->adc() );
430 vecMonTT.push_back(monTT);
432 return StatusCode::SUCCESS;
439 const int slices = vFADC.size();
442 int maxAdc = vFADC[0];
443 for (
int sl = 1; sl <
slices; ++sl) {
444 if (vFADC[sl] > maxAdc) {
447 }
else if (vFADC[sl] == maxAdc)
462 for (
int sl = slbeg; sl < slend; ++sl) {
470 sum -= (slend - slbeg) *
min;
481 std::string
part =
"";
488 part =
"LArOverlapC";
494 part =
"LArOverlapA";
523 const std::string& weightName,
533 const std::vector<double> offset32 = {1.5, 0.5, -0.5, -1.5};
534 const std::vector<double> offset25 = {0.5, -0.5};
535 std::vector<double>
offset = {};
539 phiMod = std::floor(phiMod/4)*4. + 2.;
544 phiMod = std::floor(phiMod/2)*2. + 1.;
552 for (
auto phiOffset :
offset) {
557 ATH_MSG_DEBUG(
"etaTT_2D: " << etaTT_2D <<
" phiTT_2D: " << phiTT_2D <<
" weight_2D: " << weight_2D);
563 return StatusCode::SUCCESS;
571 const double phi = monTT.
tower->
phi();
574 const std::vector<double> offset32 = {1.5, 0.5, -0.5, -1.5};
575 const std::vector<double> offset25 = {0.5, -0.5};
576 std::vector<double>
offset = {};
594 for (
auto phiOffset :
offset) {
600 return StatusCode::SUCCESS;