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) {
81 for (MESetCollection::iterator sItr(this->
source_.begin()); sItr != this->
source_.end(); ++sItr) {
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;
134 MESet const &memblocksizeME(
source_.at(
"MEMBlockSize"));
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) {
158 int channelStatus(qItr->getBinContent());
159 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
170 for (
unsigned iTower(1); iTower <= 68; ++iTower) {
175 std::vector<DetId> channels(
getElectronicsMap()->dccTowerConstituents(iDCC + 1, 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) {
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) {
230 int channelStatus(pnqualityME.getBinContent(pnid));
231 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
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) {
274 if (!crystalConsistencies.empty()) {
279 if (!towerConsistencies.empty()) {
284 if (!memChannelConsistencies.empty()) {
289 if (!memTowerConsistencies.empty()) {
294 }
catch (std::runtime_error &
e) {
295 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
314 unsigned nWL(laserWavelengths.size());
315 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
316 int wl(laserWavelengths[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);
562 }
catch (std::runtime_error &
e) {
563 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
580 unsigned nG(MGPAGains.size());
581 for (
unsigned iG(0); iG != nG; ++iG) {
582 int gain(MGPAGains[iG]);
583 if (gain != 1 && gain != 6 && gain != 12)
585 repl[
"gain"] = std::to_string(gain);
591 MESetMulti const &pnPedestal(static_cast<MESetMulti const &>(
source_.at(
"PNPedestal")));
592 unsigned nGPN(MGPAGainsPN.size());
593 for (
unsigned iG(0); iG != nGPN; ++iG) {
594 int gain(MGPAGainsPN[iG]);
595 if (gain != 1 && gain != 16)
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);
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);
733 if (!pedestals.empty())
735 if (!pnPedestals.empty())
737 }
catch (std::runtime_error &
e) {
738 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
756 std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
764 float entries(pItr->getBinEntries());
770 float mean(pItr->getBinContent());
774 data.setADCMeanG12(
mean);
775 data.setADCRMSG12(
rms);
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) {
788 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
805 unsigned nG(MGPAGains.size());
806 for (
unsigned iG(0); iG != nG; ++iG) {
807 int gain(MGPAGains[iG]);
808 if (gain != 1 && gain != 6 && gain != 12)
810 repl[
"gain"] = std::to_string(gain);
816 MESetMulti const &pnAmplitude(static_cast<MESetMulti const &>(
source_.at(
"PNAmplitude")));
817 unsigned nGPN(MGPAGainsPN.size());
818 for (
unsigned iG(0); iG != nGPN; ++iG) {
819 int gain(MGPAGainsPN[iG]);
820 if (gain != 1 && gain != 16)
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());
873 if (amplitude.find(logicID) == amplitude.end()) {
900 int channelStatus(qItr->getBinContent());
901 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
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)
933 samples[
i] /= nChannels;
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()) {
1004 int channelStatus(pnQualityME.getBinContent(pnid));
1005 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1015 if (!amplitude.empty())
1019 if (!pnAmplitude.empty())
1021 }
catch (std::runtime_error &
e) {
1022 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1040 std::map<EcalLogicID, MonTimingCrystalDat> timing;
1048 float entries(tItr->getBinEntries());
1054 float mean(tItr->getBinContent());
1058 data.setTimingMean(
mean);
1059 data.setTimingRMS(
rms);
1061 int channelStatus(qItr->getBinContent());
1062 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1063 data.setTaskStatus(channelBad);
1069 if (!timing.empty())
1071 }
catch (std::runtime_error &
e) {
1072 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1091 unsigned nWL(ledWavelengths.size());
1092 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
1093 int wl(ledWavelengths[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) {
1278 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
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.);
1320 if (!occupancy.empty())
1322 }
catch (std::runtime_error &
e) {
1323 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1333 std::map<EcalLogicID, MonRunDat>
dataset;
1347 }
catch (std::runtime_error &
e) {
1348 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
std::vector< unsigned > const memDCC
void setProblematicEvents(int prob)
void setADCMeanG1(float mean)
T getUntrackedParameter(std::string const &, T const &) const
void setPedMeanG1(float mean)
void setTaskList(int list)
void setADCRMSG16(float mean)
void setPedRMSG16(float mean)
void setPedRMSG1(float mean)
void setNumEvents(int num)
bool run(EcalCondDBInterface *, MonRunIOV &) override
PedestalWriter(edm::ParameterSet const &)
void setMonRunOutcomeDef(const MonRunOutcomeDef &outcomeDef)
DBWriterWorker(std::string const &, edm::ParameterSet const &)
void setProblematicEvents(int prob)
void setADCRMSG16(float mean)
void setADCRMSG1(float rms)
void setADCMeanG16(float mean)
void setAvgEnergy(float energy)
void setAPDOverPNRMS(float rms)
void setEventsOverLowThreshold(int events)
void setAPDOverPNMean(float mean)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
void setPedRMSG16(float mean)
void setProcessedEvents(int proc)
std::map< int, unsigned > wlToME_
void setAPDMean(float mean)
void setProblemsID(int id)
void setADCMeanG16(float mean)
void setADCMeanG1(float mean)
EcalElectronicsMapping const * getElectronicsMap()
double getBinEntries() const
void setProblemsLV1(int LV1)
void setADCRMSG1(float mean)
void setTaskStatus(bool status)
std::map< int, unsigned > gainToME_
void setVPTOverPNMean(float mean)
void setADCMeanG1(float mean)
void setADCRMSG1(float mean)
bool run(EcalCondDBInterface *, MonRunIOV &) override
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void setADCMeanG6(float mean)
bool ccuExists(unsigned, unsigned)
void setSamples(std::vector< float > &samples, int gain) noexcept(false)
void setPedRMSG1(float mean)
void setTaskStatus(bool status)
void setPedRMSG16(float mean)
void setTimingMean(float mean)
void setPedMeanG1(float mean)
void setProblemsSize(int size)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setTaskStatus(bool status)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setPedRMSG6(float rms)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setShortDesc(std::string desc)
void setTaskStatus(bool status)
void setProblematicEvents(int prob)
void setProcessedEvents(int proc)
void setVPTMean(float mean)
void setADCMeanG12(float mean)
void setVPTOverPNRMS(float rms)
void setVPTOverPNMean(float mean)
LedWriter(edm::ParameterSet const &)
void setADCMeanG1(float mean)
LaserWriter(edm::ParameterSet const &)
void setADCMeanG16(float mean)
void setTaskStatus(bool status)
void setAPDMean(float mean)
void setTaskStatus(bool status)
void setTaskStatus(bool status)
void setPedMeanG6(float mean)
void setTaskStatus(bool status)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setVPTRMS(float rms)
double getBinError() const
void setPedMeanG1(float mean)
void setAPDMean(float mean)
void setTaskStatus(bool status)
void setProblematicEvents(int prob)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setProblemsID(int id)
void setPedRMSG1(float mean)
void setProblemsID(int id)
void setPedRMSG1(float mean)
void setADCRMSG12(float rms)
void setTaskStatus(bool status)
void setPedRMSG1(float mean)
void setPedMeanG16(float mean)
EcalLogicID memChannelID(EcalPnDiodeDetId const &)
void setTaskOutcome(int outcome)
void setProblemsBunchX(int bunchX)
void setProblemsGainSwitch(int prob)
void setADCMeanG1(float mean)
void setADCRMSG1(float mean)
void setPedRMSG1(float mean)
void setADCRMSG1(float mean)
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
void setTaskStatus(bool status)
std::map< int, unsigned > pnGainToME_
void setAPDRMS(float rms)
void setPedRMSG16(float mean)
void setADCRMSG16(float mean)
void setAPDOverPNRMS(float rms)
void setAPDRMS(float rms)
std::map< int, unsigned > pnGainToME_
void setTaskStatus(bool status)
void setPedRMSG1(float rms)
void setAPDOverPNRMS(float rms)
void setVPTRMS(float rms)
bool qualityOK(int _quality)
void setTaskStatus(bool status)
EcalLogicID lmPNID(EcalPnDiodeDetId const &)
void setProblemsID(int id)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setAPDOverPNMean(float mean)
void setTimingRMS(float rms)
void setADCMeanG16(float mean)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setADCRMSG6(float rms)
void setADCMeanG16(float mean)
void setTaskStatus(bool status)
void setPedMeanG16(float mean)
void setPedMeanG16(float mean)
void setAPDOverPNRMS(float rms)
double getBinContent() const
void retrieveSource(DQMStore::IGetter &)
void setTaskStatus(bool status)
std::map< int, unsigned > gainToME_
void setPedMeanG1(float mean)
void setTaskStatus(bool status)
void setAPDOverPNMean(float mean)
void setAPDRMS(float rms)
void setProcessedEvents(int proc)
void setPedMeanG16(float mean)
void setEventsOverHighThreshold(int events)
void setTaskStatus(bool status)
char data[epos_bytes_allocation]
void setProcessedEvents(int proc)
void setADCRMSG1(float mean)
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
void setPedMeanG1(float mean)
void setProblemsGainZero(int prob)
void setPedRMSG16(float mean)
void setProblemsGainZero(int prob)
void setPedMeanG12(float mean)
void setADCMeanG1(float mean)
void setTaskStatus(bool status)
void setProblemsSize(int size)
EcalLogicID towerID(EcalElectronicsId const &)
TestPulseWriter(edm::ParameterSet const &)
void setVPTMean(float mean)
const_iterator & toNextChannel()
void setPedMeanG16(float mean)
void setTaskStatus(bool status)
void setAPDMean(float mean)
std::map< int, unsigned > wlToME_
void setVPTOverPNRMS(float rms)
void setADCRMSG16(float mean)
std::set< std::string > runTypes_
void setADCRMSG16(float mean)
void setAPDOverPNMean(float mean)
EcalLogicID memTowerID(EcalElectronicsId const &)
std::map< std::string, std::string > PathReplacements
MESet * createMESet(edm::ParameterSet const &)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setPedMeanG1(float mean)
void setPedMeanG1(float mean)
EcalLogicID crystalID(DetId const &)
void setPedRMSG16(float mean)
void setAPDRMS(float rms)
unsigned getIndex(PathReplacements const &) const
void setPedMeanG16(float mean)
void setPedRMSG12(float rms)