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 edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDGetTokenT
< RPCRawDataCounts
rawCountsLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 20 of file RPCFEDIntegrity.h.

Member Enumeration Documentation

Enumerator
Entries 
Fatal 
NonFatal 

Definition at line 63 of file RPCFEDIntegrity.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 20 of file RPCFEDIntegrity.cc.

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

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

Destructor.

Definition at line 34 of file RPCFEDIntegrity.cc.

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 54 of file RPCFEDIntegrity.cc.

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

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file RPCFEDIntegrity.cc.

References dbe_, and cppFunctionSkipper::operator.

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

Begin Lumi block.

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file RPCFEDIntegrity.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 44 of file RPCFEDIntegrity.cc.

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

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

Definition at line 80 of file RPCFEDIntegrity.cc.

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

Referenced by beginRun().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file RPCFEDIntegrity.cc.

References dbe_.

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

End Lumi Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 71 of file RPCFEDIntegrity.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file RPCFEDIntegrity.cc.

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

Definition at line 96 of file RPCFEDIntegrity.cc.

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

Referenced by bookFEDMe().

96  {
97 
98  int xbins = myMe->getNbinsX();
99 
100  if (xbins!= numOfFED_ ) return;
101  std::stringstream xLabel;
102 
103  for (int i = 0; i<xbins; i++){
104  xLabel.str("");
105  int fedNum = minFEDNum_ + i;
106  xLabel<<fedNum;
107  myMe->setBinLabel(i+1, xLabel.str(),1);
108  }
109 }
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 112 of file RPCFEDIntegrity.cc.

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

Referenced by beginRun().

112  {
113 
114  MonitorElement * me;
115 
116  if(dbe_){
117  for(unsigned int i = 0; i<histoName_.size(); i++){
118  me = 0;
119  me = dbe_->get(prefixDir_ + histoName_[i]);
120  if(0!=me ) me->Reset();
121  }
122  }
123 }
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:1623
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 59 of file RPCFEDIntegrity.h.

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

int RPCFEDIntegrity::FATAL_LIMIT
private

Definition at line 61 of file RPCFEDIntegrity.h.

Referenced by RPCFEDIntegrity().

MonitorElement* RPCFEDIntegrity::fedMe_[3]
private

Definition at line 65 of file RPCFEDIntegrity.h.

Referenced by analyze(), and bookFEDMe().

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

Definition at line 68 of file RPCFEDIntegrity.h.

Referenced by reset().

bool RPCFEDIntegrity::init_
private

Definition at line 57 of file RPCFEDIntegrity.h.

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

int RPCFEDIntegrity::maxFEDNum_
private

Definition at line 67 of file RPCFEDIntegrity.h.

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

bool RPCFEDIntegrity::merge_
private

Definition at line 57 of file RPCFEDIntegrity.h.

Referenced by beginRun(), and RPCFEDIntegrity().

int RPCFEDIntegrity::minFEDNum_
private

Definition at line 67 of file RPCFEDIntegrity.h.

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

int RPCFEDIntegrity::numOfFED_
private

Definition at line 67 of file RPCFEDIntegrity.h.

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

std::string RPCFEDIntegrity::prefixDir_
private

Definition at line 55 of file RPCFEDIntegrity.h.

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

edm::EDGetTokenT<RPCRawDataCounts> RPCFEDIntegrity::rawCountsLabel_
private

Definition at line 51 of file RPCFEDIntegrity.h.

Referenced by analyze(), and RPCFEDIntegrity().