36 categories_errors =
nullptr;
37 categories_warnings =
nullptr;
38 modules_errors =
nullptr;
39 modules_warnings =
nullptr;
40 total_errors =
nullptr;
41 total_warnings =
nullptr;
44 categories_vector = parameters.
getParameter< vector<string> >(
"Categories");
45 directoryName = parameters.
getParameter<
string>(
"Directory");
63 for(
unsigned int i=0;
i<categories_vector.size();
i++){
64 categoryMap.insert(pair<string,int>(categories_vector[
i],i+1));
70 using stringvec = vector<std::string>;
72 stringvec
const& trigpaths = tns->getTrigPaths();
75 for (
auto const & trigpath : trigpaths){
76 stringvec
strings = tns->getTrigPathModules(trigpath);
78 for(
auto &
k : strings){
79 moduleMap.insert(pair<string,int>(
k,moduleMap.size()+1));
86 if(!moduleMap.empty()){
88 modules_errors = ibooker.
book1D(
"modules_errors",
"Errors per module", moduleMap.size(), 0, moduleMap.size());
91 modules_warnings = ibooker.
book1D(
"modules_warnings",
"Warnings per module",moduleMap.size(),0,moduleMap.size());
93 for(
auto it = moduleMap.begin(); it!=moduleMap.end();++it){
94 modules_errors->
setBinLabel((*it).second,(*it).first);
95 modules_warnings->setBinLabel((*it).second,(*it).first);
97 modules_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
98 modules_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
102 if(!categoryMap.empty()){
104 categories_errors = ibooker.
book1D(
"categories_errors",
"Errors per category", categoryMap.size(), 0, categoryMap.size());
106 categories_warnings = ibooker.
book1D(
"categories_warnings",
"Warnings per category", categoryMap.size(), 0, categoryMap.size());
108 for(
auto it = categoryMap.begin(); it!=categoryMap.end();++it){
109 categories_errors->
setBinLabel((*it).second,(*it).first);
110 categories_warnings->setBinLabel((*it).second,(*it).first);
112 categories_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
113 categories_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
118 total_warnings = ibooker.
book1D(
"total_warnings",
"Total warnings per event",nbins,-0.5,nbins+0.5);
120 total_errors = ibooker.
book1D(
"total_errors",
"Total errors per event", nbins, -0.5, nbins+0.5);
125 string s = out.str();
126 total_errors->setBinLabel(i+1,s);
127 total_warnings->setBinLabel(i+1,s);
141 if(!errors.
isValid()){
return; }
149 if(total_errors!=
nullptr){
150 total_errors->Fill(0);
152 if(total_warnings!=
nullptr){
153 total_warnings->Fill(0);
159 for (
int i=0,
n=errors->size();
i<
n;
i++){
160 if((*errors)[
i].severity.getLevel() < el.
getLevel()){
161 w+= (*errors)[
i].count;
163 e+= (*errors)[
i].count;
166 if(total_errors!=
nullptr){
167 total_errors->Fill(e);
169 if(total_warnings!=
nullptr){
170 total_warnings->Fill(w);
177 for(
int i=0,
n=errors->size();
i<
n ;
i++){
181 if(!errors->empty()){
183 if((*errors)[
i].severity.getLevel() >= el.
getLevel()){
184 if(categories_errors!=
nullptr){
185 auto it = categoryMap.find((*errors)[
i].
category);
186 if (it!=categoryMap.end()){
188 categories_errors->Fill((*it).second - 1, (*errors)[
i].count);
194 if(modules_errors!=
nullptr){
196 string s = (*errors)[
i].module;
197 size_t pos = s.find(
':');
198 string s_temp = s.substr(pos+1,s.size());
199 auto it = moduleMap.find(s_temp);
200 if(it!=moduleMap.end()){
202 modules_errors->Fill((*it).second - 1, (*errors)[
i].count);
207 if(categories_warnings!=
nullptr){
208 auto it = categoryMap.find((*errors)[
i].
category);
209 if (it!=categoryMap.end()){
211 categories_warnings->Fill((*it).second - 1, (*errors)[
i].count);
218 if(modules_warnings!=
nullptr){
220 string s = (*errors)[
i].module;
221 size_t pos = s.find(
':');
222 string s_temp = s.substr(pos+1,s.size());
223 auto it = moduleMap.find(s_temp);
224 if(it!=moduleMap.end()){
226 modules_warnings->Fill((*it).second - 1, (*errors)[
i].count);
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 setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
MonitorElement * book1D(Args &&...args)
void setCurrentFolder(const std::string &fullpath)
DQMMessageLogger(const edm::ParameterSet &)
Constructor.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
~DQMMessageLogger() override
Destructor.