CMS 3D CMS Logo

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

#include <L1EmulatorErrorFlagClient.h>

Inheritance diagram for L1EmulatorErrorFlagClient:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1EmulatorErrorFlagClient (const edm::ParameterSet &)
 Constructor. More...
 
 ~L1EmulatorErrorFlagClient () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 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)
 

Protected Member Functions

void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- 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)
 

Private Member Functions

void initialize ()
 private methods More...
 
Float_t setSummary (DQMStore::IGetter &igetter, const unsigned int &) const
 

Private Attributes

std::vector< edm::ParameterSetm_l1Systems
 
std::vector< std::string > m_maskL1Systems
 
MonitorElementm_meSummaryErrorFlagMap
 
size_t m_nrL1Systems
 number of L1 trigger systems More...
 
bool m_runInEndJob
 
bool m_runInEndLumi
 
bool m_runInEndRun
 
bool m_runInEventLoop
 
std::vector< Float_t > m_summaryContent
 summary report More...
 
std::vector< std::string > m_systemErrorFlag
 
std::vector< std::string > m_systemFolder
 
std::vector< std::string > m_systemLabel
 
std::vector< std::string > m_systemLabelExt
 
std::vector< int > m_systemMask
 
bool m_verbose
 input parameters More...
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::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 Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 18 of file L1EmulatorErrorFlagClient.h.

Constructor & Destructor Documentation

L1EmulatorErrorFlagClient::L1EmulatorErrorFlagClient ( const edm::ParameterSet parSet)

Constructor.

Definition at line 25 of file L1EmulatorErrorFlagClient.cc.

References initialize().

26  : m_verbose(parSet.getUntrackedParameter<bool>("verbose", false)),
27  m_l1Systems(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Systems")),
28  m_nrL1Systems(0) {
29  initialize();
30 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
size_t m_nrL1Systems
number of L1 trigger systems
std::vector< edm::ParameterSet > m_l1Systems
L1EmulatorErrorFlagClient::~L1EmulatorErrorFlagClient ( )
override

Destructor.

Definition at line 32 of file L1EmulatorErrorFlagClient.cc.

32  {
33  //empty
34 }

Member Function Documentation

void L1EmulatorErrorFlagClient::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 72 of file L1EmulatorErrorFlagClient.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), m_meSummaryErrorFlagMap, m_nrL1Systems, m_systemLabel, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

72  {
73  ibooker.setCurrentFolder("L1TEMU/EventInfo");
74 
75  // define a histogram
77  ibooker.book1D("L1SummaryErrorFlagMap", "L1SummaryErrorFlagMap", m_nrL1Systems, 1, m_nrL1Systems + 1);
78 
79  m_meSummaryErrorFlagMap->setAxisTitle("Agreement fraction", 2);
80 
81  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
83  }
84 }
size_t m_nrL1Systems
number of L1 trigger systems
std::vector< std::string > m_systemLabel
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 void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void L1EmulatorErrorFlagClient::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 86 of file L1EmulatorErrorFlagClient.cc.

References gather_cfg::cout, m_meSummaryErrorFlagMap, m_nrL1Systems, m_summaryContent, m_systemLabel, m_systemLabelExt, m_systemMask, m_verbose, dqm::impl::MonitorElement::setBinContent(), and setSummary().

89  {
90  // reset the summary content values
91  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
92  m_summaryContent[iMon] = 0.;
93  }
94 
95  // for masked systems and objects, set the summary content to -1
96 
97  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
98  if (m_systemMask[iMon] != 0) {
99  m_summaryContent[iMon] = -1;
100  }
101  }
102 
103  // then fill content for unmasked systems
104 
105  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
106  float percAgree = -1.;
107 
108  if (m_systemMask[iSys] == 0) {
109  percAgree = setSummary(igetter, iSys);
110 
111  if ((percAgree == -1) && m_verbose) {
112  std::cout << "\nWarning: ErrorFlag histogram for system " << m_systemLabel[iSys] << " empty!" << std::endl;
113  }
114  }
115 
116  m_summaryContent[iSys] = percAgree;
117  }
118 
119  int numUnMaskedSystems = 0;
120  for (unsigned int iMon = 0; iMon < m_nrL1Systems; iMon++) {
121  if (m_summaryContent[iMon] != -1) {
122  numUnMaskedSystems++;
123  }
124  }
125 
126  // fill the SummaryErrorFlagMap histogram for L1 systems
127  // (bin 0 - underflow, bin iSys + 1 overflow)
128  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
130  }
131 
132  if (m_verbose) {
133  std::cout << "\nSummary report L1EmulatorErrorFlagClient" << std::endl;
134 
135  std::cout << "\nL1 systems: " << m_nrL1Systems << " systems included\n" << std::endl;
136 
137  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
138  std::cout << std::setw(10) << m_systemLabel[iSys] << std::setw(10) << m_systemLabelExt[iSys] << " \t"
139  << m_systemMask[iSys] << " \t" << std::setw(25) << " m_summaryContent[" << std::setw(2) << iSys
140  << "] = " << m_summaryContent[iSys] << std::endl;
141  }
142  }
143 }
size_t m_nrL1Systems
number of L1 trigger systems
std::vector< Float_t > m_summaryContent
summary report
Float_t setSummary(DQMStore::IGetter &igetter, const unsigned int &) const
std::vector< std::string > m_systemLabel
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::string > m_systemLabelExt
void L1EmulatorErrorFlagClient::initialize ( )
private

private methods

Definition at line 36 of file L1EmulatorErrorFlagClient.cc.

References relativeConstraints::empty, m_l1Systems, m_nrL1Systems, m_summaryContent, m_systemErrorFlag, m_systemFolder, m_systemLabel, m_systemLabelExt, m_systemMask, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1EmulatorErrorFlagClient().

36  {
37  m_nrL1Systems = m_l1Systems.size();
38 
41  m_systemMask.reserve(m_nrL1Systems);
44 
45  int indexSys = 0;
46 
47  for (std::vector<edm::ParameterSet>::const_iterator itSystem = m_l1Systems.begin(); itSystem != m_l1Systems.end();
48  ++itSystem) {
49  m_systemLabel.push_back(itSystem->getParameter<std::string>("SystemLabel"));
50 
51  m_systemLabelExt.push_back(itSystem->getParameter<std::string>("HwValLabel"));
52 
53  m_systemMask.push_back(itSystem->getParameter<unsigned int>("SystemMask"));
54 
55  m_systemFolder.push_back(itSystem->getParameter<std::string>("SystemFolder"));
56 
57  indexSys++;
58  }
59 
60  // [SYS]ErrorFlag histogram
61  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
62  if (m_systemFolder[iSys].empty()) {
63  m_systemErrorFlag.push_back("L1TEMU/" + m_systemLabel[iSys] + "/" + m_systemLabelExt[iSys] + "ErrorFlag");
64  } else {
65  m_systemErrorFlag.push_back(m_systemFolder[iSys] + "/" + m_systemLabelExt[iSys] + "ErrorFlag");
66  }
67  }
68 
69  m_summaryContent.reserve(m_nrL1Systems);
70 }
size_t m_nrL1Systems
number of L1 trigger systems
std::vector< Float_t > m_summaryContent
summary report
std::vector< edm::ParameterSet > m_l1Systems
std::vector< std::string > m_systemLabel
std::vector< std::string > m_systemLabelExt
std::vector< std::string > m_systemErrorFlag
std::vector< std::string > m_systemFolder
Float_t L1EmulatorErrorFlagClient::setSummary ( DQMStore::IGetter igetter,
const unsigned int &  iMon 
) const
private

Definition at line 146 of file L1EmulatorErrorFlagClient.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), mps_fire::i, and m_systemErrorFlag.

Referenced by dqmEndLuminosityBlock().

146  {
147  MonitorElement* QHist = igetter.get(m_systemErrorFlag[iMon]);
148 
149  int ntot = 0;
150  for (int i = 0; i < QHist->getNbinsX(); i++) {
151  ntot += QHist->getBinContent(i + 1);
152  }
153 
154  bool isEmpty = (ntot == 0);
155 
156  //errflag bins: agree, loc agree, loc disagree, data only, emul only
157 
158  return isEmpty ? -1. : ((QHist->getBinContent(1)) / (ntot));
159 }
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)
std::vector< std::string > m_systemErrorFlag

Member Data Documentation

std::vector<edm::ParameterSet> L1EmulatorErrorFlagClient::m_l1Systems
private

Definition at line 37 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

std::vector<std::string> L1EmulatorErrorFlagClient::m_maskL1Systems
private

Definition at line 38 of file L1EmulatorErrorFlagClient.h.

MonitorElement* L1EmulatorErrorFlagClient::m_meSummaryErrorFlagMap
private

Definition at line 64 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

size_t L1EmulatorErrorFlagClient::m_nrL1Systems
private

number of L1 trigger systems

Definition at line 52 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and initialize().

bool L1EmulatorErrorFlagClient::m_runInEndJob
private

Definition at line 43 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEndLumi
private

Definition at line 41 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEndRun
private

Definition at line 42 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEventLoop
private

Definition at line 40 of file L1EmulatorErrorFlagClient.h.

std::vector<Float_t> L1EmulatorErrorFlagClient::m_summaryContent
private

summary report

Definition at line 63 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock(), and initialize().

std::vector<std::string> L1EmulatorErrorFlagClient::m_systemErrorFlag
private

Definition at line 59 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize(), and setSummary().

std::vector<std::string> L1EmulatorErrorFlagClient::m_systemFolder
private

Definition at line 57 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

std::vector<std::string> L1EmulatorErrorFlagClient::m_systemLabel
private

Definition at line 54 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and initialize().

std::vector<std::string> L1EmulatorErrorFlagClient::m_systemLabelExt
private

Definition at line 55 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock(), and initialize().

std::vector<int> L1EmulatorErrorFlagClient::m_systemMask
private

Definition at line 56 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock(), and initialize().

bool L1EmulatorErrorFlagClient::m_verbose
private

input parameters

Definition at line 36 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock().