68 categories_errors =
nullptr;
69 categories_warnings =
nullptr;
70 modules_errors =
nullptr;
71 modules_warnings =
nullptr;
72 total_errors =
nullptr;
73 total_warnings =
nullptr;
76 categories_vector =
parameters.getParameter<vector<string> >(
"Categories");
77 directoryName =
parameters.getParameter<
string>(
"Directory");
78 errorSummary_ = consumes<std::vector<edm::ErrorSummaryEntry> >(
86 for (
unsigned int i = 0;
i < categories_vector.size();
i++) {
87 categoryMap.insert(pair<string, int>(categories_vector[
i],
i + 1));
92 using stringvec = vector<std::string>;
94 stringvec
const &trigpaths = tns->getTrigPaths();
96 for (
auto const &trigpath : trigpaths) {
97 stringvec
strings = tns->getTrigPathModules(trigpath);
100 moduleMap.insert(pair<string, int>(
k, moduleMap.size() + 1));
107 if (!moduleMap.empty()) {
109 modules_errors = ibooker.
book1D(
"modules_errors",
"Errors per module", moduleMap.size(), 0, moduleMap.size());
112 modules_warnings = ibooker.
book1D(
"modules_warnings",
"Warnings per module", moduleMap.size(), 0, moduleMap.size());
114 for (
auto it = moduleMap.begin();
it != moduleMap.end(); ++
it) {
115 modules_errors->
setBinLabel((*it).second, (*it).first);
116 modules_warnings->setBinLabel((*it).second, (*it).first);
118 modules_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
119 modules_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
122 if (!categoryMap.empty()) {
125 ibooker.
book1D(
"categories_errors",
"Errors per category", categoryMap.size(), 0, categoryMap.size());
127 categories_warnings =
128 ibooker.
book1D(
"categories_warnings",
"Warnings per category", categoryMap.size(), 0, categoryMap.size());
130 for (
auto it = categoryMap.begin();
it != categoryMap.end(); ++
it) {
131 categories_errors->
setBinLabel((*it).second, (*it).first);
132 categories_warnings->setBinLabel((*it).second, (*it).first);
134 categories_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
135 categories_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
140 total_warnings = ibooker.
book1D(
"total_warnings",
"Total warnings per event",
nbins, -0.5,
nbins + 0.5);
142 total_errors = ibooker.
book1D(
"total_errors",
"Total errors per event",
nbins, -0.5,
nbins + 0.5);
147 string s =
out.str();
148 total_errors->setBinLabel(
i + 1,
s);
149 total_warnings->setBinLabel(
i + 1,
s);
168 if (total_errors !=
nullptr) {
169 total_errors->Fill(0);
171 if (total_warnings !=
nullptr) {
172 total_warnings->Fill(0);
179 w += (*errors)[
i].count;
181 e += (*errors)[
i].count;
184 if (total_errors !=
nullptr) {
185 total_errors->Fill(
e);
187 if (total_warnings !=
nullptr) {
188 total_warnings->Fill(
w);
198 if (categories_errors !=
nullptr) {
200 if (
it != categoryMap.end()) {
202 categories_errors->Fill((*it).second - 1, (*
errors)[
i].count);
208 if (modules_errors !=
nullptr) {
210 string s = (*errors)[
i].module;
211 size_t pos =
s.find(
':');
212 string s_temp =
s.substr(
pos + 1,
s.size());
213 auto it = moduleMap.find(s_temp);
214 if (
it != moduleMap.end()) {
216 modules_errors->Fill((*it).second - 1, (*
errors)[
i].count);
221 if (categories_warnings !=
nullptr) {
223 if (
it != categoryMap.end()) {
225 categories_warnings->Fill((*it).second - 1, (*
errors)[
i].count);
232 if (modules_warnings !=
nullptr) {
234 string s = (*errors)[
i].module;
235 size_t pos =
s.find(
':');
236 string s_temp =
s.substr(
pos + 1,
s.size());
237 auto it = moduleMap.find(s_temp);
238 if (
it != moduleMap.end()) {
240 modules_warnings->Fill((*it).second - 1, (*
errors)[
i].count);
std::map< std::string, int > categoryMap
MonitorElement * total_warnings
virtual void setCurrentFolder(std::string const &fullpath)
const std::string metname
edm::EDGetTokenT< std::vector< edm::ErrorSummaryEntry > > errorSummary_
MonitorElement * total_errors
MonitorElement * modules_warnings
MonitorElement * categories_errors
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< std::string, int > categoryECount
std::string directoryName
constexpr int getLevel() const noexcept
#define DEFINE_FWK_MODULE(type)
std::map< std::string, int > moduleMap
virtual 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)
std::vector< std::string > categories_vector
MonitorElement * modules_errors
MonitorElement * categories_warnings
std::map< std::string, int > categoryWCount
DQMMessageLogger(const edm::ParameterSet &)
Constructor.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override