105 collNotFoundWarn_(ps.getUntrackedParameter<bool>(
"warnIfCollectionNotFound",
true)),
106 ebDigis_(ps.getParameter<edm::
InputTag>(
"EbDigiCollection"),
false, collNotFoundWarn_),
107 eeDigis_(ps.getParameter<edm::
InputTag>(
"EeDigiCollection"),
false, collNotFoundWarn_),
108 ebNoZsDigis_(ps.getParameter<edm::
InputTag>(
"EbUnsuppressedDigiCollection"),
false,
false ),
109 eeNoZsDigis_(ps.getParameter<edm::
InputTag>(
"EeUnsuppressedDigiCollection"),
false,
false ),
110 ebSrFlags_(ps.getParameter<edm::
InputTag>(
"EbSrFlagCollection"),
false, collNotFoundWarn_),
111 eeSrFlags_(ps.getParameter<edm::
InputTag>(
"EeSrFlagCollection"),
false, collNotFoundWarn_),
118 tps_(ps.getParameter<edm::
InputTag>(
"TrigPrimCollection"),
false, collNotFoundWarn_),
123 tmin(numeric_limits<int64_t>::
max()),
126 triggerTowerMap_(nullptr),
127 localReco_(ps.getParameter<bool>(
"LocalReco")),
128 weights_(ps.getParameter<
vector<double>>(
"weights")),
129 tpInGeV_(ps.getParameter<bool>(
"tpInGeV")),
130 firstFIRSample_(ps.getParameter<int>(
"ecalDccZs1stSample")),
131 useEventRate_(ps.getParameter<bool>(
"useEventRate")),
132 logErrForDccs_(nDccs_,
false),
135 histDir_(ps.getParameter<
string>(
"histDir")),
136 withEeSimHit_(
false),
137 withEbSimHit_(
false) {
149 tps_.setToken(collector);
154 double ebZsThr = ps.
getParameter<
double>(
"ebZsThrADCCount");
155 double eeZsThr = ps.
getParameter<
double>(
"eeZsThrADCCount");
175 LogInfo(
"OutputInfo") <<
" Ecal Digi Task histograms will be saved to '" <<
outputFile_.c_str() <<
"'";
177 LogInfo(
"OutputInfo") <<
" Ecal Digi Task histograms will NOT be saved";
187 for (vector<string>::iterator it = hists.begin(); it != hists.end(); ++it)
194 const int32_t
bx =
event.bunchCrossing();
195 if (bx < 1 || bx > 3564)
198 int64_t
t =
event.bunchCrossing() + (
event.orbitNumber() - 1) * 3564;
212 LogDebug(
"EcalSrValid") << __FILE__ <<
":" << __LINE__ <<
": "
213 <<
"Tmax = " <<
tmax <<
" x 25ns; Tmin = " <<
tmin <<
" x 25ns; L1A(Tmax) = " <<
l1aOfTmax
214 <<
"; L1A(Tmin) = " <<
l1aOfTmin <<
"\n";
228 edm::LogInfo(
"EcalSrValid") <<
"Size of TP collection: " <<
tps_->size() << std::endl
229 <<
"Size of EB SRF collection read from data: " <<
ebSrFlags_->size() << std::endl
230 <<
"Size of EB SRF collection computed from data TTFs: " <<
ebComputedSrFlags_->size()
232 <<
"Size of EE SRF collection read from data: " <<
eeSrFlags_->size() << std::endl
233 <<
"Size of EE SRF collection computed from data TTFs: " <<
eeComputedSrFlags_->size()
290 bool eventError =
false;
297 std::unique_ptr<std::array<std::array<std::array<energiesEe_t, nEeY>,
nEeX>,
nEndcaps>> eeEnergies =
298 std::make_unique<std::array<std::array<std::array<energiesEe_t, nEeY>, nEeX>,
nEndcaps>>();
300 for (
int iZ0 = 0; iZ0 <
nEndcaps; ++iZ0) {
301 for (
int iX0 = 0; iX0 <
nEeX; ++iX0) {
302 for (
int iY0 = 0; iY0 <
nEeY; ++iY0) {
305 (*eeEnergies)[iZ0][iX0][iY0].simE = 0;
306 (*eeEnergies)[iZ0][iX0][iY0].simHit = 0;
307 (*eeEnergies)[iZ0][iX0][iY0].gain12 =
false;
322 int iZ0 = frame.
id().
zside() > 0 ? 1 : 0;
324 if (iX0 < 0 || iX0 >= nEeX) {
325 edm::LogError(
"EcalSrValid") <<
"iX0 (= " << iX0 <<
") is out of range ("
326 <<
"[0," << nEeX - 1 <<
"]\n";
328 if (iY0 < 0 || iY0 >=
nEeY) {
329 edm::LogError(
"EcalSrValid") <<
"iY0 (= " << iY0 <<
") is out of range ("
330 <<
"[0," <<
nEeY - 1 <<
"]\n";
333 (*eeEnergies)[iZ0][iX0][iY0].noZsRecE =
frame2Energy(frame);
335 (*eeEnergies)[iZ0][iX0][iY0].gain12 =
true;
336 for (
int i = 0;
i < frame.
size(); ++
i) {
337 const int gain12Code = 0x1;
338 if (frame[
i].
gainId() != gain12Code)
339 (*eeEnergies)[iZ0][iX0][iY0].gain12 =
false;
344 (*eeEnergies)[iZ0][iX0][iY0].phi =
rad2deg * ((double)xtalPos.
phi());
345 (*eeEnergies)[iZ0][iX0][iY0].eta = xtalPos.
eta();
352 int iX0 =
iXY2cIndex(static_cast<const EEDetId&>(hit.
id()).ix());
353 int iY0 =
iXY2cIndex(static_cast<const EEDetId&>(hit.
id()).iy());
354 int iZ0 =
static_cast<const EEDetId&
>(hit.
id()).
zside() > 0 ? 1 : 0;
356 if (iX0 < 0 || iX0 >= nEeX) {
357 LogError(
"EcalSrValid") <<
"iX0 (= " << iX0 <<
") is out of range ("
358 <<
"[0," << nEeX - 1 <<
"]\n";
360 if (iY0 < 0 || iY0 >=
nEeY) {
361 LogError(
"EcalSrValid") <<
"iY0 (= " << iY0 <<
") is out of range ("
362 <<
"[0," <<
nEeY - 1 <<
"]\n";
365 (*eeEnergies)[iZ0][iX0][iY0].recE = hit.
energy();
370 for (vector<PCaloHit>::const_iterator it =
eeSimHits_->begin(); it !=
eeSimHits_->end(); ++it) {
377 int iZ0 = detId.zside() > 0 ? 1 : 0;
378 (*eeEnergies)[iZ0][iX0][iY0].simE += simHit.
energy();
379 ++(*eeEnergies)[iZ0][iX0][iY0].simHit;
383 pair<int, int> EExtalCoor[
nEeX][
nEeY][2];
385 for (
int iEeZ = 0; iEeZ < 2; ++iEeZ) {
386 for (
int iEeX = 0; iEeX <
nEeX; ++iEeX) {
387 for (
int iEeY = 0; iEeY <
nEeY; ++iEeY) {
388 EEcrystalShot[iEeX][iEeY][iEeZ] =
false;
389 EExtalCoor[iEeX][iEeY][iEeZ] = make_pair(0, 0);
397 int iX0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.
id()).ix());
398 int iY0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.
id()).iy());
399 int iZ0 =
static_cast<const EEDetId&
>(frame.
id()).
zside() > 0 ? 1 : 0;
400 if (iX0 < 0 || iX0 >= nEeX) {
401 LogError(
"EcalSrValid") <<
"iX0 (= " << iX0 <<
") is out of range ("
402 <<
"[0," << nEeX - 1 <<
"]\n";
404 if (iY0 < 0 || iY0 >=
nEeY) {
405 LogError(
"EcalSrValid") <<
"iY0 (= " << iY0 <<
") is out of range ("
406 <<
"[0," <<
nEeY - 1 <<
"]\n";
409 if (!EEcrystalShot[iX0][iY0][iZ0]) {
410 EEcrystalShot[iX0][iY0][iZ0] =
true;
413 cout <<
"Error: several digi for same crystal!";
418 (*eeEnergies)[iZ0][iX0][iY0].recE =
frame2Energy(frame);
421 (*eeEnergies)[iZ0][iX0][iY0].gain12 =
true;
422 for (
int i = 0;
i < frame.
size(); ++
i) {
423 const int gain12Code = 0x1;
424 if (frame[
i].
gainId() != gain12Code) {
425 (*eeEnergies)[iZ0][iX0][iY0].gain12 =
false;
431 bool highInterest =
false;
448 pair<int, int> ru =
dccCh(frame.
id());
453 <<
"RU " << frame.
id() <<
", "
454 <<
"DCC " << ru.first <<
" Ch : " << ru.second <<
": "
455 <<
"LI channel under ZS threshold.\n";
459 <<
"more ZS errors for this event...\n";
465 for (
int iEeZ = 0; iEeZ < 2; ++iEeZ) {
466 for (
int iEeX = 0; iEeX <
nEeX; ++iEeX) {
467 for (
int iEeY = 0; iEeY <
nEeY; ++iEeY) {
469 EExtalCoor[iEeX][iEeY][iEeZ].
first,
470 EExtalCoor[iEeX][iEeY][iEeZ].
second,
471 EEcrystalShot[iEeX][iEeY][iEeZ] ? 1 : 0);
476 for (
int iZ0 = 0; iZ0 <
nEndcaps; ++iZ0) {
477 for (
int iX0 = 0; iX0 <
nEeX; ++iX0) {
478 for (
int iY0 = 0; iY0 <
nEeY; ++iY0) {
479 double recE = (*eeEnergies)[iZ0][iX0][iY0].recE;
487 if (!(*eeEnergies)[iZ0][iX0][iY0].simHit) {
493 fill(
meEeRecVsSimE_, (*eeEnergies)[iZ0][iX0][iY0].simE, (*eeEnergies)[iZ0][iX0][iY0].recE);
500 int EEZs1RuCount[2][20][20];
501 int EEFullRuCount[2][20][20];
502 int EEForcedRuCount[2][20][20];
503 for (
int iZ(0); iZ < 2; iZ++) {
504 for (
int iX(0); iX < 20; iX++) {
505 for (
int iY(0); iY < 20; iY++) {
506 EEZs1RuCount[iZ][iX][iY] = 0;
507 EEFullRuCount[iZ][iX][iY] = 0;
508 EEForcedRuCount[iZ][iX][iY] = 0;
514 char eeSrfMark[2][20][20];
515 bzero(eeSrfMark,
sizeof(eeSrfMark));
520 int iX = srf.
id().
ix();
521 int iY = srf.
id().
iy();
523 if (iX < 1 || iY > 100)
525 <<
"Found an endcap SRF with an invalid det ID: " << srf.
id() <<
".\n";
526 ++eeSrfMark[zside > 0 ? 1 : 0][iX - 1][iY - 1];
527 if (eeSrfMark[zside > 0 ? 1 : 0][iX - 1][iY - 1] > 1)
528 throw cms::Exception(
"EcalSelectiveReadoutValidation") <<
"Duplicate SRF for supercrystal " << srf.
id() <<
".\n";
531 EEZs1RuCount[zside > 0 ? 1 : 0][iX - 1][iY - 1] += 1;
535 EEFullRuCount[zside > 0 ? 1 : 0][iX - 1][iY - 1] += 1;
540 EEForcedRuCount[zside > 0 ? 1 : 0][iX - 1][iY - 1] += 1;
543 for (
int iZ(0); iZ < 2; iZ++) {
544 int xOffset(iZ == 0 ? -40 : 20);
545 for (
int iX(0); iX < 20; iX++) {
546 for (
int iY(0); iY < 20; iY++) {
547 int GraphX = (iX + 1) + xOffset;
548 int GraphY = (iY + 1);
549 fill(
meZs1Ru_, GraphX, GraphY, EEZs1RuCount[iZ][iX][iY]);
558 <<
" ZS-flagged EE channels under "
559 "the ZS threshold, whose "
564 bool eventError =
false;
567 vector<pair<int, int>> xtalEtaPhi;
574 std::unique_ptr<std::array<std::array<energiesEb_t, nEbPhi>, nEbEta>> ebEnergies =
575 std::make_unique<std::array<std::array<energiesEb_t, nEbPhi>, nEbEta>>();
577 for (
int iEta0 = 0; iEta0 <
nEbEta; ++iEta0) {
578 for (
int iPhi0 = 0; iPhi0 <
nEbPhi; ++iPhi0) {
581 (*ebEnergies)[iEta0][iPhi0].simE = 0;
582 (*ebEnergies)[iEta0][iPhi0].simHit = 0;
583 (*ebEnergies)[iEta0][iPhi0].gain12 =
false;
584 xtalEtaPhi.push_back(pair<int, int>(iEta0, iPhi0));
596 int iEta0 =
iEta2cIndex(static_cast<const EBDetId&>(frame.
id()).ieta());
597 int iPhi0 =
iPhi2cIndex(static_cast<const EBDetId&>(frame.
id()).iphi());
598 if (iEta0 < 0 || iEta0 >= nEbEta) {
600 s <<
"EcalSelectiveReadoutValidation: "
601 <<
"iEta0 (= " << iEta0 <<
") is out of range ("
602 <<
"[0," << nEbEta - 1 <<
"]\n";
605 if (iPhi0 < 0 || iPhi0 >=
nEbPhi) {
607 s <<
"EcalSelectiveReadoutValidation: "
608 <<
"iPhi0 (= " << iPhi0 <<
") is out of range ("
609 <<
"[0," <<
nEbPhi - 1 <<
"]\n";
613 (*ebEnergies)[iEta0][iPhi0].noZsRecE =
frame2Energy(frame);
614 (*ebEnergies)[iEta0][iPhi0].gain12 =
true;
615 for (
int i = 0;
i < frame.
size(); ++
i) {
616 const int gain12Code = 0x1;
617 if (frame[
i].
gainId() != gain12Code)
618 (*ebEnergies)[iEta0][iPhi0].gain12 =
false;
623 (*ebEnergies)[iEta0][iPhi0].phi =
rad2deg * ((double)xtalPos.
phi());
624 (*ebEnergies)[iEta0][iPhi0].eta = xtalPos.
eta();
628 for (vector<PCaloHit>::const_iterator it =
ebSimHits_->begin(); it !=
ebSimHits_->end(); ++it) {
631 int iEta = detId.
ieta();
633 int iPhi = detId.iphi();
635 (*ebEnergies)[iEta0][iPhi0].simE += simHit.
energy();
636 ++(*ebEnergies)[iEta0][iPhi0].simHit;
642 for (
int iEta0 = 0; iEta0 <
nEbEta; ++iEta0) {
643 for (
int iPhi0 = 0; iPhi0 <
nEbPhi; ++iPhi0) {
644 crystalShot[iEta0][iPhi0] =
false;
645 EBxtalCoor[iEta0][iPhi0] = make_pair(0, 0);
654 int iEta =
static_cast<const EBDetId&
>(frame.
id()).ieta();
655 int iPhi =
static_cast<const EBDetId&
>(frame.
id()).iphi();
658 if (iEta0 < 0 || iEta0 >= nEbEta) {
659 throw(
cms::Exception(
"EcalSelectiveReadoutValidation") <<
"iEta0 (= " << iEta0 <<
") is out of range ("
660 <<
"[0," << nEbEta - 1 <<
"]");
662 if (iPhi0 < 0 || iPhi0 >=
nEbPhi) {
663 throw(
cms::Exception(
"EcalSelectiveReadoutValidation") <<
"iPhi0 (= " << iPhi0 <<
") is out of range ("
664 <<
"[0," <<
nEbPhi - 1 <<
"]");
666 assert(iEta0 >= 0 && iEta0 < nEbEta);
668 if (!crystalShot[iEta0][iPhi0]) {
669 crystalShot[iEta0][iPhi0] =
true;
672 cout <<
"Error: several digi for same crystal!";
679 (*ebEnergies)[iEta0][iPhi0].gain12 =
true;
680 for (
int i = 0;
i < frame.
size(); ++
i) {
681 const int gain12Code = 0x1;
682 if (frame[
i].
gainId() != gain12Code) {
683 (*ebEnergies)[iEta0][iPhi0].gain12 =
false;
689 bool highInterest =
false;
708 pair<int, int> ru =
dccCh(frame.
id());
713 <<
"RU " << frame.
id() <<
", "
714 <<
"DCC " << ru.first <<
" Ch : " << ru.second <<
": "
715 <<
"LI channel under ZS threshold.\n";
719 <<
"more ZS errors for this event...\n";
725 for (
int iEta0 = 0; iEta0 <
nEbEta; ++iEta0) {
726 for (
int iPhi0 = 0; iPhi0 <
nEbPhi; ++iPhi0)
728 EBxtalCoor[iEta0][iPhi0].
first,
729 EBxtalCoor[iEta0][iPhi0].
second,
730 crystalShot[iEta0][iPhi0] ? 1. : 0.);
737 int iEta =
static_cast<const EBDetId&
>(hit.
id()).ieta();
738 int iPhi =
static_cast<const EBDetId&
>(hit.
id()).iphi();
741 if (iEta0 < 0 || iEta0 >= nEbEta) {
742 LogError(
"EcalSrValid") <<
"iEta0 (= " << iEta0 <<
") is out of range ("
743 <<
"[0," << nEbEta - 1 <<
"]\n";
745 if (iPhi0 < 0 || iPhi0 >=
nEbPhi) {
746 LogError(
"EcalSrValid") <<
"iPhi0 (= " << iPhi0 <<
") is out of range ("
747 <<
"[0," <<
nEbPhi - 1 <<
"]\n";
749 (*ebEnergies)[iEta0][iPhi0].recE = hit.
energy();
753 for (
unsigned int i = 0;
i < xtalEtaPhi.size(); ++
i) {
754 int iEta0 = xtalEtaPhi[
i].first;
755 int iPhi0 = xtalEtaPhi[
i].second;
758 double recE = energies.
recE;
776 int EBZs1RuCount[2][17][72];
777 int EBFullRuCount[2][17][72];
778 int EBForcedRuCount[2][17][72];
779 std::pair<int, int> EBtowerCoor[2][17][72];
780 for (
int iZ(0); iZ < 2; iZ++) {
781 for (
int iEta(0); iEta < 17; iEta++) {
782 for (
int iPhi(0); iPhi < 72; iPhi++) {
783 EBZs1RuCount[iZ][iEta][iPhi] = 0;
784 EBFullRuCount[iZ][iEta][iPhi] = 0;
785 EBForcedRuCount[iZ][iEta][iPhi] = 0;
792 char ebSrfMark[2][17][72];
793 bzero(ebSrfMark,
sizeof(ebSrfMark));
798 int iPhi = srf.
id().
iphi();
804 if (iEtaAbs < 1 || iEtaAbs > 17 || iPhi < 1 || iPhi > 72)
806 <<
"Found a barrel SRF with an invalid det ID: " << srf.
id() <<
".\n";
807 ++ebSrfMark[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1];
808 if (ebSrfMark[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1] > 1)
809 throw cms::Exception(
"EcalSelectiveReadoutValidation") <<
"Duplicate SRF for RU " << srf.
id() <<
".\n";
811 EBtowerCoor[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1] = std::pair<int, int>(srf.
id().
ieta(), srf.
id().
iphi());
815 EBZs1RuCount[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1] += 1;
818 EBFullRuCount[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1] += 1;
822 EBForcedRuCount[iZ > 0 ? 1 : 0][iEtaAbs - 1][iPhi - 1] += 1;
825 for (
int iZ(0); iZ < 2; iZ++) {
826 for (
int iEta(0); iEta < 17; iEta++) {
827 for (
int iPhi(0); iPhi < 72; iPhi++) {
828 float x(EBtowerCoor[iZ][iEta][iPhi].
first);
829 float y(EBtowerCoor[iZ][iEta][iPhi].
second);
839 <<
" ZS-flagged EB channels under "
840 "the ZS threshold, whose "
872 "ECAL DCC event fragment size;Dcc id; "
880 "LI channel payload per DCC;Dcc id; "
888 "HI channel payload per DCC;Dcc id; "
896 "ECAL DCC event fragment size;Dcc id; "
904 "ECAL Barrel low interest crystal data payload;"
905 "Event size (kB);Nevts",
912 "Endcap low interest crystal data payload;"
913 "Event size (kB);Nevts",
920 "ECAL low interest crystal data payload;"
921 "Event size (kB);Nevts",
928 "Barrel high interest crystal data payload;"
929 "Event size (kB);Nevts",
936 "Endcap high interest crystal data payload;"
937 "Event size (kB);Nevts",
944 "ECAL high interest crystal data payload;"
945 "Event size (kB);Nevts",
952 "Barrel data volume;Event size (kB);Nevts",
959 "Endcap data volume;Event size (kB);Nevts",
966 "ECAL data volume;Event size (kB);Nevts",
973 "ECAL crystal channel occupancy after zero suppression;"
974 "iX -200 / iEta / iX + 100;"
975 "iY / iPhi (starting from -10^{o}!);"
989 tpUnit =
string(
"TP hw unit");
991 title =
string(
"Trigger primitive TT E_{T};E_{T} ") + tpUnit +
string(
";Event Count");
1001 "Trigger primitive TT flag;Flag number;Event count",
1006 title =
string(
"Trigger tower flag vs TP;E_{T}(TT) (") + tpUnit +
string(
");Flag number");
1011 "Trigger tower flag vs #sumE_{T};"
1021 "Trigger primitive Et (TP) vs #sumE_{T};"
1022 "E_{T} (sum) (GeV);"
1029 "Trigger primitive E_{T};"
1039 "Full Read-out readout unit;"
1040 "iX - 40 / iEta / iX + 20;"
1041 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1052 "Number of Full-readout-flagged readout units;"
1053 "FRO RU count;Event count",
1060 "Number of EB Full-readout-flagged readout units;"
1061 "FRO RU count;Event count",
1068 "Number of EE Full-readout-flagged readout units;"
1069 "FRO RU count;Event count",
1076 "Readout unit with ZS-thr-1 flag;"
1077 "iX - 40 / iEta / iX + 20;"
1078 "iY0 / iPhi0 (iPhi = 1 at phi = 0 rad);"
1089 "ECAL readout unit with forced bit of SR flag on;"
1090 "iX - 40 / iEta / iX + 20;"
1091 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1102 "Low interest trigger tower flags;"
1115 "Mid interest trigger tower flags;"
1128 "High interest trigger tower flags;"
1141 "Trigger tower flags with forced bit set;"
1152 const float ebMinNoise = -1.;
1153 const float ebMaxNoise = 1.;
1155 const float eeMinNoise = -1.;
1156 const float eeMaxNoise = 1.;
1158 const float ebMinE = ebMinNoise;
1159 const float ebMaxE = ebMaxNoise;
1161 const float eeMinE = eeMinNoise;
1162 const float eeMaxE = eeMaxNoise;
1164 const int evtMax = 500;
1166 meEbRecE_ =
book1D(ibooker,
"hEbRecE",
"Crystal reconstructed energy;E (GeV);Event count", 100, ebMinE, ebMaxE);
1168 meEbEMean_ =
bookProfile(ibooker,
"hEbEMean",
"EE <E_hit>;event #;<E_hit> (GeV)", evtMax, .5, evtMax + .5);
1173 "(rec E of crystal without deposited energy)"
1174 ";Rec E (GeV);Event count",
1181 "Emulated ouput of ZS FIR filter for EB "
1182 "low interest crystals;"
1191 "Emulated ouput of ZS FIR filter for EB "
1192 "high interest crystals;"
1207 meEbSimE_ =
book1D(ibooker,
"hEbSimE",
"EB hit crystal simulated energy", 100, ebMinE, ebMaxE);
1209 meEbRecEHitXtal_ =
book1D(ibooker,
"hEbRecEHitXtal",
"EB rec energy of hit crystals", 100, ebMinE, ebMaxE);
1213 "Crystal simulated vs reconstructed energy;"
1214 "Esim (GeV);Erec GeV);Event count",
1224 "Crystal no-zs simulated vs reconstructed "
1226 "Esim (GeV);Erec GeV);Event count",
1236 "EE crystal reconstructed energy;E (GeV);"
1242 meEeEMean_ =
bookProfile(ibooker,
"hEeEMean",
"<E_{EE hit}>;event;<E_{hit}> (GeV)", evtMax, .5, evtMax + .5);
1247 "(rec E of crystal without deposited energy);"
1248 "E (GeV);Event count",
1255 "Emulated ouput of ZS FIR filter for EE "
1256 "low interest crystals;"
1265 "Emulated ouput of ZS FIR filter for EE "
1266 "high interest crystals;"
1281 meEeSimE_ =
book1D(ibooker,
"hEeSimE",
"EE hit crystal simulated energy", 100, eeMinE, eeMaxE);
1283 meEeRecEHitXtal_ =
book1D(ibooker,
"hEeRecEHitXtal",
"EE rec energy of hit crystals", 100, eeMinE, eeMaxE);
1287 "EE crystal simulated vs reconstructed energy;"
1288 "Esim (GeV);Erec GeV);Event count",
1298 "EE crystal no-zs simulated vs "
1300 "energy;Esim (GeV);Erec GeV);Event count",
1310 "TTFlags and SR Flags mismatch;"
1311 "iX - 40 / iEta / iX + 20;"
1312 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1323 "hIncompleteFROMap",
1324 "Incomplete full-readout-flagged readout units;"
1325 "iX - 40 / iEta / iX + 20;"
1326 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1336 "hIncompleteFROCnt",
1337 "Number of incomplete full-readout-flagged "
1339 "Number of RUs;Event count;",
1345 "hIncompleteFRORateMap",
1346 "Incomplete full-readout-flagged readout units;"
1347 "iX - 40 / iEta / iX + 20;"
1348 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1349 "Incomplete error rate",
1359 "Dropped full-readout-flagged readout units;"
1360 "iX - 40 / iEta / iX + 20;"
1361 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1372 "Number of dropped full-readout-flagged "
1373 "RU count;RU count;Event count",
1380 "Number of zero-suppressed-flagged RU fully "
1382 "RU count;Event count",
1388 buf <<
"Number of LI EB channels below the " <<
ebZsThr_ / 4.
1389 <<
" ADC count ZS threshold;"
1390 "Channel count;Event count",
1394 buf <<
"Number of LI EE channels below the " <<
eeZsThr_ / 4.
1395 <<
" ADC count ZS theshold;"
1396 "Channel count;Event count",
1401 "Number of LI channels below the ZS threshold;"
1402 "Channel count;Event count",
1409 "Number of EB channels below the ZS "
1410 "threshold in a LI but fully readout RU;"
1411 "Channel count;Event count;",
1418 "Number EE channels below the ZS threshold"
1419 " in a LI but fully readout RU;"
1420 "Channel count;Event count",
1427 "Number of LI channels below the ZS threshold "
1428 "in a LI but fully readout RU;"
1429 "Channel count;Event count",
1435 "hDroppedFRORateMap",
1436 "Dropped full-readout-flagged readout units"
1437 "iX - 40 / iEta / iX + 20;"
1438 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1449 "Complete zero-suppressed-flagged readout units;"
1450 "iX - 40 / iEta / iX + 20;"
1451 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1462 "Complete zero-suppressed-flagged readout units;"
1463 "iX - 40 / iEta / iX + 20;"
1464 "iY / iPhi (iPhi = 1 at phi = 0 rad);"
1465 "Completeness rate",
1481 s << (s.str().empty() ?
"" :
", ") << *it;
1484 if (!s.str().empty()) {
1485 LogWarning(
"Configuration") <<
"Parameter 'histList' contains some unknown histogram(s). "
1486 "Check spelling. Following name were not found: "
1496 for (
int iTTFlag(0); iTTFlag < 8; iTTFlag++) {
1497 TTFlagCount[iTTFlag] = 0;
1499 for (
int iTtEta(0); iTtEta <
nTtEta; iTtEta++) {
1500 for (
int iTtPhi(0); iTtPhi <
nTtPhi; iTtPhi++) {
1501 LiTTFlagCount[iTtEta][iTtPhi] = 0;
1502 MiTTFlagCount[iTtEta][iTtPhi] = 0;
1503 HiTTFlagCount[iTtEta][iTtPhi] = 0;
1507 for (
int iEt(0); iEt < 100; iEt++) {
1518 double lsb10bitsEB(ebItr == physMap.end() ? 0. : ebItr->second.EtSat / 1024.);
1520 double lsb10bitsEE(eeItr == physMap.end() ? 0. : eeItr->second.EtSat / 1024.);
1526 unsigned int ADC = it->compressedEt();
1528 double lsb10bits(0.);
1530 lsb10bits = lsb10bitsEB;
1532 lsb10bits = lsb10bitsEE;
1536 uint32_t lutGrp = 999;
1537 if (itgrp != lutGrpMap.end())
1538 lutGrp = itgrp->second;
1541 if (itLut != lutMap.end()) {
1542 const unsigned int* lut = (itLut->second).getLut();
1543 for (
unsigned int i = 0;
i < 1024;
i++)
1544 if (ADC == (0xff & lut[
i])) {
1550 tpEt = lsb10bits * tpg10bits;
1552 tpEt = it->compressedEt();
1554 int iEta = it->id().ieta();
1556 int iPhi = it->id().iphi();
1558 double etSum =
ttEtSums[iEta0][iPhi0];
1561 if ((iE >= 0) && (iE < 100)) {
1570 ++TTFlagCount[it->ttFlag()];
1571 if ((it->ttFlag() & 0x3) == 0) {
1572 LiTTFlagCount[iEta0][iPhi0] += 1;
1573 }
else if ((it->ttFlag() & 0x3) == 1) {
1574 MiTTFlagCount[iEta0][iPhi0] += 1;
1575 }
else if ((it->ttFlag() & 0x3) == 3) {
1576 HiTTFlagCount[iEta0][iPhi0] += 1;
1578 if ((it->ttFlag() & 0x4)) {
1587 for (
int ittflag(0); ittflag < 8; ittflag++) {
1590 for (
int iTtEta(0); iTtEta <
nTtEta; iTtEta++) {
1591 for (
int iTtPhi(0); iTtPhi <
nTtPhi; iTtPhi++) {
1598 for (
int iE(0); iE < 100; iE++) {
1602 for (
int iE(0); iE < 40; iE++) {
1619 for (
unsigned int digis = 0; digis <
ebDigis_->
size(); ++digis) {
1625 for (
unsigned int digis = 0; digis <
eeDigis_->
size(); ++digis) {
1631 for (
unsigned iDcc0 = 0; iDcc0 <
nDccs_; ++iDcc0) {
1661 template <
class T,
class U>
1663 const DetId& xtalId = frame.id();
1664 typedef typename U::key_type RuDetId;
1666 typename U::const_iterator srf = srFlagColl.find(ruId);
1668 bool highInterest =
false;
1671 if (srf != srFlagColl.end()) {
1672 flag = srf->value() & ~
EcalSrFlag::SRF_FORCED_MASK;
1679 pair<int, int> ch =
dccCh(xtalId);
1688 int iEta0 =
iEta2cIndex(static_cast<const EBDetId&>(xtalId).ieta());
1689 int iPhi0 =
iPhi2cIndex(static_cast<const EBDetId&>(xtalId).iphi());
1707 int iX0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.id()).ix());
1708 int iY0 =
iXY2cIndex(static_cast<const EEDetId&>(frame.id()).iy());
1709 int iZ0 =
static_cast<const EEDetId&
>(frame.id()).
zside() > 0 ? 1 : 0;
1723 if (ch.second < 1 || ch.second > 68) {
1725 <<
"Error in DCC channel retrieval for crystal with detId " << xtalId.
rawId()
1726 <<
"DCC channel out of allowed range [1..68]\n";
1756 static std::atomic<bool> firstCall{
true};
1757 bool expected =
true;
1758 if (firstCall.compare_exchange_strong(expected,
false)) {
1767 double adc2GeV = 0.;
1771 }
else if (
typeid(
EEDataFrame) ==
typeid(frame)) {
1781 double gainInv[] = {12., 1., 6., 12.};
1783 for (
int i = 0;
i <
n; ++
i) {
1784 acc +=
weights_[
i] * frame[
i].adc() * gainInv[frame[
i].gainId()] * adc2GeV;
1793 throw cms::Exception(
"InvalidParameter") <<
"Wrong type of DetId passed to the "
1794 "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1795 "An ECAL DetId was expected.\n";
1808 const int oneXtalPhi0 = iTtPhi0 * 5;
1809 const int oneXtalEta0 = (iTtEta0 -
nOneEeTtEta) * 5;
1814 if (detId.
rawId() & 0x8000) {
1825 <<
"Wrong type of DetId passed to the method "
1826 "EcalSelectiveReadoutValidation::dccCh(const DetId&). "
1827 "A valid EcalTriggerTower, EcalBarrel or EcalEndcap DetId was expected. "
1829 << xtalId.
rawId() <<
".\n";
1835 result.first = EcalElecId.
dccId();
1838 throw cms::Exception(
"OutOfRange") <<
"Got an invalid DCC ID, DCCID = " << result.first <<
" for DetId 0x" << hex
1839 << detId.
rawId() <<
" and 0x" << xtalId.
rawId() <<
dec <<
"\n";
1842 result.second = EcalElecId.
towerId();
1844 if (result.second < 1 || result.second > 68) {
1845 throw cms::Exception(
"OutOfRange") <<
"Got an invalid DCC channel ID, DCC_CH = " << result.second <<
" for DetId 0x"
1846 << hex << detId.
rawId() <<
" and 0x" << xtalId.
rawId() <<
dec <<
"\n";
1858 int iDCC = EcalElecId.
dccId();
1859 int iDccChan = EcalElecId.
towerId();
1860 const bool ignoreSingle =
true;
1871 if (eeGeometry ==
nullptr || ebGeometry ==
nullptr) {
1879 for (
int iEta0 = 0; iEta0 <
nTtEta; ++iEta0) {
1880 for (
int iPhi0 = 0; iPhi0 <
nTtPhi; ++iPhi0) {
1912 int innerTTEtas[] = {0, 1, 54, 55};
1913 for (
unsigned iRing = 0; iRing <
sizeof(innerTTEtas) /
sizeof(innerTTEtas[0]); ++iRing) {
1914 int iTtEta0 = innerTTEtas[iRing];
1930 for (
unsigned iTtPhi0 = 0; iTtPhi0 <
nTtPhi - 1; iTtPhi0 += 2) {
1931 double et = .5 * (
ttEtSums[iTtEta0][iTtPhi0] +
ttEtSums[iTtEta0][iTtPhi0 + 1]);
1936 ttEtSums[iTtEta0][iTtPhi0 + 1] = et;
1945 double weights[] = {0., -1 / 3., -1 / 3., -1 / 3., 0., 1.};
1947 double adc2GeV = 0.;
1950 }
else if (
typeid(frame) ==
typeid(
EEDataFrame)) {
1954 throw cms::Exception(
"Severe Error") << __FILE__ <<
":" << __LINE__ <<
": "
1955 <<
"this is a bug. Please report it.\n";
1960 const int n = min<int>(frame.size(),
sizeof(
weights) /
sizeof(weights[0]));
1962 double gainInv[] = {12., 1., 6., 12};
1964 for (
int i = offset;
i <
n; ++
i) {
1966 if (iframe >= 0 && iframe < frame.size()) {
1967 acc += weights[
i] * frame[iframe].adc() * gainInv[frame[iframe].gainId()] * adc2GeV;
1979 if (result ==
nullptr) {
1990 if (result ==
nullptr) {
2008 if (result ==
nullptr) {
2019 if (result ==
nullptr) {
2034 const char* option) {
2037 MonitorElement*
result = ibook.
bookProfile2D(name, title, nbinx, xmin, xmax, nbiny, ymin, ymax, 0, 0, 0, option);
2038 if (result ==
nullptr) {
2068 log <<
"Avalailable histograms (DQM monitor elements): \n";
2070 log << it->first <<
": " << it->second <<
"\n";
2072 log <<
"\nTo include an histogram add its name in the vstring parameter "
2073 "'histograms' of the EcalSelectiveReadoutValidation module\n";
2077 double ruHeaderPayload = 0.;
2078 const int firstEbDcc0 =
nEeDccs / 2;
2079 for (
int iDcc0 = firstEbDcc0; iDcc0 < firstEbDcc0 +
nEbDccs; ++iDcc0) {
2087 double ruHeaderPayload = 0.;
2088 const unsigned firstEbDcc0 =
nEeDccs / 2;
2089 for (
unsigned iDcc0 = 0; iDcc0 <
nDccs_; ++iDcc0) {
2091 if (iDcc0 == firstEbDcc0)
2101 const std::vector<int>& firWeights,
2104 const int nFIRTaps = 6;
2106 const vector<int>&
w = firWeights;
2110 bool gain12saturated =
false;
2111 const int gain12 = 0x01;
2112 const int lastFIRSample = firstFIRSample + nFIRTaps - 1;
2115 for (
int iSample = firstFIRSample - 1; iSample < lastFIRSample; ++iSample, ++iWeight) {
2116 if (iSample >= 0 && iSample < frame.
size()) {
2118 if (sample.
gainId() != gain12)
2119 gain12saturated =
true;
2120 LogTrace(
"DccFir") << (iSample >= firstFIRSample ?
"+" :
"") << sample.
adc() <<
"*(" << w[iWeight] <<
")";
2121 acc += sample.
adc() * w[iWeight];
2124 <<
": Not enough samples in data frame or 'ecalDccZs1stSample' module "
2125 "parameter is not valid...";
2132 acc = (acc >= 0) ? (acc >> 8) : -(-acc >> 8);
2137 LogTrace(
"DccFir") <<
"acc: " << acc <<
"\n"
2138 <<
"saturated: " << (gain12saturated ?
"yes" :
"no") <<
"\n";
2141 *saturated = gain12saturated;
2148 const int nFIRTaps = 6;
2149 vector<int> firWeights(nFIRTaps, 0);
2150 const static int maxWeight = 0xEFF;
2151 for (
unsigned i = 0;
i <
min((
size_t)nFIRTaps, normalizedWeights.size()); ++
i) {
2152 firWeights[
i] = lround(normalizedWeights[
i] * (1 << 10));
2153 if (
abs(firWeights[
i]) > maxWeight) {
2154 firWeights[
i] = firWeights[
i] < 0 ? -maxWeight : maxWeight;
2161 bool notNormalized =
false;
2162 bool notInt =
false;
2163 for (
unsigned i = 0;
i < weightsForZsFIR.size(); ++
i) {
2164 if (weightsForZsFIR[
i] > 1.)
2165 notNormalized =
true;
2166 if ((
int)weightsForZsFIR[
i] != weightsForZsFIR[
i])
2169 if (notInt && notNormalized) {
2170 throw cms::Exception(
"InvalidParameter") <<
"weigtsForZsFIR paramater values are not valid: they "
2171 <<
"must either be integer and uses the hardware representation "
2172 <<
"of the weights or less or equal than 1 and used the normalized "
2173 <<
"representation.";
2176 if (notNormalized) {
2177 firWeights_ = vector<int>(weightsForZsFIR.size());
2178 for (
unsigned i = 0;
i < weightsForZsFIR.size(); ++
i) {
2185 log <<
"Input weights for FIR: ";
2186 for (
unsigned i = 0;
i < weightsForZsFIR.size(); ++
i) {
2187 log << weightsForZsFIR[
i] <<
"\t";
2191 log <<
"\nActual FIR weights: ";
2194 s2 += firWeights_[
i] * firWeights_[
i];
2198 log <<
"\nNormalized FIR weights after hw representation rounding: ";
2211 <<
"' for SRP algorithm result check.\n";
2219 <<
"' for Selective Readout decision application check.\n";
2229 typedef typename T::const_iterator SrFlagCollectionConstIt;
2230 typedef typename T::key_type MyRuDetIdType;
2231 SrFlagCollectionConstIt itSrfFromData = srfFromData.begin();
2232 SrFlagCollectionConstIt itComputedSr = computedSrf.begin();
2234 while (itSrfFromData != srfFromData.end() || itComputedSr != computedSrf.end()) {
2235 MyRuDetIdType inconsistentRu = 0;
2236 bool inconsistent =
false;
2237 if (itComputedSr == computedSrf.end() ||
2238 (itSrfFromData != srfFromData.end() && itSrfFromData->id() < itComputedSr->id())) {
2240 pair<int, int> ch =
dccCh(itSrfFromData->id());
2241 srpAlgoErrorLog_ <<
event.id() <<
": " << itSrfFromData->id() <<
", DCC " << ch.first <<
" ch " << ch.second
2242 <<
" found in data (SRF:" << itSrfFromData->flagName()
2243 <<
") but not in the set of SRFs computed from the data TTF.\n";
2244 inconsistentRu = itSrfFromData->id();
2245 inconsistent =
true;
2247 }
else if (itSrfFromData == srfFromData.end() ||
2248 (itComputedSr != computedSrf.end() && itComputedSr->id() < itSrfFromData->id())) {
2250 pair<int, int> ch =
dccCh(itComputedSr->id());
2252 srpAlgoErrorLog_ <<
event.id() <<
": " << itComputedSr->id() <<
", DCC " << ch.first <<
" ch " << ch.second
2253 <<
" not found in data. Computed SRF: " << itComputedSr->flagName() <<
".\n";
2254 inconsistentRu = itComputedSr->id();
2255 inconsistent =
true;
2260 if (itComputedSr->value() != itSrfFromData->value()) {
2261 pair<int, int> ch =
dccCh(itSrfFromData->id());
2262 srpAlgoErrorLog_ <<
event.id() <<
", " << itSrfFromData->id() <<
", DCC " << ch.first <<
" ch " << ch.second
2263 <<
", SRF inconsistency: "
2264 <<
"from data: " << itSrfFromData->flagName()
2265 <<
", computed from TTF: " << itComputedSr->flagName() <<
"\n";
2266 inconsistentRu = itComputedSr->id();
2267 inconsistent =
true;
2269 if (itComputedSr != computedSrf.end())
2271 if (itSrfFromData != srfFromData.end())
2285 <<
"Argument of EcalSelectiveReadoutValidation::dccId(const EcalTrigTowerDetId&) "
2286 <<
"must be a barrel trigger tower Id\n";
2288 return dccCh(detId).first;
2307 buf <<
"List of DCCs found in the first processed event: ";
2309 for (
unsigned iDcc = 0; iDcc <
nDccs_; ++iDcc) {
2311 buf << (first ?
"" :
", ") << (iDcc +
minDccId_);
2315 buf <<
"\nOnly DCCs from this list will be considered for error logging\n";
2318 LogInfo(
"EcalSrValid") << buf.str();
2323 typedef typename T::const_iterator SrFlagCollectionConstIt;
2324 typedef typename T::key_type MyRuDetIdType;
2326 for (SrFlagCollectionConstIt itSrf = srfs.begin(); itSrf != srfs.end(); ++itSrf) {
2327 int flag = itSrf->value() & ~
EcalSrFlag::SRF_FORCED_MASK;
2328 pair<int, int> ru =
dccCh(itSrf->id());
2340 << ru.second <<
") is 'Full readout' "
2341 <<
"while none of its channel was read out\n";
2348 << ru.second <<
") is 'Full readout' "
2350 <<
getCrystalCount(ru.first, ru.second) <<
" channels were read out.\n";
2370 if (iDcc < minDccId_ || iDcc >
maxDccId_) {
2372 }
else if (10 <= iDcc && iDcc <= 45) {
2379 iDccPhi = iDcc - 45;
2380 switch (iDccPhi * 100 + iDccCh) {
void configFirWeights(const std::vector< double > &weightsForZsFIR)
void printAvailableHists()
double getDccSrDependentPayload(int iDcc0, double nReadRus, double nReadXtals) const
MonitorElement * meEbFullRoCnt_
int iPhi2cIndex(int iPhi) const
std::string srApplicationErrorLogFileName_
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meEbRecVsSimE_
MonitorElement * meForcedRu_
MonitorElement * meChOcc_
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
int getCrystalCount(int iDcc, int iDccCh)
CollHandle< EBDigiCollection > ebNoZsDigis_
MonitorElement * meEeEMean_
static std::vector< std::string > checklist log
std::ofstream srApplicationErrorLog_
Output ascii file for unconsistency between Xtals and RU Flags.
MonitorElement * meZsErrType1Cnt_
MonitorElement * meTtfVsTp_
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
double getDccOverhead(subdet_t subdet) const
static const int nEeX
EE crystal grid size along X.
MonitorElement * meDroppedFROMap_
int xtalGraphX(const EEDetId &id) const
double getDccEventSize(int iDcc0, double nReadXtals) const
int nIncompleteFRO_
Counter of FRO-flagged RU only partial data.
MonitorElement * meCompleteZSRateMap_
MonitorElement * meEeFullRoCnt_
int cIndex2iPhi(int i) const
virtual void setCurrentFolder(std::string const &fullpath)
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
bool verbose_
Verbosity switch.
static const int nEbPhi
number of crystals along Phi in EB
MonitorElement * meEeZsErrCnt_
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
MonitorElement * meEbNoise_
int iXY2cIndex(int iX) const
static const int SRF_FORCED_MASK
static const double rad2deg
Conversion factor from radian to degree.
MonitorElement * meEeZsErrType1Cnt_
int cIndex2iTtPhi(int i) const
int simHit
energy reconstructed from zero-suppressed digi
CollHandle< EcalTrigPrimDigiCollection > tps_
Sin< T >::type sin(const T &t)
MonitorElement * meVolBLI_
Geom::Phi< T > phi() const
void analyzeEB(const edm::Event &event, const edm::EventSetup &es)
constexpr uint32_t rawId() const
get the raw id
edm::ESGetToken< EcalTPGLutIdMap, EcalTPGLutIdMapRcd > lutMapHandle
std::vector< EcalRecHit >::const_iterator const_iterator
Geom::Theta< T > theta() const
MonitorElement * meEbHiZsFir_
MonitorElement * meDccVolFromData_
int nEeZsErrors_
Counter of EE ZS errors (LI channel below ZS threshold)
CollHandle< FEDRawDataCollection > fedRaw_
int towerId() const
get the tower id
MonitorElement * meTpVsEtSum_
void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override
MonitorElement * meDccLiVol_
void analyzeEE(const edm::Event &event, const edm::EventSetup &es)
MonitorElement * meEeNoise_
const_iterator begin() const
The iterator returned can not safely be used across threads.
MonitorElement * meVolELI_
static const int nEeDccs
number of DCCs for EE
std::pair< int, int > getDCCandSC(EcalScDetId id) const
Log< level::Error, false > LogError
int gainId() const
get the gainId (2 bits)
MonitorElement * meTtfVsEtSum_
double ttEtSums[nTtEta][nTtPhi]
MonitorElement * meEbZsErrCnt_
MonitorElement * meEeLiZsFir_
MonitorElement * meDroppedFROCnt_
MonitorElement * meTpMap_
size_t size() const
Lenght of the data buffer in bytes.
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
const EcalTrigTowerDetId & id() const override
MonitorElement * meDccHiVol_
MonitorElement * meEbLiZsFir_
MonitorElement * meLiTtf_
bool registerHist(const std::string &name, const std::string &title)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
int ieta() const
get the tower ieta
void setTtEtSums(const edm::EventSetup &es, const EBDigiCollection &ebDigis, const EEDigiCollection &eeDigis)
int zside() const
get the z-side of the tower (1/-1)
MonitorElement * meVolBHI_
const EcalScDetId & id() const override
static const int minDccId_
static const int nEbEta
number of crystals along Eta in EB
int cIndex2iTtEta(int i) const
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > hTriggerTowerMap
MonitorElement * meIncompleteFROMap_
double frame2EnergyForTp(const T &frame, int offset=0) const
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
~EcalSelectiveReadoutValidation() override
Destructor.
CollHandle< EESrFlagCollection > eeComputedSrFlags_
static const int nTtPhi
Number of Trigger Towers along Phi.
int xtalGraphY(const EEDetId &id) const
CollHandle< EEDigiCollection > eeDigis_
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< int > firWeights_
void checkSrApplication(const edm::Event &event, T &srfs)
std::string outputFile_
Output file for histograms.
CollHandle< RecHitCollection > eeRecHits_
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
int ietaAbs() const
get the absolute value of the tower ieta
static const int maxDccId_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * bookProfile2D(DQMStore::IBooker &, const std::string &name, const std::string &title, int nbinx, double xmin, double xmax, int nbiny, double ymin, double ymax, const char *option="")
void analyzeDataVolume(const edm::Event &e, const edm::EventSetup &es)
double getL1aRate() const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
int iTtEta2cIndex(int iEta) const
edm::ESGetToken< EcalTPGLutGroup, EcalTPGLutGroupRcd > lutGrpHandle
MonitorElement * meEeHiZsFir_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoToken
void analyze(edm::Event const &e, edm::EventSetup const &c) override
Analyzes the event.
void anaDigi(const T &frame, const U &srFlagColl)
CollHandle< EBSrFlagCollection > ebSrFlags_
MonitorElement * meEbNoZsRecVsSimE_
edm::ESGetToken< EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd > physHandle
MonitorElement * meEeSimE_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void updateL1aRate(const edm::Event &event)
static const int SRF_FULL
Abs< T >::type abs(const T &t)
int nCompleteZS_
Counter of ZS-flagged RU fully read out.
CollHandle< std::vector< PCaloHit > > eeSimHits_
static int dccZsFIR(const EcalDataFrame &frame, const std::vector< int > &firWeights, int firstFIRSample, bool *saturated=nullptr)
MonitorElement * meDroppedFRORateMap_
int nEeFROCnt_
Counter of EE FRO-flagged RUs.
int ieta() const
get the crystal ieta
bool logSrApplicationErrors_
std::vector< double > weights_
void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meCompleteZSCnt_
int iTtPhi2cIndex(int iPhi) const
int iEta2cIndex(int iEta) const
MonitorElement * meMiTtf_
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
virtual TProfile * getTProfile()
MonitorElement * meVolEHI_
void read(const edm::Event &event)
int cIndex2iEta(int i) const
MonitorElement * book2D(DQMStore::IBooker &, const std::string &name, const std::string &title, int nxbins, double xmin, double xmax, int nybins, double ymin, double ymax)
std::vector< EcalScDetId > getEcalScDetId(int DCCid, int DCC_Channel, bool ignoreSingleCrystal=true) const
CollHandle< EESrFlagCollection > eeSrFlags_
static const int nDccRus_[nDccs_]
number of RUs for each DCC
MonitorElement * meEeRecVsSimE_
static const int nOneEeTtEta
Number of Trigger Towers in an endcap along Eta.
int nEbFROCnt_
Counter of EB FRO-flagged RUs.
static const int nEbDccs
number of DCCs for EB
Log< level::Info, false > LogInfo
MonitorElement * meZsErrCnt_
CollHandle< std::vector< PCaloHit > > ebSimHits_
int nEbZsErrors_
Counter of EB ZS errors (LI channel below ZS threshold)
static const int scEdge
Number of crystals along a supercrystal edge.
MonitorElement * meFullRoCnt_
double recE
energy reconstructed from unsuppressed digi
static const double tmax[3]
void readAllCollections(const edm::Event &e)
static std::vector< int > getFIRWeights(const std::vector< double > &normalizedWeights)
int iphi() const
get the tower iphi
static const int ebTtEdge
Number of crystals along an EB TT.
MonitorElement * book1D(DQMStore::IBooker &, const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
EcalSelectiveReadoutValidation(const edm::ParameterSet &ps)
Constructor.
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
constexpr int16_t xOffset
DetId id() const
get the id
double getEeEventSize(double nReadXtals) const
MonitorElement * meForcedTtf_
MonitorElement * meDccVol_
static const int kByte_
number of bytes in 1 kByte:
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
MonitorElement * meVolLI_
bool ebRuActive_[nEbEta/ebTtEdge][nEbPhi/ebTtEdge]
double getBytesPerCrystal() const
int nPerRu_[nDccs_][nDccChs_]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > ecalmapping
MonitorElement * bookProfile(DQMStore::IBooker &, const std::string &name, const std::string &title, int nbins, double xmin, double xmax)
int getRuCount(int iDcc0) const
MonitorElement * meCompleteZSMap_
MonitorElement * meIncompleteFRORateMap_
MonitorElement * meVolHI_
EcalTrigTowerDetId readOutUnitOf(const EBDetId &xtalId) const
CollHandle< EEDigiCollection > eeNoZsDigis_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
int dccId(const EcalScDetId &detId) const
MonitorElement * meEeRecE_
std::map< std::string, std::string > availableHistList_
const_iterator end() const
std::map< uint32_t, EcalTPGLut > EcalTPGLutMap
bool isRuComplete_[nDccs_][nDccChs_]
int ruGraphX(const EcalScDetId &id) const
static const int nTtEta
Number of Trigger Towers along Eta.
MonitorElement * meEeNoZsRecVsSimE_
MonitorElement * meEbZsErrType1Cnt_
MonitorElement * meEbRecE_
MonitorElement * meEeRecEHitXtal_
int nDroppedFRO_
Counter of FRO-flagged RU dropped from data.
void setToken(edm::ConsumesCollector &collector)
void fill(MonitorElement *me, float x)
std::map< uint32_t, EcalTPGPhysicsConst::Item > EcalTPGPhysicsConstMap
MonitorElement * meL1aRate_
int ruGraphY(const EcalScDetId &id) const
void compareSrfColl(const edm::Event &event, T &srfFromData, T &computedSrf)
std::pair< int, int > dccCh(const DetId &xtalId) const
double frame2Energy(const EcalDataFrame &frame) const
double noZsRecE
sim hit energy sum
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
MonitorElement * meEbRecEHitXtal_
MonitorElement * meEbSimE_
std::ofstream srpAlgoErrorLog_
Output ascii file for unconsistency on SR flags.
static const int nEeY
EE crystal grid size along Y.
CollHandle< EBDigiCollection > ebDigis_
std::map< uint32_t, EcalTPGPhysicsConst::Item >::const_iterator EcalTPGPhysicsConstMapIterator
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
UseScope< MonitorElementData::Scope::RUN > UseRunScope
double getEbEventSize(double nReadXtals) const
MonitorElement * meSRFlagsConsistency_
static const unsigned nDccs_
Total number of DCCs.
MonitorElement * meZs1Ru_
MonitorElement * meFullRoRu_
std::string srpAlgoErrorLogFileName_
MonitorElement * bookFloat(DQMStore::IBooker &, const std::string &name)
MonitorElement * meHiTtf_
std::vector< bool > logErrForDccs_
static const int nEndcaps
number of endcaps
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
std::map< uint32_t, EcalTPGLut >::const_iterator EcalTPGLutMapItr
const EcalTrigTowerConstituentsMap * triggerTowerMap_
void analyzeTP(const edm::Event &event, const edm::EventSetup &es)
std::set< std::string > histList_
const EcalElectronicsMapping * elecMap_
CollHandle< RecHitCollection > ebRecHits_
int adc() const
get the ADC sample (12 bits)
bool eeRuActive_[nEndcaps][nEeX/scEdge][nEeY/scEdge]
MonitorElement * meIncompleteFROCnt_
CollHandle< EBSrFlagCollection > ebComputedSrFlags_
MonitorElement * meEbEMean_
constexpr Detector det() const
get the detector field from this detid