Go to the documentation of this file.00001 #include "DQM/RPCMonitorClient/interface/RPCDcsInfoClient.h"
00002 #include "FWCore/Framework/interface/LuminosityBlock.h"
00003
00004 RPCDcsInfoClient::RPCDcsInfoClient( const edm::ParameterSet& ps ) {
00005
00006 dbe_ = edm::Service<DQMStore>().operator->();
00007
00008 dcsinfofolder_ = ps.getUntrackedParameter<std::string>("dcsInfoFolder", "RPC/DCSInfo") ;
00009 }
00010
00011
00012 RPCDcsInfoClient::~RPCDcsInfoClient() {}
00013
00014 void RPCDcsInfoClient::beginRun(const edm::Run& r, const edm::EventSetup& c) {
00015 DCS.clear();
00016 DCS.resize(10);
00017 }
00018
00019 void RPCDcsInfoClient::analyze(const edm::Event& e, const edm::EventSetup& c){}
00020
00021 void RPCDcsInfoClient::endLuminosityBlock(const edm::LuminosityBlock& l, const edm::EventSetup& c){
00022 if (!dbe_) return;
00023
00024 unsigned int nlumi = l.id().luminosityBlock() ;
00025
00026 if (nlumi+1 > DCS.size()) DCS.resize(nlumi+1);
00027
00028
00029 MonitorElement* DCSbyLS_ = dbe_->get(dcsinfofolder_ + "/DCSbyLS" );
00030
00031 if ( !DCSbyLS_ ) return;
00032
00033 if ( TH1F * h1 = DCSbyLS_->getTH1F()) {
00034 int hvStatus = 0;
00035
00036 if ( h1->GetBinContent(1) != 0 ) {
00037 hvStatus = 0;
00038 } else {
00039 hvStatus = 1;
00040 }
00041
00042 DCS[nlumi] = hvStatus;
00043 }
00044
00045 return;
00046 }
00047
00048 void RPCDcsInfoClient::endRun(const edm::Run& r, const edm::EventSetup& c) {
00049
00050
00051 dbe_->cd();
00052 dbe_->setCurrentFolder(dcsinfofolder_ );
00053
00054 unsigned int nlsmax = DCS.size();
00055 if (nlsmax > 900 ) nlsmax = 900;
00056
00057 std::string meName = dcsinfofolder_ + "/rpcHVStatus";
00058 MonitorElement* rpcHVStatus = dbe_->get(meName);
00059 if (rpcHVStatus) dbe_->removeElement(rpcHVStatus->getName());
00060
00061 rpcHVStatus = dbe_->book2D("rpcHVStatus","RPC HV Status", nlsmax, 1., nlsmax+1, 1, 0.5, 1.5);
00062 rpcHVStatus->setAxisTitle("Luminosity Section", 1);
00063 rpcHVStatus->setBinLabel(1,"",2);
00064
00065
00066 for (unsigned int i = 0 ; i < nlsmax ; i++ ) {
00067 rpcHVStatus->setBinContent(i+1,1,DCS[i]);
00068 }
00069
00070 }