CMS 3D CMS Logo

PNIntegrityClient.cc
Go to the documentation of this file.
2 
4 
6 
8 
10 
11 namespace ecaldqm {
12  PNIntegrityClient::PNIntegrityClient() : DQWorkerClient(), errFractionThreshold_(0.) {
13  qualitySummaries_.insert("QualitySummary");
14  }
15 
17  errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
18  }
19 
23 
24  MESet& meQualitySummary(MEs_.at("QualitySummary"));
25 
26  MESet const& sOccupancy(sources_.at("Occupancy"));
27  MESet const& sMEMChId(sources_.at("MEMChId"));
28  MESet const& sMEMGain(sources_.at("MEMGain"));
29  MESet const& sMEMBlockSize(sources_.at("MEMBlockSize"));
30  MESet const& sMEMTowerId(sources_.at("MEMTowerId"));
31 
32  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
33  if (memDCCIndex(iDCC + 1) == unsigned(-1))
34  continue;
35  for (unsigned iPN(0); iPN < 10; ++iPN) {
36  int subdet(0);
37  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
38  subdet = EcalBarrel;
39  else
40  subdet = EcalEndcap;
41 
42  EcalPnDiodeDetId id(subdet, iDCC + 1, iPN + 1);
43 
44  bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
45 
46  float entries(sOccupancy.getBinContent(getEcalDQMSetupObjects(), id));
47 
48  float chid(sMEMChId.getBinContent(getEcalDQMSetupObjects(), id));
49  float gain(sMEMGain.getBinContent(getEcalDQMSetupObjects(), id));
50 
51  float blocksize(sMEMBlockSize.getBinContent(getEcalDQMSetupObjects(), id));
52  float towerid(sMEMTowerId.getBinContent(getEcalDQMSetupObjects(), id));
53 
54  if (entries + gain + chid + blocksize + towerid < 1.) {
55  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMUnknown : kUnknown);
56  continue;
57  }
58 
59  float chErr((gain + chid + blocksize + towerid) / (entries + gain + chid + blocksize + towerid));
60 
61  if (chErr > errFractionThreshold_)
62  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMBad : kBad);
63  else
64  meQualitySummary.setBinContent(getEcalDQMSetupObjects(), id, doMask ? kMGood : kGood);
65  }
66  }
67  }
68 
70 } // namespace ecaldqm
unsigned memDCCIndex(unsigned)
void producePlots(ProcessType) override
void setParams(edm::ParameterSet const &) override
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:168
MESet & at(const std::string &key)
Definition: MESet.h:401
static constexpr int kGood
static constexpr int kMUnknown
static const int TT_SIZE_ERROR
static constexpr int kUnknown
static constexpr int kMBad
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
static constexpr int kBad
MESetCollection sources_
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
static constexpr int nDCC
static const int CH_GAIN_ZERO_ERROR
MESetCollection MEs_
Definition: DQWorker.h:131
static const int TT_ID_ERROR
static constexpr int kMGood
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:155
static const int CH_ID_ERROR