60 :
DQWorker(), 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) {
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;
145 int nDigis(dItr->getBinContent());
151 if (gain > 0 || chid > 0 || gainswitch > 0) {
159 int channelStatus(qItr->getBinContent());
160 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
171 for (
unsigned iTower(1); iTower <= 68; ++iTower) {
176 std::vector<DetId> channels(
GetElectronicsMap()->dccTowerConstituents(iDCC + 1, iTower));
178 bool towerBad(
false);
179 for (
unsigned iD(0); iD < channels.size(); ++iD) {
184 if (channelStatus ==
kBad || channelStatus ==
kMBad)
193 if (towerid > 0 || blocksize > 0 || l1a > 0 ||
bx > 0) {
209 edm::LogInfo(
"EcalDQM") <<
" Looping over MEM channels and towers";
211 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
212 unsigned iDCC(
memDCC[iMD]);
216 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
223 if (memchid > 0 || memgain > 0) {
232 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
239 for (
unsigned iTower(69); iTower <= 70; ++iTower) {
243 bool towerBad(
false);
244 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
250 if (channelStatus ==
kBad || channelStatus ==
kMBad)
257 if (towerid > 0 || blocksize > 0) {
275 if (!crystalConsistencies.empty()) {
280 if (!towerConsistencies.empty()) {
285 if (!memChannelConsistencies.empty()) {
290 if (!memTowerConsistencies.empty()) {
295 }
catch (std::runtime_error &
e) {
296 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
315 unsigned nWL(laserWavelengths.size());
316 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
317 int wl(laserWavelengths[iWL]);
318 if (wl <= 0 || wl >= 5)
319 throw cms::Exception(
"InvalidConfiguration") <<
"Laser Wavelength";
320 repl[
"wl"] = std::to_string(wl);
339 std::map<EcalLogicID, MonLaserBlueDat> l1Amp;
340 std::map<EcalLogicID, MonTimingLaserBlueCrystalDat> l1Time;
341 std::map<EcalLogicID, MonPNBlueDat> l1PN;
342 std::map<EcalLogicID, MonLaserGreenDat> l2Amp;
343 std::map<EcalLogicID, MonTimingLaserGreenCrystalDat> l2Time;
344 std::map<EcalLogicID, MonPNGreenDat> l2PN;
345 std::map<EcalLogicID, MonLaserIRedDat> l3Amp;
346 std::map<EcalLogicID, MonTimingLaserIRedCrystalDat> l3Time;
347 std::map<EcalLogicID, MonPNIRedDat> l3PN;
348 std::map<EcalLogicID, MonLaserRedDat> l4Amp;
349 std::map<EcalLogicID, MonTimingLaserRedCrystalDat> l4Time;
350 std::map<EcalLogicID, MonPNRedDat> l4PN;
361 for (std::map<int, unsigned>::iterator wlItr(
wlToME_.begin()); wlItr !=
wlToME_.end(); ++wlItr) {
362 int wl(wlItr->first);
363 unsigned iM(wlItr->second);
365 static_cast<MESetMulti const &
>(ampME).use(iM);
366 static_cast<MESetMulti const &
>(aopME).use(iM);
367 static_cast<MESetMulti const &
>(timeME).use(iM);
368 static_cast<MESetMulti const &
>(qualityME).use(iM);
369 static_cast<MESetMulti const &
>(pnME).use(iM);
370 static_cast<MESetMulti const &
>(pnQualityME).use(iM);
378 float aEntries(aItr->getBinEntries());
388 float ampMean(aItr->getBinContent());
389 float ampRms(aItr->getBinError() *
std::sqrt(aEntries));
399 int channelStatus(qItr->getBinContent());
400 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
461 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
462 unsigned iDCC(
memDCC[iMD]);
466 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
481 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
564 }
catch (std::runtime_error &
e) {
565 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
582 unsigned nG(MGPAGains.size());
583 for (
unsigned iG(0); iG != nG; ++iG) {
584 int gain(MGPAGains[iG]);
585 if (gain != 1 && gain != 6 && gain != 12)
587 repl[
"gain"] = std::to_string(gain);
594 unsigned nGPN(MGPAGainsPN.size());
595 for (
unsigned iG(0); iG != nGPN; ++iG) {
596 int gain(MGPAGainsPN[iG]);
597 if (gain != 1 && gain != 16)
599 repl[
"pngain"] = std::to_string(gain);
615 std::map<EcalLogicID, MonPedestalsDat> pedestals;
616 std::map<EcalLogicID, MonPNPedDat> pnPedestals;
624 for (std::map<int, unsigned>::iterator gainItr(
gainToME_.begin()); gainItr !=
gainToME_.end(); ++gainItr) {
625 int gain(gainItr->first);
626 int iM(gainItr->second);
628 static_cast<MESetMulti const &
>(pedestalME).use(iM);
629 static_cast<MESetMulti const &
>(qualityME).use(iM);
635 float entries(pItr->getBinEntries());
641 float mean(pItr->getBinContent());
645 if (pedestals.find(logicID) == pedestals.end()) {
672 int channelStatus(qItr->getBinContent());
673 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
681 for (std::map<int, unsigned>::iterator gainItr(
pnGainToME_.begin()); gainItr !=
pnGainToME_.end(); ++gainItr) {
682 int gain(gainItr->first);
683 int iM(gainItr->second);
685 static_cast<MESetMulti const &
>(pnPedestalME).use(iM);
686 static_cast<MESetMulti const &
>(pnQualityME).use(iM);
688 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
689 unsigned iDCC(
memDCC[iMD]);
693 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
704 if (pnPedestals.find(logicID) == pnPedestals.end()) {
726 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
736 if (!pedestals.empty())
738 if (!pnPedestals.empty())
740 }
catch (std::runtime_error &
e) {
741 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
759 std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
768 float entries(pItr->getBinEntries());
774 float mean(pItr->getBinContent());
778 data.setADCMeanG12(
mean);
779 data.setADCRMSG12(
rms);
781 int channelStatus(qItr->getBinContent());
782 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
783 data.setTaskStatus(channelBad);
789 if (!pedestals.empty())
791 }
catch (std::runtime_error &
e) {
792 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
809 unsigned nG(MGPAGains.size());
810 for (
unsigned iG(0); iG != nG; ++iG) {
811 int gain(MGPAGains[iG]);
812 if (gain != 1 && gain != 6 && gain != 12)
814 repl[
"gain"] = std::to_string(gain);
821 unsigned nGPN(MGPAGainsPN.size());
822 for (
unsigned iG(0); iG != nGPN; ++iG) {
823 int gain(MGPAGainsPN[iG]);
824 if (gain != 1 && gain != 16)
826 repl[
"pngain"] = std::to_string(gain);
844 std::map<EcalLogicID, MonTestPulseDat> amplitude;
845 std::map<EcalLogicID, MonPulseShapeDat> shape;
846 std::map<EcalLogicID, MonPNMGPADat> pnAmplitude;
856 for (std::map<int, unsigned>::iterator gainItr(
gainToME_.begin()); gainItr !=
gainToME_.end(); ++gainItr) {
857 int gain(gainItr->first);
858 int iM(gainItr->second);
860 static_cast<MESetMulti const &
>(amplitudeME).use(iM);
861 static_cast<MESetMulti const &
>(shapeME).use(iM);
862 static_cast<MESetMulti const &
>(qualityME).use(iM);
868 float entries(aItr->getBinEntries());
874 float mean(aItr->getBinContent());
878 if (amplitude.find(logicID) == amplitude.end()) {
905 int channelStatus(qItr->getBinContent());
906 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
913 for (
unsigned iSM(0); iSM < 54; ++iSM) {
914 std::vector<float> samples(10, 0.);
916 unsigned nId(ids.size());
919 for (
unsigned iD(0); iD < nId; ++iD) {
930 for (
int i(0);
i < 10; ++
i)
937 for (
int i(0);
i < 10; ++
i)
938 samples[
i] /= nChannels;
940 if (shape.find(logicID) == shape.end()) {
942 std::vector<float> defval(10, -1.);
953 for (std::map<int, unsigned>::iterator gainItr(
pnGainToME_.begin()); gainItr !=
pnGainToME_.end(); ++gainItr) {
954 int gain(gainItr->first);
955 int iM(gainItr->second);
957 static_cast<MESetMulti const &
>(pnAmplitudeME).use(iM);
958 static_cast<MESetMulti const &
>(pnQualityME).use(iM);
960 for (
unsigned iMD(0); iMD <
memDCC.size(); ++iMD) {
961 unsigned iDCC(
memDCC[iMD]);
965 for (
unsigned iPN(1); iPN <= 10; ++iPN) {
979 if (pnAmplitude.find(logicID) == pnAmplitude.end()) {
1010 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1020 if (!amplitude.empty())
1024 if (!pnAmplitude.empty())
1026 }
catch (std::runtime_error &
e) {
1027 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1045 std::map<EcalLogicID, MonTimingCrystalDat> timing;
1054 float entries(tItr->getBinEntries());
1060 float mean(tItr->getBinContent());
1064 data.setTimingMean(
mean);
1065 data.setTimingRMS(
rms);
1067 int channelStatus(qItr->getBinContent());
1068 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1069 data.setTaskStatus(channelBad);
1075 if (!timing.empty())
1077 }
catch (std::runtime_error &
e) {
1078 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1097 unsigned nWL(ledWavelengths.size());
1098 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
1099 int wl(ledWavelengths[iWL]);
1100 if (wl != 1 && wl != 2)
1101 throw cms::Exception(
"InvalidConfiguration") <<
"Led Wavelength";
1102 repl[
"wl"] = std::to_string(wl);
1121 std::map<EcalLogicID, MonLed1Dat> l1Amp;
1122 std::map<EcalLogicID, MonTimingLed1CrystalDat> l1Time;
1124 std::map<EcalLogicID, MonLed2Dat> l2Amp;
1125 std::map<EcalLogicID, MonTimingLed2CrystalDat> l2Time;
1137 for (std::map<int, unsigned>::iterator wlItr(
wlToME_.begin()); wlItr !=
wlToME_.end(); ++wlItr) {
1138 int wl(wlItr->first);
1139 unsigned iM(wlItr->second);
1141 static_cast<MESetMulti const &
>(ampME).use(iM);
1142 static_cast<MESetMulti const &
>(aopME).use(iM);
1143 static_cast<MESetMulti const &
>(timeME).use(iM);
1144 static_cast<MESetMulti const &
>(qualityME).use(iM);
1154 float aEntries(aItr->getBinEntries());
1164 float ampMean(aItr->getBinContent());
1165 float ampRms(aItr->getBinError() *
std::sqrt(aEntries));
1175 int channelStatus(qItr->getBinContent());
1176 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1274 if (!l1Time.empty())
1280 if (!l2Time.empty())
1284 }
catch (std::runtime_error &
e) {
1285 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1300 std::map<EcalLogicID, MonOccupancyDat> occupancy;
1309 if (oItr->getME()->getTH1()->GetEntries() < 1000.)
1312 int entries(oItr->getBinContent());
1318 int eEntries(eItr->getBinEntries());
1319 float energy(eEntries > 10 ? eItr->getBinContent() : -1.);
1328 if (!occupancy.empty())
1330 }
catch (std::runtime_error &
e) {
1331 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
1341 std::map<EcalLogicID, MonRunDat>
dataset;
1355 }
catch (std::runtime_error &
e) {
1356 if (
std::string(e.what()).
find(
"unique constraint") != std::string::npos)
std::vector< unsigned > const memDCC
EcalLogicID crystalID(DetId const &, EcalElectronicsMapping const *)
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)
uint16_t *__restrict__ id
void setADCRMSG16(float mean)
void setADCRMSG1(float rms)
void setADCMeanG16(float mean)
void setAvgEnergy(float energy)
MESet & at(const std::string &key)
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 insert(const std::string &key, MESet *ptr)
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)
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)
Log< level::Error, false > LogError
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)
unsigned processedEvents_
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)
MESetColletionType::iterator iterator
void setADCRMSG16(float mean)
void setAPDOverPNRMS(float rms)
void setAPDRMS(float rms)
Log< level::Info, false > LogInfo
std::map< int, unsigned > pnGainToME_
EcalDQMSetupObjects const getEcalDQMSetupObjects()
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
const_iterator & toNextChannel(EcalElectronicsMapping 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)
EcalElectronicsMapping const * GetElectronicsMap()
void setProblemsSize(int size)
EcalLogicID towerID(EcalElectronicsId const &)
TestPulseWriter(edm::ParameterSet const &)
void setVPTMean(float mean)
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)
void setPedRMSG16(float mean)
void setAPDRMS(float rms)
unsigned getIndex(PathReplacements const &) const
void setPedMeanG16(float mean)
void setPedRMSG12(float rms)