39 categories_errors =
NULL;
40 categories_warnings =
NULL;
41 modules_errors =
NULL;
42 modules_warnings =
NULL;
44 total_warnings =
NULL;
47 categories_vector = parameters.
getParameter< vector<string> >(
"Categories");
48 directoryName = parameters.
getParameter<
string>(
"Directory");
64 for(
unsigned int i=0;
i<categories_vector.size();
i++){
65 categoryMap.insert(pair<string,int>(categories_vector[
i],i+1));
71 typedef vector<std::string> stringvec;
73 stringvec
const& trigpaths = tns->getTrigPaths();
76 for (stringvec::const_iterator
i = trigpaths.begin(),
e =trigpaths.end() ;
i !=
e; ++
i){
77 stringvec strings = tns->getTrigPathModules(*
i);
79 for(
unsigned int k=0;
k<strings.size(); ++
k){
80 moduleMap.insert(pair<string,int>(strings[
k],moduleMap.size()+1));
91 if(moduleMap.size()!=0){
92 theDbe->setCurrentFolder(directoryName +
"/Errors");
93 modules_errors = theDbe->book1D(
"modules_errors",
"Errors per module", moduleMap.size(), 0, moduleMap.size());
94 theDbe->setCurrentFolder(directoryName +
"/Warnings");
96 modules_warnings = theDbe->book1D(
"modules_warnings",
"Warnings per module",moduleMap.size(),0,moduleMap.size());
98 for(map<string,int>::const_iterator it = moduleMap.begin(); it!=moduleMap.end();++it){
99 modules_errors->setBinLabel((*it).second,(*it).first);
100 modules_warnings->setBinLabel((*it).second,(*it).first);
102 modules_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
103 modules_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
110 if(categoryMap.size()!=0){
111 theDbe->setCurrentFolder(directoryName +
"/Errors");
112 categories_errors = theDbe->book1D(
"categories_errors",
"Errors per category", categoryMap.size(), 0, categoryMap.size());
113 theDbe->setCurrentFolder(directoryName +
"/Warnings");
114 categories_warnings = theDbe->book1D(
"categories_warnings",
"Warnings per category", categoryMap.size(), 0, categoryMap.size());
117 for(map<string,int>::const_iterator it = categoryMap.begin(); it!=categoryMap.end();++it){
118 categories_errors->setBinLabel((*it).second,(*it).first);
119 categories_warnings->setBinLabel((*it).second,(*it).first);
121 categories_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
122 categories_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
127 total_warnings = theDbe->book1D(
"total_warnings",
"Total warnings per event",nbins,-0.5,nbins+0.5);
128 theDbe->setCurrentFolder(directoryName +
"/Errors");
129 total_errors = theDbe->book1D(
"total_errors",
"Total errors per event", nbins, -0.5, nbins+0.5);
134 string s = out.str();
135 total_errors->setBinLabel(i+1,s);
136 total_warnings->setBinLabel(i+1,s);
149 iEvent.
getByLabel(
"logErrorHarvester",errors);
151 if(!errors.
isValid()){
return; }
158 if(errors->size()==0){
159 if(total_errors!=
NULL){
160 total_errors->Fill(0);
162 if(total_warnings!=
NULL){
163 total_warnings->Fill(0);
169 for (
int i=0,
n=errors->size();
i<
n;
i++){
170 if((*errors)[
i].severity.getLevel() < el.
getLevel()){
171 w+= (*errors)[
i].count;
173 e+= (*errors)[
i].count;
176 if(total_errors!=
NULL){
177 total_errors->Fill(e);
179 if(total_warnings!=
NULL){
180 total_warnings->Fill(w);
187 for(
int i=0,
n=errors->size();
i<
n ;
i++){
191 if(errors->size()>0){
193 if((*errors)[
i].severity.getLevel() >= el.
getLevel()){
194 if(categories_errors!=
NULL){
195 map<string,int>::const_iterator it = categoryMap.find((*errors)[
i].
category);
196 if (it!=categoryMap.end()){
198 categories_errors->Fill((*it).second - 1, (*errors)[
i].count);
204 if(modules_errors!=
NULL){
206 string s = (*errors)[
i].module;
207 size_t pos = s.find(
':');
208 string s_temp = s.substr(pos+1,s.size());
209 map<string,int>::const_iterator it = moduleMap.find(s_temp);
210 if(it!=moduleMap.end()){
212 modules_errors->Fill((*it).second - 1, (*errors)[
i].count);
217 if(categories_warnings!=
NULL){
218 map<string,int>::const_iterator it = categoryMap.find((*errors)[
i].
category);
219 if (it!=categoryMap.end()){
221 categories_warnings->Fill((*it).second - 1, (*errors)[
i].count);
228 if(modules_warnings!=
NULL){
230 string s = (*errors)[
i].module;
231 size_t pos = s.find(
':');
232 string s_temp = s.substr(pos+1,s.size());
233 map<string,int>::const_iterator it = moduleMap.find(s_temp);
234 if(it!=moduleMap.end()){
236 modules_warnings->Fill((*it).second - 1, (*errors)[
i].count);
T getParameter(std::string const &) const
const std::string metname
virtual ~DQMMessageLogger()
Destructor.
void endJob()
Save the histos.
void endRun(const edm::Run &r, const edm::EventSetup &c)
collate categories in summary plots
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
void beginJob()
Inizialize parameters for histo binning.
DQMMessageLogger(const edm::ParameterSet &)
Constructor.