#include <DQM/RPCMonitorClient/interface/RPCFEDIntegrity.h>
Public Member Functions | |
void | analyze (const edm::Event &iEvent, const edm::EventSetup &c) |
Analyze. | |
void | beginJob (const edm::EventSetup &iSetup) |
BeginJob. | |
void | beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) |
Begin Lumi block. | |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
void | endJob () |
void | endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c) |
End Lumi Block. | |
void | endRun (const edm::Run &r, const edm::EventSetup &c) |
RPCFEDIntegrity (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~RPCFEDIntegrity () |
Destructor. | |
Private Member Functions | |
void | bookFEDMe (void) |
void | reset (void) |
Private Attributes | |
DQMStore * | dbe_ |
unsigned int | FATAL_LIMIT |
std::vector< std::string > | histoName_ |
bool | init_ |
int | maxFEDNum_ |
bool | merge_ |
int | minFEDNum_ |
int | numOfFED_ |
std::string | prefixDir_ |
Definition at line 15 of file RPCFEDIntegrity.h.
RPCFEDIntegrity::RPCFEDIntegrity | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 19 of file RPCFEDIntegrity.cc.
References FATAL_LIMIT, edm::ParameterSet::getUntrackedParameter(), histoName_, init_, maxFEDNum_, merge_, minFEDNum_, numOfFED_, and prefixDir_.
00019 { 00020 LogVerbatim ("rpceventsummary") << "[RPCFEDIntegrity]: Constructor"; 00021 00022 prefixDir_ = ps.getUntrackedParameter<string>("RPCPrefixDir", "RPC"); 00023 merge_ = ps.getUntrackedParameter<bool>("MergeRuns", false); 00024 numOfFED_ = ps.getUntrackedParameter<int>("NumberOfFED", 3); 00025 minFEDNum_ = ps.getUntrackedParameter<int>("MinimumFEDID", 790); 00026 maxFEDNum_ = ps.getUntrackedParameter<int>("MaximumFEDID", 792); 00027 00028 histoName_.push_back("FEDEntries"); 00029 histoName_.push_back("FEDFatal"); 00030 histoName_.push_back("FEDNonFatal"); 00031 00032 FATAL_LIMIT = 5; 00033 00034 init_ = false; 00035 }
RPCFEDIntegrity::~RPCFEDIntegrity | ( | ) | [virtual] |
Destructor.
Definition at line 37 of file RPCFEDIntegrity.cc.
00037 { 00038 LogVerbatim ("rpceventsummary") << "[RPCFEDIntegrity]: Destructor "; 00039 // dbe_=0; 00040 }
void RPCFEDIntegrity::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 56 of file RPCFEDIntegrity.cc.
References dbe_, err, FATAL_LIMIT, MonitorElement::Fill(), DQMStore::get(), edm::Event::getByType(), maxFEDNum_, me, minFEDNum_, prefixDir_, edm::Handle< T >::product(), RPCRawDataCounts::recordTypeVector(), and v1.
00056 { 00057 00058 //get hold of raw data counts 00059 Handle<RPCRawDataCounts> rawCounts; 00060 iEvent.getByType( rawCounts); 00061 00062 const RPCRawDataCounts * aCounts = rawCounts.product(); 00063 // const RPCRawDataCounts * theCounts += *aCounts; 00064 00065 vector<double> v1; 00066 map<int,double> fedOccupancy; 00067 00068 MonitorElement * me; 00069 00070 //loop on all FEDS 00071 for (int fedId=minFEDNum_ ;fedId<maxFEDNum_+1;fedId++) { 00072 v1.clear(); 00073 aCounts->recordTypeVector(fedId,v1); 00074 00075 if(fedOccupancy.find(fedId)== fedOccupancy.end() || fedOccupancy.size()==0) fedOccupancy[fedId]=0; 00076 00077 //loop on errors 00078 for (unsigned int err = 1 ; err<v1.size(); err +=2){//get onlz even elements of the vector 00079 fedOccupancy[fedId] += v1[err]; 00080 00081 if(err-1!=0 && err-1 <= FATAL_LIMIT){ 00082 me= dbe_->get(prefixDir_+"/FEDIntegrity/FEDFatal"); 00083 me ->Fill(fedId,v1[err]); 00084 } 00085 else if (err-1!=0){ 00086 me= dbe_->get(prefixDir_+"/FEDIntegrity/FEDNonFatal"); 00087 me ->Fill(fedId,v1[err]); 00088 } 00089 00090 }//end loop o errors 00091 00092 me = dbe_->get(prefixDir_+"/FEDIntegrity/FEDEntries"); 00093 00094 if(me!=0) me->Fill(fedId, fedOccupancy[fedId] ); 00095 }//end loop on all FEDs 00096 }
void RPCFEDIntegrity::beginJob | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 42 of file RPCFEDIntegrity.cc.
References dbe_.
00042 { 00043 LogVerbatim ("rpceventsummary") << "[RPCFEDIntegrity]: Begin job "; 00044 dbe_ = Service<DQMStore>().operator->(); 00045 }
void RPCFEDIntegrity::beginLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, | |
edm::EventSetup const & | context | |||
) | [virtual] |
Begin Lumi block.
Reimplemented from edm::EDAnalyzer.
Definition at line 54 of file RPCFEDIntegrity.cc.
void RPCFEDIntegrity::beginRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 47 of file RPCFEDIntegrity.cc.
References bookFEDMe(), init_, merge_, and reset().
00047 { 00048 LogVerbatim ("rpceventsummary") << "[RPCFEDIntegrity]: Begin run "; 00049 00050 if (!init_) this->bookFEDMe(); 00051 else if (!merge_) this->reset(); 00052 }
Definition at line 107 of file RPCFEDIntegrity.cc.
References DQMStore::book1D(), dbe_, histoName_, i, init_, maxFEDNum_, minFEDNum_, numOfFED_, prefixDir_, and DQMStore::setCurrentFolder().
Referenced by beginRun().
00107 { 00108 00109 if(dbe_){ 00110 dbe_->setCurrentFolder(prefixDir_+"/FEDIntegrity/"); 00111 00112 for(unsigned int i = 0; i<histoName_.size(); i++){ 00113 dbe_->book1D(histoName_[i].c_str(),histoName_[i].c_str(),numOfFED_, minFEDNum_, maxFEDNum_ +1); 00114 } 00115 } 00116 00117 init_ = true; 00118 }
Reimplemented from edm::EDAnalyzer.
Definition at line 102 of file RPCFEDIntegrity.cc.
References dbe_.
00102 { 00103 dbe_=0; 00104 }
void RPCFEDIntegrity::endLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, | |
edm::EventSetup const & | c | |||
) | [virtual] |
End Lumi Block.
Reimplemented from edm::EDAnalyzer.
Definition at line 98 of file RPCFEDIntegrity.cc.
void RPCFEDIntegrity::endRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Definition at line 120 of file RPCFEDIntegrity.cc.
References dbe_, DQMStore::get(), histoName_, i, me, prefixDir_, and MonitorElement::Reset().
Referenced by beginRun().
00120 { 00121 00122 MonitorElement * me; 00123 00124 if(dbe_){ 00125 for(unsigned int i = 0; i<histoName_.size(); i++){ 00126 if( me = dbe_->get(prefixDir_ +"FEDIntegrity/"+ histoName_[i]) ) me->Reset(); 00127 } 00128 } 00129 }
DQMStore* RPCFEDIntegrity::dbe_ [private] |
Definition at line 53 of file RPCFEDIntegrity.h.
Referenced by analyze(), beginJob(), bookFEDMe(), endJob(), and reset().
unsigned int RPCFEDIntegrity::FATAL_LIMIT [private] |
std::vector<std::string> RPCFEDIntegrity::histoName_ [private] |
Definition at line 58 of file RPCFEDIntegrity.h.
Referenced by bookFEDMe(), reset(), and RPCFEDIntegrity().
bool RPCFEDIntegrity::init_ [private] |
Definition at line 51 of file RPCFEDIntegrity.h.
Referenced by beginRun(), bookFEDMe(), and RPCFEDIntegrity().
int RPCFEDIntegrity::maxFEDNum_ [private] |
Definition at line 57 of file RPCFEDIntegrity.h.
Referenced by analyze(), bookFEDMe(), and RPCFEDIntegrity().
bool RPCFEDIntegrity::merge_ [private] |
int RPCFEDIntegrity::minFEDNum_ [private] |
Definition at line 57 of file RPCFEDIntegrity.h.
Referenced by analyze(), bookFEDMe(), and RPCFEDIntegrity().
int RPCFEDIntegrity::numOfFED_ [private] |
std::string RPCFEDIntegrity::prefixDir_ [private] |
Definition at line 49 of file RPCFEDIntegrity.h.
Referenced by analyze(), bookFEDMe(), reset(), and RPCFEDIntegrity().