62 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
63 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();
209 x<<
"1+log2(status) for HCAL depth "<<d+1;
246 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i)
253 if (status==0)
continue;
258 int depth=
id.depth();
259 if (depth<1 || depth>4)
continue;
263 ieta>0 ? ++ieta: --ieta;
265 double logstatus = 0;
268 logstatus=-1*(log2(-1.*status)+1);
270 logstatus=log2(1.*status)+1;
278 clients_[
i]->setStatusMap(badchannelmap);
305 x<<
"1+log2(status) for HCAL depth "<<d+1;
318 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::beginLuminosityBlock>"<<std::endl;
324 std::cout <<
"HcalMonitorClient::analyze(const edm::Event&, const edm::EventSetup&) ievt_ = "<<
ievt_<<std::endl;
343 std::cout <<
"HcalMonitorClient::analyze() "<<std::endl;
361 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::endLuminosityBlock>"<<std::endl;
459 if (
debug_>0)
std::cout <<
"Preparing HcalMonitorClient html output ..." << std::endl;
463 gStyle->Reset(
"Default");
464 gStyle->SetCanvasColor(0);
465 gStyle->SetPadColor(0);
466 gStyle->SetFillColor(0);
467 gStyle->SetTitleFillColor(10);
469 gStyle->SetOptStat(
"ouemr");
470 gStyle->SetPalette(1);
477 system((
"/bin/mkdir -p " + htmlDir).c_str());
481 std::ofstream htmlFile;
482 htmlFile.open((htmlDir +
"index.html").c_str());
485 htmlFile <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> " << std::endl;
486 htmlFile <<
"<html> " << std::endl;
487 htmlFile <<
"<head> " << std::endl;
488 htmlFile <<
" <meta content=\"text/html; charset=ISO-8859-1\" " << std::endl;
489 htmlFile <<
" http-equiv=\"content-type\"> " << std::endl;
490 htmlFile <<
" <title>Hcal Data Quality Monitor</title> " << std::endl;
491 htmlFile <<
"</head> " << std::endl;
492 htmlFile <<
"<body> " << std::endl;
493 htmlFile <<
"<br> " << std::endl;
494 htmlFile <<
"<center><h1>Hcal Data Quality Monitor</h1></center>" << std::endl;
495 htmlFile <<
"<h2>Run Number: " << std::endl;
496 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
run_ <<
"</span></h2> " << std::endl;
497 htmlFile <<
"<h2>Events processed: " << std::endl;
498 htmlFile <<
"<span style=\"color: rgb(0, 0, 153);\">" <<
ievt_ <<
"</span></h2> " << std::endl;
499 htmlFile <<
"<hr>" << std::endl;
500 htmlFile <<
"<ul>" << std::endl;
504 if (
clients_[
i]->validHtmlOutput()==
true)
508 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
509 htmlFile <<
"<td WIDTH=\"35%\"><a href=\"" <<
clients_[
i]->name_ <<
".html"<<
"\">"<<
clients_[
i]->name_<<
"</a></td>" << std::endl;
510 if(
clients_[
i]->hasErrors_Temp()) htmlFile <<
"<td bgcolor=red align=center>This monitor task has errors.</td>" << std::endl;
511 else if(
clients_[
i]->hasWarnings_Temp()) htmlFile <<
"<td bgcolor=yellow align=center>This monitor task has warnings.</td>" << std::endl;
512 else if(
clients_[
i]->hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
513 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
514 htmlFile <<
"</tr></table>" << std::endl;
522 htmlFile <<
"<table border=0 WIDTH=\"50%\"><tr>" << std::endl;
526 else if(
summaryClient_->
hasOther_Temp()) htmlFile <<
"<td bgcolor=aqua align=center>This monitor task has messages.</td>" << std::endl;
527 else htmlFile <<
"<td bgcolor=lime align=center>This monitor task has no problems</td>" << std::endl;
528 htmlFile <<
"</tr></table>" << std::endl;
531 htmlFile <<
"</ul>" << std::endl;
534 htmlFile <<
"</body> " << std::endl;
535 htmlFile <<
"</html> " << std::endl;
538 if (
debug_>0)
std::cout <<
"HcalMonitorClient html output done..." << std::endl;
545 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeDBfile> Writing file for database"<<std::endl;
547 std::map<HcalDetId, unsigned int> myquality;
550 clients_[
i]->updateChannelStatus(myquality);
552 if (
debug_>0)
std::cout <<
"<HcalMonitorClient::writeChannelStatus()> myquality size = "<<myquality.size()<<std::endl;
557 for (
unsigned int i=0;
i<mydetids.size();++
i)
567 if (myquality.find(
id)!=myquality.end())
585 std::ostringstream
file;
589 std::ofstream outStream(file.str().c_str());
590 outStream<<
"### Run # "<<
run_<<std::endl;
616 for (
int subdet=1; subdet<=4;++subdet)
618 for (
int depth=0;depth<4;++depth)
625 if (ieta==-9999)
continue;
641 for (
unsigned int capid=0;capid<4;++capid)
648 temp_ADC=channelCoder_->
adc(*shape_,
653 temp_fC=pedw->
getSigma(capid,capid);
666 fC_width=
pow(fC_width,0.5)/2.;
667 ADC_width=
pow(ADC_width,0.5)/2.;
671 std::cout <<
"<HcalMonitorClient::PlotPedestalValues> HcalDet ID = "<<(
HcalSubdetector)subdet<<
": ("<<ieta<<
", "<<iphi<<
", "<<depth<<
")"<<std::endl;
672 std::cout <<
"\tADC pedestal = "<<ADC_ped<<
" +/- "<<ADC_width<<std::endl;
673 std::cout <<
"\tfC pedestal = "<<fC_ped<<
" +/- "<<fC_width<<std::endl;
679 if (ieta<0) zside=-1;
std::vector< std::string > enabledClients_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
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 setTopo(const HcalTopology *topo) 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
const Item * getValues(DetId fId, bool throwOnFail=true) const
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)
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
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
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
bool addValues(const Item &myItem)
void getFriends(const std::vector< HcalBaseDQClient * > &clients)
Power< A, B >::type pow(const A &a, const B &b)
void setCurrentFolder(const std::string &fullpath)
const HcalTopology * topo() const
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
bool hasWarnings_Temp(void)