Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-17 23:26:22

0001 #include "DQM/EcalMonitorClient/interface/RawDataClient.h"
0002 
0003 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
0004 #include "DQM/EcalCommon/interface/FEFlags.h"
0005 
0006 #include "CondFormats/EcalObjects/interface/EcalDQMStatusHelper.h"
0007 
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 
0010 #include <cmath>
0011 
0012 namespace ecaldqm {
0013 
0014   RawDataClient::RawDataClient() : DQWorkerClient(), synchErrThresholdFactor_(0.) {
0015     qualitySummaries_.insert("QualitySummary");
0016   }
0017 
0018   void RawDataClient::setParams(edm::ParameterSet const& _params) {
0019     synchErrThresholdFactor_ = _params.getUntrackedParameter<double>("synchErrThresholdFactor");
0020   }
0021 
0022   void RawDataClient::producePlots(ProcessType) {
0023     MESet& meQualitySummary(MEs_.at("QualitySummary"));
0024     MESet& meErrorsSummary(MEs_.at("ErrorsSummary"));
0025 
0026     MESet const& sEntries(sources_.at("Entries"));
0027     MESet const& sL1ADCC(sources_.at("L1ADCC"));
0028     MESet const& sFEStatus(sources_.at("FEStatus"));
0029 
0030     uint32_t mask(1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR);
0031 
0032     std::vector<int> dccStatus(nDCC, 1);
0033 
0034     for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
0035       double entries(sEntries.getBinContent(getEcalDQMSetupObjects(), iDCC + 1));
0036       if (entries > 1. && sL1ADCC.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) >
0037                               synchErrThresholdFactor_ * std::log(entries) / std::log(10.))
0038         dccStatus[iDCC] = 0;
0039     }
0040 
0041     MESet::iterator meEnd(meQualitySummary.end(GetElectronicsMap()));
0042     for (MESet::iterator meItr(meQualitySummary.beginChannel(GetElectronicsMap())); meItr != meEnd;
0043          meItr.toNextChannel(GetElectronicsMap())) {
0044       DetId id(meItr->getId());
0045 
0046       bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
0047 
0048       int dccid(dccId(id, GetElectronicsMap()));
0049 
0050       if (dccStatus[dccid - 1] == 0) {
0051         meItr->setBinContent(doMask ? kMUnknown : kUnknown);
0052         continue;
0053       }
0054 
0055       int towerStatus(doMask ? kMGood : kGood);
0056       float towerEntries(0.);
0057       for (unsigned iS(0); iS < nFEFlags; iS++) {
0058         float entries(sFEStatus.getBinContent(getEcalDQMSetupObjects(), id, iS + 1));
0059         towerEntries += entries;
0060         if (entries > 0. && iS != Enabled && iS != Suppressed && iS != FIFOFull && iS != FIFOFullL1ADesync &&
0061             iS != ForcedZS)
0062           towerStatus = doMask ? kMBad : kBad;
0063       }
0064 
0065       if (towerEntries < 1.)
0066         towerStatus = doMask ? kMUnknown : kUnknown;
0067 
0068       meItr->setBinContent(towerStatus);
0069       if (towerStatus == kBad)
0070         meErrorsSummary.fill(getEcalDQMSetupObjects(), dccid);
0071     }
0072   }
0073 
0074   DEFINE_ECALDQM_WORKER(RawDataClient);
0075 }  // namespace ecaldqm