CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PNIntegrityClient.cc
Go to the documentation of this file.
1 #include "../interface/PNIntegrityClient.h"
2 
4 
6 
8 
10 
11 namespace ecaldqm
12 {
15  errFractionThreshold_(0.)
16  {
17  qualitySummaries_.insert("QualitySummary");
18  }
19 
20  void
22  {
23  errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
24  }
25 
26  void
28  {
29  uint32_t mask(0x1 << EcalDQMStatusHelper::TT_SIZE_ERROR |
33 
34  MESet& meQualitySummary(MEs_.at("QualitySummary"));
35 
36  MESet const& sOccupancy(sources_.at("Occupancy"));
37  MESet const& sMEMChId(sources_.at("MEMChId"));
38  MESet const& sMEMGain(sources_.at("MEMGain"));
39  MESet const& sMEMBlockSize(sources_.at("MEMBlockSize"));
40  MESet const& sMEMTowerId(sources_.at("MEMTowerId"));
41 
42  for(unsigned iDCC(0); iDCC < nDCC; ++iDCC){
43  if(memDCCIndex(iDCC + 1) == unsigned(-1)) continue;
44  for(unsigned iPN(0); iPN < 10; ++iPN){
45  int subdet(0);
46  if(iDCC >= kEBmLow && iDCC <= kEBpHigh) subdet = EcalBarrel;
47  else subdet = EcalEndcap;
48 
49  EcalPnDiodeDetId id(subdet, iDCC + 1, iPN + 1);
50 
51  bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_));
52 
53  float entries(sOccupancy.getBinContent(id));
54 
55  float chid(sMEMChId.getBinContent(id));
56  float gain(sMEMGain.getBinContent(id));
57 
58  float blocksize(sMEMBlockSize.getBinContent(id));
59  float towerid(sMEMTowerId.getBinContent(id));
60 
61  if(entries + gain + chid + blocksize + towerid < 1.){
62  meQualitySummary.setBinContent(id, doMask ? kMUnknown : kUnknown);
63  continue;
64  }
65 
66  float chErr((gain + chid + blocksize + towerid) / (entries + gain + chid + blocksize + towerid));
67 
68  if(chErr > errFractionThreshold_)
69  meQualitySummary.setBinContent(id, doMask ? kMBad : kBad);
70  else
71  meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
72  }
73  }
74  }
75 
77 }
unsigned memDCCIndex(unsigned)
T getUntrackedParameter(std::string const &, T const &) const
void producePlots(ProcessType) override
void setParams(edm::ParameterSet const &) override
static const int TT_SIZE_ERROR
DEFINE_ECALDQM_WORKER(CalibrationSummaryClient)
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
static const int CH_GAIN_ZERO_ERROR
MESetCollection MEs_
Definition: DQWorker.h:76
static const int TT_ID_ERROR
static const int CH_ID_ERROR