219 int UnstableLEDCnt=0;
221 int HBP[7]={0,0,0,0,0,0,0},newHBP[7]={0,0,0,0,0,0,0};
222 int HBM[7]={0,0,0,0,0,0,0},newHBM[7]={0,0,0,0,0,0,0};
223 int HEP[7]={0,0,0,0,0,0,0},newHEP[7]={0,0,0,0,0,0,0};
224 int HEM[7]={0,0,0,0,0,0,0},newHEM[7]={0,0,0,0,0,0,0};
225 int HFP[7]={0,0,0,0,0,0,0},newHFP[7]={0,0,0,0,0,0,0};
226 int HFM[7]={0,0,0,0,0,0,0},newHFM[7]={0,0,0,0,0,0,0};
227 int HO[7] ={0,0,0,0,0,0,0},newHO[7] ={0,0,0,0,0,0,0};
230 if (
debug_>0)
std::cout <<
"<HcalDetDiagLEDClient::htmlOutput> Preparing html output ..." << std::endl;
235 for(
int i=0;
i<4;++
i){
240 s=
subdir_+
"channel status/"+name[
i]+
" Missing Channels";
243 s=
subdir_+
"channel status/"+name[
i]+
" Unstable Channels";
246 s=
subdir_+
"channel status/"+name[
i]+
" Unstable LED";
249 s=
subdir_+
"channel status/"+name[
i]+
" LED Mean";
252 s=
subdir_+
"channel status/"+name[
i]+
" LED RMS";
255 s=
subdir_+
"channel status/"+name[
i]+
" Time Mean";
258 s=
subdir_+
"channel status/"+name[
i]+
" Time RMS";
261 s=
subdir_+
"Summary Plots/"+name[
i]+
" Channel LED Energy";
264 s=
subdir_+
"Summary Plots/"+name[
i]+
" Channel LED Energy Reference";
271 int feta=0,teta=0,fdepth=0,tdepth=0;
272 if(
sd==0){ feta=-16; teta=16 ;fdepth=1; tdepth=2; }
273 if(
sd==1){ feta=-29; teta=29 ;fdepth=1; tdepth=3; }
274 if(
sd==2){ feta=-15; teta=15 ;fdepth=4; tdepth=4; }
275 if(
sd==3){ feta=-42; teta=42 ;fdepth=1; tdepth=2; }
276 for(
int phi=1;
phi<=72;
phi++)
for(
int depth=fdepth;depth<=tdepth;depth++)
for(
int eta=feta;
eta<=teta;
eta++){
277 if(
sd==3 &&
eta>-29 &&
eta<29)
continue;
278 double problem[7]={0,0,0,0,0,0,0};
279 for(
int i=0;
i<6;
i++){
288 if(
sd==0){
if(
eta>0){
295 if(
sd==1){
if(
eta>0){
306 if(
sd==3){
if(
eta>0){
318 std::ofstream Missing;
319 Missing.open((htmlDir +
"Missing.html").c_str());
322 std::ofstream BadTiming;
323 BadTiming.open((htmlDir +
"BadTiming.html").c_str());
326 std::ofstream Unstable;
327 Unstable.open((htmlDir +
"Unstable.html").c_str());
330 std::ofstream BadLED;
331 BadLED.open((htmlDir +
"UnstableLED.html").c_str());
336 if(
sd==0 && ((HBM[0]+HBP[0])==0 || (HBM[0]+HBP[0])==(1296*2)))
continue;
337 if(
sd==1 && ((HEM[0]+HEP[0])==0 || (HEM[0]+HEP[0])==(1296*2)))
continue;
338 if(
sd==2 && ((HO[0])==0 || HO[0]==2160))
continue;
339 if(
sd==3 && ((HFM[0]+HFP[0])==0 || (HFM[0]+HFP[0])==(864*2)))
continue;
340 Missing <<
"<tr><td align=\"center\"><h3>"<< subdet[
sd] <<
"</h3></td></tr>" << std::endl;
341 int feta=0,teta=0,fdepth=0,tdepth=0;
342 if(
sd==0){ feta=-16; teta=16 ;fdepth=1; tdepth=2;
if(HBM[0]==1296) feta=0;
if(HBP[0]==1296) teta=0;}
343 if(
sd==1){ feta=-29; teta=29 ;fdepth=1; tdepth=3;
if(HEM[0]==1296) feta=0;
if(HEP[0]==1296) teta=0;}
344 if(
sd==2){ feta=-15; teta=15 ;fdepth=4; tdepth=4;
if(HO[0] ==2160) {feta=0; teta=0; }}
345 if(
sd==3){ feta=-42; teta=42 ;fdepth=1; tdepth=2;
if(HFM[0]==864) feta=0;
if(HFP[0]==864) teta=0; }
346 for(
int phi=1;
phi<=72;
phi++)
for(
int depth=fdepth;depth<=tdepth;depth++)
for(
int eta=feta;
eta<=teta;
eta++){
347 if(
sd==3 &&
eta>-29 &&
eta<29)
continue;
359 printTableLine(Missing,cnt++,*detid,lmap_entry,emap_entry,s); MissingCnt++;
367 if(
sd==0 && (HBM[5]+HBP[5])==0)
continue;
368 if(
sd==1 && (HEM[5]+HEP[5])==0)
continue;
369 if(
sd==2 && (HO[5])==0)
continue;
370 if(
sd==3 && (HFM[5]+HFP[5])==0)
continue;
371 BadTiming <<
"<tr><td align=\"center\"><h3>"<< subdet[
sd] <<
"</h3></td></tr>" << std::endl;
372 int feta=0,teta=0,fdepth=0,tdepth=0;
373 if(
sd==0){ feta=-16; teta=16 ;fdepth=1; tdepth=2;
if(HBM[0]==1296) feta=0;
if(HBP[0]==1296) teta=0;}
374 if(
sd==1){ feta=-29; teta=29 ;fdepth=1; tdepth=3;
if(HEM[0]==1296) feta=0;
if(HEP[0]==1296) teta=0;}
375 if(
sd==2){ feta=-15; teta=15 ;fdepth=4; tdepth=4;
if(HO[0] ==2160) {feta=0; teta=0; }}
376 if(
sd==3){ feta=-42; teta=42 ;fdepth=1; tdepth=2;
if(HFM[0]==864) feta=0;
if(HFP[0]==864) teta=0; }
377 for(
int phi=1;
phi<=72;
phi++)
for(
int depth=fdepth;depth<=tdepth;depth++)
for(
int eta=feta;
eta<=teta;
eta++){
378 if(
sd==3 &&
eta>-29 &&
eta<29)
continue;
382 char comment[100]; sprintf(comment,
"Time-mean=%.1f\n",badtiming);
390 printTableLine(BadTiming,cnt++,*detid,lmap_entry,emap_entry,comment); BadTimingCnt++;
399 if(
sd==0 && (HBM[1]+HBP[1])==0)
continue;
400 if(
sd==1 && (HEM[1]+HEP[1])==0)
continue;
401 if(
sd==2 && (HO[1])==0)
continue;
402 if(
sd==3 && (HFM[1]+HFP[1])==0)
continue;
403 Unstable <<
"<tr><td align=\"center\"><h3>"<< subdet[
sd] <<
"</h3></td></tr>" << std::endl;
404 int feta=0,teta=0,fdepth=0,tdepth=0;
405 if(
sd==0){ feta=-16; teta=16 ;fdepth=1; tdepth=2;}
406 if(
sd==1){ feta=-29; teta=29 ;fdepth=1; tdepth=3;}
407 if(
sd==2){ feta=-15; teta=15 ;fdepth=4; tdepth=4;}
408 if(
sd==3){ feta=-42; teta=42 ;fdepth=1; tdepth=2;}
409 for(
int phi=1;
phi<=72;
phi++)
for(
int depth=fdepth;depth<=tdepth;depth++)
for(
int eta=feta;
eta<=teta;
eta++){
410 if(
sd==3 &&
eta>-29 &&
eta<29)
continue;
414 char comment[100]; sprintf(comment,
"%.3f%%\n",(1.0-unstable)*100.0);
422 printTableLine(Unstable,cnt++,*detid,lmap_entry,emap_entry,comment); UnstableCnt++;
431 if(
sd==0 && (HBM[2]+HBP[2])==0)
continue;
432 if(
sd==1 && (HEM[2]+HEP[2])==0)
continue;
433 if(
sd==2 && (HO[2])==0)
continue;
434 if(
sd==3 && (HFM[2]+HFP[2])==0)
continue;
435 BadLED <<
"<tr><td align=\"center\"><h3>"<< subdet[
sd] <<
"</h3></td></tr>" << std::endl;
436 int feta=0,teta=0,fdepth=0,tdepth=0;
437 if(
sd==0){ feta=-16; teta=16 ;fdepth=1; tdepth=2;}
438 if(
sd==1){ feta=-29; teta=29 ;fdepth=1; tdepth=3;}
439 if(
sd==2){ feta=-15; teta=15 ;fdepth=4; tdepth=4;}
440 if(
sd==3){ feta=-42; teta=42 ;fdepth=1; tdepth=2;}
441 for(
int phi=1;
phi<=72;
phi++)
for(
int depth=fdepth;depth<=tdepth;depth++)
for(
int eta=feta;
eta<=teta;
eta++){
442 if(
sd==3 &&
eta>-29 &&
eta<29)
continue;
446 char comment[100]; sprintf(comment,
"%.3f%%\n",(badled)*100.0);
456 printTableLine(BadLED,cnt++,*detid,lmap_entry,emap_entry,s); UnstableLEDCnt++;
471 int ievt_ = -1,runNo=-1;
477 sscanf((s.substr(2,s.length()-2)).c_str(),
"%d", &ievt_);
479 s=
subdir_+
"HcalDetDiagLEDMonitor Run Number";
483 sscanf((s.substr(2,s.length()-2)).c_str(),
"%d", &runNo);
485 s=
subdir_+
"HcalDetDiagLEDMonitor Reference Run";
490 sscanf((s.substr(2,s.length()-2)).c_str(),
"%s", str);
493 TH1F *Energy=0,*Timing=0,*EnergyHF=0,*TimingHF=0,*EnergyRMS=0,*TimingRMS=0,*EnergyRMSHF=0,*TimingRMSHF=0;
494 TH2F *Time2Dhbhehf=0,*Time2Dho=0,*Energy2Dhbhehf=0,*Energy2Dho=0;
495 TH2F *HBPphi=0,*HBMphi=0,*HEPphi=0,*HEMphi=0,*HFPphi=0,*HFMphi=0,*HO0phi=0,*HO1Pphi=0,*HO2Pphi=0,*HO1Mphi=0,*HO2Mphi=0;
498 if(me!=0) Energy=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, Energy,
debug_);
else return;
500 if(me!=0) Timing=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, Timing,
debug_);
else return;
501 s=
subdir_+
"Summary Plots/HBHEHO LED Energy RMS_div_Energy Distribution"; me=
dqmStore_->
get(s.c_str());
502 if(me!=0) EnergyRMS=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, EnergyRMS,
debug_);
else return;
503 s=
subdir_+
"Summary Plots/HBHEHO LED Timing RMS Distribution"; me=
dqmStore_->
get(s.c_str());
504 if(me!=0) TimingRMS=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, TimingRMS,
debug_);
else return;
506 if(me!=0) EnergyHF=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, EnergyHF,
debug_);
else return;
508 if(me!=0) TimingHF=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, TimingHF,
debug_);
else return;
509 s=
subdir_+
"Summary Plots/HF LED Energy RMS_div_Energy Distribution"; me=
dqmStore_->
get(s.c_str());
510 if(me!=0) EnergyRMSHF=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, EnergyRMSHF,
debug_);
else return;
512 if(me!=0) TimingRMSHF=HcalUtilsClient::getHisto<TH1F*>(me,
cloneME_, TimingRMSHF,
debug_);
else return;
515 if(me!=0) Time2Dhbhehf=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, Time2Dhbhehf,
debug_);
else return;
517 if(me!=0) Time2Dho=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, Time2Dho,
debug_);
else return;
519 if(me!=0) Energy2Dhbhehf=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, Energy2Dhbhehf,
debug_);
else return;
521 if(me!=0) Energy2Dho=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, Energy2Dho,
debug_);
else return;
524 if(me!=0) HBPphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HBPphi,
debug_);
else return;
526 if(me!=0) HBMphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HBMphi,
debug_);
else return;
528 if(me!=0) HEPphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HEPphi,
debug_);
else return;
530 if(me!=0) HEMphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HEMphi,
debug_);
else return;
532 if(me!=0) HFPphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HFPphi,
debug_);
else return;
534 if(me!=0) HFMphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HFMphi,
debug_);
else return;
537 if(me!=0) HO0phi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HO0phi,
debug_);
else return;
539 if(me!=0) HO1Pphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HO1Pphi,
debug_);
else return;
541 if(me!=0) HO2Pphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HO2Pphi,
debug_);
else return;
543 if(me!=0) HO1Mphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HO1Mphi,
debug_);
else return;
545 if(me!=0) HO2Mphi=HcalUtilsClient::getHisto<TH2F*>(me,
cloneME_, HO2Mphi,
debug_);
else return;
547 gROOT->SetBatch(
true);
548 gStyle->SetCanvasColor(0);
549 gStyle->SetPadColor(0);
550 gStyle->SetOptStat(111110);
551 gStyle->SetPalette(1);
553 TCanvas *
can=
new TCanvas(
"HcalDetDiagLEDClient",
"HcalDetDiagLEDClient",0,0,500,350);
558 std::ofstream htmlFile;
560 htmlFile.open(outfile.c_str());
562 htmlFile <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
563 htmlFile <<
"<html> " << std::endl;
564 htmlFile <<
"<head> " << std::endl;
565 htmlFile <<
" <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
566 htmlFile <<
" http-equiv=\"content-type\"> " << std::endl;
567 htmlFile <<
" <title>Detector Diagnostics LED Monitor</title> " << std::endl;
568 htmlFile <<
"</head> " << std::endl;
569 htmlFile <<
"<style type=\"text/css\"> td { font-weight: bold } </style>" << std::endl;
570 htmlFile <<
"<style type=\"text/css\">"<< std::endl;
571 htmlFile <<
" td.s0 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FF7700; text-align: center;}"<< std::endl;
572 htmlFile <<
" td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
573 htmlFile <<
" td.s2 { font-family: arial, arial ce, helvetica; background-color: red; }"<< std::endl;
574 htmlFile <<
" td.s3 { font-family: arial, arial ce, helvetica; background-color: yellow; }"<< std::endl;
575 htmlFile <<
" td.s4 { font-family: arial, arial ce, helvetica; background-color: green; }"<< std::endl;
576 htmlFile <<
" td.s5 { font-family: arial, arial ce, helvetica; background-color: silver; }"<< std::endl;
577 std::string state[4]={
"<td class=\"s2\" align=\"center\">",
578 "<td class=\"s3\" align=\"center\">",
579 "<td class=\"s4\" align=\"center\">",
580 "<td class=\"s5\" align=\"center\">"};
581 htmlFile <<
"</style>"<< std::endl;
582 htmlFile <<
"<body> " << std::endl;
583 htmlFile <<
"<br> " << std::endl;
584 htmlFile <<
"<h2>Run: " << std::endl;
585 htmlFile <<
" <span " << std::endl;
586 htmlFile <<
" style=\"color: rgb(0, 0, 153);\">" << runNo <<
"</span></h2>" << std::endl;
587 htmlFile <<
"<h2>Monitoring task: <span " << std::endl;
588 htmlFile <<
" style=\"color: rgb(0, 0, 153);\">Detector Diagnostics LED Monitor</span></h2> " << std::endl;
589 htmlFile <<
"<h2>Events processed: <span " << std::endl;
590 htmlFile <<
" style=\"color: rgb(0, 0, 153);\">" << ievt_ <<
"</span></h2>" << std::endl;
591 htmlFile <<
"<hr>" << std::endl;
593 htmlFile <<
"<table width=100% border=1>" << std::endl;
594 htmlFile <<
"<tr>" << std::endl;
595 htmlFile <<
"<td class=\"s0\" width=15% align=\"center\">SebDet</td>" << std::endl;
596 htmlFile <<
"<td class=\"s0\" width=17% align=\"center\">Missing</td>" << std::endl;
597 htmlFile <<
"<td class=\"s0\" width=17% align=\"center\">Unstable</td>" << std::endl;
598 htmlFile <<
"<td class=\"s0\" width=17% align=\"center\">low/no LED signal</td>" << std::endl;
599 htmlFile <<
"<td class=\"s0\" width=17% align=\"center\">Bad Timing</td>" << std::endl;
600 htmlFile <<
"<td class=\"s0\" width=17% align=\"center\">Bad LED signal</td>" << std::endl;
601 htmlFile <<
"</tr><tr>" << std::endl;
602 int ind1=0,ind2=0,ind3=0,ind4=0,ind5=0;
603 htmlFile <<
"<td class=\"s1\" align=\"center\">HB+</td>" << std::endl;
604 ind1=3;
if(newHBP[0]==0) ind1=2;
if(newHBP[0]>0 && newHBP[0]<=12) ind1=1;
if(newHBP[0]>=12 && HBP[0]<1296) ind1=0;
605 ind2=3;
if(newHBP[1]==0) ind2=2;
if(newHBP[1]>0) ind2=1;
if(newHBP[1]>21) ind2=0;
606 ind3=3;
if(newHBP[2]==0) ind3=2;
if(newHBP[2]>0) ind3=1;
if(newHBP[2]>21) ind3=0;
607 ind4=3;
if((newHBP[3]+newHBP[4])==0) ind4=2;
if((newHBP[3]+newHBP[4])>0) ind4=1;
if((newHBP[3]+newHBP[4])>21) ind4=0;
608 ind5=3;
if((newHBP[5]+newHBP[6])==0) ind5=2;
if((newHBP[5]+newHBP[6])>0) ind5=1;
if((newHBP[5]+newHBP[6])>21) ind5=0;
609 if(ind1==3) ind2=ind3=ind4=ind5=3;
610 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
611 htmlFile << state[ind1] << HBP[0] <<
" (1296)</td>" << std::endl;
612 htmlFile << state[ind2] << HBP[1] <<
"</td>" << std::endl;
613 htmlFile << state[ind3] << HBP[2] <<
"</td>" << std::endl;
614 htmlFile << state[ind5] << HBP[5]+HBP[6] <<
"</td>" << std::endl;
615 htmlFile << state[ind4] << HBP[3]+HBP[4] <<
"</td>" << std::endl;
617 htmlFile <<
"</tr><tr>" << std::endl;
618 htmlFile <<
"<td class=\"s1\" align=\"center\">HB-</td>" << std::endl;
619 ind1=3;
if(newHBM[0]==0) ind1=2;
if(newHBM[0]>0 && newHBM[0]<=12) ind1=1;
if(newHBM[0]>=12 && HBM[0]<1296) ind1=0;
620 ind2=3;
if(newHBM[1]==0) ind2=2;
if(newHBM[1]>0) ind2=1;
if(newHBM[1]>21) ind2=0;
621 ind3=3;
if(newHBM[2]==0) ind3=2;
if(newHBM[2]>0) ind3=1;
if(newHBM[2]>21) ind3=0;
622 ind4=3;
if((newHBM[3]+newHBM[4])==0) ind4=2;
if((newHBM[3]+newHBM[4])>0) ind4=1;
if((newHBM[3]+newHBM[4])>21) ind4=0;
623 ind5=3;
if((newHBM[5]+newHBM[6])==0) ind5=2;
if((newHBM[5]+newHBM[6])>0) ind5=1;
if((newHBM[5]+newHBM[6])>21) ind5=0;
624 if(ind1==3) ind2=ind3=ind4=ind5=3;
625 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
626 htmlFile << state[ind1] << HBM[0] <<
" (1296)</td>" << std::endl;
627 htmlFile << state[ind2] << HBM[1] <<
"</td>" << std::endl;
628 htmlFile << state[ind3] << HBM[2] <<
"</td>" << std::endl;
629 htmlFile << state[ind5] << HBM[5]+HBM[6] <<
"</td>" << std::endl;
630 htmlFile << state[ind4] << HBM[3]+HBM[4] <<
"</td>" << std::endl;
632 htmlFile <<
"</tr><tr>" << std::endl;
633 htmlFile <<
"<td class=\"s1\" align=\"center\">HE+</td>" << std::endl;
634 ind1=3;
if(newHEP[0]==0) ind1=2;
if(newHEP[0]>0 && newHEP[0]<=12) ind1=1;
if(newHEP[0]>=12 && HEP[0]<1296) ind1=0;
635 ind2=3;
if(newHEP[1]==0) ind2=2;
if(newHEP[1]>0) ind2=1;
if(newHEP[1]>21) ind2=0;
636 ind3=3;
if(newHEP[2]==0) ind3=2;
if(newHEP[2]>0) ind3=1;
if(newHEP[2]>21) ind3=0;
637 ind4=3;
if((newHEP[3]+newHEP[4])==0) ind4=2;
if((newHEP[3]+newHEP[4])>0) ind4=1;
if((newHEP[3]+newHEP[4])>21) ind4=0;
638 ind5=3;
if((newHEP[5]+newHEP[6])==0) ind5=2;
if((newHEP[5]+newHEP[6])>0) ind5=1;
if((newHEP[5]+newHEP[6])>21) ind5=0;
639 if(ind1==3) ind2=ind3=ind4=ind5=3;
640 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
641 htmlFile << state[ind1] << HEP[0] <<
" (1296)</td>" << std::endl;
642 htmlFile << state[ind2] << HEP[1] <<
"</td>" << std::endl;
643 htmlFile << state[ind3] << HEP[2] <<
"</td>" << std::endl;
644 htmlFile << state[ind5] << HEP[5]+HEP[6] <<
"</td>" << std::endl;
645 htmlFile << state[ind4] << HEP[3]+HEP[4] <<
"</td>" << std::endl;
647 htmlFile <<
"</tr><tr>" << std::endl;
648 htmlFile <<
"<td class=\"s1\" align=\"center\">HE-</td>" << std::endl;
649 ind1=3;
if(newHEM[0]==0) ind1=2;
if(newHEM[0]>0 && newHEM[0]<=12) ind1=1;
if(newHEM[0]>=12 && HEM[0]<1296) ind1=0;
650 ind2=3;
if(newHEM[1]==0) ind2=2;
if(newHEM[1]>0) ind2=1;
if(newHEM[1]>21) ind2=0;
651 ind3=3;
if(newHEM[2]==0) ind3=2;
if(newHEM[2]>0) ind3=1;
if(newHEM[2]>21) ind3=0;
652 ind4=3;
if((newHEM[3]+newHEM[4])==0) ind4=2;
if((newHEM[3]+newHEM[4])>0) ind4=1;
if((newHEM[3]+newHEM[4])>21) ind4=0;
653 ind5=3;
if((newHEM[5]+newHEM[6])==0) ind5=2;
if((newHEM[5]+newHEM[6])>0) ind5=1;
if((newHEM[5]+newHEM[6])>21) ind5=0;
654 if(ind1==3) ind2=ind3=ind4=ind5=3;
655 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
656 htmlFile << state[ind1] << HEM[0] <<
" (1296)</td>" << std::endl;
657 htmlFile << state[ind2] << HEM[1] <<
"</td>" << std::endl;
658 htmlFile << state[ind3] << HEM[2] <<
"</td>" << std::endl;
659 htmlFile << state[ind5] << HEM[5]+HEM[6] <<
"</td>" << std::endl;
660 htmlFile << state[ind4] << HEM[3]+HEM[4] <<
"</td>" << std::endl;
662 htmlFile <<
"</tr><tr>" << std::endl;
663 htmlFile <<
"<td class=\"s1\" align=\"center\">HF+</td>" << std::endl;
664 ind1=3;
if(newHFP[0]==0) ind1=2;
if(newHFP[0]>0 && newHFP[0]<=12) ind1=1;
if(newHFP[0]>=12 && HFP[0]<864) ind1=0;
665 ind2=3;
if(newHFP[1]==0) ind2=2;
if(newHFP[1]>0) ind2=1;
if(newHFP[1]>21) ind2=0;
666 ind3=3;
if(newHFP[2]==0) ind3=2;
if(newHFP[2]>0) ind3=1;
if(newHFP[2]>21) ind3=0;
667 ind4=3;
if((newHFP[3]+newHFP[4])==0) ind4=2;
if((newHFP[3]+newHFP[4])>0) ind4=1;
if((newHFP[3]+newHFP[4])>21) ind4=0;
668 ind5=3;
if((newHFP[5]+newHFP[6])==0) ind5=2;
if((newHFP[5]+newHFP[6])>0) ind5=1;
if((newHFP[5]+newHFP[6])>21) ind5=0;
669 if(ind1==3) ind2=ind3=ind4=ind5=3;
670 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
671 htmlFile << state[ind1] << HFP[0] <<
" (864)</td>" << std::endl;
672 htmlFile << state[ind2] << HFP[1] <<
"</td>" << std::endl;
673 htmlFile << state[ind3] << HFP[2] <<
"</td>" << std::endl;
674 htmlFile << state[ind5] << HFP[5]+HFP[6] <<
"</td>" << std::endl;
675 htmlFile << state[ind4] << HFP[3]+HFP[4] <<
"</td>" << std::endl;
677 htmlFile <<
"</tr><tr>" << std::endl;
678 htmlFile <<
"<td class=\"s1\" align=\"center\">HF-</td>" << std::endl;
679 ind1=3;
if(newHFM[0]==0) ind1=2;
if(newHFM[0]>0 && newHFM[0]<=12) ind1=1;
if(newHFM[0]>=12 && HFM[0]<864) ind1=0;
680 ind2=3;
if(newHFM[1]==0) ind2=2;
if(newHFM[1]>0) ind2=1;
if(newHFM[1]>21) ind2=0;
681 ind3=3;
if(newHFM[2]==0) ind3=2;
if(newHFM[2]>0) ind3=1;
if(newHFM[2]>21) ind3=0;
682 ind4=3;
if((HFM[3]+HFM[4])==0) ind4=2;
if((HFM[3]+HFM[4])>0) ind4=1;
if((HFM[3]+HFM[4])>21) ind4=0;
683 ind5=3;
if((HFM[5]+HFM[6])==0) ind5=2;
if((HFM[5]+HFM[6])>0) ind5=1;
if((HFM[5]+HFM[6])>21) ind5=0;
684 if(ind1==3) ind2=ind3=ind4=ind5=3;
685 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
686 htmlFile << state[ind1] << HFM[0] <<
" (864)</td>" << std::endl;
687 htmlFile << state[ind2] << HFM[1] <<
"</td>" << std::endl;
688 htmlFile << state[ind3] << HFM[2] <<
"</td>" << std::endl;
689 htmlFile << state[ind5] << HFM[5]+HFM[6] <<
"</td>" << std::endl;
690 htmlFile << state[ind4] << HFM[3]+HFM[4] <<
"</td>" << std::endl;
692 htmlFile <<
"</tr><tr>" << std::endl;
693 htmlFile <<
"<td class=\"s1\" align=\"center\">HO</td>" << std::endl;
694 ind1=3;
if(newHO[0]==0) ind1=2;
if(newHO[0]>0 && newHO[0]<=12) ind1=1;
if(newHO[0]>=12 && HO[0]<2160) ind1=0;
695 ind2=3;
if(newHO[1]==0) ind2=2;
if(newHO[1]>0) ind2=1;
if(newHO[1]>21) ind2=0;
696 ind3=3;
if(newHO[2]==0) ind3=2;
if(newHO[2]>0) ind3=1;
if(newHO[2]>21) ind3=0;
697 ind4=3;
if((newHO[3]+newHO[4])==0) ind4=2;
if((newHO[3]+newHO[4])>0) ind4=1;
if((newHO[3]+newHO[4])>21) ind4=0;
698 ind5=3;
if((newHO[5]+newHO[6])==0) ind5=2;
if((newHO[5]+newHO[6])>0) ind5=1;
if((newHO[5]+newHO[6])>21) ind5=0;
699 if(ind1==3) ind2=ind3=ind4=ind5=3;
700 if(ind1==0 || ind2==0 || ind3==0 || ind4==0)
status|=2;
else if(ind1==1 || ind2==1 || ind3==1 || ind4==1)
status|=1;
702 htmlFile << state[ind1] << HO[0] <<
" (2160)</td>" << std::endl;
703 htmlFile << state[ind2] << HO[1] <<
"</td>" << std::endl;
704 htmlFile << state[ind3] << HO[2] <<
"</td>" << std::endl;
705 htmlFile << state[ind5] << HO[5]+HO[6] <<
"</td>" << std::endl;
706 htmlFile << state[ind4] << HO[3]+HO[4] <<
"</td>" << std::endl;
708 htmlFile <<
"</tr></table>" << std::endl;
709 htmlFile <<
"<hr>" << std::endl;
711 if((MissingCnt+UnstableCnt+UnstableLEDCnt+BadTimingCnt)>0){
712 htmlFile <<
"<table width=100% border=1><tr>" << std::endl;
713 if(MissingCnt>0) htmlFile <<
"<td><a href=\"" <<
"Missing.html" <<
"\">list of missing channels</a></td>";
714 if(UnstableCnt>0) htmlFile <<
"<td><a href=\"" <<
"Unstable.html" <<
"\">list of unstable channels</a></td>";
715 if(UnstableLEDCnt>0)htmlFile <<
"<td><a href=\"" <<
"UnstableLED.html" <<
"\">list of low LED signal channels</a></td>";
716 if(BadTimingCnt>0)htmlFile <<
"<td><a href=\"" <<
"BadTiming.html" <<
"\">list of Bad Timing channels</a></td>";
717 htmlFile <<
"</tr></table>" << std::endl;
722 htmlFile <<
"<h2 align=\"center\">Summary LED plots</h2>" << std::endl;
723 htmlFile <<
"<table width=100% border=0><tr>" << std::endl;
724 htmlFile <<
"<tr align=\"left\">" << std::endl;
725 Time2Dhbhehf->SetMaximum(6);
726 Time2Dho->SetMaximum(6);
727 Time2Dhbhehf->SetNdivisions(36,
"Y");
728 Time2Dho->SetNdivisions(36,
"Y");
729 Time2Dhbhehf->SetStats(0);
730 Time2Dho->SetStats(0);
731 Time2Dhbhehf->Draw(
"COLZ"); can->SaveAs((htmlDir +
"led_timing_hbhehf.gif").c_str());
732 Time2Dho->Draw(
"COLZ"); can->SaveAs((htmlDir +
"led_timing_ho.gif").c_str());
733 htmlFile <<
"<td align=\"center\"><img src=\"led_timing_hbhehf.gif\" alt=\"led timing distribution\"> </td>" << std::endl;
734 htmlFile <<
"<td align=\"center\"><img src=\"led_timing_ho.gif\" alt=\"led timing distribution\"> </td>" << std::endl;
735 htmlFile <<
"</tr>" << std::endl;
737 htmlFile <<
"<tr align=\"left\">" << std::endl;
738 Energy2Dhbhehf->SetStats(0);
739 Energy2Dho->SetStats(0);
740 Energy2Dhbhehf->SetNdivisions(36,
"Y");
741 Energy2Dho->SetNdivisions(36,
"Y");
742 Energy2Dhbhehf->Draw(
"COLZ"); can->SaveAs((htmlDir +
"led_energy_hbhehf.gif").c_str());
743 Energy2Dho->Draw(
"COLZ"); can->SaveAs((htmlDir +
"led_energy_ho.gif").c_str());
744 htmlFile <<
"<td align=\"center\"><img src=\"led_energy_hbhehf.gif\" alt=\"led energy distribution\"> </td>" << std::endl;
745 htmlFile <<
"<td align=\"center\"><img src=\"led_energy_ho.gif\" alt=\"led energy distribution\"> </td>" << std::endl;
746 htmlFile <<
"</tr>" << std::endl;
748 can->SetGridy(
false);
749 htmlFile <<
"<tr align=\"left\">" << std::endl;
750 Energy->Draw(); can->SaveAs((htmlDir +
"led_energy_distribution.gif").c_str());
751 EnergyRMS->Draw(); can->SaveAs((htmlDir +
"led_energy_rms_distribution.gif").c_str());
752 htmlFile <<
"<td align=\"center\"><img src=\"led_energy_distribution.gif\" alt=\"led energy distribution\"> </td>" << std::endl;
753 htmlFile <<
"<td align=\"center\"><img src=\"led_energy_rms_distribution.gif\" alt=\"led energy rms distribution\"> </td>" << std::endl;
754 htmlFile <<
"</tr>" << std::endl;
755 htmlFile <<
"<tr align=\"left\">" << std::endl;
756 Timing->Draw(); can->SaveAs((htmlDir +
"led_timing_distribution.gif").c_str());
757 TimingRMS->Draw(); can->SaveAs((htmlDir +
"led_timing_rms_distribution.gif").c_str());
758 htmlFile <<
"<td align=\"center\"><img src=\"led_timing_distribution.gif\" alt=\"led timing distribution\"> </td>" << std::endl;
759 htmlFile <<
"<td align=\"center\"><img src=\"led_timing_rms_distribution.gif\" alt=\"led timing rms distribution\"> </td>" << std::endl;
760 htmlFile <<
"</tr>" << std::endl;
761 htmlFile <<
"<tr align=\"left\">" << std::endl;
762 EnergyHF->Draw(); can->SaveAs((htmlDir +
"led_energyhf_distribution.gif").c_str());
763 EnergyRMSHF->Draw(); can->SaveAs((htmlDir +
"led_energyhf_rms_distribution.gif").c_str());
764 htmlFile <<
"<td align=\"center\"><img src=\"led_energyhf_distribution.gif\" alt=\"hf led energy distribution\"> </td>" << std::endl;
765 htmlFile <<
"<td align=\"center\"><img src=\"led_energyhf_rms_distribution.gif\" alt=\"hf led energy rms distribution\"> </td>" << std::endl;
766 htmlFile <<
"</tr>" << std::endl;
767 htmlFile <<
"<tr align=\"left\">" << std::endl;
768 TimingHF->Draw(); can->SaveAs((htmlDir +
"led_timinghf_distribution.gif").c_str());
769 TimingRMSHF->Draw(); can->SaveAs((htmlDir +
"led_timinghf_rms_distribution.gif").c_str());
770 htmlFile <<
"<td align=\"center\"><img src=\"led_timinghf_distribution.gif\" alt=\"hf led timing distribution\"> </td>" << std::endl;
771 htmlFile <<
"<td align=\"center\"><img src=\"led_timinghf_rms_distribution.gif\" alt=\"hf led timing rms distribution\"> </td>" << std::endl;
772 htmlFile <<
"</tr>" << std::endl;
773 htmlFile <<
"</table>" << std::endl;
776 htmlFile <<
"<h2 align=\"center\">Stability LED plots (Reference run "<<ref_run<<
")</h2>" << std::endl;
777 htmlFile <<
"<table width=100% border=0><tr>" << std::endl;
778 htmlFile <<
"<tr align=\"left\">" << std::endl;
779 HBPphi->GetXaxis()->SetNdivisions(418,kFALSE);
780 HBMphi->GetXaxis()->SetNdivisions(418,kFALSE);
781 HEPphi->GetXaxis()->SetNdivisions(418,kFALSE);
782 HEMphi->GetXaxis()->SetNdivisions(418,kFALSE);
784 HBPphi->SetMarkerColor(kRed);
785 HBPphi->SetMarkerStyle(23);
786 HBPphi->SetXTitle(
"HPD Index = RBX*4+RM");
787 HBMphi->SetMarkerColor(kRed);
788 HBMphi->SetMarkerStyle(23);
789 HBMphi->SetXTitle(
"HPD Index = RBX*4+RM");
790 HBPphi->Draw(); can->SaveAs((htmlDir +
"led_hbp_distribution.gif").c_str());
791 HBMphi->Draw(); can->SaveAs((htmlDir +
"led_hbm_distribution.gif").c_str());
792 htmlFile <<
"<td align=\"center\"><img src=\"led_hbp_distribution.gif\" alt=\"led hbp distribution\"> </td>" << std::endl;
793 htmlFile <<
"<td align=\"center\"><img src=\"led_hbm_distribution.gif\" alt=\"led hbm distribution\"> </td>" << std::endl;
794 htmlFile <<
"</tr>" << std::endl;
796 htmlFile <<
"<tr align=\"left\">" << std::endl;
797 HEPphi->SetMarkerColor(kRed);
798 HEPphi->SetMarkerStyle(23);
799 HEPphi->SetXTitle(
"HPD Index = RBX*4+RM");
800 HEMphi->SetMarkerColor(kRed);
801 HEMphi->SetMarkerStyle(23);
802 HEMphi->SetXTitle(
"HPD Index = RBX*4+RM");
803 HEPphi->Draw(); can->SaveAs((htmlDir +
"led_hep_distribution.gif").c_str());
804 HEMphi->Draw(); can->SaveAs((htmlDir +
"led_hem_distribution.gif").c_str());
805 htmlFile <<
"<td align=\"center\"><img src=\"led_hep_distribution.gif\" alt=\"led hep distribution\"> </td>" << std::endl;
806 htmlFile <<
"<td align=\"center\"><img src=\"led_hem_distribution.gif\" alt=\"led hem distribution\"> </td>" << std::endl;
807 htmlFile <<
"</tr>" << std::endl;
809 htmlFile <<
"<tr align=\"left\">" << std::endl;
810 HFPphi->SetMarkerColor(kRed);
811 HFPphi->SetMarkerStyle(23);
812 HFPphi->SetXTitle(
"RM Index = RoBox*3+RM");
813 HFMphi->SetMarkerColor(kRed);
814 HFMphi->SetMarkerStyle(23);
815 HFPphi->GetXaxis()->SetNdivisions(312,kFALSE);
816 HFMphi->GetXaxis()->SetNdivisions(312,kFALSE);
818 HFMphi->SetXTitle(
"RM Index = RoBox*3+RM");
819 HFPphi->Draw(); can->SaveAs((htmlDir +
"led_hfp_distribution.gif").c_str());
820 HFMphi->Draw(); can->SaveAs((htmlDir +
"led_hfm_distribution.gif").c_str());
821 htmlFile <<
"<td align=\"center\"><img src=\"led_hfp_distribution.gif\" alt=\"led hfp distribution\"> </td>" << std::endl;
822 htmlFile <<
"<td align=\"center\"><img src=\"led_hfm_distribution.gif\" alt=\"led hfm distribution\"> </td>" << std::endl;
823 htmlFile <<
"</tr>" << std::endl;
825 htmlFile <<
"<tr align=\"left\">" << std::endl;
826 HO1Pphi->SetMarkerColor(kRed);
827 HO1Pphi->SetMarkerStyle(23);
828 HO1Pphi->SetXTitle(
"HPD Index = RBX*4+RM");
829 HO1Mphi->SetMarkerColor(kRed);
830 HO1Mphi->SetMarkerStyle(23);
831 HO1Mphi->GetXaxis()->SetNdivisions(412,kFALSE);
832 HO1Pphi->GetXaxis()->SetNdivisions(412,kFALSE);
834 HO1Mphi->SetXTitle(
"HPD Index = RBX*4+RM");
835 HO1Pphi->Draw(); can->SaveAs((htmlDir +
"led_ho1p_distribution.gif").c_str());
836 HO1Mphi->Draw(); can->SaveAs((htmlDir +
"led_ho1m_distribution.gif").c_str());
837 htmlFile <<
"<td align=\"center\"><img src=\"led_ho1p_distribution.gif\" alt=\"led ho1p distribution\"> </td>" << std::endl;
838 htmlFile <<
"<td align=\"center\"><img src=\"led_ho1m_distribution.gif\" alt=\"led ho1m distribution\"> </td>" << std::endl;
839 htmlFile <<
"</tr>" << std::endl;
841 htmlFile <<
"<tr align=\"left\">" << std::endl;
842 HO2Pphi->SetMarkerColor(kRed);
843 HO2Pphi->SetMarkerStyle(23);
844 HO2Pphi->SetXTitle(
"HPD Index = RBX*4+RM");
845 HO2Mphi->SetMarkerColor(kRed);
846 HO2Mphi->SetMarkerStyle(23);
847 HO2Mphi->GetXaxis()->SetNdivisions(412,kFALSE);
848 HO2Pphi->GetXaxis()->SetNdivisions(412,kFALSE);
850 HO2Mphi->SetXTitle(
"HPD Index = RBX*4+RM");
851 HO2Pphi->Draw(); can->SaveAs((htmlDir +
"led_ho2p_distribution.gif").c_str());
852 HO2Mphi->Draw(); can->SaveAs((htmlDir +
"led_ho2m_distribution.gif").c_str());
853 htmlFile <<
"<td align=\"center\"><img src=\"led_ho2p_distribution.gif\" alt=\"led ho2p distribution\"> </td>" << std::endl;
854 htmlFile <<
"<td align=\"center\"><img src=\"led_ho2m_distribution.gif\" alt=\"led ho2m distribution\"> </td>" << std::endl;
855 htmlFile <<
"</tr>" << std::endl;
857 htmlFile <<
"<tr align=\"left\">" << std::endl;
858 HO0phi->SetMarkerColor(kRed);
859 HO0phi->SetMarkerStyle(23);
860 HO0phi->SetXTitle(
"HPD Index = RBX*4+RM");
861 HO0phi->GetXaxis()->SetNdivisions(412,kFALSE);
862 HO0phi->Draw(); can->SaveAs((htmlDir +
"led_ho0_distribution.gif").c_str());
863 htmlFile <<
"<td align=\"center\"><img src=\"led_ho0_distribution.gif\" alt=\"led ho0 distribution\"> </td>" << std::endl;
864 htmlFile <<
"</tr>" << std::endl;
866 htmlFile <<
"</table>" << std::endl;
868 htmlFile <<
"</body> " << std::endl;
869 htmlFile <<
"</html> " << std::endl;
TH2F * ChannelStatusUnstableChannels[4]
static void printTableLine(std::ofstream &file, int ind, HcalDetId &detid, HcalFrontEndId &lmap_entry, HcalElectronicsId &emap_entry, std::string comment="")
static void printTableTail(std::ofstream &file)
TH2F * ChannelStatusTimeRMS[4]
std::vector< std::string > HcalEtaPhiHistNames()
static void printTableHeader(std::ofstream &file, std::string header)
HcalElectronicsMap generateHcalElectronicsMap()
TH2F * ChannelStatusLEDMean[4]
TH2F * ChannelsLEDEnergy[4]
TH2F * ChannelStatusMissingChannels[4]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
TH2F * ChannelsLEDEnergyRef[4]
double get_channel_status(std::string subdet, int eta, int phi, int depth, int type)
std::string valueString(void) const
const HcalFrontEndId getHcalFrontEndId(const DetId &)
std::map< HcalDetId, unsigned int > badstatusmap
HcalLogicalMap * logicalMap_
TH2F * ChannelStatusLEDRMS[4]
TH2F * ChannelStatusTimeMean[4]
TH2F * ChannelStatusUnstableLEDsignal[4]
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id