CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TEventInfoClient.cc
Go to the documentation of this file.
2 
11 #include "TRandom.h"
12 #include <TF1.h>
13 #include <stdio.h>
14 #include <sstream>
15 #include <math.h>
16 #include <TProfile.h>
17 #include <TProfile2D.h>
18 #include <memory>
19 #include <iostream>
20 #include <iomanip>
21 #include <map>
22 #include <vector>
23 #include <string>
24 #include <fstream>
25 #include "TROOT.h"
26 
27 using namespace edm;
28 using namespace std;
29 
31 {
32  parameters_=ps;
33  initialize();
34 }
35 
37  if(verbose_) cout <<"[TriggerDQM]: ending... " << endl;
38 }
39 
40 //--------------------------------------------------------
42 
43  counterLS_=0;
44  counterEvt_=0;
45 
46  // get back-end interface
48 
49  // base folder for the contents of this job
50  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
51 
52  monitorDir_ = parameters_.getUntrackedParameter<string>("monitorDir","");
53  if(verbose_) cout << "Monitor dir = " << monitorDir_ << endl;
54 
55  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
56  if(verbose_) cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl;
57 
58  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
59  if(verbose_) cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl;
60 
61  thresholdLS_ = parameters_.getUntrackedParameter<int>("thresholdLS", 1);
62  if(verbose_) cout << "Minimum LS required to perform QTests = " << thresholdLS_ << " lumi section(s)"<< endl;
63 
64  GCT_NonIsoEm_threshold_ = parameters_.getUntrackedParameter<double>("GCT_NonIsoEm_threshold",100000);
65  GCT_IsoEm_threshold_ = parameters_.getUntrackedParameter<double>("GCT_IsoEm_threshold",1000000);
66  GCT_TauJets_threshold_ = parameters_.getUntrackedParameter<double>("GCT_TauJets_threshold",100000);
67  GCT_AllJets_threshold_ = parameters_.getUntrackedParameter<double>("GCT_AllJets_threshold",100000);
68  GMT_Muons_threshold_ = parameters_.getUntrackedParameter<double>("GMT_Muons_threshold",100000);
69 
70  if(verbose_){
71  cout << " Thresholds are as follows:" << endl;
72  cout << " \t GCT_NonIsoEm_threshold_: " << GCT_NonIsoEm_threshold_ << endl;
73  cout << " \t GCT_IsoEm_threshold_: " << GCT_IsoEm_threshold_ << endl;
74  cout << " \t GCT_TauJets_threshold_: " << GCT_TauJets_threshold_ << endl;
75  cout << " \t GCT_AllJets_threshold_: " << GCT_AllJets_threshold_ << endl;
76  cout << " \t GMT_Muons_threshold_: " << GMT_Muons_threshold_ << endl;
77  }
78 
79  std::vector<string> emptyMask;
80 
81  dataMask = parameters_.getUntrackedParameter<std::vector<string> >("dataMaskedSystems", emptyMask);
82  emulMask = parameters_.getUntrackedParameter<std::vector<string> >("emulatorMaskedSystems", emptyMask);
83 
84  s_mapDataValues["EMPTY"] = data_empty;
85  s_mapDataValues["ALL"] = data_all;
86  s_mapDataValues["GT"] = data_gt;
87  s_mapDataValues["MUONS"] = data_muons;
88  s_mapDataValues["JETS"] = data_jets;
89  s_mapDataValues["TAUJETS"] = data_taujets;
90  s_mapDataValues["ISOEM"] = data_isoem;
91  s_mapDataValues["NONISOEM"] = data_nonisoem;
92  s_mapDataValues["MET"] = data_met;
93 
94  s_mapEmulValues["EMPTY"] = emul_empty;
95  s_mapEmulValues["ALL"] = emul_all;
96  s_mapEmulValues["DTTF"] = emul_dtf;
97  s_mapEmulValues["DTTPG"] = emul_dtp;
98  s_mapEmulValues["CSCTF"] = emul_ctf;
99  s_mapEmulValues["CSCTPG"] = emul_ctp;
100  s_mapEmulValues["RPC"] = emul_rpc;
101  s_mapEmulValues["GMT"] = emul_gmt;
102  s_mapEmulValues["ECAL"] = emul_etp;
103  s_mapEmulValues["HCAL"] = emul_htp;
104  s_mapEmulValues["RCT"] = emul_rct;
105  s_mapEmulValues["GCT"] = emul_gct;
106  s_mapEmulValues["GLT"] = emul_glt;
107 
108 }
109 
110 //--------------------------------------------------------
112 
113  if(verbose_) cout <<"[TriggerDQM]: Begin Job" << endl;
114  // get backendinterface
116 
117  dbe_->setCurrentFolder("L1T/EventInfo");
118 
119  if( (reportSummary_ = dbe_->get("L1T/EventInfo/reportSumamry")) ) {
120  dbe_->removeElement(reportSummary_->getName());
121  }
122 
123  reportSummary_ = dbe_->bookFloat("reportSummary");
124 
125  //initialize reportSummary to 1
126  if (reportSummary_) reportSummary_->Fill(1);
127 
128  dbe_->setCurrentFolder("L1T/EventInfo/reportSummaryContents");
129 
130 
131  char histo[100];
132 
133  for (int n = 0; n < nsys_; n++) {
134 
135  switch(n){
136  case 0 : sprintf(histo,"L1T_MET"); break;
137  case 1 : sprintf(histo,"L1T_NonIsoEM"); break;
138  case 2 : sprintf(histo,"L1T_IsoEM"); break;
139  case 3 : sprintf(histo,"L1T_TauJets"); break;
140  case 4 : sprintf(histo,"L1T_Jets"); break;
141  case 5 : sprintf(histo,"L1T_Muons"); break;
142  case 6 : sprintf(histo,"L1T_GT"); break;
143  case 7 : sprintf(histo,"L1TEMU_GLT"); break;
144  case 8 : sprintf(histo,"L1TEMU_GMT"); break;
145  case 9 : sprintf(histo,"L1TEMU_RPC"); break;
146  case 10: sprintf(histo,"L1TEMU_CTP"); break;
147  case 11: sprintf(histo,"L1TEMU_CTF"); break;
148  case 12: sprintf(histo,"L1TEMU_DTP"); break;
149  case 13: sprintf(histo,"L1TEMU_DTF"); break;
150  case 14: sprintf(histo,"L1TEMU_HTP"); break;
151  case 15: sprintf(histo,"L1TEMU_ETP"); break;
152  case 16: sprintf(histo,"L1TEMU_GCT"); break;
153  case 17: sprintf(histo,"L1TEMU_RCT"); break;
154  }
155 
156  reportSummaryContent_[n] = dbe_->bookFloat(histo);
157  }
158 
159  //initialize reportSummaryContents to 0
160  for (int k = 0; k < nsys_; k++) {
161  summaryContent[k] = 0;
162  reportSummaryContent_[k]->Fill(0.);
163  }
164 
165 
166  dbe_->setCurrentFolder("L1T/EventInfo");
167 
168  if( (reportSummaryMap_ = dbe_->get("L1T/EventInfo/reportSummaryMap")) ){
169  dbe_->removeElement(reportSummaryMap_->getName());
170  }
171 
172  reportSummaryMap_ = dbe_->book2D("reportSummaryMap", "reportSummaryMap", 2, 1, 3, 11, 1, 12);
173  reportSummaryMap_->setAxisTitle("", 1);
174  reportSummaryMap_->setAxisTitle("", 2);
175 
176  reportSummaryMap_->setBinLabel(1," ",1);
177  reportSummaryMap_->setBinLabel(2," ",1);
178 
179  reportSummaryMap_->setBinLabel(1," ",2);
180  reportSummaryMap_->setBinLabel(2," ",2);
181  reportSummaryMap_->setBinLabel(3," ",2);
182  reportSummaryMap_->setBinLabel(4," ",2);
183  reportSummaryMap_->setBinLabel(5," ",2);
184  reportSummaryMap_->setBinLabel(6," ",2);
185  reportSummaryMap_->setBinLabel(7," ",2);
186  reportSummaryMap_->setBinLabel(8," ",2);
187  reportSummaryMap_->setBinLabel(9," ",2);
188  reportSummaryMap_->setBinLabel(10," ",2);
189  reportSummaryMap_->setBinLabel(11," ",2);
190 
191 }
192 
193 //--------------------------------------------------------
194 void L1TEventInfoClient::beginRun(const Run& r, const EventSetup& context) {
195 }
196 
197 //--------------------------------------------------------
199  // optionally reset histograms here
200 }
201 
203  const edm::EventSetup& c){
204 
205 
206  counterLS_++;
207 
208  MonitorElement *GMT_QHist = dbe_->get("L1T/L1TGMT/GMT_etaphi");
209  MonitorElement *GCT_IsoEm_QHist = dbe_->get("L1T/L1TGCT/IsoEmRankEtaPhi");
210  MonitorElement *GCT_NonIsoEm_QHist = dbe_->get("L1T/L1TGCT/NonIsoEmRankEtaPhi");
211  MonitorElement *GCT_AllJets_QHist = dbe_->get("L1T/L1TGCT/AllJetsEtEtaPhi");
212  MonitorElement *GCT_TauJets_QHist = dbe_->get("L1T/L1TGCT/TauJetsEtEtaPhi");
213  MonitorElement *GT_AlgoBits_QHist = dbe_->get("L1T/L1TGT/algo_bits");
214  MonitorElement *GT_TechBits_QHist = dbe_->get("L1T/L1TGT/tt_bits");
215 
216 
217 
218  for (int k = 0; k < nsys_; k++) {
219  summaryContent[k] = 0;
220  reportSummaryContent_[k]->Fill(0.);
221  }
222  summarySum = 0;
223 
224 
225  int GCT_IsoEm_nXCh = 0,GCT_IsoEm_nYCh=0,GCT_NonIsoEm_nXCh = 0,GCT_NonIsoEm_nYCh=0,GCT_AllJets_nXCh = 0,GCT_AllJets_nYCh=0,GCT_TauJets_nXCh = 0,GCT_TauJets_nYCh=0,GMT_nXCh=0,GMT_nYCh=0;
226 
227 
228  if(GCT_IsoEm_QHist){
229  GCT_IsoEm_nXCh = GCT_IsoEm_QHist->getNbinsX();
230  GCT_IsoEm_nYCh = GCT_IsoEm_QHist->getNbinsY();
231  }
232  if(GCT_NonIsoEm_QHist){
233  GCT_NonIsoEm_nXCh = GCT_NonIsoEm_QHist->getNbinsX();
234  GCT_NonIsoEm_nYCh = GCT_NonIsoEm_QHist->getNbinsY();
235  }
236  if(GCT_AllJets_QHist){
237  GCT_AllJets_nXCh = GCT_AllJets_QHist->getNbinsX();
238  GCT_AllJets_nYCh = GCT_AllJets_QHist->getNbinsY();
239  }
240  if(GCT_TauJets_QHist){
241  GCT_TauJets_nXCh = GCT_TauJets_QHist->getNbinsX();
242  GCT_TauJets_nYCh = GCT_TauJets_QHist->getNbinsY();
243  }
244  if(GMT_QHist){
245  GMT_nXCh = GMT_QHist->getNbinsX();
246  GMT_nYCh = GMT_QHist->getNbinsY();
247  }
248 
249 
250  int GCT_IsoEm_nCh=0,GCT_NonIsoEm_nCh=0,GCT_AllJets_nCh=0,GCT_TauJets_nCh=0,GMT_nCh=0;
251 
252  if(GCT_IsoEm_nYCh)
253  GCT_IsoEm_nCh = GCT_IsoEm_nXCh*GCT_IsoEm_nYCh;
254  if(GCT_NonIsoEm_nYCh)
255  GCT_NonIsoEm_nCh = GCT_NonIsoEm_nXCh*GCT_NonIsoEm_nYCh;
256  if(GCT_AllJets_nYCh)
257  GCT_AllJets_nCh = GCT_AllJets_nXCh*GCT_AllJets_nYCh;
258  if(GCT_TauJets_nYCh)
259  GCT_TauJets_nCh = GCT_TauJets_nXCh*GCT_TauJets_nYCh;
260  if(GMT_nYCh)
261  GMT_nCh = GMT_nXCh*GMT_nYCh;
262 
263 
264 
265 
266 
267  //
268  // 00 MET Quality Tests
269  //
270 
271 
272 
273  // GCT uninstrumented regions for IsoEm, NonIsoEm, and TauJets
274  int nCh_no_inst = 144;
275 
276  //
277  // 01 NonIsoEM Quality Tests
278  //
279  if (GCT_NonIsoEm_QHist){
280  const QReport *GCT_NonIsoEm_DeadCh_QReport = GCT_NonIsoEm_QHist->getQReport("DeadChannels_GCT_2D_loose");
281  const QReport *GCT_NonIsoEm_HotCh_QReport = GCT_NonIsoEm_QHist->getQReport("HotChannels_GCT_2D");
282 
283  int GCT_NonIsoEm_nBadCh = 0;
284 
285  if (GCT_NonIsoEm_DeadCh_QReport) {
286  int GCT_NonIsoEm_nDeadCh = GCT_NonIsoEm_DeadCh_QReport->getBadChannels().size();
287  if( verbose_ ) cout << " GCT_NonIsoEm_nDeadCh: " << GCT_NonIsoEm_nDeadCh
288  << ", GCT_NonIsoEm_nCh: " << GCT_NonIsoEm_nCh
289  << ", GCT_NonIsoEm_DeadCh_efficiency: " << 1 - (float)GCT_NonIsoEm_nDeadCh/(float)GCT_NonIsoEm_nCh
290  << " GCT_NonIsoEm_DeadCh QTResult = " << GCT_NonIsoEm_DeadCh_QReport->getQTresult() << std::endl;
291 
292  GCT_NonIsoEm_nBadCh+=GCT_NonIsoEm_nDeadCh;
293  }
294 
295  if (GCT_NonIsoEm_HotCh_QReport) {
296  int GCT_NonIsoEm_nHotCh = GCT_NonIsoEm_HotCh_QReport->getBadChannels().size();
297  if( verbose_ ) cout << " GCT_NonIsoEm_nHotCh: " << GCT_NonIsoEm_nHotCh
298  << ", GCT_NonIsoEm_nCh: " << GCT_NonIsoEm_nCh
299  << ", GCT_NonIsoEm_HotCh_efficiency: " << 1 - (float)GCT_NonIsoEm_nHotCh/(float)GCT_NonIsoEm_nCh
300  << " GCT_NonIsoEm_HotCh QTResult = " << GCT_NonIsoEm_HotCh_QReport->getQTresult() << std::endl;
301 
302  GCT_NonIsoEm_nBadCh+=GCT_NonIsoEm_nHotCh;
303  }
304 
305  if( verbose_ ) std::cout << " GCT_NonIsoEm total efficiency = " << 1 - (float)GCT_NonIsoEm_nBadCh/(float)GCT_NonIsoEm_nCh << std::endl;
306 
307  double GCT_NonIsoEm_nentries = GCT_NonIsoEm_QHist->getEntries();
308  float nonisoResult = -1;
309  if( (counterLS_>=1000 && GCT_NonIsoEm_nentries==0) ) nonisoResult = 0;
310  if( (GCT_NonIsoEm_nentries>GCT_NonIsoEm_threshold_) ) nonisoResult = 1 - (float)(GCT_NonIsoEm_nBadCh-nCh_no_inst)/(float)(GCT_NonIsoEm_nCh-nCh_no_inst);
311  summaryContent[1] = ( nonisoResult < (1.0+1e-10) ) ? nonisoResult : 1.0;
312  }
313 
314 
315 
316 
317  //
318  // 02 IsoEM Quality Tests
319  //
320  if (GCT_IsoEm_QHist){
321  const QReport *GCT_IsoEm_DeadCh_QReport = GCT_IsoEm_QHist->getQReport("DeadChannels_GCT_2D_loose");
322  const QReport *GCT_IsoEm_HotCh_QReport = GCT_IsoEm_QHist->getQReport("HotChannels_GCT_2D");
323 
324  int GCT_IsoEm_nBadCh = 0;
325 
326  if (GCT_IsoEm_DeadCh_QReport) {
327  int GCT_IsoEm_nDeadCh = GCT_IsoEm_DeadCh_QReport->getBadChannels().size();
328  if( verbose_ ) cout << " GCT_IsoEm_nDeadCh: " << GCT_IsoEm_nDeadCh
329  << ", GCT_IsoEm_nCh: " << GCT_IsoEm_nCh
330  << ", GCT_IsoEm_DeadCh_efficiency: " << 1 - (float)GCT_IsoEm_nDeadCh/(float)GCT_IsoEm_nCh
331  << " GCT_IsoEm_DeadCh QTResult = " << GCT_IsoEm_DeadCh_QReport->getQTresult() << std::endl;
332 
333  GCT_IsoEm_nBadCh+=GCT_IsoEm_nDeadCh;
334  }
335 
336  if (GCT_IsoEm_HotCh_QReport) {
337  int GCT_IsoEm_nHotCh = GCT_IsoEm_HotCh_QReport->getBadChannels().size();
338  if( verbose_ ) cout << " GCT_IsoEm_nHotCh: " << GCT_IsoEm_nHotCh
339  << ", GCT_IsoEm_nCh: " << GCT_IsoEm_nCh
340  << ", GCT_IsoEm_HotCh_efficiency: " << 1 - (float)GCT_IsoEm_nHotCh/(float)GCT_IsoEm_nCh
341  << " GCT_IsoEm_HotCh QTResult = " << GCT_IsoEm_HotCh_QReport->getQTresult() << std::endl;
342 
343  GCT_IsoEm_nBadCh+=GCT_IsoEm_nHotCh;
344  }
345 
346  if( verbose_ ) std::cout << " GCT_IsoEm total efficiency = " << 1 - (float)GCT_IsoEm_nBadCh/(float)GCT_IsoEm_nCh << std::endl;
347 
348  double GCT_IsoEm_nentries = GCT_IsoEm_QHist->getEntries();
349  float isoResult = -1;
350  if( (counterLS_>=thresholdLS_ && GCT_IsoEm_nentries==0) ) isoResult = 0;
351  if( (GCT_IsoEm_nentries>GCT_IsoEm_threshold_) ) isoResult = 1 - (float)(GCT_IsoEm_nBadCh-nCh_no_inst)/(float)(GCT_IsoEm_nCh-nCh_no_inst);
352  summaryContent[2] = ( isoResult < (1.0+1e-10) ) ? isoResult : 1.0;
353  }
354 
355 
356 
357 
358  //
359  // 03 TauJets Quality Tests
360  //
361  if (GCT_TauJets_QHist){
362  const QReport *GCT_TauJets_DeadCh_QReport = GCT_TauJets_QHist->getQReport("DeadChannels_GCT_2D_loose");
363  const QReport *GCT_TauJets_HotCh_QReport = GCT_TauJets_QHist->getQReport("HotChannels_GCT_2D");
364 
365  int GCT_TauJets_nBadCh = 0;
366 
367  if (GCT_TauJets_DeadCh_QReport) {
368  int GCT_TauJets_nDeadCh = GCT_TauJets_DeadCh_QReport->getBadChannels().size();
369  if( verbose_ ) cout << " GCT_TauJets_nDeadCh: " << GCT_TauJets_nDeadCh
370  << ", GCT_TauJets_nCh: " << GCT_TauJets_nCh
371  << ", GCT_TauJets_DeadCh_efficiency: " << 1 - (float)GCT_TauJets_nDeadCh/(float)GCT_TauJets_nCh
372  << " GCT_TauJets_DeadCh QTResult = " << GCT_TauJets_DeadCh_QReport->getQTresult() << std::endl;
373 
374  GCT_TauJets_nBadCh+=GCT_TauJets_nDeadCh;
375  }
376 
377  if (GCT_TauJets_HotCh_QReport) {
378  int GCT_TauJets_nHotCh = GCT_TauJets_HotCh_QReport->getBadChannels().size();
379  if( verbose_ ) cout << " GCT_TauJets_nHotCh: " << GCT_TauJets_nHotCh
380  << ", GCT_TauJets_nCh: " << GCT_TauJets_nCh
381  << ", GCT_TauJets_HotCh_efficiency: " << 1 - (float)GCT_TauJets_nHotCh/(float)GCT_TauJets_nCh
382  << " GCT_TauJets_HotCh QTResult = " << GCT_TauJets_HotCh_QReport->getQTresult() << std::endl;
383 
384  GCT_TauJets_nBadCh+=GCT_TauJets_nHotCh;
385  }
386 
387  if( verbose_ ) std::cout << " GCT_TauJets total efficiency = " << 1 - (float)GCT_TauJets_nBadCh/(float)GCT_TauJets_nCh << std::endl;
388 
389  double GCT_TauJets_nentries = GCT_TauJets_QHist->getEntries();
390  float taujetsResult = -1;
391  if( (counterLS_>=thresholdLS_ && GCT_TauJets_nentries==0) ) taujetsResult = 0;
392  if( (GCT_TauJets_nentries>GCT_TauJets_threshold_) ) taujetsResult = 1 - (float)(GCT_TauJets_nBadCh-nCh_no_inst)/(float)(GCT_TauJets_nCh-nCh_no_inst);
393  summaryContent[3] = ( taujetsResult < (1.0+1e-10) ) ? taujetsResult : 1.0;
394  }
395 
396 
397 
398 
399  //
400  // 04 Jets Quality Tests
401  //
402  if (GCT_AllJets_QHist){
403  const QReport *GCT_AllJets_DeadCh_QReport = GCT_AllJets_QHist->getQReport("DeadChannels_GCT_2D_tight");
404  const QReport *GCT_AllJets_HotCh_QReport = GCT_AllJets_QHist->getQReport("HotChannels_GCT_2D");
405 
406  int GCT_AllJets_nBadCh = 0;
407 
408  if (GCT_AllJets_DeadCh_QReport) {
409  int GCT_AllJets_nDeadCh = GCT_AllJets_DeadCh_QReport->getBadChannels().size();
410  if( verbose_ ) cout << " GCT_AllJets_nDeadCh: " << GCT_AllJets_nDeadCh
411  << ", GCT_AllJets_nCh: " << GCT_AllJets_nCh
412  << ", GCT_AllJets_DeadCh_efficiency: " << 1 - (float)GCT_AllJets_nDeadCh/(float)GCT_AllJets_nCh
413  << " GCT_AllJets_DeadCh QTResult = " << GCT_AllJets_DeadCh_QReport->getQTresult() << std::endl;
414 
415  GCT_AllJets_nBadCh+=GCT_AllJets_nDeadCh;
416  }
417 
418  if (GCT_AllJets_HotCh_QReport) {
419  int GCT_AllJets_nHotCh = GCT_AllJets_HotCh_QReport->getBadChannels().size();
420  if( verbose_ ) cout << " GCT_AllJets_nHotCh: " << GCT_AllJets_nHotCh
421  << ", GCT_AllJets_nCh: " << GCT_AllJets_nCh
422  << ", GCT_AllJets_HotCh_efficiency: " << 1 - (float)GCT_AllJets_nHotCh/(float)GCT_AllJets_nCh
423  << " GCT_AllJets_HotCh QTResult = " << GCT_AllJets_HotCh_QReport->getQTresult() << std::endl;
424 
425  GCT_AllJets_nBadCh+=GCT_AllJets_nHotCh;
426  }
427 
428  if( verbose_ ) std::cout << " GCT_AllJets total efficiency = " << 1 - (float)GCT_AllJets_nBadCh/(float)GCT_AllJets_nCh << std::endl;
429 
430  double GCT_AllJets_nentries = GCT_AllJets_QHist->getEntries();
431  float jetsResult = -1;
432  if( (counterLS_>=thresholdLS_ && GCT_AllJets_nentries==0) ) jetsResult = 0;
433  if( (GCT_AllJets_nentries>GCT_AllJets_threshold_) ) jetsResult = 1 - (float)GCT_AllJets_nBadCh/(float)GCT_AllJets_nCh;
434  summaryContent[4] = ( jetsResult < (1.0+1e-10) ) ? jetsResult : 1.0;
435  }
436 
437 
438 
439 
440  //
441  // 05 Muon Quality Tests
442  //
443 
444  if (GMT_QHist){
445  const QReport *GMT_DeadCh_QReport = GMT_QHist->getQReport("DeadChannels_GMT_2D");
446  const QReport *GMT_HotCh_QReport = GMT_QHist->getQReport("HotChannels_GMT_2D");
447 
448  int GMT_nBadCh = 0;
449 
450  if (GMT_DeadCh_QReport) {
451  int GMT_nDeadCh = GMT_DeadCh_QReport->getBadChannels().size();
452  if( verbose_ ) cout << " GMT_nDeadCh: " << GMT_nDeadCh
453  << ", GMT_nCh: " << GMT_nCh
454  << ", GMT_DeadCh_efficiency: " << 1 - (float)GMT_nDeadCh/(float)GMT_nCh
455  << " GMT_DeadCh QTResult = " << GMT_DeadCh_QReport->getQTresult() << std::endl;
456 
457  GMT_nBadCh+=GMT_nDeadCh;
458  }
459 
460  if (GMT_HotCh_QReport) {
461  int GMT_nHotCh = GMT_HotCh_QReport->getBadChannels().size();
462  if( verbose_ ) cout << " GMT_nHotCh: " << GMT_nHotCh
463  << ", GMT_nCh: " << GMT_nCh
464  << ", GMT_HotCh_efficiency: " << 1 - (float)GMT_nHotCh/(float)GMT_nCh
465  << " GMT_HotCh QTResult = " << GMT_HotCh_QReport->getQTresult() << std::endl;
466 
467  GMT_nBadCh+=GMT_nHotCh;
468  }
469 
470  if( verbose_ ) std::cout << " GMT total efficiency = " << 1 - (float)GMT_nBadCh/(float)GMT_nCh << std::endl;
471 
472  double GMT_nentries = GMT_QHist->getEntries();
473  float muonResult = -1;
474  if( (counterLS_>=thresholdLS_ && GMT_nentries==0) ) muonResult = 0;
475  if( (GMT_nentries>GMT_Muons_threshold_) ) muonResult = 1.5*(1 - (float)GMT_nBadCh/(float)GMT_nCh);
476  summaryContent[5] = ( muonResult < (1.0+1e-10) ) ? muonResult : 1.0;
477  }
478 
479 
480 
481  //
482  // 06 GT Quality Tests
483  //
484  double gt_algobits_prob = 0;
485  double gt_techbits_prob = 0;
486 
487  if (GT_AlgoBits_QHist){
488  gt_algobits_prob = 1;
489  const QReport *GT_AlgoBits_QReport = GT_AlgoBits_QHist->getQReport("CompareHist_GT");
490  if (GT_AlgoBits_QReport) gt_algobits_prob = GT_AlgoBits_QReport->getQTresult();
491  }
492  if (GT_TechBits_QHist){
493  gt_techbits_prob = 1;
494  const QReport *GT_TechBits_QReport = GT_TechBits_QHist->getQReport("CompareHist_GT");
495  if (GT_TechBits_QReport) gt_techbits_prob = GT_TechBits_QReport->getQTresult();
496  }
497 
498  if( gt_algobits_prob!=-1 && gt_techbits_prob!=-1 ) summaryContent[6] = 0.5*( gt_algobits_prob + gt_techbits_prob );
499  else if( GT_AlgoBits_QHist && GT_TechBits_QHist ) summaryContent[6] = 1;
500  else summaryContent[6] = 0;
501 
502 
503 
504 
505  //
506  // 07 - 17 L1T EMU Quality Tests
507  //
508 
509 
510 
511  //
512  // Apply masks for data and emulator
513  //
514 
515  // Data Mask
516  unsigned int NumDataMask = dataMask.size();
517  std::vector<string> maskedData;
518  for( unsigned int i=0; i<NumDataMask; i++ ){
519  std::string mask_sys_tmp = dataMask[i];
520  std::string mask_sys = StringToUpper(mask_sys_tmp);
521  switch(s_mapDataValues[mask_sys])
522  {
523  case data_empty:
524  break;
525  case data_all:
526  for( int m=0; m<7; m++ ) summaryContent[m] = -2;
527  maskedData.push_back(mask_sys_tmp);
528  break;
529  case data_gt:
530  summaryContent[6]=-2;
531  maskedData.push_back(mask_sys_tmp);
532  break;
533  case data_muons:
534  summaryContent[5]=-2;
535  maskedData.push_back(mask_sys_tmp);
536  break;
537  case data_jets:
538  summaryContent[4]=-2;
539  maskedData.push_back(mask_sys_tmp);
540  break;
541  case data_taujets:
542  summaryContent[3]=-2;
543  maskedData.push_back(mask_sys_tmp);
544  break;
545  case data_isoem:
546  summaryContent[2]=-2;
547  maskedData.push_back(mask_sys_tmp);
548  break;
549  case data_nonisoem:
550  summaryContent[1]=-2;
551  maskedData.push_back(mask_sys_tmp);
552  break;
553  case data_met:
554  summaryContent[0]=-2;
555  maskedData.push_back(mask_sys_tmp);
556  break;
557  default:
558  if( verbose_ ) cout << " User input mask '" << mask_sys_tmp << "' is not recognized." << endl;
559  break;
560  }
561  }
562 
563  // Emulator Mask
564  unsigned int NumEmulMask = emulMask.size();
565  std::vector<string> maskedEmul;
566  for( unsigned int i=0; i<NumEmulMask; i++ ){
567  std::string mask_sys_tmp = emulMask[i];
568  std::string mask_sys = StringToUpper(mask_sys_tmp);
569  switch(s_mapEmulValues[mask_sys])
570  {
571  case emul_empty:
572  break;
573  case emul_all:
574  for( int m=7; m<18; m++ ) summaryContent[m] = -2;
575  maskedEmul.push_back(mask_sys_tmp);
576  break;
577  case emul_glt:
578  summaryContent[7]=-2;
579  maskedEmul.push_back(mask_sys_tmp);
580  break;
581  case emul_gmt:
582  summaryContent[8]=-2;
583  maskedEmul.push_back(mask_sys_tmp);
584  break;
585  case emul_rpc:
586  summaryContent[9]=-2;
587  maskedEmul.push_back(mask_sys_tmp);
588  break;
589  case emul_ctp:
590  summaryContent[10]=-2;
591  maskedEmul.push_back(mask_sys_tmp);
592  break;
593  case emul_ctf:
594  summaryContent[11]=-2;
595  maskedEmul.push_back(mask_sys_tmp);
596  break;
597  case emul_dtp:
598  summaryContent[12]=-2;
599  maskedEmul.push_back(mask_sys_tmp);
600  break;
601  case emul_dtf:
602  summaryContent[13]=-2;
603  maskedEmul.push_back(mask_sys_tmp);
604  break;
605  case emul_htp:
606  summaryContent[14]=-2;
607  maskedEmul.push_back(mask_sys_tmp);
608  break;
609  case emul_etp:
610  summaryContent[15]=-2;
611  maskedEmul.push_back(mask_sys_tmp);
612  break;
613  case emul_gct:
614  summaryContent[16]=-2;
615  maskedEmul.push_back(mask_sys_tmp);
616  break;
617  case emul_rct:
618  summaryContent[17]=-2;
619  maskedEmul.push_back(mask_sys_tmp);
620  break;
621  default:
622  if( verbose_ ) cout << " User input mask '" << mask_sys_tmp << "' is not recognized." << endl;
623  break;
624  }
625  }
626 
627 
628  int numUnMaskedSystems = 0;
629  for( int m=0; m<nsys_; m++ ){
630  if( summaryContent[m]>-1e-5){
631  if( m<7 ){
632  summarySum += summaryContent[m];
633  numUnMaskedSystems++;
634  }
635 
636  reportSummaryContent_[m]->Fill( summaryContent[m] );
637  }
638  }
639 
640 
641 
642  // For now, only use L1T for reportSummary value
643  reportSummary = summarySum/float(numUnMaskedSystems);
644  if (reportSummary_) reportSummary_->Fill(reportSummary);
645 
646 
647  //L1T summary map
648  reportSummaryMap_->setBinContent(1,11,summaryContent[6]); // GT
649  reportSummaryMap_->setBinContent(1,10,summaryContent[5]); // Muons
650  reportSummaryMap_->setBinContent(1,9, summaryContent[4]); // Jets
651  reportSummaryMap_->setBinContent(1,8, summaryContent[3]); // TauJets
652  reportSummaryMap_->setBinContent(1,7, summaryContent[2]); // IsoEM
653  reportSummaryMap_->setBinContent(1,6, summaryContent[1]); // NonIsoEM
654  reportSummaryMap_->setBinContent(1,5, summaryContent[0]); // MET
655 
656  //L1TEMU summary map
657  reportSummaryMap_->setBinContent(2,11,summaryContent[7]); // GLT
658  reportSummaryMap_->setBinContent(2,10,summaryContent[8]); // GMT
659  reportSummaryMap_->setBinContent(2,9, summaryContent[9]); // RPC
660  reportSummaryMap_->setBinContent(2,8, summaryContent[10]);// CTP
661  reportSummaryMap_->setBinContent(2,7, summaryContent[11]);// CTF
662  reportSummaryMap_->setBinContent(2,6, summaryContent[12]);// DTP
663  reportSummaryMap_->setBinContent(2,5, summaryContent[13]);// DTF
664  reportSummaryMap_->setBinContent(2,4, summaryContent[14]);// HTP
665  reportSummaryMap_->setBinContent(2,3, summaryContent[15]);// ETP
666  reportSummaryMap_->setBinContent(2,2, summaryContent[16]);// GCT
667  reportSummaryMap_->setBinContent(2,1, summaryContent[17]);// RCT
668 
669 
670  if( verbose_ ){
671  if( maskedData.size()>0 ){
672  std::cout << " Masked Data Systems = ";
673  for( unsigned int i=0; i<maskedData.size(); i++ ){
674  if( i!=maskedData.size()-1 ){
675  std::cout << maskedData[i] << ", ";
676  }
677  else {
678  std::cout << maskedData[i] << std::endl;
679  }
680  }
681  }
682  if( maskedEmul.size()>0 ){
683  std::cout << " Masked Emul Systems = ";
684  for( unsigned int i=0; i<maskedEmul.size(); i++ ){
685  if( i!=maskedEmul.size()-1 ){
686  std::cout << maskedEmul[i] << ", ";
687  }
688  else {
689  std::cout << maskedEmul[i] << std::endl;
690  }
691  }
692  }
693 
694  std::cout << " L1T " << std::endl;
695  std::cout << " summaryContent[0] = MET = " << summaryContent[0] << std::endl;
696  std::cout << " summaryContent[1] = NonIsoEM = " << summaryContent[1] << std::endl;
697  std::cout << " summaryContent[2] = IsoEM = " << summaryContent[2] << std::endl;
698  std::cout << " summaryContent[3] = TauJets = " << summaryContent[3] << std::endl;
699  std::cout << " summaryContent[4] = Jets = " << summaryContent[4] << std::endl;
700  std::cout << " summaryContent[5] = Muons = " << summaryContent[5] << std::endl;
701  std::cout << " summaryContent[6] = GT = " << summaryContent[6] << std::endl;
702  std::cout << " L1T EMU" << std::endl;
703  std::cout << " summaryContent[7] = GLT = " << summaryContent[7] << std::endl;
704  std::cout << " summaryContent[8] = GMT = " << summaryContent[8] << std::endl;
705  std::cout << " summaryContent[9] = RPC = " << summaryContent[9] << std::endl;
706  std::cout << " summaryContent[10] = CTP = " << summaryContent[10] << std::endl;
707  std::cout << " summaryContent[11] = CTF = " << summaryContent[11] << std::endl;
708  std::cout << " summaryContent[12] = DTP = " << summaryContent[12] << std::endl;
709  std::cout << " summaryContent[13] = DTF = " << summaryContent[13] << std::endl;
710  std::cout << " summaryContent[14] = HTP = " << summaryContent[14] << std::endl;
711  std::cout << " summaryContent[15] = ETP = " << summaryContent[15] << std::endl;
712  std::cout << " summaryContent[16] = GCT = " << summaryContent[16] << std::endl;
713  std::cout << " summaryContent[17] = RCT = " << summaryContent[17] << std::endl;
714  }
715 
716 }
717 
718 
719 
720 //--------------------------------------------------------
721 void L1TEventInfoClient::analyze(const Event& e, const EventSetup& context){
722 
723  counterEvt_++;
724  if (prescaleEvt_<1) return;
725  if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;
726 
727  if(verbose_) cout << "L1TEventInfoClient::analyze" << endl;
728 
729 
730 
731 
732  //reportSummary = average of report summaries of each system
733 
734 
735 }
736 
737 //--------------------------------------------------------
738 void L1TEventInfoClient::endRun(const Run& r, const EventSetup& context){
739 }
740 
741 //--------------------------------------------------------
743 }
744 
745 
746 
747 TH1F * L1TEventInfoClient::get1DHisto(string meName, DQMStore * dbi)
748 {
749 
750  MonitorElement * me_ = dbi->get(meName);
751 
752  if (!me_) {
753  if(verbose_) cout << "ME NOT FOUND." << endl;
754  return NULL;
755  }
756 
757  return me_->getTH1F();
758 }
759 
760 TH2F * L1TEventInfoClient::get2DHisto(string meName, DQMStore * dbi)
761 {
762 
763 
764  MonitorElement * me_ = dbi->get(meName);
765 
766  if (!me_) {
767  if(verbose_) cout << "ME NOT FOUND." << endl;
768  return NULL;
769  }
770 
771  return me_->getTH2F();
772 }
773 
774 
775 
776 TProfile2D * L1TEventInfoClient::get2DProfile(string meName, DQMStore * dbi)
777 {
778 
779 
780  MonitorElement * me_ = dbi->get(meName);
781 
782  if (!me_) {
783  if(verbose_) cout << "ME NOT FOUND." << endl;
784  return NULL;
785  }
786 
787  return me_->getTProfile2D();
788 }
789 
790 
791 TProfile * L1TEventInfoClient::get1DProfile(string meName, DQMStore * dbi)
792 {
793 
794 
795  MonitorElement * me_ = dbi->get(meName);
796 
797  if (!me_) {
798  if(verbose_) cout << "ME NOT FOUND." << endl;
799  return NULL;
800  }
801 
802  return me_->getTProfile();
803 }
804 
805 string L1TEventInfoClient::StringToUpper(string strToConvert)
806 {//change each element of the string to upper case
807  for(unsigned int i=0;i<strToConvert.length();i++)
808  {
809  strToConvert[i] = toupper(strToConvert[i]);
810  }
811  return strToConvert;//return the converted string
812 }
813 
814 
815 
816 
817 
818 
819 
L1TEventInfoClient(const edm::ParameterSet &ps)
Constructor.
int i
Definition: DBlmapReader.cc:9
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to &lt;qtname&gt; (null pointer if QReport does not exist)
TProfile2D * getTProfile2D(void) const
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
TProfile2D * get2DProfile(std::string meName, DQMStore *dbi)
#define NULL
Definition: scimark2.h:8
TH2F * get2DHisto(std::string meName, DQMStore *dbi)
void beginJob(void)
BeginJob.
double getEntries(void) const
get # of entries
void analyze(const edm::Event &e, const edm::EventSetup &c)
Fake Analyze.
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
virtual ~L1TEventInfoClient()
Destructor.
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
const std::vector< DQMChannel > & getBadChannels(void) const
Definition: QReport.h:33
DQMStore * dbe_
int k[5][pyjets_maxn]
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
TH1F * getTH1F(void) const
float getQTresult(void) const
get test result i.e. prob value
Definition: QReport.h:20
TProfile * getTProfile(void) const
int getNbinsX(void) const
get # of bins in X-axis
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
Definition: Run.h:33
std::string StringToUpper(std::string strToConvert)
TProfile * get1DProfile(std::string meName, DQMStore *dbi)
TH1F * get1DHisto(std::string meName, DQMStore *dbi)