264 if (!hLArDigitContainer.
isValid()) {
265 ATH_MSG_WARNING(
"The requested digit container key could not be retrieved. Was there a problem retrieving information from the run logger?");
269 ATH_MSG_DEBUG(
"hLArDigitContainer.size() " << hLArDigitContainer->size());
276 if (!hSCetContainer.
isValid()) {
277 ATH_MSG_WARNING(
"The requested SC ET container key could not be retrieved. Was there a problem retrieving information from the run logger?");
281 ATH_MSG_DEBUG(
"hSCetContainer.size() " << hSCetContainer->size());
287 if (!hSCetRecoContainer.
isValid()) {
288 ATH_MSG_WARNING(
"The requested SC ET reco container key could not be retrieved. Was there a problem retrieving information from the run logger?");
292 ATH_MSG_DEBUG(
"hSCetRecoContainer.size() " << hSCetRecoContainer->size());
298 if (!hLArLATOMEHeaderContainer.
isValid()) {
299 ATH_MSG_WARNING(
"The requested LATOME header container key could not be retrieved. Was there a problem retrieving information from the run logger?");
301 ATH_MSG_DEBUG(
"hLArLATOMEHeaderContainer.size() " << hLArLATOMEHeaderContainer->size());
310 ATH_MSG_WARNING(
"All of the requested containers are empty. Was there a problem retrieving information from the run logger?");
311 return StatusCode::SUCCESS;
314 BCID = thisEvent->bcid();
315 lumi_block = thisEvent->lumiBlock();
316 time_stamp = thisEvent->timeStamp();
335 bcCont = (*bcContHdl);
338 std::vector<std::vector<Digi_MonValues>> digiMonValueVec(
m_layerNames.size());
339 for (
auto& innerVec : digiMonValueVec) {
340 innerVec.reserve(1600);
344 for (
const LArDigit* pLArDigit : *hLArDigitContainer) {
347 if (!cabling->isOnlineConnected(
id))
350 const unsigned trueNSamples = pLArDigit->nsamples();
351 if (trueNSamples == 0)
353 Digi_Nsamples = trueNSamples;
354 const int cgain = pLArDigit->gain();
356 const Identifier offlineID = cabling->cnvToIdentifier(
id);
358 if (caloDetElement == 0) {
362 Digi_eta = caloDetElement->
eta_raw();
363 Digi_phi = caloDetElement->
phi_raw();
368 const int calosample = caloDetElement->
getSampling();
372 const unsigned iLyr = iLyrNS * 2 + side;
373 auto& lvaluemap_digi = digiMonValueVec[iLyr];
374 auto& lvaluemap_digi_ALL = digiMonValueVec.back();
378 Digi_partition = ThisPartition;
384 if (
m_bcMask.cellShouldBeMasked(bcCont,
id)) {
389 Pedestal = pedestals->
pedestal(
id, cgain);
398 Digi_SCChannel = scdigi->
Channel();
399 Digi_latomeSourceId = scdigi->
SourceId();
403 const std::vector<short>* digito = &pLArDigit->
samples();
406 std::vector<short>::const_iterator maxSam = std::max_element(digito->begin(), digito->end());
407 int thismaxPos = std::distance(digito->begin(), maxSam);
408 Digi_maxpos = thismaxPos + 1;
409 float ADC_max = pLArDigit->samples().at(Digi_maxpos - 1);
411 float ADC_0 = pLArDigit->samples().at(0);
416 float samp_sum = std::accumulate(digito->begin(), digito->end(), 0.0);
417 float samp_mean = samp_sum /
static_cast<float>(trueNSamples);
418 float sq_sum = std::inner_product(digito->begin(), digito->end(), digito->begin(), 0.0);
419 float rms_arg = sq_sum /
static_cast<float>(trueNSamples) - samp_mean * samp_mean;
424 Digi_ADC_RMS = std::sqrt(rms_arg);
428 Digi_Diff_ADC0_Ped = ADC_0 - Pedestal;
429 for (
unsigned i = 0; i < trueNSamples; ++i) {
430 badNotMasked =
false;
435 Digi_ADC = pLArDigit->samples().at(i);
437 Digi_ADC = Digi_ADC / 8;
440 Digi_Diff_ADC_Ped = Digi_ADC - Pedestal;
441 if (ADC_max != Pedestal) {
442 Digi_Diff_ADC_Ped_Norm = (Digi_ADC - Pedestal) / std::abs(ADC_max - Pedestal);
446 if (Digi_ADC != -1) {
453 if (ADC_max - Pedestal > 10 * PedestalRMS) {
456 if (notMasked && notBadQual && ADCped10RMS) {
460 lvaluemap_digi.emplace_back(Digi_eta, Digi_phi, Digi_ieta, Digi_iphi, Digi_sampos, Digi_ADC, Digi_latomeSourceIdBIN, Pedestal, Digi_maxpos,
461 Digi_partition, Digi_Diff_ADC_Ped_Norm, Digi_Diff_ADC_Ped, Digi_Diff_ADC0_Ped, Digi_ADC_RMS, BCID, lumi_block, passDigiNom,
463 lvaluemap_digi_ALL.emplace_back(Digi_eta, Digi_phi, Digi_ieta, Digi_iphi, Digi_sampos, Digi_ADC, Digi_latomeSourceIdBIN, Pedestal, Digi_maxpos,
464 Digi_partition, Digi_Diff_ADC_Ped_Norm, Digi_Diff_ADC_Ped, Digi_Diff_ADC0_Ped, Digi_ADC_RMS, BCID, lumi_block, passDigiNom,
472 for (
size_t ilayer = 0; ilayer < digiMonValueVec.size(); ++ilayer) {
473 const auto& tool = digiMonValueVec[ilayer];
474 auto digi_part_eta =
Monitored::Collection(
"Digi_part_eta", tool, [](
const auto& v) {
return v.digi_eta; });
475 auto digi_part_phi =
Monitored::Collection(
"Digi_part_phi", tool, [](
const auto& v) {
return v.digi_phi; });
476 auto digi_part_ieta =
Monitored::Collection(
"Digi_part_ieta", tool, [](
const auto& v) {
return v.digi_ieta; });
477 auto digi_part_iphi =
Monitored::Collection(
"Digi_part_iphi", tool, [](
const auto& v) {
return v.digi_iphi; });
478 auto digi_part_sampos =
Monitored::Collection(
"Digi_part_sampos", tool, [](
const auto& v) {
return v.digi_sampos; });
479 auto digi_part_adc =
Monitored::Collection(
"Digi_part_adc", tool, [](
const auto& v) {
return v.digi_adc; });
480 auto digi_part_latomesourceidbin =
Monitored::Collection(
"Digi_part_latomesourceidbin", tool, [](
const auto& v) {
return v.digi_latomesourceidbin; });
481 auto digi_part_pedestal =
Monitored::Collection(
"Digi_part_pedestal", tool, [](
const auto& v) {
return v.digi_pedestal; });
482 auto digi_part_maxpos =
Monitored::Collection(
"Digi_part_maxpos", tool, [](
const auto& v) {
return v.digi_maxpos; });
483 auto digi_part_partition =
Monitored::Collection(
"Digi_part_partition", tool, [](
const auto& v) {
return v.digi_partition; });
484 auto digi_part_diff_adc_ped_norm =
Monitored::Collection(
"Digi_part_diff_adc_ped_norm", tool, [](
const auto& v) {
return v.digi_diff_adc_ped_norm; });
485 auto digi_part_diff_adc_ped =
Monitored::Collection(
"Digi_part_diff_adc_ped", tool, [](
const auto& v) {
return v.digi_diff_adc_ped; });
486 auto digi_part_diff_adc0_ped =
Monitored::Collection(
"Digi_part_diff_adc0_ped", tool, [](
const auto& v) {
return v.digi_diff_adc0_ped; });
487 auto digi_part_bcid =
Monitored::Collection(
"Digi_part_BCID", tool, [](
const auto& v) {
return v.digi_bcid; });
488 auto digi_part_lb =
Monitored::Collection(
"Digi_part_LB", tool, [](
const auto& v) {
return v.digi_lb; });
489 auto digi_part_passDigiNom =
Monitored::Collection(
"Digi_part_passDigiNom", tool, [](
const auto& v) {
return v.digi_passDigiNom; });
490 auto digi_part_badNotMasked =
Monitored::Collection(
"Digi_part_badNotMasked", tool, [](
const auto& v) {
return v.digi_badNotMasked; });
491 auto digi_part_adc_rms =
Monitored::Collection(
"Digi_part_adc_rms", tool, [](
const auto& v) {
return v.digi_adc_rms; });
494 digi_part_adc, digi_part_latomesourceidbin, digi_part_pedestal, digi_part_maxpos, digi_part_diff_adc_ped_norm, digi_part_diff_adc_ped,
495 digi_part_diff_adc0_ped, digi_part_adc_rms, digi_part_bcid, digi_part_lb, digi_part_passDigiNom, digi_part_badNotMasked);
508 std::vector<std::vector<SC_MonValues>> scMonValueVec(
m_layerNames.size());
509 for (
auto& innerVec : scMonValueVec) {
510 innerVec.reserve(1600);
514 for (; itSC != itSC_e; ++itSC, ++itSCReco) {
516 if (itSCReco < hSCetRecoContainer->end()) {
517 rawSCReco = *itSCReco;
523 SC_SCChannel = rawSC->
chan();
526 if (!cabling->isOnlineConnected(
id))
529 const Identifier offlineID = cabling->cnvToIdentifier(
id);
532 if (caloDetElement == 0) {
533 ATH_MSG_ERROR(
"Cannot retrieve (eta,phi) coordinates for raw channels");
535 <<
"; rawSC->SourceId() = " << rawSC->
SourceId());
538 SC_eta = caloDetElement->
eta_raw();
539 SC_phi = caloDetElement->
phi_raw();
547 const unsigned iLyr = iLyrNS * 2 + side;
549 auto& lvaluemap_sc = scMonValueVec[iLyr];
550 auto& lvaluemap_sc_ALL = scMonValueVec.back();
564 eTgt0p325GeV =
false;
565 eTgt0lt0p325GeV =
false;
572 onlofflEmismatch =
false;
573 passSCNom0_0p325 =
false;
574 passSCNom0p325_1 =
false;
577 passSCNom10tauGt3 =
false;
578 saturNotMasked =
false;
579 OFCbOFNotMasked =
false;
580 notMaskedEoflNe0 =
false;
581 notMaskedEoflGt1 =
false;
582 nonZeroETofl =
false;
584 passSCNomInvalid =
false;
585 SC_ltdbsourceid = -1;
587 if (!
m_bcMask.cellShouldBeMasked(bcCont,
id)) {
595 unsigned int bcid_ind = 0;
597 for (
auto& SCe : rawSC->
bcids()) {
602 if (bcid_ind >= rawSC->
bcids().size()) {
603 ATH_MSG_WARNING(
"BCID not found in SC bcids list!! " << BCID <<
" BCIDs size: " << rawSC->
bcids().size() <<
", proposed index: " << bcid_ind);
604 }
else if (rawSC->
bcids().at(bcid_ind) != BCID) {
605 ATH_MSG_WARNING(
"BCID not found in SC bcids list!! " << BCID <<
" " << rawSC->
bcids().at(bcid_ind));
608 if (rawSC->
energies().size() > bcid_ind) {
609 SC_energy_onl = rawSC->
energies().at(bcid_ind);
611 ATH_MSG_WARNING(
"rawSC energies vector is too small for the requested BCID index " << bcid_ind <<
" (size is " << rawSC->
energies().size()
612 <<
", bcid vec size is " << rawSC->
bcids().size() <<
")");
620 if (rawSCReco != 0) {
621 if (rawSCReco->
energies().size() > 0) {
622 SC_energy_ofl = rawSCReco->
energies().at(0);
628 SC_ET_diff = SC_energy_onl - SC_energy_ofl;
629 SC_ET_onl = (SC_energy_onl * 12.5) / 1000;
630 SC_ET_ofl = (SC_energy_ofl * 12.5) / 1000;
631 SC_ET_onl_muscaled = event_mu > 0. ? SC_ET_onl / event_mu : SC_ET_onl;
633 if (rawSCReco != 0) {
638 SC_time = (SC_energy_ofl != 0) ? (
float)Etau / (float)SC_energy_ofl : Etau;
640 ATH_MSG_DEBUG(
"Energy onl - Energy ofl: " << SC_energy_onl <<
", " << SC_energy_ofl << std::endl);
641 if (SC_ET_onl != 0) {
646 if (SC_ET_onl > 0.325) {
648 }
else if (SC_ET_onl < 0.325 && SC_ET_onl > 0.) {
649 eTgt0lt0p325GeV =
true;
657 if (SC_ET_onl > 10) {
660 if (SC_ET_onl < 10) {
663 if (SC_ET_ofl != 0) {
669 if (rawSC->
satur().size() > bcid_ind) {
670 if (rawSC->
satur().at(bcid_ind)) {
672 saturNotMasked =
true;
681 if (rawSCReco != 0 && rawSCReco->
ofcbOverflow() ==
false) {
685 OFCbOFNotMasked =
true;
688 if (std::abs(SC_time) > 3) {
692 if (notMasked && notSatur && notOFCbOF) {
694 notMaskedEoflNe0 =
true;
697 notMaskedEoflGt1 =
true;
699 if (SC_energy_onl == -99999) {
700 passSCNomInvalid =
true;
701 SC_ltdbsourceid = ltdbHash;
706 if (eTgt0lt0p325GeV) {
707 passSCNom0_0p325 =
true;
709 if (eTgt0p325GeV && eTlt1GeV) {
710 passSCNom0p325_1 =
true;
718 passSCNom10tauGt3 =
true;
721 if (SC_energy_onl != SC_energy_ofl) {
722 onlofflEmismatch =
true;
727 lvaluemap_sc.emplace_back(SC_eta, SC_phi, SC_ieta, SC_iphi, SC_latomeSourceIdBIN, SC_ET_ofl, SC_ET_diff, SC_ET_onl, SC_ET_onl_muscaled, SC_time, BCID,
728 lumi_block, SC_ltdbsourceid, zeroET, passSCNomInvalid, passSCNom0_0p325, passSCNom0p325_1, passSCNom1, passSCNom10, passSCNom10tauGt3, saturNotMasked, OFCbOFNotMasked, notMaskedEoflNe0,
730 lvaluemap_sc_ALL.emplace_back(SC_eta, SC_phi, SC_ieta, SC_iphi, SC_latomeSourceIdBIN, SC_ET_ofl, SC_ET_diff, SC_ET_onl, SC_ET_onl_muscaled, SC_time,
731 BCID, lumi_block, SC_ltdbsourceid, zeroET, passSCNomInvalid, passSCNom0_0p325, passSCNom0p325_1, passSCNom1, passSCNom10, passSCNom10tauGt3, saturNotMasked, OFCbOFNotMasked,
732 notMaskedEoflNe0, notMaskedEoflGt1);
737 for (
size_t ilayer = 0; ilayer < scMonValueVec.size(); ++ilayer) {
738 const auto& tool = scMonValueVec[ilayer];
739 auto sc_part_eta =
Monitored::Collection(
"SC_part_eta", tool, [](
const auto& v) {
return v.sc_eta; });
740 auto sc_part_phi =
Monitored::Collection(
"SC_part_phi", tool, [](
const auto& v) {
return v.sc_phi; });
741 auto sc_part_ieta =
Monitored::Collection(
"SC_part_ieta", tool, [](
const auto& v) {
return v.sc_ieta; });
742 auto sc_part_iphi =
Monitored::Collection(
"SC_part_iphi", tool, [](
const auto& v) {
return v.sc_iphi; });
743 auto sc_part_latomesourceidbin =
Monitored::Collection(
"SC_part_latomesourceidbin", tool, [](
const auto& v) {
return v.sc_latomesourceidbin; });
744 auto sc_part_et_ofl =
Monitored::Collection(
"SC_part_et_ofl", tool, [](
const auto& v) {
return v.sc_et_ofl; });
745 auto sc_part_et_diff =
Monitored::Collection(
"SC_part_et_diff", tool, [](
const auto& v) {
return v.sc_et_diff; });
746 auto sc_part_et_onl =
Monitored::Collection(
"SC_part_et_onl", tool, [](
const auto& v) {
return v.sc_et_onl; });
747 auto sc_part_et_onl_muscaled =
Monitored::Collection(
"SC_part_et_onl_muscaled", tool, [](
const auto& v) {
return v.sc_et_onl_muscaled; });
748 auto sc_part_time =
Monitored::Collection(
"SC_part_time", tool, [](
const auto& v) {
return v.sc_time; });
749 auto sc_part_bcid =
Monitored::Collection(
"SC_part_BCID", tool, [](
const auto& v) {
return v.sc_bcid; });
751 auto sc_part_ltdbsourceid =
Monitored::Collection(
"SC_part_ltdbsourceid", tool, [](
const auto& v) {
return v.sc_ltdbsourceid; });
753 auto sc_zeroET =
Monitored::Collection(
"SC_part_zeroET", tool, [](
const auto& v) {
return v.sc_zeroET; });
754 auto sc_part_passSCNomInvalid =
Monitored::Collection(
"SC_part_passSCNomInvalid", tool, [](
const auto& v) {
return v.sc_passSCNomInvalid; });
755 auto sc_part_passSCNom0_0p325 =
Monitored::Collection(
"SC_part_passSCNom0_0p325", tool, [](
const auto& v) {
return v.sc_passSCNom0_0p325; });
756 auto sc_part_passSCNom0p325_1 =
Monitored::Collection(
"SC_part_passSCNom0p325_1", tool, [](
const auto& v) {
return v.sc_passSCNom0p325_1; });
757 auto sc_part_passSCNom1 =
Monitored::Collection(
"SC_part_passSCNom1", tool, [](
const auto& v) {
return v.sc_passSCNom1; });
758 auto sc_part_passSCNom10 =
Monitored::Collection(
"SC_part_passSCNom10", tool, [](
const auto& v) {
return v.sc_passSCNom10; });
759 auto sc_part_passSCNom10tauGt3 =
Monitored::Collection(
"SC_part_passSCNom10tauGt3", tool, [](
const auto& v) {
return v.sc_passSCNom10tauGt3; });
760 auto sc_part_saturNotMasked =
Monitored::Collection(
"SC_part_saturNotMasked", tool, [](
const auto& v) {
return v.sc_saturNotMasked; });
761 auto sc_part_OFCbOFNotMasked =
Monitored::Collection(
"SC_part_OFCbOFNotMasked", tool, [](
const auto& v) {
return v.sc_OFCbOFNotMasked; });
762 auto sc_part_notMaskedEoflNe0 =
Monitored::Collection(
"SC_part_notMaskedEoflNe0", tool, [](
const auto& v) {
return v.sc_notMaskedEoflNe0; });
763 auto sc_part_notMaskedEoflGt1 =
Monitored::Collection(
"SC_part_notMaskedEoflGt1", tool, [](
const auto& v) {
return v.sc_notMaskedEoflGt1; });
767 sc_part_et_ofl, sc_part_et_diff, sc_part_et_onl, sc_part_et_onl_muscaled, sc_part_time, sc_part_bcid, sc_part_lb, sc_part_ltdbsourceid, sc_zeroET, sc_part_passSCNomInvalid,
768 sc_part_passSCNom0_0p325, sc_part_passSCNom0p325_1, sc_part_passSCNom1, sc_part_passSCNom10, sc_part_passSCNom10tauGt3, sc_part_saturNotMasked, sc_part_OFCbOFNotMasked, sc_part_notMaskedEoflNe0,
769 sc_part_notMaskedEoflGt1);
780 for (
const LArLATOMEHeader* pLArLATOMEHeader : *hLArLATOMEHeaderContainer) {
781 event_size += pLArLATOMEHeader->ROBFragSize() + 48;
783 event_size /= (1024 * 1024 / 4);
789 return StatusCode::SUCCESS;