CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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(), synchErrThresholdFactor_(0.) {
15  qualitySummaries_.insert("QualitySummary");
16  }
17 
19  synchErrThresholdFactor_ = _params.getUntrackedParameter<double>("synchErrThresholdFactor");
20  }
21 
23  MESet& meQualitySummary(MEs_.at("QualitySummary"));
24  MESet& meErrorsSummary(MEs_.at("ErrorsSummary"));
25 
26  MESet const& sEntries(sources_.at("Entries"));
27  MESet const& sL1ADCC(sources_.at("L1ADCC"));
28  MESet const& sFEStatus(sources_.at("FEStatus"));
29 
30  uint32_t mask(1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR);
31 
32  std::vector<int> dccStatus(nDCC, 1);
33 
34  for (unsigned iDCC(0); iDCC < nDCC; ++iDCC) {
35  double entries(sEntries.getBinContent(getEcalDQMSetupObjects(), iDCC + 1));
36  if (entries > 1. && sL1ADCC.getBinContent(getEcalDQMSetupObjects(), iDCC + 1) >
37  synchErrThresholdFactor_ * std::log(entries) / std::log(10.))
38  dccStatus[iDCC] = 0;
39  }
40 
41  MESet::iterator meEnd(meQualitySummary.end(GetElectronicsMap()));
42  for (MESet::iterator meItr(meQualitySummary.beginChannel(GetElectronicsMap())); meItr != meEnd;
44  DetId id(meItr->getId());
45 
46  bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_, GetTrigTowerMap()));
47 
48  int dccid(dccId(id, GetElectronicsMap()));
49 
50  if (dccStatus[dccid - 1] == 0) {
51  meItr->setBinContent(doMask ? kMUnknown : kUnknown);
52  continue;
53  }
54 
55  int towerStatus(doMask ? kMGood : kGood);
56  float towerEntries(0.);
57  for (unsigned iS(0); iS < nFEFlags; iS++) {
58  float entries(sFEStatus.getBinContent(getEcalDQMSetupObjects(), id, iS + 1));
59  towerEntries += entries;
60  if (entries > 0. && iS != Enabled && iS != Suppressed && iS != FIFOFull && iS != FIFOFullL1ADesync &&
61  iS != ForcedZS)
62  towerStatus = doMask ? kMBad : kBad;
63  }
64 
65  if (towerEntries < 1.)
66  towerStatus = doMask ? kMUnknown : kUnknown;
67 
68  meItr->setBinContent(towerStatus);
69  if (towerStatus == kBad)
70  meErrorsSummary.fill(getEcalDQMSetupObjects(), dccid);
71  }
72  }
73 
75 } // namespace ecaldqm
T getUntrackedParameter(std::string const &, T const &) const
static std::vector< std::string > checklist log
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:162
uint16_t *__restrict__ id
MESet & at(const std::string &key)
Definition: MESet.h:399
const_iterator & toNextChannel(EcalElectronicsMapping const *electronicsMap)
Definition: MESet.h:320
void producePlots(ProcessType) override
void setParams(edm::ParameterSet const &) override
static const int STATUS_FLAG_ERROR
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:124
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
MESetCollection sources_
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
Definition: DetId.h:17
MESetCollection MEs_
Definition: DQWorker.h:125
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:118