64 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
65 prefixME_.append(
"/");
81 std::cout <<
"HcalMonitorClient:: The following clients are enabled:"<<std::endl;
82 for (
unsigned int i=0;
i<enabledClients_.size();++
i)
99 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DeadCellMonitor")!=enabledClients_.end())
101 if (
find(enabledClients_.begin(), enabledClients_.end(),
"HotCellMonitor")!=enabledClients_.end())
103 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RecHitMonitor")!=enabledClients_.end())
105 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DigiMonitor")!=enabledClients_.end())
107 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RawDataMonitor")!=enabledClients_.end())
109 if (
find(enabledClients_.begin(), enabledClients_.end(),
"TrigPrimMonitor")!=enabledClients_.end())
111 if (
find(enabledClients_.begin(), enabledClients_.end(),
"NZSMonitor")!=enabledClients_.end())
113 if (
find(enabledClients_.begin(), enabledClients_.end(),
"BeamMonitor")!=enabledClients_.end())
115 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagPedestalMonitor")!=enabledClients_.end())
117 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLaserMonitor")!=enabledClients_.end())
119 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLEDMonitor")!=enabledClients_.end())
121 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagNoiseMonitor")!=enabledClients_.end())
123 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagTimingMonitor")!=enabledClients_.end())
125 if (
find(enabledClients_.begin(), enabledClients_.end(),
"CoarsePedestalMonitor")!=enabledClients_.end())
128 if (
find(enabledClients_.begin(), enabledClients_.end(),
"Summary")!=enabledClients_.end())
178 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginRun(r,c)>"<<std::endl;
188 std::map <HcalDetId, unsigned int> badchannelmap;
189 badchannelmap.clear();
205 x<<
"1+log2(status) for HCAL depth "<<d+1;
242 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i)
249 if (status==0)
continue;
254 int depth=
id.depth();
255 if (depth<1 || depth>4)
continue;
259 ieta>0 ? ++ieta: --ieta;
261 double logstatus = 0;
264 logstatus=-1*(log2(-1.*status)+1);
266 logstatus=log2(1.*status)+1;
274 clients_[
i]->setStatusMap(badchannelmap);
301 x<<
"1+log2(status) for HCAL depth "<<d+1;
314 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginLuminosityBlock>"<<std::endl;
320 std::cout <<
"HcalMonitorClient::analyze(const edm::Event&, const edm::EventSetup&) ievt_ = "<<
ievt_<<std::endl;
333 std::cout <<
"HcalMonitorClient::analyze() "<<std::endl;
351 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::endLuminosityBlock>"<<std::endl;
439 if (
debug_>0)
std::cout <<
"Preparing HcalMonitorClient html output ..." << std::endl;
443 gStyle->Reset(
"Default");
444 gStyle->SetCanvasColor(0);
445 gStyle->SetPadColor(0);
446 gStyle->SetFillColor(0);
447 gStyle->SetTitleFillColor(10);
449 gStyle->SetOptStat(
"ouemr");
450 gStyle->SetPalette(1);
457 system((
"/bin/mkdir -p " + htmlDir).c_str());
462 htmlFile.open((htmlDir +
"index.html").c_str());
465 htmlFile <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
466 htmlFile <<
"<html> " << std::endl;
467 htmlFile <<
"<head> " << std::endl;
468 htmlFile <<
" <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
469 htmlFile <<
" http-equiv=\"content-type\"> " << std::endl;
470 htmlFile <<
" <title>Hcal Data Quality Monitor</title> " << std::endl;
471 htmlFile <<
"</head> " << std::endl;
472 htmlFile <<
"<body> " << std::endl;
473 htmlFile <<
"<br> " << std::endl;
474 htmlFile <<
"<center><h1>Hcal Data Quality Monitor</h1></center>" << std::endl;
475 htmlFile <<
"<h2>Run Number: " << std::endl;
476 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
run_ <<
"</span></h2> " << std::endl;
477 htmlFile <<
"<h2>Events processed: " << std::endl;
478 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
ievt_ <<
"</span></h2> " << std::endl;
479 htmlFile <<
"<hr>" << std::endl;
480 htmlFile <<
"<ul>" << std::endl;
484 if (
clients_[
i]->validHtmlOutput()==
true)
488 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
489 htmlFile <<
"<td WIDTH=\"35%\"><a href=\"" <<
clients_[
i]->name_ <<
".html"<<
"\">"<<
clients_[
i]->name_<<
"</a></td>" << std::endl;
490 if(
clients_[
i]->hasErrors_Temp()) htmlFile <<
"<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
491 else if(
clients_[
i]->hasWarnings_Temp()) htmlFile <<
"<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
492 else if(
clients_[
i]->hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
493 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
494 htmlFile <<
"</tr></table>" << std::endl;
502 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
506 else if(
summaryClient_->
hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
507 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
508 htmlFile <<
"</tr></table>" << std::endl;
511 htmlFile <<
"</ul>" << std::endl;
514 htmlFile <<
"</body> " << std::endl;
515 htmlFile <<
"</html> " << std::endl;
518 if (
debug_>0)
std::cout <<
"HcalMonitorClient html output done..." << std::endl;
525 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeDBfile> Writing file for database"<<std::endl;
527 std::map<HcalDetId, unsigned int> myquality;
530 clients_[
i]->updateChannelStatus(myquality);
532 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeChannelStatus()> myquality size = "<<myquality.size()<<std::endl;
537 for (
unsigned int i=0;
i<mydetids.size();++
i)
547 if (myquality.find(
id)!=myquality.end())
565 std::ostringstream
file;
569 std::ofstream outStream(file.str().c_str());
570 outStream<<
"### Run # "<<
run_<<std::endl;
597 for (
int subdet=1; subdet<=4;++subdet)
599 for (
int depth=0;depth<4;++depth)
606 if (ieta==-9999)
continue;
621 for (
unsigned int capid=0;capid<4;++capid)
628 temp_ADC=channelCoder_->
adc(*shape_,
633 temp_fC=pedw->
getSigma(capid,capid);
646 fC_width=
pow(fC_width,0.5)/2.;
647 ADC_width=
pow(ADC_width,0.5)/2.;
651 std::cout <<
"<HcalMonitorClient::PlotPedestalValues> HcalDet ID = "<<(
HcalSubdetector)subdet<<
": ("<<ieta<<
", "<<iphi<<
", "<<depth<<
")"<<std::endl;
652 std::cout <<
"\tADC pedestal = "<<ADC_ped<<
" +/- "<<ADC_width<<std::endl;
653 std::cout <<
"\tfC pedestal = "<<fC_ped<<
" +/- "<<fC_width<<std::endl;
659 if (ieta<0) zside=-1;
std::vector< std::string > enabledClients_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
bool addValues(const Item &myItem, bool h2mode_=false)
void cleanup(void)
Cleanup.
EtaPhiHists * fC_WidthFromDBByDepth
EtaPhiHists * ADC_PedestalFromDBByDepth
void PlotPedestalValues(const HcalDbService &cond)
void analyze(int LS=-1)
Analyze.
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
#define DEFINE_FWK_MODULE(type)
void fillReportSummaryLSbyLS(int LS)
EtaPhiHists * fC_PedestalFromDBByDepth
void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
BeginLumiBlock.
void beginJob(void)
BeginJob.
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
edm::LuminosityBlockNumber_t luminosityBlock() const
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c)
EndLumiBlock.
double pedestal(int fCapId) const
get pedestal for capid=0..3
EtaPhiHists * ADC_WidthFromDBByDepth
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void unsetBit(unsigned int bitnumber)
void setBit(unsigned int bitnumber)
LuminosityBlockNumber_t luminosityBlock() const
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
bool hasErrors_Temp(void)
HcalMonitorClient(const edm::ParameterSet &ps)
std::vector< MonitorElement * > depth
void getFriends(std::vector< HcalBaseDQClient * > clients)
std::vector< DetId > getAllChannels() const
virtual ~HcalMonitorClient()
void writeChannelStatus()
HcalSummaryClient * summaryClient_
int CalcIeta(int subdet, int eta, int depth)
std::vector< HcalBaseDQClient * > clients_
HcalChannelQuality * chanquality_
T const * product() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
virtual void htmlOutput(std::string htmlDir)
void FillUnphysicalHEHFBins(EtaPhiHists &hh)
EtaPhiHists * ChannelStatus
std::vector< std::vector< double > > tmp
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
const Item * getValues(DetId fId) const
Power< A, B >::type pow(const A &a, const B &b)
void setCurrentFolder(const std::string &fullpath)
const HcalQIEShape * getHcalShape() const
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
bool hasWarnings_Temp(void)