60 : name_(_name), runTypes_(), source_(), active_(
false) {
63 std::vector<std::string>
runTypes(
params.getUntrackedParameter<std::vector<std::string>>(
"runTypes"));
64 for (
unsigned iT(0); iT <
runTypes.size(); ++iT)
71 std::vector<std::string>
const &meNames(sourceParams.getParameterNames());
72 for (
unsigned iP(0); iP < meNames.size(); ++iP) {
82 if (!sItr->second->retrieve(_igetter, &failedPath)) {
83 edm::LogError(
"EcalDQM") <<
name_ <<
": MESet " << sItr->first <<
"@" << failedPath <<
" not found";
112 std::map<EcalLogicID, MonCrystalConsistencyDat> crystalConsistencies;
113 std::map<EcalLogicID, MonTTConsistencyDat> towerConsistencies;
114 std::map<EcalLogicID, MonMemChConsistencyDat> memChannelConsistencies;
115 std::map<EcalLogicID, MonMemTTConsistencyDat> memTowerConsistencies;
144 int nDigis(dItr->getBinContent());
145 int gain(gainME.getBinContent(
id));
146 int chid(chidME.getBinContent(
id));
147 int gainswitch(gainswitchME.getBinContent(
id));
150 if (
gain > 0 || chid > 0 || gainswitch > 0) {
152 data.setProcessedEvents(nDigis);
153 data.setProblematicEvents(
gain + chid + gainswitch);
155 data.setProblemsID(chid);
156 data.setProblemsGainSwitch(gainswitch);
158 int channelStatus(qItr->getBinContent());
159 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
160 data.setTaskStatus(channelBad);
170 for (
unsigned iTower(1); iTower <= 68; ++iTower) {
177 bool towerBad(
false);
178 for (
unsigned iD(0); iD <
channels.size(); ++iD) {
179 int n(digiME.getBinContent(
channels[iD]));
182 int channelStatus(qualityME.getBinContent(
channels[iD]));
183 if (channelStatus ==
kBad || channelStatus ==
kMBad)
187 int towerid(toweridME.getBinContent(
eid));
188 int blocksize(blocksizeME.getBinContent(
eid));
189 int l1a(l1aME.getBinContent(iDCC + 1, iTower));
190 int bx(bxME.getBinContent(iDCC + 1, iTower));
192 if (towerid > 0 || blocksize > 0 || l1a > 0 ||
bx > 0) {
194 data.setProcessedEvents(nDigis);
195 data.setProblematicEvents(towerid + blocksize + l1a +
bx);
196 data.setProblemsID(towerid);
197 data.setProblemsSize(blocksize);
198 data.setProblemsLV1(l1a);
199 data.setProblemsBunchX(
bx);
200 data.setTaskStatus(towerBad);
208 edm::LogInfo(
"EcalDQM") <<
" Looping over MEM channels and towers";
210 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
211 unsigned iDCC(
memDCC[iMD]);
215 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
218 int nDigis(memdigiME.getBinContent(pnid));
219 int memchid(memchidME.getBinContent(pnid));
220 int memgain(memgainME.getBinContent(pnid));
222 if (memchid > 0 || memgain > 0) {
225 data.setProcessedEvents(nDigis);
226 data.setProblematicEvents(memchid + memgain);
227 data.setProblemsID(memchid);
228 data.setProblemsGainZero(memgain);
230 int channelStatus(pnqualityME.getBinContent(pnid));
231 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
232 data.setTaskStatus(channelBad);
238 for (
unsigned iTower(69); iTower <= 70; ++iTower) {
242 bool towerBad(
false);
243 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
245 int n(memdigiME.getBinContent(pnid));
248 int channelStatus(pnqualityME.getBinContent(pnid));
249 if (channelStatus ==
kBad || channelStatus ==
kMBad)
253 int towerid(memtoweridME.getBinContent(
eid));
254 int blocksize(memblocksizeME.getBinContent(
eid));
256 if (towerid > 0 || blocksize > 0) {
259 data.setProcessedEvents(nDigis);
260 data.setProblematicEvents(towerid + blocksize);
261 data.setProblemsID(towerid);
262 data.setProblemsSize(blocksize);
263 data.setTaskStatus(towerBad);
274 if (!crystalConsistencies.empty()) {
279 if (!towerConsistencies.empty()) {
284 if (!memChannelConsistencies.empty()) {
289 if (!memTowerConsistencies.empty()) {
294 }
catch (std::runtime_error &
e) {
315 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
317 if (wl <= 0 || wl >= 5)
318 throw cms::Exception(
"InvalidConfiguration") <<
"Laser Wavelength";
319 repl[
"wl"] = std::to_string(
wl);
338 std::map<EcalLogicID, MonLaserBlueDat> l1Amp;
339 std::map<EcalLogicID, MonTimingLaserBlueCrystalDat> l1Time;
340 std::map<EcalLogicID, MonPNBlueDat> l1PN;
341 std::map<EcalLogicID, MonLaserGreenDat> l2Amp;
342 std::map<EcalLogicID, MonTimingLaserGreenCrystalDat> l2Time;
343 std::map<EcalLogicID, MonPNGreenDat> l2PN;
344 std::map<EcalLogicID, MonLaserIRedDat> l3Amp;
345 std::map<EcalLogicID, MonTimingLaserIRedCrystalDat> l3Time;
346 std::map<EcalLogicID, MonPNIRedDat> l3PN;
347 std::map<EcalLogicID, MonLaserRedDat> l4Amp;
348 std::map<EcalLogicID, MonTimingLaserRedCrystalDat> l4Time;
349 std::map<EcalLogicID, MonPNRedDat> l4PN;
360 for (std::map<int, unsigned>::iterator wlItr(
wlToME_.begin()); wlItr !=
wlToME_.end(); ++wlItr) {
361 int wl(wlItr->first);
362 unsigned iM(wlItr->second);
364 static_cast<MESetMulti const &>(ampME).use(iM);
365 static_cast<MESetMulti const &>(aopME).use(iM);
366 static_cast<MESetMulti const &>(timeME).use(iM);
367 static_cast<MESetMulti const &>(qualityME).use(iM);
368 static_cast<MESetMulti const &>(pnME).use(iM);
369 static_cast<MESetMulti const &>(pnQualityME).use(iM);
376 float aEntries(aItr->getBinEntries());
386 float ampMean(aItr->getBinContent());
387 float ampRms(aItr->getBinError() *
std::sqrt(aEntries));
397 int channelStatus(qItr->getBinContent());
398 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
459 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
460 unsigned iDCC(
memDCC[iMD]);
464 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
467 float entries(pnME.getBinEntries(pnid));
471 float mean(pnME.getBinContent(pnid));
474 float pedestalEntries(pnPedestalME.getBinEntries(pnid));
475 float pedestalMean(pnPedestalME.getBinContent(pnid));
476 float pedestalRms(pnPedestalME.getBinError(pnid) *
std::sqrt(pedestalEntries));
478 int channelStatus(pnQualityME.getBinContent(pnid));
479 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
484 data.setADCMeanG1(-1.);
485 data.setADCRMSG1(-1.);
486 data.setPedMeanG1(-1.);
487 data.setPedRMSG1(-1.);
490 data.setPedMeanG16(pedestalMean);
491 data.setPedRMSG16(pedestalRms);
492 data.setTaskStatus(channelBad);
496 data.setADCMeanG1(-1.);
497 data.setADCRMSG1(-1.);
498 data.setPedMeanG1(-1.);
499 data.setPedRMSG1(-1.);
502 data.setPedMeanG16(pedestalMean);
503 data.setPedRMSG16(pedestalRms);
504 data.setTaskStatus(channelBad);
508 data.setADCMeanG1(-1.);
509 data.setADCRMSG1(-1.);
510 data.setPedMeanG1(-1.);
511 data.setPedRMSG1(-1.);
514 data.setPedMeanG16(pedestalMean);
515 data.setPedRMSG16(pedestalRms);
516 data.setTaskStatus(channelBad);
520 data.setADCMeanG1(-1.);
521 data.setADCRMSG1(-1.);
522 data.setPedMeanG1(-1.);
523 data.setPedRMSG1(-1.);
526 data.setPedMeanG16(pedestalMean);
527 data.setPedRMSG16(pedestalRms);
528 data.setTaskStatus(channelBad);
562 }
catch (std::runtime_error &
e) {
581 for (
unsigned iG(0); iG != nG; ++iG) {
585 repl[
"gain"] = std::to_string(
gain);
593 for (
unsigned iG(0); iG != nGPN; ++iG) {
597 repl[
"pngain"] = std::to_string(
gain);
613 std::map<EcalLogicID, MonPedestalsDat> pedestals;
614 std::map<EcalLogicID, MonPNPedDat> pnPedestals;
622 for (std::map<int, unsigned>::iterator gainItr(
gainToME_.begin()); gainItr !=
gainToME_.end(); ++gainItr) {
623 int gain(gainItr->first);
624 int iM(gainItr->second);
626 static_cast<MESetMulti const &>(pedestalME).use(iM);
627 static_cast<MESetMulti const &>(qualityME).use(iM);
632 float entries(pItr->getBinEntries());
638 float mean(pItr->getBinContent());
642 if (pedestals.find(logicID) == pedestals.end()) {
669 int channelStatus(qItr->getBinContent());
670 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
672 data.setTaskStatus(
true);
678 for (std::map<int, unsigned>::iterator gainItr(
pnGainToME_.begin()); gainItr !=
pnGainToME_.end(); ++gainItr) {
679 int gain(gainItr->first);
680 int iM(gainItr->second);
682 static_cast<MESetMulti const &>(pnPedestalME).use(iM);
683 static_cast<MESetMulti const &>(pnQualityME).use(iM);
685 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
686 unsigned iDCC(
memDCC[iMD]);
690 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
693 float entries(pnPedestalME.getBinEntries(pnid));
697 float mean(pnPedestalME.getBinContent(pnid));
698 float rms(pnPedestalME.getBinError(pnid) *
std::sqrt(entries));
701 if (pnPedestals.find(logicID) == pnPedestals.end()) {
722 int channelStatus(pnQualityME.getBinContent(pnid));
723 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
725 data.setTaskStatus(
true);
733 if (!pedestals.empty())
735 if (!pnPedestals.empty())
737 }
catch (std::runtime_error &
e) {
756 std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
764 float entries(pItr->getBinEntries());
770 float mean(pItr->getBinContent());
777 int channelStatus(qItr->getBinContent());
778 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
779 data.setTaskStatus(channelBad);
785 if (!pedestals.empty())
787 }
catch (std::runtime_error &
e) {
806 for (
unsigned iG(0); iG != nG; ++iG) {
810 repl[
"gain"] = std::to_string(
gain);
818 for (
unsigned iG(0); iG != nGPN; ++iG) {
822 repl[
"pngain"] = std::to_string(
gain);
840 std::map<EcalLogicID, MonTestPulseDat>
amplitude;
841 std::map<EcalLogicID, MonPulseShapeDat> shape;
842 std::map<EcalLogicID, MonPNMGPADat> pnAmplitude;
852 for (std::map<int, unsigned>::iterator gainItr(
gainToME_.begin()); gainItr !=
gainToME_.end(); ++gainItr) {
853 int gain(gainItr->first);
854 int iM(gainItr->second);
856 static_cast<MESetMulti const &>(amplitudeME).use(iM);
857 static_cast<MESetMulti const &>(shapeME).use(iM);
858 static_cast<MESetMulti const &>(qualityME).use(iM);
863 float entries(aItr->getBinEntries());
869 float mean(aItr->getBinContent());
900 int channelStatus(qItr->getBinContent());
901 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
903 data.setTaskStatus(
true);
908 for (
unsigned iSM(0); iSM < 54; ++iSM) {
909 std::vector<float>
samples(10, 0.);
911 unsigned nId(ids.size());
914 for (
unsigned iD(0); iD < nId; ++iD) {
920 if (shapeME.getBinEntries(
id, 1) < 1.)
925 for (
int i(0);
i < 10; ++
i)
926 samples[
i] += shapeME.getBinContent(
id,
i + 1);
932 for (
int i(0);
i < 10; ++
i)
935 if (shape.find(logicID) == shape.end()) {
937 std::vector<float> defval(10, -1.);
948 for (std::map<int, unsigned>::iterator gainItr(
pnGainToME_.begin()); gainItr !=
pnGainToME_.end(); ++gainItr) {
949 int gain(gainItr->first);
950 int iM(gainItr->second);
952 static_cast<MESetMulti const &>(pnAmplitudeME).use(iM);
953 static_cast<MESetMulti const &>(pnQualityME).use(iM);
955 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
956 unsigned iDCC(
memDCC[iMD]);
960 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
963 float entries(pnAmplitudeME.getBinEntries(pnid));
967 float mean(pnAmplitudeME.getBinContent(pnid));
968 float rms(pnAmplitudeME.getBinError(pnid) *
std::sqrt(entries));
969 float pedestalEntries(pnPedestalME.getBinEntries(pnid));
970 float pedestalMean(pnPedestalME.getBinContent(pnid));
971 float pedestalRms(pnPedestalME.getBinError(pnid) *
std::sqrt(pedestalEntries));
974 if (pnAmplitude.find(logicID) == pnAmplitude.end()) {
999 data.setPedMeanG16(pedestalMean);
1000 data.setPedRMSG16(pedestalRms);
1004 int channelStatus(pnQualityME.getBinContent(pnid));
1005 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1007 data.setTaskStatus(
true);
1019 if (!pnAmplitude.empty())
1021 }
catch (std::runtime_error &
e) {
1040 std::map<EcalLogicID, MonTimingCrystalDat>
timing;
1048 float entries(tItr->getBinEntries());
1054 float mean(tItr->getBinContent());
1061 int channelStatus(qItr->getBinContent());
1062 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1063 data.setTaskStatus(channelBad);
1071 }
catch (std::runtime_error &
e) {
1092 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
1094 if (
wl != 1 &&
wl != 2)
1095 throw cms::Exception(
"InvalidConfiguration") <<
"Led Wavelength";
1096 repl[
"wl"] = std::to_string(
wl);
1115 std::map<EcalLogicID, MonLed1Dat> l1Amp;
1116 std::map<EcalLogicID, MonTimingLed1CrystalDat> l1Time;
1118 std::map<EcalLogicID, MonLed2Dat> l2Amp;
1119 std::map<EcalLogicID, MonTimingLed2CrystalDat> l2Time;
1131 for (std::map<int, unsigned>::iterator wlItr(
wlToME_.begin()); wlItr !=
wlToME_.end(); ++wlItr) {
1132 int wl(wlItr->first);
1133 unsigned iM(wlItr->second);
1135 static_cast<MESetMulti const &>(ampME).use(iM);
1136 static_cast<MESetMulti const &>(aopME).use(iM);
1137 static_cast<MESetMulti const &>(timeME).use(iM);
1138 static_cast<MESetMulti const &>(qualityME).use(iM);
1147 float aEntries(aItr->getBinEntries());
1157 float ampMean(aItr->getBinContent());
1158 float ampRms(aItr->getBinError() *
std::sqrt(aEntries));
1168 int channelStatus(qItr->getBinContent());
1169 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1267 if (!l1Time.empty())
1273 if (!l2Time.empty())
1277 }
catch (std::runtime_error &
e) {
1293 std::map<EcalLogicID, MonOccupancyDat> occupancy;
1301 if (oItr->getME()->getTH1()->GetEntries() < 1000.)
1304 int entries(oItr->getBinContent());
1310 int eEntries(eItr->getBinEntries());
1311 float energy(eEntries > 10 ? eItr->getBinContent() : -1.);
1314 data.setEventsOverLowThreshold(entries);
1315 data.setEventsOverHighThreshold(eEntries);
1320 if (!occupancy.empty())
1322 }
catch (std::runtime_error &
e) {
1333 std::map<EcalLogicID, MonRunDat>
dataset;
1347 }
catch (std::runtime_error &
e) {