CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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< T > 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 beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
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 24 of file L1EmulatorErrorFlagClient.cc.

References initialize().

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

Destructor.

Definition at line 31 of file L1EmulatorErrorFlagClient.cc.

31  {
32  //empty
33 }

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 71 of file L1EmulatorErrorFlagClient.cc.

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

71  {
72  ibooker.setCurrentFolder("L1TEMU/EventInfo");
73 
74  // define a histogram
76  ibooker.book1D("L1SummaryErrorFlagMap", "L1SummaryErrorFlagMap", m_nrL1Systems, 1, m_nrL1Systems + 1);
77 
78  m_meSummaryErrorFlagMap->setAxisTitle("Agreement fraction", 2);
79 
80  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
82  }
83 }
size_t m_nrL1Systems
number of L1 trigger systems
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
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)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
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 ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  evSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 85 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().

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

private methods

Definition at line 35 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().

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

References dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), mps_fire::i, m_systemErrorFlag, and gpuPixelDoublets::ntot.

Referenced by dqmEndLuminosityBlock().

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

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().