CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SummaryClient.cc
Go to the documentation of this file.
1 #include "../interface/SummaryClient.h"
2 
8 
11 
12 namespace ecaldqm {
13 
15  DQWorkerClient(_params, _paths, "SummaryClient")
16  {
17  edm::ParameterSet const& sources(_params.getUntrackedParameterSet("sources"));
18  source_(sIntegrity, "IntegrityClient", IntegrityClient::kQuality, sources);
19  source_(sPresample, "PresampleClient", PresampleClient::kQuality, sources);
20  source_(sTiming, "TimingClient", TimingClient::kQuality, sources);
21  source_(sRawData, "RawDataClient", RawDataClient::kQualitySummary, sources);
22  source_(sDigiOccupancy, "OccupancyTask", OccupancyTask::kDigi, sources);
23  }
24 
25  void
27  {
28  }
29 
30  void
32  {
33  for(unsigned iME(0); iME < MEs_.size(); ++iME)
34  MEs_[iME]->book();
35 
36  MEs_[kQualitySummary]->resetAll(-1.);
37  MEs_[kQualitySummary]->reset(1.);
38  MEs_[kReportSummaryMap]->resetAll(-1.);
39  MEs_[kReportSummaryMap]->reset(1.);
40  MEs_[kReportSummaryContents]->reset(1.);
41  MEs_[kReportSummary]->reset(1.);
42  }
43 
44  void
46  {
47  MEs_[kQualitySummary]->reset(2.);
48  MEs_[kReportSummaryMap]->reset(1.);
49 
50  float totalChannels(0.);
51  float totalGood(0.);
52 
53  for(unsigned dccid(1); dccid <= 54; dccid++){
54  MonitorElement const* me(sources_[sDigiOccupancy]->getME(dccid - 1));
55  if(me && me->getTH1()->GetEntries() < 1.){
56  MEs_[kReportSummaryContents]->fill(dccid, 1.);
57  continue;
58  }
59 
60  float dccChannels(0.);
61  float dccGood(0.);
62 
63  for(unsigned tower(1); tower <= getNSuperCrystals(dccid); tower++){
64  std::vector<DetId> ids(getElectronicsMap()->dccTowerConstituents(dccid, tower));
65 
66  if(ids.size() == 0) continue;
67 
68  float towerChannels(0.);
69  float towerGood(0.);
70 
71  for(std::vector<DetId>::iterator idItr(ids.begin()); idItr != ids.end(); ++idItr){
72 
73  float integrity(sources_[sIntegrity]->getBinContent(*idItr));
74 
75  if(integrity == 2.) continue;
76 
77  float presample(sources_[sPresample]->getBinContent(*idItr));
78  float timing(sources_[sTiming]->getBinContent(*idItr));
79  float rawdata(sources_[sRawData]->getBinContent(*idItr));
80 
81  if(integrity > 2.) integrity = 1.;
82  if(presample > 2.) presample = 1.;
83  if(timing > 2.) timing = 1.;
84  if(rawdata > 2.) rawdata = 1.;
85 
86  float status(1.);
87  if(integrity < 2.) status *= integrity;
88  if(presample < 2.) status *= presample;
89  if(timing < 2.) status *= timing;
90  if(rawdata < 2.) status *= rawdata;
91 
92  MEs_[kQualitySummary]->setBinContent(*idItr, status);
93 
94  if(status == 1.){
95  towerGood += 1.;
96  dccGood += 1.;
97  totalGood += 1.;
98  }
99  towerChannels += 1.;
100  dccChannels += 1.;
101  totalChannels += 1.;
102  }
103 
104  if(towerChannels < 1.) continue;
105 
106  if(dccid <= 9 || dccid >= 46){
107  std::vector<EcalScDetId> scs(getElectronicsMap()->getEcalScDetId(dccid, tower));
108  for(std::vector<EcalScDetId>::iterator scItr(scs.begin()); scItr != scs.end(); ++scItr)
109  MEs_[kReportSummaryMap]->setBinContent(*scItr, towerGood / towerChannels);
110  }
111  else
112  MEs_[kReportSummaryMap]->setBinContent(ids[0], towerGood / towerChannels);
113  }
114 
115  if(dccChannels < 1.) continue;
116 
117  MEs_[kReportSummaryContents]->fill(dccid, dccGood / dccChannels);
118  }
119 
120  if(totalChannels > 0.) MEs_[kReportSummary]->fill(totalGood / totalChannels);
121 
122  }
123 
124  /*static*/
125  void
126  SummaryClient::setMEData(std::vector<MEData>& _data)
127  {
132  }
133 
135 }
136 
const EcalElectronicsMapping * getElectronicsMap()
void source_(unsigned, std::string const &, unsigned, edm::ParameterSet const &)
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
TH1 * getTH1(void) const
static void setMEData(std::vector< MEData > &)
SummaryClient(const edm::ParameterSet &, const edm::ParameterSet &)
std::vector< MESet * > MEs_
Definition: DQWorker.h:56
unsigned getNSuperCrystals(unsigned)
std::vector< MESet const * > sources_
DEFINE_ECALDQM_WORKER(CertificationClient)
dictionary rawdata
Definition: lumiPlot.py:393
tuple status
Definition: ntuplemaker.py:245
void beginRun(const edm::Run &, const edm::EventSetup &)
Definition: Run.h:33