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 
4 
7 
8 #include <cmath>
9 
10 namespace ecaldqm {
11 
13  DQWorkerClient(_params, _paths, "RawDataClient"),
14  synchErrorThreshold_(0)
15  {
16  edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_));
17  synchErrorThreshold_ = taskParams.getUntrackedParameter<int>("synchErrorThreshold");
18 
19  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
20  source_(sL1ADCC, "RawDataTask", RawDataTask::kL1ADCC, sources);
21  source_(sFEStatus, "RawDataTask", RawDataTask::kFEStatus, sources);
22  }
23 
24  void
26  {
28 
29  MEs_[kQualitySummary]->resetAll(-1.);
30  }
31 
32  void
34  {
35  uint32_t mask(1 << EcalDQMStatusHelper::STATUS_FLAG_ERROR);
36 
37  for(unsigned dccid(1); dccid <= 54; dccid++){
38 
39  float l1aDesync(sources_[sL1ADCC]->getBinContent(dccid));
40 
41  float dccStatus(l1aDesync > synchErrorThreshold_ ? 0. : 1.);
42 
43  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
44  std::vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
45 
46  if(ids.size() == 0) continue;
47 
48  float towerStatus(dccStatus);
49 
50  if(towerStatus > 0.){ // if the DCC is good, look into individual FEs
51  float towerEntries(0.);
52  for(unsigned iS(0); iS < nFEFlags; iS++){
53  float entries(sources_[sFEStatus]->getBinContent(ids[0], iS + 1));
54  towerEntries += entries;
55  if(entries > 0. &&
56  iS != Enabled && iS != Disabled && iS != Suppressed &&
57  iS != FIFOFull && iS != FIFOFullL1ADesync && iS != ForcedZS)
58  towerStatus = 0.;
59  }
60 
61  if(towerEntries < 1.) towerStatus = 2.;
62  }
63 
64  if(dccid <= 9 || dccid >= 46){
65  std::vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
66  for(std::vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr)
67  fillQuality_(kQualitySummary, *scItr, mask, towerStatus);
68  }
69  else
70  fillQuality_(kQualitySummary, ids[0], mask, towerStatus);
71  }
72  }
73  }
74 
75  /*static*/
76  void
77  RawDataClient::setMEData(std::vector<MEData>& _data)
78  {
80  }
81 
83 }
84 
RawDataClient(const edm::ParameterSet &, const edm::ParameterSet &)
const EcalElectronicsMapping * getElectronicsMap()
void source_(unsigned, std::string const &, unsigned, edm::ParameterSet const &)
static const int STATUS_FLAG_ERROR
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
static void setMEData(std::vector< MEData > &)
virtual void bookMEs()
Definition: DQWorker.cc:48
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
unsigned getNSuperCrystals(unsigned)
std::vector< MESet const * > sources_
DEFINE_ECALDQM_WORKER(CertificationClient)
void fillQuality_(unsigned, DetId const &, uint32_t, float)
std::string name_
Definition: DQWorker.h:55
static EcalDQMTowerStatus const * towerStatus