CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
RPCFEDIntegrity Class Reference

#include <RPCFEDIntegrity.h>

Inheritance diagram for RPCFEDIntegrity:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &c) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 Begin Lumi block. More...
 
 RPCFEDIntegrity (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~RPCFEDIntegrity () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

enum  fedHisto { Entries, Fatal, NonFatal }
 

Private Member Functions

void bookFEDMe (DQMStore::IBooker &)
 
void labelBins (MonitorElement *myMe)
 

Private Attributes

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< RPCRawDataCountsrawCountsLabel_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 15 of file RPCFEDIntegrity.h.

Member Enumeration Documentation

◆ fedHisto

Enumerator
Entries 
Fatal 
NonFatal 

Definition at line 40 of file RPCFEDIntegrity.h.

Constructor & Destructor Documentation

◆ RPCFEDIntegrity()

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

Constructor.

Definition at line 7 of file RPCFEDIntegrity.cc.

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

7  {
8  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Constructor";
9 
10  rawCountsLabel_ = consumes<RPCRawDataCounts>(ps.getUntrackedParameter<edm::InputTag>("RPCRawCountsInputTag"));
11  prefixDir_ = ps.getUntrackedParameter<std::string>("RPCPrefixDir", "RPC/FEDIntegrity");
12  merge_ = ps.getUntrackedParameter<bool>("MergeRuns", false);
13  minFEDNum_ = ps.getUntrackedParameter<int>("MinimumFEDID", 790);
14  maxFEDNum_ = ps.getUntrackedParameter<int>("MaximumFEDID", 792);
15 
16  init_ = false;
18  FATAL_LIMIT = 5;
19 }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< RPCRawDataCounts > rawCountsLabel_
std::string prefixDir_

◆ ~RPCFEDIntegrity()

RPCFEDIntegrity::~RPCFEDIntegrity ( )
override

Destructor.

Definition at line 21 of file RPCFEDIntegrity.cc.

21  {
22  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Destructor ";
23  // dbe_=0;
24 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ analyze()

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

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 32 of file RPCFEDIntegrity.cc.

References dqmiodumpmetadata::counts, Entries, Fatal, fedMe_, HcalObjRepresent::Fill(), iEvent, edm::HandleBase::isValid(), maxFEDNum_, minFEDNum_, NonFatal, edm::Handle< T >::product(), and rawCountsLabel_.

32  {
33  //get hold of raw data counts
35  iEvent.getByToken(rawCountsLabel_, rawCounts);
36  if (!rawCounts.isValid())
37  return;
38 
39  const RPCRawDataCounts& counts = *rawCounts.product();
40 
41  for (int fed = minFEDNum_; fed <= maxFEDNum_; ++fed) {
42  if (counts.fedBxRecords(fed))
43  fedMe_[Entries]->Fill(fed);
44  if (counts.fedFormatErrors(fed))
45  fedMe_[Fatal]->Fill(fed);
46  if (counts.fedErrorRecords(fed))
47  fedMe_[NonFatal]->Fill(fed);
48  }
49 }
T const * product() const
Definition: Handle.h:70
int iEvent
Definition: GenABIO.cc:224
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * fedMe_[3]
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< RPCRawDataCounts > rawCountsLabel_

◆ bookFEDMe()

void RPCFEDIntegrity::bookFEDMe ( DQMStore::IBooker ibooker)
private

Definition at line 52 of file RPCFEDIntegrity.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), Entries, Fatal, fedMe_, init_, labelBins(), maxFEDNum_, minFEDNum_, NonFatal, numOfFED_, prefixDir_, and dqm::implementation::NavigatorBase::setCurrentFolder().

Referenced by bookHistograms().

52  {
53  ibooker.cd();
55 
56  fedMe_[Entries] = ibooker.book1D("FEDEntries", "FED Entries", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
57  this->labelBins(fedMe_[Entries]);
58  fedMe_[Fatal] = ibooker.book1D("FEDFatal", "FED Fatal Errors", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
59  this->labelBins(fedMe_[Fatal]);
60  fedMe_[NonFatal] = ibooker.book1D("FEDNonFatal", "FED NON Fatal Errors", numOfFED_, minFEDNum_, maxFEDNum_ + 1);
61  this->labelBins(fedMe_[NonFatal]);
62 
63  init_ = true;
64 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * fedMe_[3]
void labelBins(MonitorElement *myMe)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string prefixDir_

◆ bookHistograms()

void RPCFEDIntegrity::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Begin Lumi block.

Implements DQMEDAnalyzer.

Definition at line 26 of file RPCFEDIntegrity.cc.

References bookFEDMe().

26  {
27  edm::LogVerbatim("rpcfedintegrity") << "[RPCFEDIntegrity]: Begin booking histograms ";
28 
29  this->bookFEDMe(ibooker);
30 }
Log< level::Info, true > LogVerbatim
void bookFEDMe(DQMStore::IBooker &)

◆ labelBins()

void RPCFEDIntegrity::labelBins ( MonitorElement myMe)
private

Definition at line 66 of file RPCFEDIntegrity.cc.

References dqm-mbProfile::format, dqm::impl::MonitorElement::getNbinsX(), mps_fire::i, minFEDNum_, numOfFED_, dqm::impl::MonitorElement::setBinLabel(), AlCaHLTBitMon_QueryRunRegistry::string, and fw3dlego::xbins.

Referenced by bookFEDMe().

66  {
67  int xbins = myMe->getNbinsX();
68 
69  if (xbins != numOfFED_)
70  return;
71 
72  for (int i = 0; i < xbins; i++) {
73  const std::string xLabel = fmt::format("{}", minFEDNum_ + i);
74  myMe->setBinLabel(i + 1, xLabel, 1);
75  }
76 }
const double xbins[]
virtual 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)
virtual int getNbinsX() const
get # of bins in X-axis

Member Data Documentation

◆ FATAL_LIMIT

int RPCFEDIntegrity::FATAL_LIMIT
private

Definition at line 38 of file RPCFEDIntegrity.h.

Referenced by RPCFEDIntegrity().

◆ fedMe_

MonitorElement* RPCFEDIntegrity::fedMe_[3]
private

Definition at line 42 of file RPCFEDIntegrity.h.

Referenced by analyze(), and bookFEDMe().

◆ histoName_

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

Definition at line 45 of file RPCFEDIntegrity.h.

◆ init_

bool RPCFEDIntegrity::init_
private

Definition at line 36 of file RPCFEDIntegrity.h.

Referenced by bookFEDMe(), and RPCFEDIntegrity().

◆ maxFEDNum_

int RPCFEDIntegrity::maxFEDNum_
private

Definition at line 44 of file RPCFEDIntegrity.h.

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

◆ merge_

bool RPCFEDIntegrity::merge_
private

Definition at line 36 of file RPCFEDIntegrity.h.

Referenced by RPCFEDIntegrity().

◆ minFEDNum_

int RPCFEDIntegrity::minFEDNum_
private

Definition at line 44 of file RPCFEDIntegrity.h.

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

◆ numOfFED_

int RPCFEDIntegrity::numOfFED_
private

Definition at line 44 of file RPCFEDIntegrity.h.

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

◆ prefixDir_

std::string RPCFEDIntegrity::prefixDir_
private

Definition at line 34 of file RPCFEDIntegrity.h.

Referenced by bookFEDMe(), and RPCFEDIntegrity().

◆ rawCountsLabel_

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

Definition at line 31 of file RPCFEDIntegrity.h.

Referenced by analyze(), and RPCFEDIntegrity().