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) {
153 data.setProcessedEvents(nDigis);
154 data.setProblematicEvents(
gain + chid + gainswitch);
156 data.setProblemsID(chid);
157 data.setProblemsGainSwitch(gainswitch);
159 int channelStatus(qItr->getBinContent());
160 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
161 data.setTaskStatus(channelBad);
171 for (
unsigned iTower(1); iTower <= 68; ++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) {
195 data.setProcessedEvents(nDigis);
196 data.setProblematicEvents(towerid + blocksize + l1a +
bx);
197 data.setProblemsID(towerid);
198 data.setProblemsSize(blocksize);
199 data.setProblemsLV1(l1a);
200 data.setProblemsBunchX(
bx);
201 data.setTaskStatus(towerBad);
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) {
226 data.setProcessedEvents(nDigis);
227 data.setProblematicEvents(memchid + memgain);
228 data.setProblemsID(memchid);
229 data.setProblemsGainZero(memgain);
232 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
233 data.setTaskStatus(channelBad);
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) {
260 data.setProcessedEvents(nDigis);
261 data.setProblematicEvents(towerid + blocksize);
262 data.setProblemsID(towerid);
263 data.setProblemsSize(blocksize);
264 data.setTaskStatus(towerBad);
275 if (!crystalConsistencies.empty()) {
280 if (!towerConsistencies.empty()) {
285 if (!memChannelConsistencies.empty()) {
290 if (!memTowerConsistencies.empty()) {
295 }
catch (std::runtime_error &
e) {
316 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
318 if (wl <= 0 || wl >= 5)
319 throw cms::Exception(
"InvalidConfiguration") <<
"Laser Wavelength";
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);
486 data.setADCMeanG1(-1.);
487 data.setADCRMSG1(-1.);
488 data.setPedMeanG1(-1.);
489 data.setPedRMSG1(-1.);
492 data.setPedMeanG16(pedestalMean);
493 data.setPedRMSG16(pedestalRms);
494 data.setTaskStatus(channelBad);
498 data.setADCMeanG1(-1.);
499 data.setADCRMSG1(-1.);
500 data.setPedMeanG1(-1.);
501 data.setPedRMSG1(-1.);
504 data.setPedMeanG16(pedestalMean);
505 data.setPedRMSG16(pedestalRms);
506 data.setTaskStatus(channelBad);
510 data.setADCMeanG1(-1.);
511 data.setADCRMSG1(-1.);
512 data.setPedMeanG1(-1.);
513 data.setPedRMSG1(-1.);
516 data.setPedMeanG16(pedestalMean);
517 data.setPedRMSG16(pedestalRms);
518 data.setTaskStatus(channelBad);
522 data.setADCMeanG1(-1.);
523 data.setADCRMSG1(-1.);
524 data.setPedMeanG1(-1.);
525 data.setPedRMSG1(-1.);
528 data.setPedMeanG16(pedestalMean);
529 data.setPedRMSG16(pedestalRms);
530 data.setTaskStatus(channelBad);
564 }
catch (std::runtime_error &
e) {
583 for (
unsigned iG(0); iG != nG; ++iG) {
595 for (
unsigned iG(0); iG != nGPN; ++iG) {
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);
675 data.setTaskStatus(
true);
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);
728 data.setTaskStatus(
true);
736 if (!pedestals.empty())
738 if (!pnPedestals.empty())
740 }
catch (std::runtime_error &
e) {
759 std::map<EcalLogicID, MonPedestalsOnlineDat> pedestals;
768 float entries(pItr->getBinEntries());
774 float mean(pItr->getBinContent());
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) {
810 for (
unsigned iG(0); iG != nG; ++iG) {
822 for (
unsigned iG(0); iG != nGPN; ++iG) {
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());
905 int channelStatus(qItr->getBinContent());
906 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
908 data.setTaskStatus(
true);
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)
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()) {
1004 data.setPedMeanG16(pedestalMean);
1005 data.setPedRMSG16(pedestalRms);
1010 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1012 data.setTaskStatus(
true);
1024 if (!pnAmplitude.empty())
1026 }
catch (std::runtime_error &
e) {
1045 std::map<EcalLogicID, MonTimingCrystalDat>
timing;
1054 float entries(tItr->getBinEntries());
1060 float mean(tItr->getBinContent());
1067 int channelStatus(qItr->getBinContent());
1068 bool channelBad(channelStatus ==
kBad || channelStatus ==
kMBad);
1069 data.setTaskStatus(channelBad);
1077 }
catch (std::runtime_error &
e) {
1098 for (
unsigned iWL(0); iWL != nWL; ++iWL) {
1100 if (
wl != 1 &&
wl != 2)
1101 throw cms::Exception(
"InvalidConfiguration") <<
"Led Wavelength";
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) {
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.);
1322 data.setEventsOverLowThreshold(entries);
1323 data.setEventsOverHighThreshold(eEntries);
1328 if (!occupancy.empty())
1330 }
catch (std::runtime_error &
e) {
1341 std::map<EcalLogicID, MonRunDat>
dataset;
1355 }
catch (std::runtime_error &
e) {
double getBinContent() const
std::vector< unsigned > const memDCC
EcalLogicID crystalID(DetId const &, EcalElectronicsMapping const *)
void setPedMeanG1(float mean)
void setTaskList(int list)
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 setADCRMSG1(float rms)
MESet & at(const std::string &key)
void setAPDOverPNRMS(float rms)
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)
std::map< int, unsigned > wlToME_
void setAPDMean(float mean)
std::map< int, unsigned > gainToME_
void setVPTOverPNMean(float mean)
void setADCMeanG1(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 setTimingMean(float mean)
void setPedMeanG1(float mean)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setPedRMSG6(float rms)
bool run(EcalCondDBInterface *, MonRunIOV &) override
static std::string to_string(const XMLCh *ch)
void setShortDesc(std::string desc)
void setTaskStatus(bool status)
T getUntrackedParameter(std::string const &, T const &) const
void setVPTMean(float mean)
void setADCMeanG12(float mean)
static constexpr int nChannels
void setVPTOverPNRMS(float rms)
void setVPTOverPNMean(float mean)
LedWriter(edm::ParameterSet const &)
LaserWriter(edm::ParameterSet const &)
void setADCMeanG16(float mean)
void setTaskStatus(bool status)
void setAPDMean(float mean)
void setTaskStatus(bool status)
void setTaskStatus(bool status)
double getBinEntries() const
void setPedMeanG6(float mean)
void setTaskStatus(bool status)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setVPTRMS(float rms)
unsigned processedEvents_
void setAPDMean(float mean)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setADCRMSG12(float rms)
void setPedMeanG16(float mean)
EcalLogicID memChannelID(EcalPnDiodeDetId const &)
void setTaskOutcome(int outcome)
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)
MESetColletionType::iterator iterator
void setAPDOverPNRMS(float rms)
void setAPDRMS(float rms)
Log< level::Info, false > LogInfo
EcalElectronicsMapping const * GetElectronicsMap()
std::map< int, unsigned > pnGainToME_
EcalDQMSetupObjects const getEcalDQMSetupObjects()
unsigned getIndex(PathReplacements const &) const
void setTaskStatus(bool status)
void setPedRMSG1(float rms)
void setAPDOverPNRMS(float rms)
void setVPTRMS(float rms)
bool qualityOK(int _quality)
EcalLogicID lmPNID(EcalPnDiodeDetId const &)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setAPDOverPNMean(float mean)
void setTimingRMS(float rms)
bool run(EcalCondDBInterface *, MonRunIOV &) override
void setADCRMSG6(float rms)
void setTaskStatus(bool status)
void setPedMeanG16(float mean)
void setAPDOverPNRMS(float rms)
const_iterator & toNextChannel(EcalElectronicsMapping const *)
void retrieveSource(DQMStore::IGetter &)
void setTaskStatus(bool status)
std::map< int, unsigned > gainToME_
void setAPDOverPNMean(float mean)
void setAPDRMS(float rms)
char data[epos_bytes_allocation]
void setADCRMSG1(float mean)
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov) noexcept(false)
void setPedMeanG12(float mean)
void setADCMeanG1(float mean)
void setTaskStatus(bool status)
EcalLogicID towerID(EcalElectronicsId const &)
TestPulseWriter(edm::ParameterSet const &)
void setVPTMean(float mean)
void setAPDMean(float mean)
std::map< int, unsigned > wlToME_
void setVPTOverPNRMS(float rms)
void setADCRMSG16(float mean)
std::set< std::string > runTypes_
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 setPedRMSG16(float mean)
void setAPDRMS(float rms)
double getBinError() const
void setPedRMSG12(float rms)