#include <RPCDaqInfo.h>
Public Member Functions | |
RPCDaqInfo (const edm::ParameterSet &) | |
~RPCDaqInfo () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) |
virtual void | endJob () |
virtual void | endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) |
Private Attributes | |
MonitorElement * | daqDiskFractions [10] |
MonitorElement * | DaqFraction_ |
MonitorElement * | DaqMap_ |
MonitorElement * | daqWheelFractions [5] |
DQMStore * | dbe_ |
std::pair< int, int > | FEDRange_ |
int | numberOfDisks_ |
int | NumberOfFeds_ |
Definition at line 25 of file RPCDaqInfo.h.
RPCDaqInfo::RPCDaqInfo | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 7 of file RPCDaqInfo.cc.
References FEDRange_, edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, and NumberOfFeds_.
{ FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790); FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792); NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1; numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3); }
RPCDaqInfo::~RPCDaqInfo | ( | ) |
Definition at line 17 of file RPCDaqInfo.cc.
{}
void RPCDaqInfo::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
void RPCDaqInfo::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 55 of file RPCDaqInfo.cc.
References DQMStore::book2D(), DQMStore::bookFloat(), daqDiskFractions, DaqFraction_, DaqMap_, daqWheelFractions, dbe_, MonitorElement::Fill(), i, MessageLogger_cff::limit, numberOfDisks_, evf::evtn::offset(), cppFunctionSkipper::operator, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and hcal_dqm_sourceclient-file_cfg::streams.
{ dbe_ = 0; dbe_ = edm::Service<DQMStore>().operator->(); //fraction of alive FEDs dbe_->setCurrentFolder("RPC/EventInfo/DAQContents"); int limit = numberOfDisks_; if(numberOfDisks_ < 2) limit = 2; for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks if (i>-3 && i<3){//wheels std::stringstream streams; streams << "RPC_Wheel" << i; daqWheelFractions[i+2] = dbe_->bookFloat(streams.str()); daqWheelFractions[i+2]->Fill(-1); } if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue; int offset = numberOfDisks_; if (i>0) offset --; //used to skip case equale to zero std::stringstream streams; streams << "RPC_Disk" << i; daqDiskFractions[i+2] = dbe_->bookFloat(streams.str()); daqDiskFractions[i+2]->Fill(-1); } //daq summary for RPCs dbe_->setCurrentFolder("RPC/EventInfo"); DaqFraction_ = dbe_->bookFloat("DAQSummary"); DaqMap_ = dbe_->book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5); //customize the 2d histo std::stringstream BinLabel; for (int i= 1 ; i<=15; i++){ BinLabel.str(""); if(i<13){ BinLabel<<"Sec"<<i; DaqMap_->setBinLabel(i,BinLabel.str(),2); } BinLabel.str(""); if(i<5) BinLabel<<"Disk"<<i-5; else if(i>11) BinLabel<<"Disk"<<i-11; else if(i==11 || i==5) BinLabel.str(""); else BinLabel<<"Wheel"<<i-8; DaqMap_->setBinLabel(i,BinLabel.str(),1); } }
void RPCDaqInfo::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiBlock, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 19 of file RPCDaqInfo.cc.
References DaqFraction_, FEDRange_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), and NumberOfFeds_.
{ edm::eventsetup::EventSetupRecordKey recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("RunInfoRcd")); if(0 != iSetup.find( recordKey ) ) { //get fed summary information edm::ESHandle<RunInfo> sumFED; iSetup.get<RunInfoRcd>().get(sumFED); std::vector<int> FedsInIds= sumFED->m_fed_in; int FedCount=0; //loop on all active feds for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) { int fedID=FedsInIds[fedItr]; //make sure fed id is in allowed range if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount; } //Fill active fed fraction ME if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_); else DaqFraction_->Fill(-1); }else{ DaqFraction_->Fill(-1); return; } }
void RPCDaqInfo::endJob | ( | void | ) | [private, virtual] |
void RPCDaqInfo::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiBlock, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
MonitorElement* RPCDaqInfo::daqDiskFractions[10] [private] |
Definition at line 43 of file RPCDaqInfo.h.
Referenced by beginJob().
MonitorElement* RPCDaqInfo::DaqFraction_ [private] |
Definition at line 40 of file RPCDaqInfo.h.
Referenced by beginJob(), and beginLuminosityBlock().
MonitorElement* RPCDaqInfo::DaqMap_ [private] |
Definition at line 41 of file RPCDaqInfo.h.
Referenced by beginJob().
MonitorElement* RPCDaqInfo::daqWheelFractions[5] [private] |
Definition at line 42 of file RPCDaqInfo.h.
Referenced by beginJob().
DQMStore* RPCDaqInfo::dbe_ [private] |
Definition at line 38 of file RPCDaqInfo.h.
Referenced by beginJob().
std::pair<int,int> RPCDaqInfo::FEDRange_ [private] |
Definition at line 45 of file RPCDaqInfo.h.
Referenced by beginLuminosityBlock(), and RPCDaqInfo().
int RPCDaqInfo::numberOfDisks_ [private] |
Definition at line 47 of file RPCDaqInfo.h.
Referenced by beginJob(), and RPCDaqInfo().
int RPCDaqInfo::NumberOfFeds_ [private] |
Definition at line 47 of file RPCDaqInfo.h.
Referenced by beginLuminosityBlock(), and RPCDaqInfo().