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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Analyse errors in raw data stream as RPCRawDataCounts produced by RPCRawToDigi

Definition at line 22 of file RPCMonitorRaw.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file RPCMonitorRaw.cc.

References hltMVAJetPuId_cff::algos, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, rpcRawDataCountsTag_, and theWatchedErrorHistoPos.

27  : theConfig(cfg) {
28  rpcRawDataCountsTag_ = consumes<RPCRawDataCounts>(cfg.getParameter<edm::InputTag>("rpcRawDataCountsTag"));
29 
30  for (unsigned int i = 0; i < 10; i++)
32  std::vector<int> algos = cfg.getUntrackedParameter<std::vector<int> >("watchedErrors");
33  for (std::vector<int>::const_iterator it = algos.begin(); it != algos.end(); ++it) {
34  unsigned int ialgo = *it;
35  if (ialgo < 10)
36  theWatchedErrorHistoPos[ialgo] = 1; // real position initialisain is in begin job. here mark just switched on.
37  }
38 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< RPCRawDataCounts > rpcRawDataCountsTag_
Definition: RPCMonitorRaw.h:45
edm::ParameterSet theConfig
Definition: RPCMonitorRaw.h:36
unsigned int theWatchedErrorHistoPos[10]
Definition: RPCMonitorRaw.h:40
RPCMonitorRaw::~RPCMonitorRaw ( )
override

Definition at line 40 of file RPCMonitorRaw.cc.

References LogTrace.

40 { LogTrace("") << "RPCMonitorRaw destructor"; }
#define LogTrace(id)

Member Function Documentation

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

Definition at line 81 of file RPCMonitorRaw.cc.

References dqmiodumpmetadata::counts, LinkBoardElectronicIndex::dccInputChannelNum, relativeConstraints::error, dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), training_settings::idx, hlt_dqm_clientPB-live_cfg::me, me_e, me_mapBadEvents, me_mapGoodEvents, me_t, edm::Handle< T >::product(), rpcRawDataCountsTag_, LinkBoardElectronicIndex::tbLinkInputNum, RPCRawDataCounts::theBadEvents, RPCRawDataCounts::theGoodEvents, RPCRawDataCounts::theReadoutErrors, RPCRawDataCounts::theRecordTypes, theWatchedErrorHistoPos, theWatchedErrorHistos, rpcrawtodigi::ReadoutError::type(), and rpcrawtodigi::ReadoutError::where().

81  {
83  ev.getByToken(rpcRawDataCountsTag_, rawCounts);
84  const RPCRawDataCounts& counts = *rawCounts.product();
85 
86  //
87  // record type
88  //
89  for (IT it = counts.theRecordTypes.begin(); it != counts.theRecordTypes.end(); ++it)
90  me_t[it->first.first - 790]->Fill(it->first.second, it->second);
91 
92  //
93  // good events topology
94  //
95  for (IT it = counts.theGoodEvents.begin(); it != counts.theGoodEvents.end(); ++it)
96  me_mapGoodEvents->Fill(it->first.second, it->first.first, it->second);
97 
98  //
99  // bad events topology
100  //
101  for (IT it = counts.theBadEvents.begin(); it != counts.theBadEvents.end(); ++it)
102  me_mapBadEvents->Fill(it->first.second, it->first.first, it->second);
103 
104  //
105  // readout errors
106  //
107  for (IT it = counts.theReadoutErrors.begin(); it != counts.theReadoutErrors.end(); ++it) {
108  rpcrawtodigi::ReadoutError error(it->first.second);
109  LinkBoardElectronicIndex ele = error.where();
111 
112  int fed = it->first.first;
113  me_e[fed - 790]->Fill(type, it->second);
114 
115  //
116  // in addition fill location map for selected errors
117  //
118  int idx = theWatchedErrorHistoPos[type] - 1;
119  if (idx >= 0) {
120  std::vector<MonitorElement*>& wh = theWatchedErrorHistos[fed - 790];
121  MonitorElement* me = wh[idx];
122  me->Fill(ele.dccInputChannelNum, ele.tbLinkInputNum, it->second);
123  }
124  }
125 
126  // for (int i=0; i<3; ++i) {
127  // me_t[i]->update();
128  // me_e[i]->update();
129  // std::vector<MonitorElement* > & wh = theWatchedErrorHistos[i];
130  // for (std::vector<MonitorElement* >::iterator it=wh.begin(); it != wh.end(); ++it) (*it)->update();
131  // }
132  // me_mapGoodEvents->update();
133  // me_mapBadEvents->update();
134 }
type
Definition: HCALResponse.h:21
std::map< std::pair< int, int >, int > theReadoutErrors
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
MonitorElement * me_mapBadEvents
Definition: RPCMonitorRaw.h:34
MonitorElement * me_mapGoodEvents
Definition: RPCMonitorRaw.h:33
edm::EDGetTokenT< RPCRawDataCounts > rpcRawDataCountsTag_
Definition: RPCMonitorRaw.h:45
void Fill(long long x)
std::map< std::pair< int, int >, int > theRecordTypes
MonitorElement * me_t[3]
Definition: RPCMonitorRaw.h:31
std::vector< MonitorElement * > theWatchedErrorHistos[3]
Definition: RPCMonitorRaw.h:37
std::vector< LinkConnSpec >::const_iterator IT
unsigned int theWatchedErrorHistoPos[10]
Definition: RPCMonitorRaw.h:40
std::map< std::pair< int, int >, int > theGoodEvents
std::map< std::pair< int, int >, int > theBadEvents
T const * product() const
Definition: Handle.h:69
MonitorElement * me_e[3]
Definition: RPCMonitorRaw.h:32
void RPCMonitorRaw::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 42 of file RPCMonitorRaw.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), dqm::dqmstoreimpl::DQMStore::IBooker::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::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), theWatchedErrorHistoPos, and theWatchedErrorHistos.

42  {
43  ibooker.cd();
44  ibooker.setCurrentFolder("RPC/LinkMonitor");
45 
46  me_t[0] = ibooker.book1D("recordType_790", RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(790));
47  me_t[1] = ibooker.book1D("recordType_791", RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(791));
48  me_t[2] = ibooker.book1D("recordType_792", RPCRawDataCountsHistoMaker::emptyRecordTypeHisto(792));
49  for (int i = 0; i < 3; ++i)
50  me_t[i]->getTH1F()->SetStats(false);
51 
52  me_e[0] = ibooker.book1D("readoutErrors_790", RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(790));
53  me_e[1] = ibooker.book1D("readoutErrors_791", RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(791));
54  me_e[2] = ibooker.book1D("readoutErrors_792", RPCRawDataCountsHistoMaker::emptyReadoutErrorHisto(792));
55  for (int i = 0; i < 3; ++i)
56  me_e[i]->getTH1F()->SetStats(false);
57 
58  me_mapGoodEvents = ibooker.book2D("mapGoodRecords", "mapGoodRecords", 36, -0.5, 35.5, 3, 789.5, 792.5);
59  me_mapGoodEvents->getTH2F()->SetNdivisions(3, "y");
61  me_mapGoodEvents->getTH2F()->SetYTitle("fed");
62  me_mapGoodEvents->getTH2F()->SetStats(false);
63  me_mapBadEvents = ibooker.book2D("mapErrorRecords", "mapErrorRecords", 36, -0.5, 35.5, 3, 789.5, 792.5);
65  me_mapBadEvents->getTH2F()->SetYTitle("rmb");
66  me_mapBadEvents->getTH2F()->SetNdivisions(3, "y");
67  me_mapBadEvents->getTH2F()->SetStats(false);
68 
69  for (unsigned int i = 0; i <= 9; ++i) {
71  for (unsigned int fed = 790; fed <= 792; ++fed) {
73  MonitorElement* watched = ibooker.book2D(histo->GetName(), histo);
74  theWatchedErrorHistos[fed - 790].push_back(watched);
75  theWatchedErrorHistoPos[i] = theWatchedErrorHistos[fed - 790].size();
76  }
77  }
78  }
79 }
MonitorElement * me_mapBadEvents
Definition: RPCMonitorRaw.h:34
static TH1F * emptyReadoutErrorHisto(int fedId)
MonitorElement * me_mapGoodEvents
Definition: RPCMonitorRaw.h:33
MonitorElement * me_t[3]
Definition: RPCMonitorRaw.h:31
std::vector< MonitorElement * > theWatchedErrorHistos[3]
Definition: RPCMonitorRaw.h:37
static TH2F * emptyReadoutErrorMapHisto(int fedId, int type)
unsigned int theWatchedErrorHistoPos[10]
Definition: RPCMonitorRaw.h:40
static TH1F * emptyRecordTypeHisto(int fedId)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * me_e[3]
Definition: RPCMonitorRaw.h:32

Member Data Documentation

MonitorElement* RPCMonitorRaw::me_e[3]
private

Definition at line 32 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCMonitorRaw::me_mapBadEvents
private

Definition at line 34 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCMonitorRaw::me_mapGoodEvents
private

Definition at line 33 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RPCMonitorRaw::me_t[3]
private

Definition at line 31 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 45 of file RPCMonitorRaw.h.

Referenced by analyze(), and RPCMonitorRaw().

edm::ParameterSet RPCMonitorRaw::theConfig
private

Definition at line 36 of file RPCMonitorRaw.h.

unsigned int RPCMonitorRaw::theWatchedErrorHistoPos[10]
private

Definition at line 40 of file RPCMonitorRaw.h.

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

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

Definition at line 37 of file RPCMonitorRaw.h.

Referenced by analyze(), and bookHistograms().