CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1EmulatorErrorFlagClient (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~L1EmulatorErrorFlagClient ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
virtual void dqmEndLuminosityBlock (DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- 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::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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

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 }
const std::string & getName(void) const
get name of ME
size_t m_nrL1Systems
number of L1 trigger systems
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
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(Args &&...args)
Definition: DQMStore.h:115
std::vector< std::string > m_systemLabel
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
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:202
void L1EmulatorErrorFlagClient::dqmEndLuminosityBlock ( DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  evSetup 
)
protectedvirtual

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
tuple cout
Definition: gather_cfg.py:145
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 data, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, and m_systemErrorFlag.

Referenced by dqmEndLuminosityBlock().

178  {
179 
180  MonitorElement* QHist = igetter.get(m_systemErrorFlag[iMon].data());
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 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
double getBinContent(int binx) const
get content of bin (1-D)
std::vector< std::string > m_systemErrorFlag
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int getNbinsX(void) 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().