65 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
66 prefixME_.append(
"/");
84 std::cout <<
"HcalMonitorClient:: The following clients are enabled:"<<std::endl;
85 for (
unsigned int i=0;
i<enabledClients_.size();++
i)
102 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DeadCellMonitor")!=enabledClients_.end())
104 if (
find(enabledClients_.begin(), enabledClients_.end(),
"HotCellMonitor")!=enabledClients_.end())
106 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RecHitMonitor")!=enabledClients_.end())
108 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DigiMonitor")!=enabledClients_.end())
110 if (
find(enabledClients_.begin(), enabledClients_.end(),
"RawDataMonitor")!=enabledClients_.end())
112 if (
find(enabledClients_.begin(), enabledClients_.end(),
"TrigPrimMonitor")!=enabledClients_.end())
114 if (
find(enabledClients_.begin(), enabledClients_.end(),
"NZSMonitor")!=enabledClients_.end())
116 if (
find(enabledClients_.begin(), enabledClients_.end(),
"BeamMonitor")!=enabledClients_.end())
118 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagPedestalMonitor")!=enabledClients_.end())
120 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLaserMonitor")!=enabledClients_.end())
122 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagLEDMonitor")!=enabledClients_.end())
124 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagNoiseMonitor")!=enabledClients_.end())
126 if (
find(enabledClients_.begin(), enabledClients_.end(),
"DetDiagTimingMonitor")!=enabledClients_.end())
128 if (
find(enabledClients_.begin(), enabledClients_.end(),
"CoarsePedestalMonitor")!=enabledClients_.end())
130 if (
find(enabledClients_.begin(), enabledClients_.end(),
"ZDCMonitor")!=enabledClients_.end())
133 if (
find(enabledClients_.begin(), enabledClients_.end(),
"Summary")!=enabledClients_.end())
183 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginRun(r,c)>"<<std::endl;
193 std::map <HcalDetId, unsigned int> badchannelmap;
194 badchannelmap.clear();
210 x<<
"1+log2(status) for HCAL depth "<<d+1;
247 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i)
254 if (status==0)
continue;
259 int depth=
id.depth();
260 if (depth<1 || depth>4)
continue;
264 ieta>0 ? ++ieta: --ieta;
266 double logstatus = 0;
269 logstatus=-1*(log2(-1.*status)+1);
271 logstatus=log2(1.*status)+1;
279 clients_[
i]->setStatusMap(badchannelmap);
306 x<<
"1+log2(status) for HCAL depth "<<d+1;
319 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginLuminosityBlock>"<<std::endl;
325 std::cout <<
"HcalMonitorClient::analyze(const edm::Event&, const edm::EventSetup&) ievt_ = "<<
ievt_<<std::endl;
338 std::cout <<
"HcalMonitorClient::analyze() "<<std::endl;
356 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::endLuminosityBlock>"<<std::endl;
454 if (
debug_>0)
std::cout <<
"Preparing HcalMonitorClient html output ..." << std::endl;
458 gStyle->Reset(
"Default");
459 gStyle->SetCanvasColor(0);
460 gStyle->SetPadColor(0);
461 gStyle->SetFillColor(0);
462 gStyle->SetTitleFillColor(10);
464 gStyle->SetOptStat(
"ouemr");
465 gStyle->SetPalette(1);
472 system((
"/bin/mkdir -p " + htmlDir).c_str());
477 htmlFile.open((htmlDir +
"index.html").c_str());
480 htmlFile <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
481 htmlFile <<
"<html> " << std::endl;
482 htmlFile <<
"<head> " << std::endl;
483 htmlFile <<
" <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
484 htmlFile <<
" http-equiv=\"content-type\"> " << std::endl;
485 htmlFile <<
" <title>Hcal Data Quality Monitor</title> " << std::endl;
486 htmlFile <<
"</head> " << std::endl;
487 htmlFile <<
"<body> " << std::endl;
488 htmlFile <<
"<br> " << std::endl;
489 htmlFile <<
"<center><h1>Hcal Data Quality Monitor</h1></center>" << std::endl;
490 htmlFile <<
"<h2>Run Number: " << std::endl;
491 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
run_ <<
"</span></h2> " << std::endl;
492 htmlFile <<
"<h2>Events processed: " << std::endl;
493 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
ievt_ <<
"</span></h2> " << std::endl;
494 htmlFile <<
"<hr>" << std::endl;
495 htmlFile <<
"<ul>" << std::endl;
499 if (
clients_[
i]->validHtmlOutput()==
true)
503 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
504 htmlFile <<
"<td WIDTH=\"35%\"><a href=\"" <<
clients_[
i]->name_ <<
".html"<<
"\">"<<
clients_[
i]->name_<<
"</a></td>" << std::endl;
505 if(
clients_[
i]->hasErrors_Temp()) htmlFile <<
"<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
506 else if(
clients_[
i]->hasWarnings_Temp()) htmlFile <<
"<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
507 else if(
clients_[
i]->hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
508 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
509 htmlFile <<
"</tr></table>" << std::endl;
517 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
521 else if(
summaryClient_->
hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
522 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
523 htmlFile <<
"</tr></table>" << std::endl;
526 htmlFile <<
"</ul>" << std::endl;
529 htmlFile <<
"</body> " << std::endl;
530 htmlFile <<
"</html> " << std::endl;
533 if (
debug_>0)
std::cout <<
"HcalMonitorClient html output done..." << std::endl;
540 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeDBfile> Writing file for database"<<std::endl;
542 std::map<HcalDetId, unsigned int> myquality;
545 clients_[
i]->updateChannelStatus(myquality);
547 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeChannelStatus()> myquality size = "<<myquality.size()<<std::endl;
552 for (
unsigned int i=0;
i<mydetids.size();++
i)
562 if (myquality.find(
id)!=myquality.end())
580 std::ostringstream
file;
584 std::ofstream outStream(file.str().c_str());
585 outStream<<
"### Run # "<<
run_<<std::endl;
612 for (
int subdet=1; subdet<=4;++subdet)
614 for (
int depth=0;depth<4;++depth)
621 if (ieta==-9999)
continue;
636 for (
unsigned int capid=0;capid<4;++capid)
643 temp_ADC=channelCoder_->
adc(*shape_,
648 temp_fC=pedw->
getSigma(capid,capid);
661 fC_width=
pow(fC_width,0.5)/2.;
662 ADC_width=
pow(ADC_width,0.5)/2.;
666 std::cout <<
"<HcalMonitorClient::PlotPedestalValues> HcalDet ID = "<<(
HcalSubdetector)subdet<<
": ("<<ieta<<
", "<<iphi<<
", "<<depth<<
")"<<std::endl;
667 std::cout <<
"\tADC pedestal = "<<ADC_ped<<
" +/- "<<ADC_width<<std::endl;
668 std::cout <<
"\tfC pedestal = "<<fC_ped<<
" +/- "<<fC_width<<std::endl;
674 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
int CalcIeta(int subdet, int eta, int depth)
void getFriends(std::vector< HcalBaseDQClient * > clients)
std::vector< DetId > getAllChannels() const
virtual ~HcalMonitorClient()
void writeChannelStatus()
HcalSummaryClient * summaryClient_
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(std::vector< TH2F > &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)