63 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
64 prefixME_.append(
"/");
86 std::cout <<
"HcalMonitorClient:: The following clients are enabled:"<<std::endl;
87 for (
unsigned int i=0;
i<enabledClients_.size();++
i)
104 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DeadCellMonitor")!=enabledClients_.end())
106 if (
find(enabledClients_.begin(), enabledClients_.end(),
"HotCellMonitor")!=enabledClients_.end())
108 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RecHitMonitor")!=enabledClients_.end())
110 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DigiMonitor")!=enabledClients_.end())
112 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RawDataMonitor")!=enabledClients_.end())
114 if (
find(enabledClients_.begin(), enabledClients_.end(),
"TrigPrimMonitor")!=enabledClients_.end())
116 if (
find(enabledClients_.begin(), enabledClients_.end(),
"NZSMonitor")!=enabledClients_.end())
118 if (
find(enabledClients_.begin(), enabledClients_.end(),
"BeamMonitor")!=enabledClients_.end())
120 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagPedestalMonitor")!=enabledClients_.end())
122 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLaserMonitor")!=enabledClients_.end())
124 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLEDMonitor")!=enabledClients_.end())
126 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagNoiseMonitor")!=enabledClients_.end())
128 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagTimingMonitor")!=enabledClients_.end())
130 if (
find(enabledClients_.begin(), enabledClients_.end(),
"CoarsePedestalMonitor")!=enabledClients_.end())
132 if (
find(enabledClients_.begin(), enabledClients_.end(),
"ZDCMonitor")!=enabledClients_.end())
135 if (
find(enabledClients_.begin(), enabledClients_.end(),
"Summary")!=enabledClients_.end())
166 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginRun(r,c)>"<<std::endl;
175 std::map <HcalDetId, unsigned int> badchannelmap;
176 badchannelmap.clear();
192 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i)
199 if (status==0)
continue;
203 int depth=
id.depth();
204 if (depth<1 || depth>4)
continue;
208 ieta>0 ? ++ieta: --ieta;
210 double logstatus = 0;
213 logstatus=-1*(log2(-1.*status)+1);
215 logstatus=log2(1.*status)+1;
223 clients_[
i]->setStatusMap(badchannelmap);
245 std::cout <<
"HcalMonitorClient::analyze() "<<std::endl;
267 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::dqmEndLuminosityBlock>"<<std::endl;
371 if (
debug_>0)
std::cout <<
"Preparing HcalMonitorClient html output ..." << std::endl;
375 gStyle->Reset(
"Default");
376 gStyle->SetCanvasColor(0);
377 gStyle->SetPadColor(0);
378 gStyle->SetFillColor(0);
379 gStyle->SetTitleFillColor(10);
381 gStyle->SetOptStat(
"ouemr");
382 gStyle->SetPalette(1);
392 system((
"/bin/mkdir -p " + htmlDir).c_str());
396 std::ofstream htmlFile;
397 htmlFile.open((htmlDir +
"index.html").c_str());
400 htmlFile <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
401 htmlFile <<
"<html> " << std::endl;
402 htmlFile <<
"<head> " << std::endl;
403 htmlFile <<
" <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
404 htmlFile <<
" http-equiv=\"content-type\"> " << std::endl;
405 htmlFile <<
" <title>Hcal Data Quality Monitor</title> " << std::endl;
406 htmlFile <<
"</head> " << std::endl;
407 htmlFile <<
"<body> " << std::endl;
408 htmlFile <<
"<br> " << std::endl;
409 htmlFile <<
"<center><h1>Hcal Data Quality Monitor</h1></center>" << std::endl;
410 htmlFile <<
"<h2>Run Number: " << std::endl;
411 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
run_ <<
"</span></h2> " << std::endl;
412 htmlFile <<
"<h2>Events processed: " << std::endl;
413 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
ievt_ <<
"</span></h2> " << std::endl;
414 htmlFile <<
"<hr>" << std::endl;
415 htmlFile <<
"<ul>" << std::endl;
419 if (
clients_[
i]->validHtmlOutput(ib,ig)==
true)
423 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
424 htmlFile <<
"<td WIDTH=\"35%\"><a href=\"" <<
clients_[
i]->name_ <<
".html"<<
"\">"<<
clients_[
i]->name_<<
"</a></td>" << std::endl;
425 if(
clients_[
i]->hasErrors_Temp()) htmlFile <<
"<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
426 else if(
clients_[
i]->hasWarnings_Temp()) htmlFile <<
"<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
427 else if(
clients_[
i]->hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
428 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
429 htmlFile <<
"</tr></table>" << std::endl;
437 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
441 else if(
summaryClient_->
hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
442 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
443 htmlFile <<
"</tr></table>" << std::endl;
446 htmlFile <<
"</ul>" << std::endl;
449 htmlFile <<
"</body> " << std::endl;
450 htmlFile <<
"</html> " << std::endl;
453 if (
debug_>0)
std::cout <<
"HcalMonitorClient html output done..." << std::endl;
460 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeDBfile> Writing file for database"<<std::endl;
462 std::map<HcalDetId, unsigned int> myquality;
465 clients_[
i]->updateChannelStatus(myquality);
467 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeChannelStatus()> myquality size = "<<myquality.size()<<std::endl;
472 for (
unsigned int i=0;
i<mydetids.size();++
i)
482 if (myquality.find(
id)!=myquality.end())
500 std::ostringstream
file;
504 std::ofstream outStream(file.str().c_str());
505 outStream<<
"### Run # "<<
run_<<std::endl;
531 for (
int subdet=1; subdet<=4;++subdet)
540 if (ieta==-9999)
continue;
556 for (
unsigned int capid=0;capid<4;++capid)
563 temp_ADC=channelCoder_->
adc(*shape_,
568 temp_fC=pedw->
getSigma(capid,capid);
581 fC_width=
pow(fC_width,0.5)/2.;
582 ADC_width=
pow(ADC_width,0.5)/2.;
586 std::cout <<
"<HcalMonitorClient::PlotPedestalValues> HcalDet ID = "<<(
HcalSubdetector)subdet<<
": ("<<ieta<<
", "<<iphi<<
", "<<
depth<<
")"<<std::endl;
587 std::cout <<
"\tADC pedestal = "<<ADC_ped<<
" +/- "<<ADC_width<<std::endl;
588 std::cout <<
"\tfC pedestal = "<<fC_ped<<
" +/- "<<fC_width<<std::endl;
594 if (ieta<0) zside=-1;
676 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)
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
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
const HcalTopology * hctopo_
bool hasWarnings_Temp(void)