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_));
45 
46  float entries(sOccupancy.getBinContent(id));
47 
48  float chid(sMEMChId.getBinContent(id));
49  float gain(sMEMGain.getBinContent(id));
50 
51  float blocksize(sMEMBlockSize.getBinContent(id));
52  float towerid(sMEMTowerId.getBinContent(id));
53 
54  if (entries + gain + chid + blocksize + towerid < 1.) {
55  meQualitySummary.setBinContent(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(id, doMask ? kMBad : kBad);
63  else
64  meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
65  }
66  }
67  }
68 
70 } // namespace ecaldqm
unsigned memDCCIndex(unsigned)
T getUntrackedParameter(std::string const &, T const &) const
void producePlots(ProcessType) override
void setParams(edm::ParameterSet const &) override
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:112
static const int TT_SIZE_ERROR
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
static const int CH_GAIN_ZERO_ERROR
MESetCollection MEs_
Definition: DQWorker.h:78
static const int TT_ID_ERROR
static const int CH_ID_ERROR