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");
66 for(
unsigned int i=0;
i<categories_vector.size();
i++){
67 categoryMap.insert(pair<string,int>(categories_vector[
i],i+1));
73 typedef vector<std::string> stringvec;
75 stringvec
const& trigpaths = tns->getTrigPaths();
78 for (stringvec::const_iterator
i = trigpaths.begin(),
e =trigpaths.end() ;
i !=
e; ++
i){
79 stringvec strings = tns->getTrigPathModules(*
i);
81 for(
unsigned int k=0;
k<strings.size(); ++
k){
82 moduleMap.insert(pair<string,int>(strings[
k],moduleMap.size()+1));
93 if(moduleMap.size()!=0){
94 theDbe->setCurrentFolder(directoryName +
"/Errors");
95 modules_errors = theDbe->book1D(
"modules_errors",
"Errors per module", moduleMap.size(), 0, moduleMap.size());
96 theDbe->setCurrentFolder(directoryName +
"/Warnings");
98 modules_warnings = theDbe->book1D(
"modules_warnings",
"Warnings per module",moduleMap.size(),0,moduleMap.size());
100 for(map<string,int>::const_iterator it = moduleMap.begin(); it!=moduleMap.end();++it){
101 modules_errors->setBinLabel((*it).second,(*it).first);
102 modules_warnings->setBinLabel((*it).second,(*it).first);
104 modules_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
105 modules_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
112 if(categoryMap.size()!=0){
113 theDbe->setCurrentFolder(directoryName +
"/Errors");
114 categories_errors = theDbe->book1D(
"categories_errors",
"Errors per category", categoryMap.size(), 0, categoryMap.size());
115 theDbe->setCurrentFolder(directoryName +
"/Warnings");
116 categories_warnings = theDbe->book1D(
"categories_warnings",
"Warnings per category", categoryMap.size(), 0, categoryMap.size());
119 for(map<string,int>::const_iterator it = categoryMap.begin(); it!=categoryMap.end();++it){
120 categories_errors->setBinLabel((*it).second,(*it).first);
121 categories_warnings->setBinLabel((*it).second,(*it).first);
123 categories_warnings->getTH1()->GetXaxis()->LabelsOption(
"v");
124 categories_errors->getTH1()->GetXaxis()->LabelsOption(
"v");
129 total_warnings = theDbe->book1D(
"total_warnings",
"Total warnings per event",nbins,-0.5,nbins+0.5);
130 theDbe->setCurrentFolder(directoryName +
"/Errors");
131 total_errors = theDbe->book1D(
"total_errors",
"Total errors per event", nbins, -0.5, nbins+0.5);
136 string s = out.str();
137 total_errors->setBinLabel(i+1,s);
138 total_warnings->setBinLabel(i+1,s);
153 if(!errors.
isValid()){
return; }
160 if(errors->size()==0){
161 if(total_errors!=
NULL){
162 total_errors->Fill(0);
164 if(total_warnings!=
NULL){
165 total_warnings->Fill(0);
171 for (
int i=0,
n=errors->size();
i<
n;
i++){
172 if((*errors)[
i].severity.getLevel() < el.
getLevel()){
173 w+= (*errors)[
i].count;
175 e+= (*errors)[
i].count;
178 if(total_errors!=
NULL){
179 total_errors->Fill(e);
181 if(total_warnings!=
NULL){
182 total_warnings->Fill(w);
189 for(
int i=0,
n=errors->size();
i<
n ;
i++){
193 if(errors->size()>0){
195 if((*errors)[
i].severity.getLevel() >= el.
getLevel()){
196 if(categories_errors!=
NULL){
197 map<string,int>::const_iterator it = categoryMap.find((*errors)[
i].
category);
198 if (it!=categoryMap.end()){
200 categories_errors->Fill((*it).second - 1, (*errors)[
i].count);
206 if(modules_errors!=
NULL){
208 string s = (*errors)[
i].module;
209 size_t pos = s.find(
':');
210 string s_temp = s.substr(pos+1,s.size());
211 map<string,int>::const_iterator it = moduleMap.find(s_temp);
212 if(it!=moduleMap.end()){
214 modules_errors->Fill((*it).second - 1, (*errors)[
i].count);
219 if(categories_warnings!=
NULL){
220 map<string,int>::const_iterator it = categoryMap.find((*errors)[
i].
category);
221 if (it!=categoryMap.end()){
223 categories_warnings->Fill((*it).second - 1, (*errors)[
i].count);
230 if(modules_warnings!=
NULL){
232 string s = (*errors)[
i].module;
233 size_t pos = s.find(
':');
234 string s_temp = s.substr(pos+1,s.size());
235 map<string,int>::const_iterator it = moduleMap.find(s_temp);
236 if(it!=moduleMap.end()){
238 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 endJob()
Save the histos.
void endRun(const edm::Run &r, const edm::EventSetup &c)
collate categories in summary plots
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
void beginJob()
Inizialize parameters for histo binning.
DQMMessageLogger(const edm::ParameterSet &)
Constructor.