CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
RPCFEDIntegrity Class Reference

#include <RPCFEDIntegrity.h>

Inheritance diagram for RPCFEDIntegrity:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Begin Lumi block. More...
 
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. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
 RPCFEDIntegrity (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCFEDIntegrity ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Types

enum  fedHisto { Entries, Fatal, NonFatal }
 

Private Member Functions

void bookFEDMe (void)
 
void labelBins (MonitorElement *myMe)
 
void reset (void)
 

Private Attributes

DQMStoredbe_
 
int FATAL_LIMIT
 
MonitorElementfedMe_ [3]
 
std::vector< std::string > histoName_
 
bool init_
 
int maxFEDNum_
 
bool merge_
 
int minFEDNum_
 
int numOfFED_
 
std::string prefixDir_
 
edm::InputTag rawCountsLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 16 of file RPCFEDIntegrity.h.

Member Enumeration Documentation

Enumerator
Entries 
Fatal 
NonFatal 

Definition at line 60 of file RPCFEDIntegrity.h.

Constructor & Destructor Documentation

RPCFEDIntegrity::RPCFEDIntegrity ( const edm::ParameterSet ps)

Constructor.

Definition at line 21 of file RPCFEDIntegrity.cc.

References FATAL_LIMIT, edm::ParameterSet::getUntrackedParameter(), init_, maxFEDNum_, merge_, minFEDNum_, numOfFED_, prefixDir_, and rawCountsLabel_.

21  {
22  edm::LogVerbatim ("rpcfedintegrity") << "[RPCFEDIntegrity]: Constructor";
23 
24  rawCountsLabel_ = ps.getUntrackedParameter<edm::InputTag>("RPCRawCountsInputTag");
25  prefixDir_ = ps.getUntrackedParameter<std::string>("RPCPrefixDir", "RPC/FEDIntegrity");
26  merge_ = ps.getUntrackedParameter<bool>("MergeRuns", false);
27  minFEDNum_ = ps.getUntrackedParameter<int>("MinimumFEDID", 790);
28  maxFEDNum_ = ps.getUntrackedParameter<int>("MaximumFEDID", 792);
29 
30  init_ = false;
31  numOfFED_= maxFEDNum_ - minFEDNum_ + 1;
32  FATAL_LIMIT = 5;
33 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag rawCountsLabel_
std::string prefixDir_
RPCFEDIntegrity::~RPCFEDIntegrity ( )
virtual

Destructor.

Definition at line 35 of file RPCFEDIntegrity.cc.

35  {
36  edm::LogVerbatim ("rpcfedintegrity") << "[RPCFEDIntegrity]: Destructor ";
37  // dbe_=0;
38 }

Member Function Documentation

void RPCFEDIntegrity::analyze ( const edm::Event iEvent,
const edm::EventSetup c 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 55 of file RPCFEDIntegrity.cc.

References Entries, Fatal, RPCRawDataCounts::fedBxRecords(), RPCRawDataCounts::fedErrorRecords(), RPCRawDataCounts::fedFormatErrors(), fedMe_, HcalObjRepresent::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), maxFEDNum_, minFEDNum_, NonFatal, edm::Handle< T >::product(), and rawCountsLabel_.

55  {
56 
57  //get hold of raw data counts
59  iEvent.getByLabel (rawCountsLabel_, rawCounts);
60  if(!rawCounts.isValid()) return;
61 
62 
63  const RPCRawDataCounts & counts = *rawCounts.product();
64 
65  for (int fed=minFEDNum_; fed <=maxFEDNum_; ++fed) {
66  if (counts.fedBxRecords(fed) ) fedMe_[Entries]->Fill(fed);
67  if (counts.fedFormatErrors(fed)) fedMe_[Fatal]->Fill(fed);
68  if (counts.fedErrorRecords(fed)) fedMe_[NonFatal]->Fill(fed);
69  }
70 }
int fedErrorRecords(int fedId) const
int fedBxRecords(int fedId) const
int fedFormatErrors(int fedId) const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * fedMe_[3]
T const * product() const
Definition: Handle.h:74
edm::InputTag rawCountsLabel_
void RPCFEDIntegrity::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 40 of file RPCFEDIntegrity.cc.

References dbe_, and cppFunctionSkipper::operator.

40  {
41  edm::LogVerbatim ("rpcfedintegrity") << "[RPCFEDIntegrity]: Begin job ";
43 }
void RPCFEDIntegrity::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Begin Lumi block.

Reimplemented from edm::EDAnalyzer.

Definition at line 53 of file RPCFEDIntegrity.cc.

53 {}
void RPCFEDIntegrity::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file RPCFEDIntegrity.cc.

References bookFEDMe(), init_, merge_, and reset().

45  {
46  edm::LogVerbatim ("rpcfedintegrity") << "[RPCFEDIntegrity]: Begin run ";
47 
48  if (!init_) this->bookFEDMe();
49  else if (!merge_) this->reset();
50 
51 }
void bookFEDMe(void)
void RPCFEDIntegrity::bookFEDMe ( void  )
private

Definition at line 81 of file RPCFEDIntegrity.cc.

References DQMStore::book1D(), dbe_, Entries, Fatal, fedMe_, init_, labelBins(), maxFEDNum_, minFEDNum_, NonFatal, numOfFED_, prefixDir_, and DQMStore::setCurrentFolder().

Referenced by beginRun().

81  {
82 
83  if(dbe_){
85 
86  fedMe_[Entries] = dbe_->book1D("FEDEntries","FED Entries",numOfFED_, minFEDNum_, maxFEDNum_ +1);
87  this->labelBins(fedMe_[Entries]);
88  fedMe_[Fatal] = dbe_->book1D("FEDFatal","FED Fatal Errors",numOfFED_, minFEDNum_, maxFEDNum_ +1);
89  this->labelBins(fedMe_[Fatal]);
90  fedMe_[NonFatal] = dbe_->book1D("FEDNonFatal","FED NON Fatal Errors",numOfFED_, minFEDNum_, maxFEDNum_ +1);
91  this->labelBins(fedMe_[NonFatal]);
92  }
93 
94  init_ = true;
95 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * fedMe_[3]
void labelBins(MonitorElement *myMe)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::string prefixDir_
void RPCFEDIntegrity::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file RPCFEDIntegrity.cc.

References dbe_.

76  {
77  dbe_=0;
78 }
void RPCFEDIntegrity::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

End Lumi Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file RPCFEDIntegrity.cc.

72 {}
void RPCFEDIntegrity::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file RPCFEDIntegrity.cc.

74 {}
void RPCFEDIntegrity::labelBins ( MonitorElement myMe)
private

Definition at line 97 of file RPCFEDIntegrity.cc.

References MonitorElement::getNbinsX(), i, minFEDNum_, numOfFED_, MonitorElement::setBinLabel(), and fw3dlego::xbins.

Referenced by bookFEDMe().

97  {
98 
99  int xbins = myMe->getNbinsX();
100 
101  if (xbins!= numOfFED_ ) return;
102  std::stringstream xLabel;
103 
104  for (int i = 0; i<xbins; i++){
105  xLabel.str("");
106  int fedNum = minFEDNum_ + i;
107  xLabel<<fedNum;
108  myMe->setBinLabel(i+1, xLabel.str(),1);
109  }
110 }
int i
Definition: DBlmapReader.cc:9
const double xbins[]
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int getNbinsX(void) const
get # of bins in X-axis
void RPCFEDIntegrity::reset ( void  )
private

Definition at line 113 of file RPCFEDIntegrity.cc.

References dbe_, DQMStore::get(), histoName_, i, prefixDir_, and MonitorElement::Reset().

Referenced by beginRun().

113  {
114 
115  MonitorElement * me;
116 
117  if(dbe_){
118  for(unsigned int i = 0; i<histoName_.size(); i++){
119  me = 0;
120  me = dbe_->get(prefixDir_ + histoName_[i]);
121  if(0!=me ) me->Reset();
122  }
123  }
124 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
std::vector< std::string > histoName_
void Reset(void)
reset ME (ie. contents, errors, etc)
std::string prefixDir_

Member Data Documentation

DQMStore* RPCFEDIntegrity::dbe_
private

Definition at line 56 of file RPCFEDIntegrity.h.

Referenced by beginJob(), bookFEDMe(), endJob(), and reset().

int RPCFEDIntegrity::FATAL_LIMIT
private

Definition at line 58 of file RPCFEDIntegrity.h.

Referenced by RPCFEDIntegrity().

MonitorElement* RPCFEDIntegrity::fedMe_[3]
private

Definition at line 62 of file RPCFEDIntegrity.h.

Referenced by analyze(), and bookFEDMe().

std::vector<std::string> RPCFEDIntegrity::histoName_
private

Definition at line 65 of file RPCFEDIntegrity.h.

Referenced by reset().

bool RPCFEDIntegrity::init_
private

Definition at line 54 of file RPCFEDIntegrity.h.

Referenced by beginRun(), bookFEDMe(), and RPCFEDIntegrity().

int RPCFEDIntegrity::maxFEDNum_
private

Definition at line 64 of file RPCFEDIntegrity.h.

Referenced by analyze(), bookFEDMe(), and RPCFEDIntegrity().

bool RPCFEDIntegrity::merge_
private

Definition at line 54 of file RPCFEDIntegrity.h.

Referenced by beginRun(), and RPCFEDIntegrity().

int RPCFEDIntegrity::minFEDNum_
private

Definition at line 64 of file RPCFEDIntegrity.h.

Referenced by analyze(), bookFEDMe(), labelBins(), and RPCFEDIntegrity().

int RPCFEDIntegrity::numOfFED_
private

Definition at line 64 of file RPCFEDIntegrity.h.

Referenced by bookFEDMe(), labelBins(), and RPCFEDIntegrity().

std::string RPCFEDIntegrity::prefixDir_
private

Definition at line 52 of file RPCFEDIntegrity.h.

Referenced by bookFEDMe(), reset(), and RPCFEDIntegrity().

edm::InputTag RPCFEDIntegrity::rawCountsLabel_
private

Definition at line 48 of file RPCFEDIntegrity.h.

Referenced by analyze(), and RPCFEDIntegrity().