Main Page
Namespaces
Classes
Package Documentation
EventFilter
SiStripRawToDigi
plugins
WarningSummary.cc
Go to the documentation of this file.
1
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
2
#include "
EventFilter/SiStripRawToDigi/plugins/WarningSummary.h
"
3
4
#include <algorithm>
5
6
void
sistrip::WarningSummary::add
(
const
std::string
& message,
const
std::string
&
details
)
7
{
8
const
auto
wIt = std::find_if(
std::begin
(
m_warnings
),
std::end
(
m_warnings
),
9
[&message] (
const
std::pair<std::string,std::size_t>& item ) {
return
item.first == message; } );
10
if
(
std::end
(
m_warnings
) == wIt ) {
11
m_warnings
.emplace(message, 1);
12
edm::LogWarning
(
m_category
) << message <<
": "
<< details << (
m_debug
?
""
:
13
"\nNote: further warnings of this type will be suppressed (this can be changed by enabling debugging printout)"
);
14
}
else
{
15
++(wIt->second);
16
if
(
m_debug
) {
17
edm::LogWarning
(
m_category
) << message <<
": "
<< details;
18
}
19
}
20
}
21
22
void
sistrip::WarningSummary::printSummary
()
const
23
{
24
if
( !
m_warnings
.empty() ) {
25
std::stringstream message;
26
message <<
m_name
<<
" warnings:"
;
27
for
(
const
auto
& warnAndCount :
m_warnings
) {
28
message << std::endl << warnAndCount.first <<
" ("
<< warnAndCount.second <<
")"
;
29
}
30
edm::LogWarning
(
m_category
) << message.str();
31
}
32
}
MessageLogger.h
sistrip::WarningSummary::printSummary
void printSummary() const
Definition:
WarningSummary.cc:22
sistrip::WarningSummary::m_name
std::string m_name
Definition:
WarningSummary.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::LogWarning
Definition:
MessageLogger.h:142
WarningSummary.h
sistrip::WarningSummary::m_category
std::string m_category
Definition:
WarningSummary.h:21
details
Definition:
TrackerStablePhiSort.h:15
end
#define end
Definition:
vmac.h:39
sistrip::WarningSummary::add
void add(const std::string &message, const std::string &details="")
Definition:
WarningSummary.cc:6
begin
#define begin
Definition:
vmac.h:32
sistrip::WarningSummary::m_warnings
std::map< std::string, std::size_t > m_warnings
Definition:
WarningSummary.h:23
sistrip::WarningSummary::m_debug
bool m_debug
Definition:
WarningSummary.h:20
Generated for CMSSW Reference Manual by
1.8.11