CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IntegrityClient.cc
Go to the documentation of this file.
1 #include "../interface/IntegrityClient.h"
2 
4 
6 
7 namespace ecaldqm
8 {
11  errFractionThreshold_(0.)
12  {
13  qualitySummaries_.insert("Quality");
14  qualitySummaries_.insert("QualitySummary");
15  }
16 
17  void
19  {
20  errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
21  }
22 
23  void
25  {
26  uint32_t mask(1 << EcalDQMStatusHelper::CH_ID_ERROR |
31 
32  MESet& meQuality(MEs_.at("Quality"));
33  MESet& meQualitySummary(MEs_.at("QualitySummary"));
34 
35  MESet const& sOccupancy(sources_.at("Occupancy"));
36  MESet const& sGain(sources_.at("Gain"));
37  MESet const& sChId(sources_.at("ChId"));
38  MESet const& sGainSwitch(sources_.at("GainSwitch"));
39  MESet const& sTowerId(sources_.at("TowerId"));
40  MESet const& sBlockSize(sources_.at("BlockSize"));
41 
42  MESet::iterator qEnd(meQuality.end());
43  MESet::const_iterator occItr(sOccupancy);
44  for(MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()){
45 
46  occItr = qItr;
47 
48  DetId id(qItr->getId());
49 
50  bool doMask(meQuality.maskMatches(id, mask, statusManager_));
51 
52  float entries(occItr->getBinContent());
53 
54  float gain(sGain.getBinContent(id));
55  float chid(sChId.getBinContent(id));
56  float gainswitch(sGainSwitch.getBinContent(id));
57 
58  float towerid(sTowerId.getBinContent(id));
59  float blocksize(sBlockSize.getBinContent(id));
60 
61  if(entries + gain + chid + gainswitch + towerid + blocksize < 1.){
62  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
63  meQualitySummary.setBinContent(id, doMask ? kMUnknown : kUnknown);
64  continue;
65  }
66 
67  float chErr((gain + chid + gainswitch + towerid + blocksize) / (entries + gain + chid + gainswitch + towerid + blocksize));
68 
69  if(chErr > errFractionThreshold_){
70  qItr->setBinContent(doMask ? kMBad : kBad);
71  meQualitySummary.setBinContent(id, doMask ? kMBad : kBad);
72  }
73  else{
74  qItr->setBinContent(doMask ? kMGood : kGood);
75  meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
76  }
77  }
78  }
79 
81 }
T getUntrackedParameter(std::string const &, T const &) const
void producePlots(ProcessType) override
static const int TT_SIZE_ERROR
static const int CH_GAIN_SWITCH_ERROR
const_iterator & toNextChannel()
Definition: MESet.h:272
void setParams(edm::ParameterSet const &) override
DEFINE_ECALDQM_WORKER(CalibrationSummaryClient)
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
Definition: DetId.h:18
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