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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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)
 
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::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)
 

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 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 20 of file L1EmulatorErrorFlagClient.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 25 of file L1EmulatorErrorFlagClient.cc.

References initialize().

25  :
26  m_verbose(parSet.getUntrackedParameter<bool>("verbose", false)),
27  m_l1Systems(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Systems")),
28  m_nrL1Systems(0) {
29 
30  initialize();
31 }
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 33 of file L1EmulatorErrorFlagClient.cc.

33  {
34  //empty
35 }

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 85 of file L1EmulatorErrorFlagClient.cc.

References DQMStore::IBooker::book1D(), DQMStore::IGetter::get(), MonitorElement::getName(), m_meSummaryErrorFlagMap, m_nrL1Systems, m_systemLabel, DQMStore::IGetter::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::IBooker::setCurrentFolder().

85  {
86 
87  ibooker.setCurrentFolder("L1TEMU/EventInfo");
88 
89  if ((m_meSummaryErrorFlagMap = igetter.get("L1TEMU/EventInfo/summaryErrorFlagMap"))) {
91  }
92 
93  // define a histogram
94  m_meSummaryErrorFlagMap = ibooker.book1D("L1SummaryErrorFlagMap",
95  "L1SummaryErrorFlagMap", m_nrL1Systems, 1, m_nrL1Systems + 1);
96 
97  m_meSummaryErrorFlagMap->setAxisTitle("Agreement fraction", 2);
98 
99  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
100 
102  }
103 }
size_t m_nrL1Systems
number of L1 trigger systems
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)
const std::string & getName() const
get name of ME
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::vector< std::string > m_systemLabel
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void removeElement(Args &&...args)
Definition: DQMStore.h:199
void L1EmulatorErrorFlagClient::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 105 of file L1EmulatorErrorFlagClient.cc.

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

106  {
107 
108  // reset the summary content values
109  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
110 
111  m_summaryContent[iMon] = 0.;
112  }
113 
114  // for masked systems and objects, set the summary content to -1
115 
116  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
117 
118  if (m_systemMask[iMon] != 0) {
119  m_summaryContent[iMon] = -1;
120  }
121  }
122 
123  // then fill content for unmasked systems
124 
125  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
126 
127  float percAgree = -1.;
128 
129  if (m_systemMask[iSys] == 0) {
130  percAgree = setSummary(igetter, iSys);
131 
132  if ((percAgree == -1) && m_verbose) {
133  std::cout << "\nWarning: ErrorFlag histogram for system "
134  << m_systemLabel[iSys] << " empty!" << std::endl;
135  }
136  }
137 
138  m_summaryContent[iSys] = percAgree;
139 
140  }
141 
142  int numUnMaskedSystems = 0;
143  for (unsigned int iMon = 0; iMon < m_nrL1Systems; iMon++) {
144  if (m_summaryContent[iMon] != -1) {
145  numUnMaskedSystems++;
146 
147  }
148  }
149 
150 
151 
152  // fill the SummaryErrorFlagMap histogram for L1 systems
153  // (bin 0 - underflow, bin iSys + 1 overflow)
154  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
156  }
157 
158  if (m_verbose) {
159  std::cout << "\nSummary report L1EmulatorErrorFlagClient" << std::endl;
160 
161  std::cout << "\nL1 systems: " << m_nrL1Systems << " systems included\n"
162  << std::endl;
163 
164  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
165 
166  std::cout << std::setw(10) << m_systemLabel[iSys] << std::setw(10)
167  << m_systemLabelExt[iSys] << " \t" << m_systemMask[iSys]
168  << " \t" << std::setw(25) << " m_summaryContent["
169  << std::setw(2) << iSys << "] = " << m_summaryContent[iSys]
170  << std::endl;
171  }
172 
173  }
174 
175 }
void setBinContent(int binx, double content)
set content of bin (1-D)
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
std::vector< std::string > m_systemLabelExt
void L1EmulatorErrorFlagClient::initialize ( )
private

private methods

Definition at line 37 of file L1EmulatorErrorFlagClient.cc.

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

Referenced by L1EmulatorErrorFlagClient().

37  {
38 
39  m_nrL1Systems = m_l1Systems.size();
40 
43  m_systemMask.reserve(m_nrL1Systems);
46 
47  int indexSys = 0;
48 
49  for (std::vector<edm::ParameterSet>::const_iterator itSystem =
50  m_l1Systems.begin(); itSystem != m_l1Systems.end(); ++itSystem) {
51 
52  m_systemLabel.push_back(itSystem->getParameter<std::string>(
53  "SystemLabel"));
54 
55  m_systemLabelExt.push_back(itSystem->getParameter<std::string>(
56  "HwValLabel"));
57 
58  m_systemMask.push_back(itSystem->getParameter<unsigned int>(
59  "SystemMask"));
60 
61  m_systemFolder.push_back(itSystem->getParameter<std::string>(
62  "SystemFolder"));
63 
64  indexSys++;
65 
66  }
67 
68  // [SYS]ErrorFlag histogram
69  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
70  if (m_systemFolder[iSys] == "") {
71  m_systemErrorFlag.push_back("L1TEMU/" + m_systemLabel[iSys] + "/"
72  + m_systemLabelExt[iSys] + "ErrorFlag");
73  } else {
74  m_systemErrorFlag.push_back(m_systemFolder[iSys] + "/"
75  + m_systemLabelExt[iSys] + "ErrorFlag");
76  }
77  }
78 
79 
80  m_summaryContent.reserve(m_nrL1Systems);
81 
82 }
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 178 of file L1EmulatorErrorFlagClient.cc.

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

Referenced by dqmEndLuminosityBlock().

178  {
179 
180  MonitorElement* QHist = igetter.get(m_systemErrorFlag[iMon]);
181 
182  int ntot = 0;
183  for (int i = 0; i < QHist->getNbinsX(); i++) {
184  ntot += QHist->getBinContent(i + 1);
185  }
186 
187  bool isEmpty = (ntot == 0);
188 
189  //errflag bins: agree, loc agree, loc disagree, data only, emul only
190 
191  return isEmpty ? -1. : ((QHist->getBinContent(1)) / (ntot));
192 }
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< std::string > m_systemErrorFlag
int getNbinsX() const
get # of bins in X-axis

Member Data Documentation

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

Definition at line 40 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

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

Definition at line 41 of file L1EmulatorErrorFlagClient.h.

MonitorElement* L1EmulatorErrorFlagClient::m_meSummaryErrorFlagMap
private

Definition at line 69 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

size_t L1EmulatorErrorFlagClient::m_nrL1Systems
private

number of L1 trigger systems

Definition at line 57 of file L1EmulatorErrorFlagClient.h.

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

bool L1EmulatorErrorFlagClient::m_runInEndJob
private

Definition at line 46 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEndLumi
private

Definition at line 44 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEndRun
private

Definition at line 45 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEventLoop
private

Definition at line 43 of file L1EmulatorErrorFlagClient.h.

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

summary report

Definition at line 68 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock(), and initialize().

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

Definition at line 64 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize(), and setSummary().

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

Definition at line 62 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

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

Definition at line 59 of file L1EmulatorErrorFlagClient.h.

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

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

Definition at line 60 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock(), and initialize().

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

Definition at line 61 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock(), and initialize().

bool L1EmulatorErrorFlagClient::m_verbose
private

input parameters

Definition at line 39 of file L1EmulatorErrorFlagClient.h.

Referenced by dqmEndLuminosityBlock().