src
EventFilter
CTPPSRawToDigi
src
CTPPSPixelErrorSummary.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
#include "
EventFilter/CTPPSRawToDigi/interface/CTPPSPixelErrorSummary.h
"
3
#include <iostream>
4
#include <algorithm>
5
6
void
CTPPSPixelErrorSummary::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
CTPPSPixelErrorSummary::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
}
CTPPSPixelErrorSummary::m_debug
bool m_debug
Definition:
CTPPSPixelErrorSummary.h:16
MessageLogger.h
CTPPSPixelErrorSummary::m_errors
std::map< std::string, std::size_t > m_errors
Definition:
CTPPSPixelErrorSummary.h:19
CTPPSPixelErrorSummary::printSummary
void printSummary() const
Definition:
CTPPSPixelErrorSummary.cc:22
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:129
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelErrorSummary::add
void add(const std::string &message, const std::string &details="")
Definition:
CTPPSPixelErrorSummary.cc:6
details
Definition:
helper.h:56
CTPPSPixelErrorSummary.h
CTPPSPixelErrorSummary::m_category
std::string m_category
Definition:
CTPPSPixelErrorSummary.h:17
CTPPSPixelErrorSummary::m_name
std::string m_name
Definition:
CTPPSPixelErrorSummary.h:18
Generated for CMSSW Reference Manual by
1.8.14