src
EventFilter
CTPPSRawToDigi
src
CTPPSRawToDigiErrorSummary.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
#include "
EventFilter/CTPPSRawToDigi/interface/CTPPSRawToDigiErrorSummary.h
"
3
#include <iostream>
4
#include <algorithm>
5
6
void
CTPPSRawToDigiErrorSummary::add
(
const
std::string
& message,
const
std::string
&
details
) {
7
const
auto
eIt =
m_errors
.find(message);
8
if
(eIt ==
m_errors
.end()) {
9
m_errors
.emplace(message, 1);
10
edm::LogError
(
m_category
) << message <<
": "
<<
details
11
<< (
m_debug
?
""
12
:
"\nNote: further warnings of this type will be suppressed (this can be "
13
"changed by enabling debugging printout)"
);
14
}
else
{
15
++(eIt->second);
16
if
(
m_debug
) {
17
edm::LogError
(
m_category
) << message <<
": "
<<
details
;
18
}
19
}
20
}
21
22
void
CTPPSRawToDigiErrorSummary::printSummary
()
const
{
23
if
(!
m_errors
.empty()) {
24
std::stringstream message;
25
message <<
m_name
<<
" errors:"
;
26
for
(
const
auto
& warnAndCount :
m_errors
) {
27
message << std::endl << warnAndCount.first <<
" ("
<< warnAndCount.second <<
")"
;
28
}
29
edm::LogError
(
m_category
) << message.str();
30
}
31
}
MessageLogger.h
CTPPSRawToDigiErrorSummary::m_category
std::string m_category
Definition:
CTPPSRawToDigiErrorSummary.h:17
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:129
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
details
Definition:
helper.h:56
CTPPSRawToDigiErrorSummary::m_errors
std::map< std::string, std::size_t > m_errors
Definition:
CTPPSRawToDigiErrorSummary.h:19
CTPPSRawToDigiErrorSummary.h
CTPPSRawToDigiErrorSummary::add
void add(const std::string &message, const std::string &details="")
Definition:
CTPPSRawToDigiErrorSummary.cc:6
CTPPSRawToDigiErrorSummary::m_debug
bool m_debug
Definition:
CTPPSRawToDigiErrorSummary.h:16
CTPPSRawToDigiErrorSummary::m_name
std::string m_name
Definition:
CTPPSRawToDigiErrorSummary.h:18
CTPPSRawToDigiErrorSummary::printSummary
void printSummary() const
Definition:
CTPPSRawToDigiErrorSummary.cc:22
Generated for CMSSW Reference Manual by
1.8.14