32 categories_errors =
nullptr;
33 categories_warnings =
nullptr;
34 modules_errors =
nullptr;
35 modules_warnings =
nullptr;
36 total_errors =
nullptr;
37 total_warnings =
nullptr;
40 categories_vector = parameters.
getParameter<vector<string> >(
"Categories");
41 directoryName = parameters.
getParameter<
string>(
"Directory");
42 errorSummary_ = consumes<std::vector<edm::ErrorSummaryEntry> >(
54 for (
unsigned int i = 0;
i < categories_vector.size();
i++) {
55 categoryMap.insert(pair<string, int>(categories_vector[
i], i + 1));
60 using stringvec = vector<std::string>;
62 stringvec
const& trigpaths = tns->getTrigPaths();
64 for (
auto const& trigpath : trigpaths) {
65 stringvec
strings = tns->getTrigPathModules(trigpath);
67 for (
auto&
k : strings) {
68 moduleMap.insert(pair<string, int>(
k, moduleMap.size() + 1));
75 if (!moduleMap.empty()) {
77 modules_errors = ibooker.
book1D(
"modules_errors",
"Errors per module", moduleMap.size(), 0, moduleMap.size());
80 modules_warnings = ibooker.
book1D(
"modules_warnings",
"Warnings per module", moduleMap.size(), 0, moduleMap.size());
82 for (
auto it = moduleMap.begin(); it != moduleMap.end(); ++it) {
83 modules_errors->
setBinLabel((*it).second, (*it).first);
84 modules_warnings->setBinLabel((*it).second, (*it).first);
86 modules_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
87 modules_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
90 if (!categoryMap.empty()) {
93 ibooker.
book1D(
"categories_errors",
"Errors per category", categoryMap.size(), 0, categoryMap.size());
96 ibooker.
book1D(
"categories_warnings",
"Warnings per category", categoryMap.size(), 0, categoryMap.size());
98 for (
auto it = categoryMap.begin(); it != categoryMap.end(); ++it) {
99 categories_errors->
setBinLabel((*it).second, (*it).first);
100 categories_warnings->setBinLabel((*it).second, (*it).first);
102 categories_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
103 categories_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
108 total_warnings = ibooker.
book1D(
"total_warnings",
"Total warnings per event", nbins, -0.5, nbins + 0.5);
110 total_errors = ibooker.
book1D(
"total_errors",
"Total errors per event", nbins, -0.5, nbins + 0.5);
115 string s = out.str();
116 total_errors->setBinLabel(i + 1, s);
117 total_warnings->setBinLabel(i + 1, s);
135 if (errors->empty()) {
136 if (total_errors !=
nullptr) {
137 total_errors->Fill(0);
139 if (total_warnings !=
nullptr) {
140 total_warnings->Fill(0);
145 for (
int i = 0,
n = errors->size();
i <
n;
i++) {
146 if ((*errors)[
i].severity.getLevel() < el.
getLevel()) {
147 w += (*errors)[
i].count;
149 e += (*errors)[
i].count;
152 if (total_errors !=
nullptr) {
153 total_errors->Fill(e);
155 if (total_warnings !=
nullptr) {
156 total_warnings->Fill(w);
160 for (
int i = 0,
n = errors->size();
i <
n;
i++) {
163 if (!errors->empty()) {
165 if ((*errors)[
i].severity.getLevel() >= el.
getLevel()) {
166 if (categories_errors !=
nullptr) {
167 auto it = categoryMap.find((*errors)[
i].
category);
168 if (it != categoryMap.end()) {
170 categories_errors->Fill((*it).second - 1, (*errors)[
i].count);
176 if (modules_errors !=
nullptr) {
178 string s = (*errors)[
i].module;
179 size_t pos = s.find(
':');
180 string s_temp = s.substr(pos + 1, s.size());
181 auto it = moduleMap.find(s_temp);
182 if (it != moduleMap.end()) {
184 modules_errors->Fill((*it).second - 1, (*errors)[
i].count);
189 if (categories_warnings !=
nullptr) {
190 auto it = categoryMap.find((*errors)[
i].
category);
191 if (it != categoryMap.end()) {
193 categories_warnings->Fill((*it).second - 1, (*errors)[
i].count);
200 if (modules_warnings !=
nullptr) {
202 string s = (*errors)[
i].module;
203 size_t pos = s.find(
':');
204 string s_temp = s.substr(pos + 1, s.size());
205 auto it = moduleMap.find(s_temp);
206 if (it != moduleMap.end()) {
208 modules_warnings->Fill((*it).second - 1, (*errors)[
i].count);
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
void setCurrentFolder(std::string const &fullpath)
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
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)
DQMMessageLogger(const edm::ParameterSet &)
Constructor.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
~DQMMessageLogger() override
Destructor.