CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

DQMDcsInfo Class Reference

#include <DQMDcsInfo.h>

Inheritance diagram for DQMDcsInfo:
edm::EDAnalyzer

List of all members.

Public Member Functions

 DQMDcsInfo (const edm::ParameterSet &ps)
 Constructor.
virtual ~DQMDcsInfo ()
 Destructor.

Protected Member Functions

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

Private Member Functions

void makeDcsInfo (const edm::Event &e)
void makeGtInfo (const edm::Event &e)

Private Attributes

DQMStoredbe_
bool dcs [25]
MonitorElementDCSbyLS_
std::string dcsinfofolder_
edm::ParameterSet parameters_
std::string subsystemname_

Detailed Description

Definition at line 24 of file DQMDcsInfo.h.


Constructor & Destructor Documentation

DQMDcsInfo::DQMDcsInfo ( const edm::ParameterSet ps)

Constructor.

Definition at line 21 of file DQMDcsInfo.cc.

References dbe_, dcs, dcsinfofolder_, edm::ParameterSet::getUntrackedParameter(), i, cppFunctionSkipper::operator, parameters_, and subsystemname_.

{
  
  parameters_ = ps;

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

  subsystemname_ = parameters_.getUntrackedParameter<std::string>("subSystemFolder", "Info") ;
  dcsinfofolder_ = parameters_.getUntrackedParameter<std::string>("dcsInfoFolder", "DcsInfo") ;
  
  // initialize
  for (int i=0;i<25;i++) dcs[i]=true;
}
DQMDcsInfo::~DQMDcsInfo ( ) [virtual]

Destructor.

Definition at line 35 of file DQMDcsInfo.cc.

                       {
}

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 59 of file DQMDcsInfo.cc.

References makeDcsInfo(), and makeGtInfo().

                                                                 {
 
  makeDcsInfo(e);
  makeGtInfo(e);

  return;
}
void DQMDcsInfo::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file DQMDcsInfo.cc.

References DQMStore::book1D(), DQMStore::bookString(), DQMStore::cd(), dbe_, dcs, DCSbyLS_, dcsinfofolder_, edm::ParameterSet::getParameter(), edm::getProcessParameterSet(), i, DQMStore::setCurrentFolder(), MonitorElement::setLumiFlag(), and subsystemname_.

                                                             {

  // Fetch GlobalTag information and fill the string/ME.
  dbe_->cd();  
  dbe_->setCurrentFolder(subsystemname_ +"/CMSSWInfo/");
  const edm::ParameterSet &globalTagPSet = edm::getProcessParameterSet()
                                           .getParameterSet("PoolDBESSource@GlobalTag");

  dbe_->bookString("globalTag_Step1", globalTagPSet.getParameter<std::string>("globaltag"));

  dbe_->cd();  
  dbe_->setCurrentFolder(subsystemname_ + "/" + dcsinfofolder_);

  DCSbyLS_=dbe_->book1D("DCSbyLS","DCS",25,0.,25.);
  DCSbyLS_->setLumiFlag();

  // initialize
  for (int i=0;i<25;i++) dcs[i]=true;
} 
void DQMDcsInfo::endLuminosityBlock ( const edm::LuminosityBlock l,
const edm::EventSetup c 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file DQMDcsInfo.cc.

References dcs, DCSbyLS_, i, and MonitorElement::setBinContent().

{
  // int nlumi = l.id().luminosityBlock();

  // fill dcs vs lumi 
  /* set those bins 0 for which bits are ON 
     needed for merge off lumi histograms across files */
  for (int i=0;i<25;i++)
  {
    if (dcs[i])
      DCSbyLS_->setBinContent(i+1,0.);
    else
      DCSbyLS_->setBinContent(i+1,1.);

    dcs[i]=true;
  }

  return;
}
void DQMDcsInfo::makeDcsInfo ( const edm::Event e) [private]

Definition at line 89 of file DQMDcsInfo.cc.

References DcsStatus::BPIX, DcsStatus::CASTOR, DcsStatus::CSCm, DcsStatus::CSCp, dcs, DcsStatus::DT0, DcsStatus::DTm, DcsStatus::DTp, DcsStatus::EBm, DcsStatus::EBp, DcsStatus::EEm, DcsStatus::EEp, DcsStatus::ESm, DcsStatus::ESp, DcsStatus::FPIX, edm::Event::getByLabel(), DcsStatus::HBHEa, DcsStatus::HBHEb, DcsStatus::HBHEc, DcsStatus::HF, DcsStatus::HO, i, edm::HandleBase::isValid(), DcsStatus::RPC, DcsStatus::TECm, DcsStatus::TECp, DcsStatus::TIBTID, and DcsStatus::TOB.

Referenced by analyze().

{

  edm::Handle<DcsStatusCollection> dcsStatus;
  if ( ! e.getByLabel("scalersRawToDigi", dcsStatus) )
  {
    for (int i=0;i<24;i++) dcs[i]=false;
    return;
  }
  
  if ( ! dcsStatus.isValid() ) 
  {
    edm::LogWarning("DQMDcsInfo") << "scalersRawToDigi not found" ;
    for (int i=0;i<24;i++) dcs[i]=false; // info not available: set to false
    return;
  }
    
  for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); 
                            dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) 
  {
      if (!dcsStatusItr->ready(DcsStatus::CSCp))   dcs[0]=false;
      if (!dcsStatusItr->ready(DcsStatus::CSCm))   dcs[1]=false;   
      if (!dcsStatusItr->ready(DcsStatus::DT0))    dcs[2]=false;
      if (!dcsStatusItr->ready(DcsStatus::DTp))    dcs[3]=false;
      if (!dcsStatusItr->ready(DcsStatus::DTm))    dcs[4]=false;
      if (!dcsStatusItr->ready(DcsStatus::EBp))    dcs[5]=false;
      if (!dcsStatusItr->ready(DcsStatus::EBm))    dcs[6]=false;
      if (!dcsStatusItr->ready(DcsStatus::EEp))    dcs[7]=false;
      if (!dcsStatusItr->ready(DcsStatus::EEm))    dcs[8]=false;
      if (!dcsStatusItr->ready(DcsStatus::ESp))    dcs[9]=false;
      if (!dcsStatusItr->ready(DcsStatus::ESm))    dcs[10]=false; 
      if (!dcsStatusItr->ready(DcsStatus::HBHEa))  dcs[11]=false;
      if (!dcsStatusItr->ready(DcsStatus::HBHEb))  dcs[12]=false;
      if (!dcsStatusItr->ready(DcsStatus::HBHEc))  dcs[13]=false; 
      if (!dcsStatusItr->ready(DcsStatus::HF))     dcs[14]=false;
      if (!dcsStatusItr->ready(DcsStatus::HO))     dcs[15]=false;
      if (!dcsStatusItr->ready(DcsStatus::BPIX))   dcs[16]=false;
      if (!dcsStatusItr->ready(DcsStatus::FPIX))   dcs[17]=false;
      if (!dcsStatusItr->ready(DcsStatus::RPC))    dcs[18]=false;
      if (!dcsStatusItr->ready(DcsStatus::TIBTID)) dcs[19]=false;
      if (!dcsStatusItr->ready(DcsStatus::TOB))    dcs[20]=false;
      if (!dcsStatusItr->ready(DcsStatus::TECp))   dcs[21]=false;
      if (!dcsStatusItr->ready(DcsStatus::TECm))   dcs[22]=false;
      if (!dcsStatusItr->ready(DcsStatus::CASTOR)) dcs[23]=false;
  }
      
  return ;
}
void DQMDcsInfo::makeGtInfo ( const edm::Event e) [private]

Definition at line 139 of file DQMDcsInfo.cc.

References dcs, edm::Event::getByLabel(), L1GlobalTriggerReadoutRecord::gtFdlWord(), edm::HandleBase::isValid(), L1GtFdlWord::physicsDeclared(), and edm::Handle< T >::product().

Referenced by analyze().

{

  edm::Handle<L1GlobalTriggerReadoutRecord> gtrr_handle;
  if ( ! e.getByLabel("gtDigis", gtrr_handle) ) 
  {
    dcs[24]=false; // info not available: set to false
    return;
  }
  
  if ( ! gtrr_handle.isValid() ) 
  {
    edm::LogWarning("DQMDcsInfo") << " gtDigis not found" ;
    dcs[24]=false; // info not available: set to false
    return;
  }
  
  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
  L1GtFdlWord fdlWord ; 
  if (gtrr)
    fdlWord = gtrr->gtFdlWord();
  else
  {
    edm::LogWarning ("DQMDcsInfo") << " phys decl. bit not accessible !!!";
    dcs[24]=false; // info not available: set to false
    return;
  }

  if (fdlWord.physicsDeclared() !=1) dcs[24]=false;

  return;
}

Member Data Documentation

Definition at line 46 of file DQMDcsInfo.h.

Referenced by beginRun(), and DQMDcsInfo().

bool DQMDcsInfo::dcs[25] [private]

Definition at line 52 of file DQMDcsInfo.h.

Referenced by beginRun(), DQMDcsInfo(), endLuminosityBlock(), makeDcsInfo(), and makeGtInfo().

Definition at line 54 of file DQMDcsInfo.h.

Referenced by beginRun(), and endLuminosityBlock().

std::string DQMDcsInfo::dcsinfofolder_ [private]

Definition at line 50 of file DQMDcsInfo.h.

Referenced by beginRun(), and DQMDcsInfo().

Definition at line 48 of file DQMDcsInfo.h.

Referenced by DQMDcsInfo().

std::string DQMDcsInfo::subsystemname_ [private]

Definition at line 49 of file DQMDcsInfo.h.

Referenced by beginRun(), and DQMDcsInfo().