62 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
63 prefixME_.append(
"/");
85 std::cout <<
"HcalMonitorClient:: The following clients are enabled:"<<std::endl;
86 for (
unsigned int i=0;
i<enabledClients_.size();++
i)
103 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DeadCellMonitor")!=enabledClients_.end())
105 if (
find(enabledClients_.begin(), enabledClients_.end(),
"HotCellMonitor")!=enabledClients_.end())
107 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RecHitMonitor")!=enabledClients_.end())
109 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DigiMonitor")!=enabledClients_.end())
111 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RawDataMonitor")!=enabledClients_.end())
113 if (
find(enabledClients_.begin(), enabledClients_.end(),
"TrigPrimMonitor")!=enabledClients_.end())
115 if (
find(enabledClients_.begin(), enabledClients_.end(),
"NZSMonitor")!=enabledClients_.end())
117 if (
find(enabledClients_.begin(), enabledClients_.end(),
"BeamMonitor")!=enabledClients_.end())
119 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagPedestalMonitor")!=enabledClients_.end())
121 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLaserMonitor")!=enabledClients_.end())
123 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLEDMonitor")!=enabledClients_.end())
125 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagNoiseMonitor")!=enabledClients_.end())
127 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagTimingMonitor")!=enabledClients_.end())
129 if (
find(enabledClients_.begin(), enabledClients_.end(),
"CoarsePedestalMonitor")!=enabledClients_.end())
132 if (
find(enabledClients_.begin(), enabledClients_.end(),
"Summary")!=enabledClients_.end())
163 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginRun(r,c)>"<<std::endl;
172 std::map <HcalDetId, unsigned int> badchannelmap;
173 badchannelmap.clear();
185 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i)
192 if (status==0)
continue;
196 int depth=
id.depth();
197 if (depth<1 || depth>4)
continue;
201 ieta>0 ? ++ieta: --ieta;
203 double logstatus = 0;
206 logstatus=-1*(log2(-1.*status)+1);
208 logstatus=log2(1.*status)+1;
216 clients_[
i]->setStatusMap(badchannelmap);
238 std::cout <<
"HcalMonitorClient::analyze() "<<std::endl;
260 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::dqmEndLuminosityBlock>"<<std::endl;
364 if (
debug_>0)
std::cout <<
"Preparing HcalMonitorClient html output ..." << std::endl;
368 gStyle->Reset(
"Default");
369 gStyle->SetCanvasColor(0);
370 gStyle->SetPadColor(0);
371 gStyle->SetFillColor(0);
372 gStyle->SetTitleFillColor(10);
374 gStyle->SetOptStat(
"ouemr");
375 gStyle->SetPalette(1);
385 system((
"/bin/mkdir -p " + htmlDir).c_str());
389 std::ofstream htmlFile;
390 htmlFile.open((htmlDir +
"index.html").c_str());
393 htmlFile <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
394 htmlFile <<
"<html> " << std::endl;
395 htmlFile <<
"<head> " << std::endl;
396 htmlFile <<
" <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
397 htmlFile <<
" http-equiv=\"content-type\"> " << std::endl;
398 htmlFile <<
" <title>Hcal Data Quality Monitor</title> " << std::endl;
399 htmlFile <<
"</head> " << std::endl;
400 htmlFile <<
"<body> " << std::endl;
401 htmlFile <<
"<br> " << std::endl;
402 htmlFile <<
"<center><h1>Hcal Data Quality Monitor</h1></center>" << std::endl;
403 htmlFile <<
"<h2>Run Number: " << std::endl;
404 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
run_ <<
"</span></h2> " << std::endl;
405 htmlFile <<
"<h2>Events processed: " << std::endl;
406 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
ievt_ <<
"</span></h2> " << std::endl;
407 htmlFile <<
"<hr>" << std::endl;
408 htmlFile <<
"<ul>" << std::endl;
412 if (
clients_[
i]->validHtmlOutput(ib,ig)==
true)
416 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
417 htmlFile <<
"<td WIDTH=\"35%\"><a href=\"" <<
clients_[
i]->name_ <<
".html"<<
"\">"<<
clients_[
i]->name_<<
"</a></td>" << std::endl;
418 if(
clients_[
i]->hasErrors_Temp()) htmlFile <<
"<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
419 else if(
clients_[
i]->hasWarnings_Temp()) htmlFile <<
"<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
420 else if(
clients_[
i]->hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
421 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
422 htmlFile <<
"</tr></table>" << std::endl;
430 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
434 else if(
summaryClient_->
hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
435 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
436 htmlFile <<
"</tr></table>" << std::endl;
439 htmlFile <<
"</ul>" << std::endl;
442 htmlFile <<
"</body> " << std::endl;
443 htmlFile <<
"</html> " << std::endl;
446 if (
debug_>0)
std::cout <<
"HcalMonitorClient html output done..." << std::endl;
453 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeDBfile> Writing file for database"<<std::endl;
455 std::map<HcalDetId, unsigned int> myquality;
458 clients_[
i]->updateChannelStatus(myquality);
460 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeChannelStatus()> myquality size = "<<myquality.size()<<std::endl;
465 for (
unsigned int i=0;
i<mydetids.size();++
i)
475 if (myquality.find(
id)!=myquality.end())
493 std::ostringstream
file;
497 std::ofstream outStream(file.str().c_str());
498 outStream<<
"### Run # "<<
run_<<std::endl;
524 for (
int subdet=1; subdet<=4;++subdet)
533 if (ieta==-9999)
continue;
549 for (
unsigned int capid=0;capid<4;++capid)
556 temp_ADC=channelCoder_->
adc(*shape_,
561 temp_fC=pedw->
getSigma(capid,capid);
574 fC_width=
pow(fC_width,0.5)/2.;
575 ADC_width=
pow(ADC_width,0.5)/2.;
579 std::cout <<
"<HcalMonitorClient::PlotPedestalValues> HcalDet ID = "<<(
HcalSubdetector)subdet<<
": ("<<ieta<<
", "<<iphi<<
", "<<
depth<<
")"<<std::endl;
580 std::cout <<
"\tADC pedestal = "<<ADC_ped<<
" +/- "<<ADC_width<<std::endl;
581 std::cout <<
"\tfC pedestal = "<<fC_ped<<
" +/- "<<fC_width<<std::endl;
587 if (ieta<0) zside=-1;
669 x<<
"1+log2(status) for HCAL depth "<<d+1;
std::vector< std::string > enabledClients_
T getUntrackedParameter(std::string const &, T const &) const
void cleanup(void)
Cleanup.
EtaPhiHists * fC_WidthFromDBByDepth
EtaPhiHists * ADC_PedestalFromDBByDepth
void setupPedestalMon(DQMStore::IBooker &)
void PlotPedestalValues(const HcalDbService &cond)
float getSigma(int fCapId1, int fCapId2) const
get correlation element for capId1/2 = 0..3
RunNumber_t const invalidRunNumber
#define DEFINE_FWK_MODULE(type)
EtaPhiHists * fC_PedestalFromDBByDepth
virtual void htmlOutput(DQMStore::IBooker &, DQMStore::IGetter &, std::string htmlDir)
double pedestal(int fCapId) const
get pedestal for capid=0..3
EtaPhiHists * ADC_WidthFromDBByDepth
const Item * getValues(DetId fId, bool throwOnFail=true) const
void setupChannelStatusMon(DQMStore::IBooker &)
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
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
EndJob.
const HcalPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
virtual void endJob() final
bool hasErrors_Temp(void)
HcalMonitorClient(const edm::ParameterSet &ps)
std::vector< MonitorElement * > depth
int CalcIeta(int subdet, int eta, int depth)
void analyze(DQMStore::IBooker &, DQMStore::IGetter &, int LS=-1)
std::vector< DetId > getAllChannels() const
virtual ~HcalMonitorClient()
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
void analyze(DQMStore::IBooker &ib, DQMStore::IGetter &, int LS=-1)
Analyze.
void writeChannelStatus()
HcalSummaryClient * summaryClient_
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &l, const edm::EventSetup &c)
EndLumiBlock.
std::vector< HcalBaseDQClient * > clients_
void setCurrentFolder(const std::string &fullpath)
T const * product() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
EtaPhiHists * ChannelStatus
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::vector< std::vector< double > > tmp
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
void writeHtml(DQMStore::IBooker &, DQMStore::IGetter &)
const HcalChannelQuality * chanquality_
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
void fillReportSummaryLSbyLS(DQMStore::IBooker &, DQMStore::IGetter &, int LS)
uint32_t getValue() const
void endRun(DQMStore::IBooker &, DQMStore::IGetter &)
EndRun.
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
bool addValues(const Item &myItem)
void getFriends(const std::vector< HcalBaseDQClient * > &clients)
Power< A, B >::type pow(const A &a, const B &b)
const HcalTopology * topo() const
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
bool hasWarnings_Temp(void)