CMS 3D CMS Logo

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

#include <RPCMonitorRaw.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 RPCMonitorRaw (const edm::ParameterSet &cfg)
 
 ~RPCMonitorRaw () override
 
- 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 Attributes

MonitorElementme_e [3]
 
MonitorElementme_mapBadEvents
 
MonitorElementme_mapGoodEvents
 
MonitorElementme_t [3]
 
edm::EDGetTokenT< RPCRawDataCountsrpcRawDataCountsTag_
 
edm::ParameterSet theConfig
 
unsigned int theWatchedErrorHistoPos [10]
 
std::vector< MonitorElement * > theWatchedErrorHistos [3]
 

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

Analyse errors in raw data stream as RPCRawDataCounts produced by RPCRawToDigi

Definition at line 15 of file RPCMonitorRaw.h.

Constructor & Destructor Documentation

◆ RPCMonitorRaw()

RPCMonitorRaw::RPCMonitorRaw ( const edm::ParameterSet cfg)
explicit

Definition at line 8 of file RPCMonitorRaw.cc.

8  : theConfig(cfg) {
9  rpcRawDataCountsTag_ = consumes<RPCRawDataCounts>(cfg.getParameter<edm::InputTag>("rpcRawDataCountsTag"));
10 
11  for (unsigned int i = 0; i < 10; i++)
13  std::vector<int> algos = cfg.getUntrackedParameter<std::vector<int> >("watchedErrors");
14  for (std::vector<int>::const_iterator it = algos.begin(); it != algos.end(); ++it) {
15  unsigned int ialgo = *it;
16  if (ialgo < 10)
17  theWatchedErrorHistoPos[ialgo] = 1; // real position initialisain is in begin job. here mark just switched on.
18  }
19 }

References jets_cff::algos, looper::cfg, mps_fire::i, rpcRawDataCountsTag_, and theWatchedErrorHistoPos.

◆ ~RPCMonitorRaw()

RPCMonitorRaw::~RPCMonitorRaw ( )
override

Definition at line 21 of file RPCMonitorRaw.cc.

21 { LogTrace("") << "RPCMonitorRaw destructor"; }

References LogTrace.

Member Function Documentation

◆ analyze()

void RPCMonitorRaw::analyze ( const edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 62 of file RPCMonitorRaw.cc.

62  {
64  ev.getByToken(rpcRawDataCountsTag_, rawCounts);
65  const RPCRawDataCounts& counts = *rawCounts.product();
66 
67  // record type
68  for (auto cnt : counts.theRecordTypes)
69  me_t[cnt.first.first - 790]->Fill(cnt.first.second, cnt.second);
70 
71  // good events topology
72  for (auto cnt : counts.theGoodEvents)
73  me_mapGoodEvents->Fill(cnt.first.second, cnt.first.first, cnt.second);
74 
75  // bad events topology
76  for (auto cnt : counts.theBadEvents)
77  me_mapBadEvents->Fill(cnt.first.second, cnt.first.first, cnt.second);
78 
79  // readout errors
80  for (auto cnt : counts.theReadoutErrors) {
81  rpcrawtodigi::ReadoutError error(cnt.first.second);
82  LinkBoardElectronicIndex ele = error.where();
84 
85  int fed = cnt.first.first;
86  me_e[fed - 790]->Fill(type, cnt.second);
87 
88  // in addition fill location map for selected errors
89  int idx = theWatchedErrorHistoPos[type] - 1;
90  if (idx >= 0) {
91  std::vector<MonitorElement*>& wh = theWatchedErrorHistos[fed - 790];
92  MonitorElement* me = wh[idx];
93  me->Fill(ele.dccInputChannelNum, ele.tbLinkInputNum, cnt.second);
94  }
95  }
96 }

References dqmiodumpmetadata::counts, LinkBoardElectronicIndex::dccInputChannelNum, relativeConstraints::error, ev, dqm::impl::MonitorElement::Fill(), heavyIonCSV_trainingSettings::idx, hlt_dqm_clientPB-live_cfg::me, me_e, me_mapBadEvents, me_mapGoodEvents, me_t, edm::Handle< T >::product(), rpcRawDataCountsTag_, LinkBoardElectronicIndex::tbLinkInputNum, theWatchedErrorHistoPos, and theWatchedErrorHistos.

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 23 of file RPCMonitorRaw.cc.

23  {
24  ibooker.cd();
25  ibooker.setCurrentFolder("RPC/LinkMonitor");
26 
27  me_t[0] = ibooker.book1D("recordType_790", RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(790));
28  me_t[1] = ibooker.book1D("recordType_791", RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(791));
29  me_t[2] = ibooker.book1D("recordType_792", RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(792));
30  for (int i = 0; i < 3; ++i)
31  me_t[i]->getTH1F()->SetStats(false);
32 
33  me_e[0] = ibooker.book1D("readoutErrors_790", RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(790));
34  me_e[1] = ibooker.book1D("readoutErrors_791", RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(791));
35  me_e[2] = ibooker.book1D("readoutErrors_792", RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(792));
36  for (int i = 0; i < 3; ++i)
37  me_e[i]->getTH1F()->SetStats(false);
38 
39  me_mapGoodEvents = ibooker.book2D("mapGoodRecords", "mapGoodRecords", 36, -0.5, 35.5, 3, 789.5, 792.5);
40  me_mapGoodEvents->getTH2F()->SetNdivisions(3, "y");
42  me_mapGoodEvents->getTH2F()->SetYTitle("fed");
43  me_mapGoodEvents->getTH2F()->SetStats(false);
44  me_mapBadEvents = ibooker.book2D("mapErrorRecords", "mapErrorRecords", 36, -0.5, 35.5, 3, 789.5, 792.5);
46  me_mapBadEvents->getTH2F()->SetYTitle("rmb");
47  me_mapBadEvents->getTH2F()->SetNdivisions(3, "y");
48  me_mapBadEvents->getTH2F()->SetStats(false);
49 
50  for (unsigned int i = 0; i <= 9; ++i) {
52  for (unsigned int fed = 790; fed <= 792; ++fed) {
54  MonitorElement* watched = ibooker.book2D(histo->GetName(), histo);
55  theWatchedErrorHistos[fed - 790].push_back(watched);
56  theWatchedErrorHistoPos[i] = theWatchedErrorHistos[fed - 790].size();
57  }
58  }
59  }
60 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(), RPCRawDataCountsHistoMaker::emptyReadoutErrorMapHisto(), RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(), dqm::impl::MonitorElement::getTH2F(), timingPdfMaker::histo, mps_fire::i, me_e, me_mapBadEvents, me_mapGoodEvents, me_t, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), theWatchedErrorHistoPos, and theWatchedErrorHistos.

Member Data Documentation

◆ me_e

MonitorElement* RPCMonitorRaw::me_e[3]
private

Definition at line 25 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

◆ me_mapBadEvents

MonitorElement* RPCMonitorRaw::me_mapBadEvents
private

Definition at line 27 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

◆ me_mapGoodEvents

MonitorElement* RPCMonitorRaw::me_mapGoodEvents
private

Definition at line 26 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

◆ me_t

MonitorElement* RPCMonitorRaw::me_t[3]
private

Definition at line 24 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

◆ rpcRawDataCountsTag_

edm::EDGetTokenT<RPCRawDataCounts> RPCMonitorRaw::rpcRawDataCountsTag_
private

Definition at line 38 of file RPCMonitorRaw.h.

Referenced by analyze(), and RPCMonitorRaw().

◆ theConfig

edm::ParameterSet RPCMonitorRaw::theConfig
private

Definition at line 29 of file RPCMonitorRaw.h.

◆ theWatchedErrorHistoPos

unsigned int RPCMonitorRaw::theWatchedErrorHistoPos[10]
private

Definition at line 33 of file RPCMonitorRaw.h.

Referenced by analyze(), bookHistograms(), and RPCMonitorRaw().

◆ theWatchedErrorHistos

std::vector<MonitorElement*> RPCMonitorRaw::theWatchedErrorHistos[3]
private

Definition at line 30 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

rpcrawtodigi::ReadoutError::ReadoutErrorType
ReadoutErrorType
Definition: ReadoutError.h:10
mps_fire.i
i
Definition: mps_fire.py:428
RPCMonitorRaw::theWatchedErrorHistoPos
unsigned int theWatchedErrorHistoPos[10]
Definition: RPCMonitorRaw.h:33
RPCRawDataCountsHistoMaker::emptyRecordTypeHisto
static TH1F * emptyRecordTypeHisto(int fedId)
Definition: RPCRawDataCountsHistoMaker.cc:19
RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto
static TH1F * emptyReadoutErrorHisto(int fedId)
Definition: RPCRawDataCountsHistoMaker.cc:9
edm::Handle::product
T const * product() const
Definition: Handle.h:70
RPCRawDataCounts
Definition: RPCRawDataCounts.h:15
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:278
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
rpcrawtodigi::ReadoutError
Definition: ReadoutError.h:8
edm::Handle
Definition: AssociativeIterator.h:50
relativeConstraints.error
error
Definition: relativeConstraints.py:53
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
RPCMonitorRaw::me_e
MonitorElement * me_e[3]
Definition: RPCMonitorRaw.h:25
dqm::impl::MonitorElement::getTH2F
virtual TH2F * getTH2F()
Definition: MonitorElement.cc:1004
LinkBoardElectronicIndex::dccInputChannelNum
int dccInputChannelNum
Definition: LinkBoardElectronicIndex.h:12
jets_cff.algos
algos
Definition: jets_cff.py:714
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
RPCMonitorRaw::me_mapBadEvents
MonitorElement * me_mapBadEvents
Definition: RPCMonitorRaw.h:27
LinkBoardElectronicIndex::tbLinkInputNum
int tbLinkInputNum
Definition: LinkBoardElectronicIndex.h:13
RPCMonitorRaw::theConfig
edm::ParameterSet theConfig
Definition: RPCMonitorRaw.h:29
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
RPCRawDataCountsHistoMaker::emptyReadoutErrorMapHisto
static TH2F * emptyReadoutErrorMapHisto(int fedId, int type)
Definition: RPCRawDataCountsHistoMaker.cc:30
looper.cfg
cfg
Definition: looper.py:296
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
RPCMonitorRaw::theWatchedErrorHistos
std::vector< MonitorElement * > theWatchedErrorHistos[3]
Definition: RPCMonitorRaw.h:30
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
dqmiodumpmetadata.counts
counts
Definition: dqmiodumpmetadata.py:25
RPCMonitorRaw::me_mapGoodEvents
MonitorElement * me_mapGoodEvents
Definition: RPCMonitorRaw.h:26
RPCMonitorRaw::rpcRawDataCountsTag_
edm::EDGetTokenT< RPCRawDataCounts > rpcRawDataCountsTag_
Definition: RPCMonitorRaw.h:38
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
RPCMonitorRaw::me_t
MonitorElement * me_t[3]
Definition: RPCMonitorRaw.h:24
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
edm::InputTag
Definition: InputTag.h:15
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98