36 categories_errors =
NULL;
37 categories_warnings =
NULL;
38 modules_errors =
NULL;
39 modules_warnings =
NULL;
41 total_warnings =
NULL;
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 typedef vector<std::string> stringvec;
72 stringvec
const& trigpaths = tns->getTrigPaths();
75 for (stringvec::const_iterator
i = trigpaths.begin(),
e =trigpaths.end() ;
i !=
e; ++
i){
76 stringvec strings = tns->getTrigPathModules(*
i);
78 for(
unsigned int k=0;
k<strings.size(); ++
k){
79 moduleMap.insert(pair<string,int>(strings[
k],moduleMap.size()+1));
86 if(moduleMap.size()!=0){
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(map<string,int>::const_iterator 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.size()!=0){
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(map<string,int>::const_iterator 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; }
148 if(errors->size()==0){
149 if(total_errors!=
NULL){
150 total_errors->Fill(0);
152 if(total_warnings!=
NULL){
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!=
NULL){
167 total_errors->Fill(e);
169 if(total_warnings!=
NULL){
170 total_warnings->Fill(w);
177 for(
int i=0,
n=errors->size();
i<
n ;
i++){
181 if(errors->size()>0){
183 if((*errors)[
i].severity.getLevel() >= el.
getLevel()){
184 if(categories_errors!=
NULL){
185 map<string,int>::const_iterator 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!=
NULL){
196 string s = (*errors)[
i].module;
197 size_t pos = s.find(
':');
198 string s_temp = s.substr(pos+1,s.size());
199 map<string,int>::const_iterator it = moduleMap.find(s_temp);
200 if(it!=moduleMap.end()){
202 modules_errors->Fill((*it).second - 1, (*errors)[
i].count);
207 if(categories_warnings!=
NULL){
208 map<string,int>::const_iterator 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!=
NULL){
220 string s = (*errors)[
i].module;
221 size_t pos = s.find(
':');
222 string s_temp = s.substr(pos+1,s.size());
223 map<string,int>::const_iterator 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
virtual ~DQMMessageLogger()
Destructor.
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)
MonitorElement * book1D(Args &&...args)
void setCurrentFolder(const std::string &fullpath)
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
DQMMessageLogger(const edm::ParameterSet &)
Constructor.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override