CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RawDataClient.cc
Go to the documentation of this file.
1 #include "../interface/RawDataClient.h"
2 
5 
7 
9 
10 #include <cmath>
11 
12 namespace ecaldqm {
13 
16  synchErrThresholdFactor_(0.)
17  {
18  qualitySummaries_.insert("QualitySummary");
19  }
20 
21  void
23  {
24  synchErrThresholdFactor_ = _params.getUntrackedParameter<double>("synchErrThresholdFactor");
25  }
26 
27  void
29  {
30  MESet& meQualitySummary(MEs_.at("QualitySummary"));
31  MESet& meErrorsSummary(MEs_.at("ErrorsSummary"));
32 
33  MESet const& sEntries(sources_.at("Entries"));
34  MESet const& sL1ADCC(sources_.at("L1ADCC"));
35  MESet const& sFEStatus(sources_.at("FEStatus"));
36 
37  uint32_t mask(1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR);
38 
39  std::vector<int> dccStatus(nDCC, 1);
40 
41  for(unsigned iDCC(0); iDCC < nDCC; ++iDCC){
42  double entries(sEntries.getBinContent(iDCC + 1));
43  if(entries > 1. && sL1ADCC.getBinContent(iDCC + 1) > synchErrThresholdFactor_ * std::log(entries) / std::log(10.))
44  dccStatus[iDCC] = 0;
45  }
46 
47  MESet::iterator meEnd(meQualitySummary.end());
48  for(MESet::iterator meItr(meQualitySummary.beginChannel()); meItr != meEnd; meItr.toNextChannel()){
49 
50  DetId id(meItr->getId());
51 
52  bool doMask(meQualitySummary.maskMatches(id, mask, statusManager_));
53 
54  int dccid(dccId(id));
55 
56  if(dccStatus[dccid - 1] == 0){
57  meItr->setBinContent(doMask ? kMUnknown : kUnknown);
58  continue;
59  }
60 
61  int towerStatus(doMask ? kMGood : kGood);
62  float towerEntries(0.);
63  for(unsigned iS(0); iS < nFEFlags; iS++){
64  float entries(sFEStatus.getBinContent(id, iS + 1));
65  towerEntries += entries;
66  if(entries > 0. &&
67  iS != Enabled && iS != Disabled && iS != Suppressed &&
68  iS != FIFOFull && iS != FIFOFullL1ADesync && iS != ForcedZS)
69  towerStatus = doMask ? kMBad : kBad;
70  }
71 
72  if(towerEntries < 1.) towerStatus = doMask ? kMUnknown : kUnknown;
73 
74  meItr->setBinContent(towerStatus);
75  if(towerStatus == kBad) meErrorsSummary.fill(dccid);
76  }
77  }
78 
80 }
81 
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_ECALDQM_WORKER(TYPE)
Definition: DQWorker.h:108
void producePlots(ProcessType) override
const_iterator & toNextChannel()
Definition: MESet.h:271
void setParams(edm::ParameterSet const &) override
static const int STATUS_FLAG_ERROR
std::set< std::string > qualitySummaries_
StatusManager const * statusManager_
MESetCollection sources_
Definition: DetId.h:18
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
tuple log
Definition: cmsBatch.py:341