CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

RPCDcsInfoClient Class Reference

#include <RPCDcsInfoClient.h>

Inheritance diagram for RPCDcsInfoClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

 RPCDcsInfoClient (const edm::ParameterSet &ps)
 ~RPCDcsInfoClient ()

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
void endLuminosityBlock (const edm::LuminosityBlock &l, const edm::EventSetup &c)
void endRun (const edm::Run &r, const edm::EventSetup &c)

Private Attributes

DQMStoredbe_
std::vector< int > DCS
std::string dcsinfofolder_

Detailed Description

Definition at line 14 of file RPCDcsInfoClient.h.


Constructor & Destructor Documentation

RPCDcsInfoClient::RPCDcsInfoClient ( const edm::ParameterSet ps)

Definition at line 4 of file RPCDcsInfoClient.cc.

References dbe_, dcsinfofolder_, edm::ParameterSet::getUntrackedParameter(), and cppFunctionSkipper::operator.

                                                              {

  dbe_ = edm::Service<DQMStore>().operator->();

  dcsinfofolder_ = ps.getUntrackedParameter<std::string>("dcsInfoFolder", "RPC/DCSInfo") ;
}
RPCDcsInfoClient::~RPCDcsInfoClient ( )

Definition at line 12 of file RPCDcsInfoClient.cc.

{}

Member Function Documentation

void RPCDcsInfoClient::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Implements edm::EDAnalyzer.

Definition at line 19 of file RPCDcsInfoClient.cc.

{}
void RPCDcsInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 14 of file RPCDcsInfoClient.cc.

References DCS.

                                                                       {
  DCS.clear();
  DCS.resize(10);  // start with 10 LS, resize later
}
void RPCDcsInfoClient::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file RPCDcsInfoClient.cc.

References dbe_, DCS, dcsinfofolder_, DQMStore::get(), MonitorElement::getTH1F(), and edm::LuminosityBlockBase::id().

                                                                                            {
  if (!dbe_) return;

  unsigned int nlumi = l.id().luminosityBlock() ;

  if (nlumi+1 > DCS.size())   DCS.resize(nlumi+1);


  MonitorElement* DCSbyLS_ = dbe_->get(dcsinfofolder_ + "/DCSbyLS" ); 

  if ( !DCSbyLS_ ) return;
  
  if ( TH1F * h1 = DCSbyLS_->getTH1F()) {
    int hvStatus = 0;
   
    if ( h1->GetBinContent(1) != 0 ) {
      hvStatus = 0; // set to 0 because HV was off (!)
    } else  {
      hvStatus = 1;    // set to 1 because HV was on (!)
    }

    DCS[nlumi] = hvStatus;
  }
  
  return; 
}
void RPCDcsInfoClient::endRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file RPCDcsInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookInt(), DQMStore::cd(), dbe_, DCS, dcsinfofolder_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), i, DQMStore::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

                                                                     {

  // book 
  dbe_->cd();  
  dbe_->setCurrentFolder(dcsinfofolder_ );

  unsigned int nlsmax = DCS.size();
  if (nlsmax > 900 ) nlsmax = 900;
   
  std::string meName = dcsinfofolder_ + "/rpcHVStatus";
  MonitorElement* rpcHVStatus = dbe_->get(meName);
  if (rpcHVStatus) dbe_->removeElement(rpcHVStatus->getName());

  rpcHVStatus = dbe_->book2D("rpcHVStatus","RPC HV Status", nlsmax, 1., nlsmax+1, 1, 0.5, 1.5);
  rpcHVStatus->setAxisTitle("Luminosity Section", 1);
  rpcHVStatus->setBinLabel(1,"",2);   

  int lsCounter = 0;
  // fill
  for (unsigned int i = 0 ; i < nlsmax ; i++ )  {
    rpcHVStatus->setBinContent(i+1,1,DCS[i]);
    lsCounter +=DCS[i];
  }

  meName = dcsinfofolder_ + "/rpcHV";
  MonitorElement* rpcHV = dbe_->get(meName);
  if (rpcHV) dbe_->removeElement(rpcHVStatus->getName());
  rpcHV = dbe_->bookInt("rpcHV");

  rpcHV ->Fill(lsCounter);
  
  return;
}

Member Data Documentation

Definition at line 30 of file RPCDcsInfoClient.h.

Referenced by endLuminosityBlock(), endRun(), and RPCDcsInfoClient().

std::vector<int> RPCDcsInfoClient::DCS [private]

Definition at line 32 of file RPCDcsInfoClient.h.

Referenced by beginRun(), endLuminosityBlock(), and endRun().

std::string RPCDcsInfoClient::dcsinfofolder_ [private]

Definition at line 28 of file RPCDcsInfoClient.h.

Referenced by endLuminosityBlock(), endRun(), and RPCDcsInfoClient().