CMS 3D CMS Logo

RawDataClient.cc
Go to the documentation of this file.
2 
5 
7 
9 
10 #include <cmath>
11 
12 namespace ecaldqm {
13 
14  RawDataClient::RawDataClient() : DQWorkerClient(), minEvents_(0), synchErrThresholdFactor_(0.) {
15  qualitySummaries_.insert("QualitySummary");
16  }
17 
19  minEvents_ = _params.getUntrackedParameter<int>("minEvents");
20  synchErrThresholdFactor_ = _params.getUntrackedParameter<double>("synchErrThresholdFactor");
21  }
22 
24  MESet& meQualitySummary(MEs_.at("QualitySummary"));
25  MESet& meErrorsSummary(MEs_.at("ErrorsSummary"));
26 
27  MESet const& sEntries(sources_.at("Entries"));
28  MESet const& sL1ADCC(sources_.at("L1ADCC"));
29  MESet const& sFEStatus(sources_.at("FEStatus"));
30 
32 
33  std::vector<int> dccStatus(nDCC, 1);
34 
35  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
36  double entries(sEntries.getBinContent(getEcalDQMSetupObjects(), iDCC + 1));
37  if (entries > 1. && sL1ADCC.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) >
38  synchErrThresholdFactor_ * std::log(entries) / std::log(10.))
39  dccStatus[iDCC] = 0;
40  }
41 
42  MESet::iterator meEnd(meQualitySummary.end(GetElectronicsMap()));
43  for (MESet::iterator meItr(meQualitySummary.beginChannel(GetElectronicsMap())); meItr != meEnd;
45  DetId id(meItr->getId());
46 
47  bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
48 
49  int dccid(dccId(id, GetElectronicsMap()));
50 
51  if (dccStatus[dccid - 1] == 0) {
52  meItr->setBinContent(doMask ? kMUnknown : kUnknown);
53  continue;
54  }
55 
56  int towerStatus(doMask ? kMGood : kGood);
57  float towerEntries(0.);
58  for (unsigned iS(0); iS < nFEFlags; iS++) {
59  float entries(sFEStatus.getBinContent(getEcalDQMSetupObjects(), id, iS + 1));
60  towerEntries += entries;
61  if (entries > minEvents_ && iS != Enabled && iS != Suppressed && iS != ForcedFullSupp && iS != FIFOFull &&
62  iS != ForcedZS)
63  towerStatus = doMask ? kMBad : kBad;
64  }
65 
66  if (towerEntries < 1.)
67  towerStatus = doMask ? kMUnknown : kUnknown;
68 
69  meItr->setBinContent(towerStatus);
70  if (towerStatus == kBad)
71  meErrorsSummary.fill(getEcalDQMSetupObjects(), dccid);
72  }
73  }
74 
76 } // namespace ecaldqm
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:168
MESet & at(const std::string &key)
Definition: MESet.h:401
static constexpr int kGood
const_iterator & toNextChannel(EcalElectronicsMapping const *electronicsMap)
Definition: MESet.h:322
static constexpr int kMUnknown
void producePlots(ProcessType) override
void setParams(edm::ParameterSet const &) override
static constexpr int kUnknown
static const int STATUS_FLAG_ERROR
static constexpr int kMBad
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
static constexpr int kBad
MESetCollection sources_
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Definition: DetId.h:17
static constexpr int nDCC
MESetCollection MEs_
Definition: DQWorker.h:131
static constexpr int kMGood
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:155