CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1EmulatorErrorFlagClient Class Reference

#include <L1EmulatorErrorFlagClient.h>

Inheritance diagram for L1EmulatorErrorFlagClient:
edm::EDAnalyzer

Public Member Functions

 L1EmulatorErrorFlagClient (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~L1EmulatorErrorFlagClient ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 analyze More...
 
void beginJob ()
 begin job More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 begin run More...
 
void endJob ()
 end job More...
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 end luminosity block More...
 
void endRun (const edm::Run &, const edm::EventSetup &)
 end run More...
 
void initialize ()
 private methods More...
 
Float_t setSummary (const unsigned int &) const
 

Private Attributes

DQMStorem_dbe
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 19 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 
35  //empty
36 
37 }

Member Function Documentation

void L1EmulatorErrorFlagClient::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
privatevirtual

analyze

Implements edm::EDAnalyzer.

Definition at line 204 of file L1EmulatorErrorFlagClient.cc.

205  {
206 
207  // there is no loop on events in the offline harvesting step
208  // do not put any code here, it will not be executed
209 
210 }
void L1EmulatorErrorFlagClient::beginJob ( void  )
privatevirtual

begin job

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file L1EmulatorErrorFlagClient.cc.

References DQMStore::book1D(), DQMStore::get(), MonitorElement::getName(), m_dbe, m_meSummaryErrorFlagMap, m_nrL1Systems, m_systemLabel, cppFunctionSkipper::operator, DQMStore::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

93  {
94 
95 
96  // get backend interface
98 
99  m_dbe->setCurrentFolder("L1TEMU/EventInfo");
100 
101  if ((m_meSummaryErrorFlagMap = m_dbe->get("L1TEMU/EventInfo/summaryErrorFlagMap"))) {
103  }
104 
105  // define a histogram
106  m_meSummaryErrorFlagMap = m_dbe->book1D("L1SummaryErrorFlagMap",
107  "L1SummaryErrorFlagMap", m_nrL1Systems, 1, m_nrL1Systems + 1);
108 
109  m_meSummaryErrorFlagMap->setAxisTitle("Agreement fraction", 2);
110 
111  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
112 
114  }
115 
116 }
const std::string & getName(void) const
get name of ME
size_t m_nrL1Systems
number of L1 trigger systems
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
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)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
std::vector< std::string > m_systemLabel
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void L1EmulatorErrorFlagClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file L1EmulatorErrorFlagClient.cc.

127  {
128  // optionally reset histograms here
129 }
void L1EmulatorErrorFlagClient::beginRun ( const edm::Run run,
const edm::EventSetup evSetup 
)
privatevirtual

begin run

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file L1EmulatorErrorFlagClient.cc.

120  {
121 
122  // empty
123 }
void L1EmulatorErrorFlagClient::endJob ( void  )
privatevirtual

end job

Reimplemented from edm::EDAnalyzer.

Definition at line 218 of file L1EmulatorErrorFlagClient.cc.

218  {
219  //empty
220 }
void L1EmulatorErrorFlagClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
)
privatevirtual

end luminosity block

Reimplemented from edm::EDAnalyzer.

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

132  {
133 
134  // reset the summary content values
135  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
136 
137  m_summaryContent[iMon] = 0.;
138  }
139 
140  // for masked systems and objects, set the summary content to -1
141 
142  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
143 
144  if (m_systemMask[iMon] != 0) {
145  m_summaryContent[iMon] = -1;
146  }
147  }
148 
149  // then fill content for unmasked systems
150 
151  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
152 
153  float percAgree = -1.;
154 
155  if (m_systemMask[iSys] == 0) {
156  percAgree = setSummary(iSys);
157 
158  if ((percAgree == -1) && m_verbose) {
159  std::cout << "\nWarning: ErrorFlag histogram for system "
160  << m_systemLabel[iSys] << " empty!" << std::endl;
161  }
162  }
163 
164  m_summaryContent[iSys] = percAgree;
165 
166  }
167 
168  int numUnMaskedSystems = 0;
169  for (unsigned int iMon = 0; iMon < m_nrL1Systems; iMon++) {
170  if (m_summaryContent[iMon] != -1) {
171  numUnMaskedSystems++;
172 
173  }
174  }
175 
176 
177 
178  // fill the SummaryErrorFlagMap histogram for L1 systems
179  // (bin 0 - underflow, bin iSys + 1 overflow)
180  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
182  }
183 
184  if (m_verbose) {
185  std::cout << "\nSummary report L1EmulatorErrorFlagClient" << std::endl;
186 
187  std::cout << "\nL1 systems: " << m_nrL1Systems << " systems included\n"
188  << std::endl;
189 
190  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
191 
192  std::cout << std::setw(10) << m_systemLabel[iSys] << std::setw(10)
193  << m_systemLabelExt[iSys] << " \t" << m_systemMask[iSys]
194  << " \t" << std::setw(25) << " m_summaryContent["
195  << std::setw(2) << iSys << "] = " << m_summaryContent[iSys]
196  << std::endl;
197  }
198 
199  }
200 
201 }
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
std::vector< std::string > m_systemLabel
Float_t setSummary(const unsigned int &) const
std::vector< std::string > m_systemLabelExt
tuple cout
Definition: gather_cfg.py:121
void L1EmulatorErrorFlagClient::endRun ( const edm::Run run,
const edm::EventSetup evSetup 
)
privatevirtual

end run

Reimplemented from edm::EDAnalyzer.

Definition at line 213 of file L1EmulatorErrorFlagClient.cc.

214  {
215  //empty
216 }
void L1EmulatorErrorFlagClient::initialize ( )
private

private methods

Definition at line 39 of file L1EmulatorErrorFlagClient.cc.

References m_dbe, m_l1Systems, m_nrL1Systems, m_summaryContent, m_systemErrorFlag, m_systemFolder, m_systemLabel, m_systemLabelExt, m_systemMask, and cppFunctionSkipper::operator.

Referenced by L1EmulatorErrorFlagClient().

39  {
40 
41 
42  // get back-end interface
44 
45  //
46 
47  m_nrL1Systems = m_l1Systems.size();
48 
51  m_systemMask.reserve(m_nrL1Systems);
54 
55  int indexSys = 0;
56 
57  for (std::vector<edm::ParameterSet>::const_iterator itSystem =
58  m_l1Systems.begin(); itSystem != m_l1Systems.end(); ++itSystem) {
59 
60  m_systemLabel.push_back(itSystem->getParameter<std::string>(
61  "SystemLabel"));
62 
63  m_systemLabelExt.push_back(itSystem->getParameter<std::string>(
64  "HwValLabel"));
65 
66  m_systemMask.push_back(itSystem->getParameter<unsigned int>(
67  "SystemMask"));
68 
69  m_systemFolder.push_back(itSystem->getParameter<std::string>(
70  "SystemFolder"));
71 
72  indexSys++;
73 
74  }
75 
76  // [SYS]ErrorFlag histogram
77  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
78  if (m_systemFolder[iSys] == "") {
79  m_systemErrorFlag.push_back("L1TEMU/" + m_systemLabel[iSys] + "/"
80  + m_systemLabelExt[iSys] + "ErrorFlag");
81  } else {
82  m_systemErrorFlag.push_back(m_systemFolder[iSys] + "/"
83  + m_systemLabelExt[iSys] + "ErrorFlag");
84  }
85  }
86 
87 
88  m_summaryContent.reserve(m_nrL1Systems);
89 
90 }
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 ( const unsigned int &  iMon) const
private

Definition at line 223 of file L1EmulatorErrorFlagClient.cc.

References data, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, m_dbe, and m_systemErrorFlag.

Referenced by endLuminosityBlock().

223  {
224 
225  MonitorElement* QHist = m_dbe->get(m_systemErrorFlag[iMon].data());
226 
227  int ntot = 0;
228  for (int i = 0; i < QHist->getNbinsX(); i++) {
229  ntot += QHist->getBinContent(i + 1);
230  }
231 
232  bool isEmpty = (ntot == 0);
233 
234  //errflag bins: agree, loc agree, loc disagree, data only, emul only
235 
236  return isEmpty ? -1. : ((QHist->getBinContent(1)) / (ntot));
237 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
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

DQMStore* L1EmulatorErrorFlagClient::m_dbe
private

Definition at line 91 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), initialize(), and setSummary().

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

Definition at line 58 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

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

Definition at line 59 of file L1EmulatorErrorFlagClient.h.

MonitorElement* L1EmulatorErrorFlagClient::m_meSummaryErrorFlagMap
private

Definition at line 87 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), and endLuminosityBlock().

size_t L1EmulatorErrorFlagClient::m_nrL1Systems
private

number of L1 trigger systems

Definition at line 75 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), endLuminosityBlock(), and initialize().

bool L1EmulatorErrorFlagClient::m_runInEndJob
private

Definition at line 64 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEndLumi
private

Definition at line 62 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEndRun
private

Definition at line 63 of file L1EmulatorErrorFlagClient.h.

bool L1EmulatorErrorFlagClient::m_runInEventLoop
private

Definition at line 61 of file L1EmulatorErrorFlagClient.h.

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

summary report

Definition at line 86 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock(), and initialize().

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

Definition at line 82 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize(), and setSummary().

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

Definition at line 80 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

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

Definition at line 77 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), endLuminosityBlock(), and initialize().

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

Definition at line 78 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock(), and initialize().

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

Definition at line 79 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock(), and initialize().

bool L1EmulatorErrorFlagClient::m_verbose
private

input parameters

Definition at line 57 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock().