16 #include <TProfile2D.h>
35 if(verbose_)
cout <<
"[TriggerDQM]: ending... " << endl;
48 verbose_ = parameters_.getUntrackedParameter<
bool>(
"verbose",
false);
50 monitorDir_ = parameters_.getUntrackedParameter<
string>(
"monitorDir",
"");
51 if(verbose_)
cout <<
"Monitor dir = " << monitorDir_ << endl;
53 prescaleLS_ = parameters_.getUntrackedParameter<
int>(
"prescaleLS", -1);
54 if(verbose_)
cout <<
"DQM lumi section prescale = " << prescaleLS_ <<
" lumi section(s)"<< endl;
56 prescaleEvt_ = parameters_.getUntrackedParameter<
int>(
"prescaleEvt", -1);
57 if(verbose_)
cout <<
"DQM event prescale = " << prescaleEvt_ <<
" events(s)"<< endl;
61 std::string syslabel [nsysmon_]=
62 {
"DTTF",
"DTTPG",
"CSCTF",
"CSCTPG",
"RPC",
"GMT",
"ECAL",
"HCAL",
"RCT",
"GCT",
"GT"};
63 std::string syslabelext[nsysmon_]=
64 {
"DTF",
"DTP",
"CTF",
"CTP",
"RPC",
"GMT",
"ETP",
"HTP",
"RCT",
"GCT",
"GLT"};
65 std::vector<unsigned int> sysmask(0,nsysmon_);
66 sysmask = parameters_.getUntrackedParameter<std::vector<unsigned int> >(
"maskedSystems", sysmask);
68 for(
int i=0;
i<nsysmon_;
i++) {
69 syslabel_[
i] = syslabel[
i];
70 syslabelext_[
i] = syslabelext[
i];
71 sysmask_[
i] = sysmask[
i];
74 std::vector<string> emptyMask;
76 dataMask = parameters_.getUntrackedParameter<std::vector<string> >(
"dataMaskedSystems", emptyMask);
77 emulMask = parameters_.getUntrackedParameter<std::vector<string> >(
"emulatorMaskedSystems", emptyMask);
79 s_mapDataValues[
"EMPTY"] = data_empty;
80 s_mapDataValues[
"ALL"] = data_all;
81 s_mapDataValues[
"GT"] = data_gt;
82 s_mapDataValues[
"MUONS"] = data_muons;
83 s_mapDataValues[
"JETS"] = data_jets;
84 s_mapDataValues[
"TAUJETS"] = data_taujets;
85 s_mapDataValues[
"ISOEM"] = data_isoem;
86 s_mapDataValues[
"NONISOEM"] = data_nonisoem;
87 s_mapDataValues[
"MET"] = data_met;
89 s_mapEmulValues[
"EMPTY"] = emul_empty;
90 s_mapEmulValues[
"ALL"] = emul_all;
91 s_mapEmulValues[
"DTTF"] = emul_dtf;
92 s_mapEmulValues[
"DTTPG"] = emul_dtp;
93 s_mapEmulValues[
"CSCTF"] = emul_ctf;
94 s_mapEmulValues[
"CSCTPG"] = emul_ctp;
95 s_mapEmulValues[
"RPC"] = emul_rpc;
96 s_mapEmulValues[
"GMT"] = emul_gmt;
97 s_mapEmulValues[
"ECAL"] = emul_etp;
98 s_mapEmulValues[
"HCAL"] = emul_htp;
99 s_mapEmulValues[
"RCT"] = emul_rct;
100 s_mapEmulValues[
"GCT"] = emul_gct;
101 s_mapEmulValues[
"GLT"] = emul_glt;
120 if(verbose_)
cout <<
"[TriggerDQM]: Begin Job" << endl;
127 if( (reportSummary_ =
dbe_->
get(
"L1TEMU/EventInfo/reportSumamry")) ){
134 if (reportSummary_) reportSummary_->
Fill(1);
141 for (
int n = 0;
n < nsys_;
n++) {
144 case 0 : sprintf(histo,
"L1T_MET");
break;
145 case 1 : sprintf(histo,
"L1T_NonIsoEM");
break;
146 case 2 : sprintf(histo,
"L1T_IsoEM");
break;
147 case 3 : sprintf(histo,
"L1T_TauJets");
break;
148 case 4 : sprintf(histo,
"L1T_Jets");
break;
149 case 5 : sprintf(histo,
"L1T_Muons");
break;
150 case 6 : sprintf(histo,
"L1T_GT");
break;
151 case 7 : sprintf(histo,
"L1TEMU_GLT");
break;
152 case 8 : sprintf(histo,
"L1TEMU_GMT");
break;
153 case 9 : sprintf(histo,
"L1TEMU_RPC");
break;
154 case 10: sprintf(histo,
"L1TEMU_CTP");
break;
155 case 11: sprintf(histo,
"L1TEMU_CTF");
break;
156 case 12: sprintf(histo,
"L1TEMU_DTP");
break;
157 case 13: sprintf(histo,
"L1TEMU_DTF");
break;
158 case 14: sprintf(histo,
"L1TEMU_HTP");
break;
159 case 15: sprintf(histo,
"L1TEMU_ETP");
break;
160 case 16: sprintf(histo,
"L1TEMU_GCT");
break;
161 case 17: sprintf(histo,
"L1TEMU_RCT");
break;
168 for (
int k = 0;
k < nsys_;
k++) {
169 summaryContent[
k] = 0;
170 reportSummaryContent_[
k]->
Fill(0.);
176 if( (reportSummaryMap_ =
dbe_->
get(
"L1TEMU/EventInfo/reportSummaryMap")) ){
180 reportSummaryMap_ =
dbe_->
book2D(
"reportSummaryMap",
"reportSummaryMap", 2, 1, 3, 11, 1, 12);
182 reportSummaryMap_->setAxisTitle(
"", 2);
184 reportSummaryMap_->setBinLabel(1,
" ",1);
185 reportSummaryMap_->setBinLabel(2,
" ",1);
187 reportSummaryMap_->setBinLabel(1,
" ",2);
188 reportSummaryMap_->setBinLabel(2,
" ",2);
189 reportSummaryMap_->setBinLabel(3,
" ",2);
190 reportSummaryMap_->setBinLabel(4,
" ",2);
191 reportSummaryMap_->setBinLabel(5,
" ",2);
192 reportSummaryMap_->setBinLabel(6,
" ",2);
193 reportSummaryMap_->setBinLabel(7,
" ",2);
194 reportSummaryMap_->setBinLabel(8,
" ",2);
195 reportSummaryMap_->setBinLabel(9,
" ",2);
196 reportSummaryMap_->setBinLabel(10,
" ",2);
197 reportSummaryMap_->setBinLabel(11,
" ",2);
215 for (
int k = 0;
k < nsys_;
k++) {
216 summaryContent[
k] = 0;
217 reportSummaryContent_[
k]->Fill(0.);
227 unsigned int NumDataMask = dataMask.size();
228 std::vector<string> maskedData;
229 for(
unsigned int i=0;
i<NumDataMask;
i++ ){
230 std::string mask_sys_tmp = dataMask[
i];
231 std::string mask_sys = StringToUpper(mask_sys_tmp);
232 switch(s_mapDataValues[mask_sys])
237 for(
int m=0;
m<7;
m++ ) summaryContent[
m] = -1;
238 maskedData.push_back(mask_sys_tmp);
241 summaryContent[6]=-1;
242 maskedData.push_back(mask_sys_tmp);
245 summaryContent[5]=-1;
246 maskedData.push_back(mask_sys_tmp);
249 summaryContent[4]=-1;
250 maskedData.push_back(mask_sys_tmp);
253 summaryContent[3]=-1;
254 maskedData.push_back(mask_sys_tmp);
257 summaryContent[2]=-1;
258 maskedData.push_back(mask_sys_tmp);
261 summaryContent[1]=-1;
262 maskedData.push_back(mask_sys_tmp);
265 summaryContent[0]=-1;
266 maskedData.push_back(mask_sys_tmp);
269 if( verbose_ )
cout <<
" User input mask '" << mask_sys_tmp <<
"' is not recognized." << endl;
275 unsigned int NumEmulMask = emulMask.size();
276 std::vector<string> maskedEmul;
277 for(
unsigned int i=0;
i<NumEmulMask;
i++ ){
278 std::string mask_sys_tmp = emulMask[
i];
279 std::string mask_sys = StringToUpper(mask_sys_tmp);
280 switch(s_mapEmulValues[mask_sys])
285 for(
int m=7;
m<18;
m++ ) summaryContent[
m] = -1;
286 maskedEmul.push_back(mask_sys_tmp);
289 summaryContent[7]=-1;
290 maskedEmul.push_back(mask_sys_tmp);
293 summaryContent[8]=-1;
294 maskedEmul.push_back(mask_sys_tmp);
297 summaryContent[9]=-1;
298 maskedEmul.push_back(mask_sys_tmp);
301 summaryContent[10]=-1;
302 maskedEmul.push_back(mask_sys_tmp);
305 summaryContent[11]=-1;
306 maskedEmul.push_back(mask_sys_tmp);
309 summaryContent[12]=-1;
310 maskedEmul.push_back(mask_sys_tmp);
313 summaryContent[13]=-1;
314 maskedEmul.push_back(mask_sys_tmp);
317 summaryContent[14]=-1;
318 maskedEmul.push_back(mask_sys_tmp);
321 summaryContent[15]=-1;
322 maskedEmul.push_back(mask_sys_tmp);
325 summaryContent[16]=-1;
326 maskedEmul.push_back(mask_sys_tmp);
329 summaryContent[17]=-1;
330 maskedEmul.push_back(mask_sys_tmp);
333 if( verbose_ )
cout <<
" User input mask '" << mask_sys_tmp <<
"' is not recognized." << endl;
338 for(
int i=0;
i<nsysmon_;
i++ ){
339 if( summaryContent[emulatorMap[
i]]==-1 ) sysmask_[
i] = 1;
345 for(
int i=0;
i<nsysmon_;
i++) {
347 lbl+=
"L1TEMU/"; lbl+=syslabel_[
i]; lbl+=
"/";
348 lbl+=syslabelext_[
i]; lbl+=
"ErrorFlag";
352 pv = setSummary(QHist[i]);
354 summaryContent[emulatorMap[
i]] = pv;
359 int numUnMaskedSystems = 0;
360 for(
int m=0;
m<nsys_;
m++ ){
361 if( summaryContent[
m]!=-1){
363 summarySum += summaryContent[
m];
364 numUnMaskedSystems++;
367 reportSummaryContent_[
m]->Fill( summaryContent[
m] );
374 reportSummary = summarySum/float(numUnMaskedSystems);
375 if (reportSummary_) reportSummary_->Fill(reportSummary);
379 reportSummaryMap_->setBinContent(1,11,summaryContent[6]);
380 reportSummaryMap_->setBinContent(1,10,summaryContent[5]);
381 reportSummaryMap_->setBinContent(1,9, summaryContent[4]);
382 reportSummaryMap_->setBinContent(1,8, summaryContent[3]);
383 reportSummaryMap_->setBinContent(1,7, summaryContent[2]);
384 reportSummaryMap_->setBinContent(1,6, summaryContent[1]);
385 reportSummaryMap_->setBinContent(1,5, summaryContent[0]);
388 reportSummaryMap_->setBinContent(2,11,summaryContent[7]);
389 reportSummaryMap_->setBinContent(2,10,summaryContent[8]);
390 reportSummaryMap_->setBinContent(2,9, summaryContent[9]);
391 reportSummaryMap_->setBinContent(2,8, summaryContent[10]);
392 reportSummaryMap_->setBinContent(2,7, summaryContent[11]);
393 reportSummaryMap_->setBinContent(2,6, summaryContent[12]);
394 reportSummaryMap_->setBinContent(2,5, summaryContent[13]);
395 reportSummaryMap_->setBinContent(2,4, summaryContent[14]);
396 reportSummaryMap_->setBinContent(2,3, summaryContent[15]);
397 reportSummaryMap_->setBinContent(2,2, summaryContent[16]);
398 reportSummaryMap_->setBinContent(2,1, summaryContent[17]);
402 if( maskedData.size()>0 ){
404 for(
unsigned int i=0;
i<maskedData.size();
i++ ){
405 if(
i!=maskedData.size()-1 ){
413 if( maskedEmul.size()>0 ){
415 for(
unsigned int i=0;
i<maskedEmul.size();
i++ ){
416 if(
i!=maskedEmul.size()-1 ){
426 std::cout <<
" summaryContent[0] = MET = " << summaryContent[0] << std::endl;
427 std::cout <<
" summaryContent[1] = NonIsoEM = " << summaryContent[1] << std::endl;
428 std::cout <<
" summaryContent[2] = IsoEM = " << summaryContent[2] << std::endl;
429 std::cout <<
" summaryContent[3] = TauJets = " << summaryContent[3] << std::endl;
430 std::cout <<
" summaryContent[4] = Jets = " << summaryContent[4] << std::endl;
431 std::cout <<
" summaryContent[5] = Muons = " << summaryContent[5] << std::endl;
432 std::cout <<
" summaryContent[6] = GT = " << summaryContent[6] << std::endl;
434 std::cout <<
" summaryContent[7] = GLT = " << summaryContent[7] << std::endl;
435 std::cout <<
" summaryContent[8] = GMT = " << summaryContent[8] << std::endl;
436 std::cout <<
" summaryContent[9] = RPC = " << summaryContent[9] << std::endl;
437 std::cout <<
" summaryContent[10] = CTP = " << summaryContent[10] << std::endl;
438 std::cout <<
" summaryContent[11] = CTF = " << summaryContent[11] << std::endl;
439 std::cout <<
" summaryContent[12] = DTP = " << summaryContent[12] << std::endl;
440 std::cout <<
" summaryContent[13] = DTF = " << summaryContent[13] << std::endl;
441 std::cout <<
" summaryContent[14] = HTP = " << summaryContent[14] << std::endl;
442 std::cout <<
" summaryContent[15] = ETP = " << summaryContent[15] << std::endl;
443 std::cout <<
" summaryContent[16] = GCT = " << summaryContent[16] << std::endl;
444 std::cout <<
" summaryContent[17] = RCT = " << summaryContent[17] << std::endl;
454 if (prescaleEvt_<1)
return;
455 if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0)
return;
457 if(verbose_)
cout <<
"L1TEMUEventInfoClient::analyze" << endl;
473 for(
int i=1;
i<5;
i++)
475 {isempty=
false;
continue;}
476 return isempty ? -1. :
486 if(verbose_)
cout <<
"ME NOT FOUND." << endl;
500 if(verbose_)
cout <<
"ME NOT FOUND." << endl;
516 if(verbose_)
cout <<
"ME NOT FOUND." << endl;
531 if(verbose_)
cout <<
"ME NOT FOUND." << endl;
540 for(
unsigned int i=0;
i<strToConvert.length();
i++)
542 strToConvert[
i] = toupper(strToConvert[
i]);
std::string StringToUpper(std::string strToConvert)
TProfile2D * getTProfile2D(void) const
void beginJob(void)
BeginJob.
TH1F * get1DHisto(std::string meName, DQMStore *dbi)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
Float_t setSummary(MonitorElement *)
double getEntries(void) const
get # of entries
virtual ~L1TEMUEventInfoClient()
Destructor.
TProfile2D * get2DProfile(std::string meName, DQMStore *dbi)
L1TEMUEventInfoClient(const edm::ParameterSet &ps)
Constructor.
MonitorElement * bookFloat(const char *name)
Book float.
void removeElement(const std::string &name)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DQM Client Diagnostic.
TProfile * get1DProfile(std::string meName, DQMStore *dbi)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
TH1F * getTH1F(void) const
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
double getBinContent(int binx) const
get content of bin (1-D)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Fake Analyze.
TProfile * getTProfile(void) const
TH2F * get2DHisto(std::string meName, DQMStore *dbi)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
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.
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)