CMS 3D CMS Logo

DQMFEDIntegrityClient.cc
Go to the documentation of this file.
1 
2 /*
3  * \file DQMFEDIntegrityClient.cc
4  * \author M. Marienfeld
5  * Last Update:
6  *
7  * Description: Summing up FED entries from all subdetectors.
8  *
9 */
10 
11 #include "DQMFEDIntegrityClient.h"
13 
14 // -----------------------------
15 // constructors and destructor
16 // -----------------------------
17 
19  parameters_ = ps;
20  initialize();
21  fillInEventloop = ps.getUntrackedParameter<bool>("fillInEventloop", false);
22  fillOnEndRun = ps.getUntrackedParameter<bool>("fillOnEndRun", false);
23  fillOnEndJob = ps.getUntrackedParameter<bool>("fillOnEndJob", false);
24  fillOnEndLumi = ps.getUntrackedParameter<bool>("fillOnEndLumi", true);
25  moduleName = ps.getUntrackedParameter<std::string>("moduleName", "FED");
26  fedFolderName = ps.getUntrackedParameter<std::string>("fedFolderName", "FEDIntegrity");
27 }
28 
30 
32  // get back-end interface
33  dbe_ = edm::Service<DQMStore>().operator->();
34 }
35 
37  NBINS = 850;
38  XMIN = 0.;
39  XMAX = 850.;
40 
41  dbe_ = edm::Service<DQMStore>().operator->();
42 
43  // ----------------------------------------------------------------------------------
44  std::string currentFolder = moduleName + "/" + fedFolderName;
45  dbe_->setCurrentFolder(currentFolder);
46 
47  FedEntries = dbe_->book1D("FedEntries", "FED Entries", NBINS, XMIN, XMAX);
48  FedFatal = dbe_->book1D("FedFatal", "FED Fatal Errors", NBINS, XMIN, XMAX);
49  FedNonFatal = dbe_->book1D("FedNonFatal", "FED Non Fatal Errors", NBINS, XMIN, XMAX);
50 
51  FedEntries->setAxisTitle("", 1);
52  FedFatal->setAxisTitle("", 1);
53  FedNonFatal->setAxisTitle("", 1);
54 
55  FedEntries->setAxisTitle("", 2);
56  FedFatal->setAxisTitle("", 2);
57  FedNonFatal->setAxisTitle("", 2);
58 
59  FedEntries->setBinLabel(11, "PIXEL", 1);
60  FedEntries->setBinLabel(221, "SIST", 1);
61  FedEntries->setBinLabel(606, "EE", 1);
62  FedEntries->setBinLabel(628, "EB", 1);
63  FedEntries->setBinLabel(651, "EE", 1);
64  FedEntries->setBinLabel(550, "ES", 1);
65  FedEntries->setBinLabel(716, "HCAL", 1);
66  FedEntries->setBinLabel(754, "CSC", 1);
67  FedEntries->setBinLabel(772, "DT", 1);
68  FedEntries->setBinLabel(791, "RPC", 1);
69  FedEntries->setBinLabel(804, "L1T", 1);
70 
71  FedFatal->setBinLabel(11, "PIXEL", 1);
72  FedFatal->setBinLabel(221, "SIST", 1);
73  FedFatal->setBinLabel(606, "EE", 1);
74  FedFatal->setBinLabel(628, "EB", 1);
75  FedFatal->setBinLabel(651, "EE", 1);
76  FedFatal->setBinLabel(550, "ES", 1);
77  FedFatal->setBinLabel(716, "HCAL", 1);
78  FedFatal->setBinLabel(754, "CSC", 1);
79  FedFatal->setBinLabel(772, "DT", 1);
80  FedFatal->setBinLabel(791, "RPC", 1);
81  FedFatal->setBinLabel(804, "L1T", 1);
82 
83  FedNonFatal->setBinLabel(11, "PIXEL", 1);
84  FedNonFatal->setBinLabel(221, "SIST", 1);
85  FedNonFatal->setBinLabel(606, "EE", 1);
86  FedNonFatal->setBinLabel(628, "EB", 1);
87  FedNonFatal->setBinLabel(651, "EE", 1);
88  FedNonFatal->setBinLabel(550, "ES", 1);
89  FedNonFatal->setBinLabel(716, "HCAL", 1);
90  FedNonFatal->setBinLabel(754, "CSC", 1);
91  FedNonFatal->setBinLabel(772, "DT", 1);
92  FedNonFatal->setBinLabel(791, "RPC", 1);
93  FedNonFatal->setBinLabel(804, "L1T", 1);
94 
95  //-----------------------------------------------------------------------------------
96  currentFolder = moduleName + "/EventInfo";
97  dbe_->setCurrentFolder(currentFolder);
98 
99  reportSummary = dbe_->bookFloat("reportSummary");
100 
101  int nSubsystems = 10;
102 
103  if (reportSummary)
104  reportSummary->Fill(1.);
105 
106  currentFolder = moduleName + "/EventInfo/reportSummaryContents";
107  dbe_->setCurrentFolder(currentFolder);
108 
109  reportSummaryContent[0] = dbe_->bookFloat("CSC FEDs");
110  reportSummaryContent[1] = dbe_->bookFloat("DT FEDs");
111  reportSummaryContent[2] = dbe_->bookFloat("EB FEDs");
112  reportSummaryContent[3] = dbe_->bookFloat("EE FEDs");
113  reportSummaryContent[4] = dbe_->bookFloat("ES FEDs");
114  reportSummaryContent[5] = dbe_->bookFloat("Hcal FEDs");
115  reportSummaryContent[6] = dbe_->bookFloat("L1T FEDs");
116  reportSummaryContent[7] = dbe_->bookFloat("Pixel FEDs");
117  reportSummaryContent[8] = dbe_->bookFloat("RPC FEDs");
118  reportSummaryContent[9] = dbe_->bookFloat("SiStrip FEDs");
119 
120  // initialize reportSummaryContents to 1
121  for (int i = 0; i < nSubsystems; ++i) {
122  SummaryContent[i] = 1.;
124  }
125 
126  currentFolder = moduleName + "/EventInfo";
127  dbe_->setCurrentFolder(currentFolder);
128 
129  reportSummaryMap = dbe_->book2D("reportSummaryMap", "FED Report Summary Map", 1, 1, 2, 10, 1, 11);
130 
133 
134  reportSummaryMap->setBinLabel(1, " ", 1);
135  reportSummaryMap->setBinLabel(10, "CSC", 2);
136  reportSummaryMap->setBinLabel(9, "DT", 2);
137  reportSummaryMap->setBinLabel(8, "EB", 2);
138  reportSummaryMap->setBinLabel(7, "EE", 2);
139  reportSummaryMap->setBinLabel(6, "ES", 2);
140  reportSummaryMap->setBinLabel(5, "Hcal", 2);
141  reportSummaryMap->setBinLabel(4, "L1T", 2);
142  reportSummaryMap->setBinLabel(3, "Pixel", 2);
143  reportSummaryMap->setBinLabel(2, "RPC", 2);
144  reportSummaryMap->setBinLabel(1, "SiStrip", 2);
145 }
146 
148 
150  if (fillInEventloop)
151  fillHistograms();
152 }
153 
155  if (fillOnEndLumi)
156  fillHistograms();
157 }
158 
160  // FED Entries
161 
162  std::vector<std::string> entries;
163  entries.push_back("CSC/" + fedFolderName + "/FEDEntries");
164  entries.push_back("DT/" + fedFolderName + "/FEDEntries");
165  entries.push_back("EcalBarrel/" + fedFolderName + "/FEDEntries");
166  entries.push_back("EcalEndcap/" + fedFolderName + "/FEDEntries");
167  entries.push_back("EcalPreshower/" + fedFolderName + "/FEDEntries");
168  entries.push_back("Hcal/" + fedFolderName + "/FEDEntries");
169  entries.push_back("L1T/" + fedFolderName + "/FEDEntries");
170  entries.push_back("Pixel/" + fedFolderName + "/FEDEntries");
171  entries.push_back("RPC/" + fedFolderName + "/FEDEntries");
172  entries.push_back("SiStrip/" + fedFolderName + "/FEDEntries");
173 
174  for (auto ent = entries.begin(); ent != entries.end(); ++ent) {
175  if (!(dbe_->get(*ent))) {
176  // cout << ">> Endluminosity No histogram! <<" << endl;
177  continue;
178  }
179 
180  MonitorElement* me = dbe_->get(*ent);
181 
182  if (TH1F* rootHisto = me->getTH1F()) {
183  int xmin = 0;
184  int Nbins = me->getNbinsX();
185 
186  float entry = 0.;
187 
188  xmin = (int)rootHisto->GetXaxis()->GetXmin();
189  if (*ent == "L1T/" + fedFolderName + "/FEDEntries")
190  xmin = xmin + 800;
191 
192  for (int bin = 1; bin <= Nbins; ++bin) {
193  int id = xmin + bin;
194  entry = rootHisto->GetBinContent(bin);
195  if (entry > 0.)
197  }
198  }
199  }
200 
201  // FED Fatal
202 
203  int nSubsystems = 10;
204 
205  std::vector<std::string> fatal;
206  fatal.push_back("CSC/" + fedFolderName + "/FEDFatal");
207  fatal.push_back("DT/" + fedFolderName + "/FEDFatal");
208  fatal.push_back("EcalBarrel/" + fedFolderName + "/FEDFatal");
209  fatal.push_back("EcalEndcap/" + fedFolderName + "/FEDFatal");
210  fatal.push_back("EcalPreshower/" + fedFolderName + "/FEDFatal");
211  fatal.push_back("Hcal/" + fedFolderName + "/FEDFatal");
212  fatal.push_back("L1T/" + fedFolderName + "/FEDFatal");
213  fatal.push_back("Pixel/" + fedFolderName + "/FEDFatal");
214  fatal.push_back("RPC/" + fedFolderName + "/FEDFatal");
215  fatal.push_back("SiStrip/" + fedFolderName + "/FEDFatal");
216 
217  int k = 0, count = 0;
218 
219  float sum = 0.;
220 
221  auto ent = entries.begin();
222  for (auto fat = fatal.begin(); fat != fatal.end(); ++fat) {
223  if (!(dbe_->get(*fat))) {
224  // cout << ">> No histogram! <<" << endl;
226  reportSummaryMap->setBinContent(1, nSubsystems - k, -1);
227  k++;
228  ent++;
229  continue;
230  }
231 
232  MonitorElement* me = dbe_->get(*fat);
233  MonitorElement* meNorm = dbe_->get(*ent);
234  // cout << "Path : " << me->getFullname() << endl;
235 
236  int Nbins = me->getNbinsX();
237 
238  float entry = 0.;
239  float norm = 0.;
240 
241  if (TH1F* rootHisto = me->getTH1F()) {
242  if (TH1F* rootHistoNorm = meNorm->getTH1F()) {
243  int xmin = 0;
244  int xmax = 0;
245 
246  xmin = (int)rootHisto->GetXaxis()->GetXmin();
247  if (*fat == "L1T/" + fedFolderName + "/FEDFatal")
248  xmin = xmin + 800;
249 
250  xmax = (int)rootHisto->GetXaxis()->GetXmax();
251  if (*fat == "L1T/" + fedFolderName + "/FEDFatal")
252  xmax = xmax + 800;
253 
254  // cout << "FED ID range : " << xmin << " - " << xmax << endl;
255 
256  float binentry = 0.;
257  for (int bin = 1; bin <= Nbins; ++bin) {
258  int id = xmin + bin;
259  binentry = rootHisto->GetBinContent(bin);
260  entry += binentry;
261  norm += rootHistoNorm->GetBinContent(bin);
262  // cout << *fat << "errors = " << entry << "\tnorm = " << norm << endl;
263  // cout << "Bin content : " << entry << endl;
264  FedFatal->setBinContent(id, binentry);
265  }
266  }
267  }
268 
269  if (norm > 0)
270  SummaryContent[k] = 1.0 - entry / norm;
271  // cout << "Summary Content : " << SummaryContent[k] << endl;
273  if ((k == 2 || k == 3) // for EE and EB only show yellow when more than 1% errors.
274  && SummaryContent[k] >= 0.95 && SummaryContent[k] < 0.99)
275  SummaryContent[k] = 0.949;
276  reportSummaryMap->setBinContent(1, nSubsystems - k, SummaryContent[k]);
277  sum = sum + SummaryContent[k];
278 
279  k++;
280  ent++;
281  count++;
282  }
283 
284  if (count > 0)
285  reportSummary->Fill(sum / (float)count);
286 
287  // FED Non Fatal
288 
289  std::vector<std::string> nonfatal;
290  nonfatal.push_back("CSC/" + fedFolderName + "/FEDNonFatal");
291  nonfatal.push_back("DT/" + fedFolderName + "/FEDNonFatal");
292  nonfatal.push_back("EcalBarrel/" + fedFolderName + "/FEDNonFatal");
293  nonfatal.push_back("EcalEndcap/" + fedFolderName + "/FEDNonFatal");
294  nonfatal.push_back("EcalPreshower/" + fedFolderName + "/FEDNonFatal");
295  nonfatal.push_back("Hcal/" + fedFolderName + "/FEDNonFatal");
296  nonfatal.push_back("L1T/" + fedFolderName + "/FEDNonFatal");
297  nonfatal.push_back("Pixel/" + fedFolderName + "/FEDNonFatal");
298  nonfatal.push_back("RPC/" + fedFolderName + "/FEDNonFatal");
299  nonfatal.push_back("SiStrip/" + fedFolderName + "/FEDNonFatal");
300 
301  for (auto non = nonfatal.begin(); non != nonfatal.end(); ++non) {
302  if (!(dbe_->get(*non))) {
303  // cout << ">> No histogram! <<" << endl;
304  continue;
305  }
306 
307  MonitorElement* me = dbe_->get(*non);
308 
309  if (TH1F* rootHisto = me->getTH1F()) {
310  int xmin = 0;
311  int Nbins = me->getNbinsX();
312 
313  float entry = 0.;
314 
315  xmin = (int)rootHisto->GetXaxis()->GetXmin();
316  if (*non == "L1T/" + fedFolderName + "/FEDNonFatal")
317  xmin = xmin + 800;
318 
319  for (int bin = 1; bin <= Nbins; ++bin) {
320  int id = xmin + bin;
321  entry = rootHisto->GetBinContent(bin);
322  if (entry > 0.)
324  }
325  }
326  }
327 }
328 
330  if (fillOnEndRun)
331  fillHistograms();
332 }
333 
335  if (fillOnEndJob)
336  fillHistograms();
337 }
DQMFEDIntegrityClient::reportSummaryContent
MonitorElement * reportSummaryContent[10]
Definition: DQMFEDIntegrityClient.h:63
DQMFEDIntegrityClient::endJob
void endJob() override
Definition: DQMFEDIntegrityClient.cc:334
mps_fire.i
i
Definition: mps_fire.py:428
DQMFEDIntegrityClient::beginRun
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: DQMFEDIntegrityClient.cc:147
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
mps_splice.entry
entry
Definition: mps_splice.py:68
DQMFEDIntegrityClient.h
DQMFEDIntegrityClient::fillOnEndLumi
bool fillOnEndLumi
Definition: DQMFEDIntegrityClient.h:69
DQMFEDIntegrityClient::XMIN
float XMIN
Definition: DQMFEDIntegrityClient.h:55
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
DQMFEDIntegrityClient::beginJob
void beginJob() override
Definition: DQMFEDIntegrityClient.cc:36
DQMFEDIntegrityClient::FedNonFatal
MonitorElement * FedNonFatal
Definition: DQMFEDIntegrityClient.h:60
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
DQMFEDIntegrityClient::fillInEventloop
bool fillInEventloop
Definition: DQMFEDIntegrityClient.h:66
DQMFEDIntegrityClient::FedFatal
MonitorElement * FedFatal
Definition: DQMFEDIntegrityClient.h:59
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DQMFEDIntegrityClient::DQMFEDIntegrityClient
DQMFEDIntegrityClient(const edm::ParameterSet &)
Definition: DQMFEDIntegrityClient.cc:18
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMFEDIntegrityClient::NBINS
int NBINS
Definition: DQMFEDIntegrityClient.h:54
edm::ParameterSet
Definition: ParameterSet.h:47
DQMFEDIntegrityClient::SummaryContent
float SummaryContent[10]
Definition: DQMFEDIntegrityClient.h:56
SiStripMonitorCluster_cfi.Nbins
Nbins
Definition: SiStripMonitorCluster_cfi.py:32
DQMFEDIntegrityClient::fillOnEndRun
bool fillOnEndRun
Definition: DQMFEDIntegrityClient.h:67
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
DQMFEDIntegrityClient::parameters_
edm::ParameterSet parameters_
Definition: DQMFEDIntegrityClient.h:48
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:771
DQMFEDIntegrityClient::fedFolderName
std::string fedFolderName
Definition: DQMFEDIntegrityClient.h:71
edm::EventSetup
Definition: EventSetup.h:57
DQMFEDIntegrityClient::FedEntries
MonitorElement * FedEntries
Definition: DQMFEDIntegrityClient.h:58
DQMFEDIntegrityClient::endRun
void endRun(const edm::Run &r, const edm::EventSetup &c) override
Definition: DQMFEDIntegrityClient.cc:329
DQMFEDIntegrityClient::reportSummary
MonitorElement * reportSummary
Definition: DQMFEDIntegrityClient.h:62
DQMFEDIntegrityClient::fillOnEndJob
bool fillOnEndJob
Definition: DQMFEDIntegrityClient.h:68
alignCSCRings.r
r
Definition: alignCSCRings.py:93
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
DQMFEDIntegrityClient::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
Definition: DQMFEDIntegrityClient.cc:149
DQMFEDIntegrityClient::~DQMFEDIntegrityClient
~DQMFEDIntegrityClient() override
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
DQMFEDIntegrityClient::reportSummaryMap
MonitorElement * reportSummaryMap
Definition: DQMFEDIntegrityClient.h:64
DQMFEDIntegrityClient::XMAX
float XMAX
Definition: DQMFEDIntegrityClient.h:55
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
DQMFEDIntegrityClient::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c) override
Definition: DQMFEDIntegrityClient.cc:154
DQMFEDIntegrityClient::dbe_
DQMStore * dbe_
Definition: DQMFEDIntegrityClient.h:50
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
edm::Event
Definition: Event.h:73
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
DQMFEDIntegrityClient::initialize
void initialize()
Definition: DQMFEDIntegrityClient.cc:31
DQMFEDIntegrityClient::fillHistograms
void fillHistograms()
Definition: DQMFEDIntegrityClient.cc:159
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
DQMFEDIntegrityClient::moduleName
std::string moduleName
Definition: DQMFEDIntegrityClient.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37