34 messageLoggerPSet (pset);
54 suppressionLists(pset);
58 vStringsCheck(pset,
"MessageLogger");
63 (
pset,
"MessageLogger",
"messageSummaryToJobReport" );
65 (
pset,
"MessageLogger",
"generate_preconfiguration_message" );
67 (
pset,
"MessageLogger",
"threshold" );
68 if (!thresh.empty()) validateThreshold(thresh,
"MessageLogger");
70 (
pset,
"MessageLogger",
"waiting_threshold");
74 destinationPSets(pset);
76 statisticsPSets(pset);
77 fwkJobReportPSets(pset);
78 categoryPSets(pset,
"MessageLogger");
86 noneExcept <int> (
pset,
"MessageLogger",
"int");
87 noneExcept <unsigned int> (
pset,
"MessageLogger",
"unsigned int",
"waiting_threshold");
88 noneExcept <bool> (
pset,
"MessageLogger",
"bool",
"messageSummaryToJobReport");
91 noneExcept <float> (
pset,
"MessageLogger",
"float");
92 noneExcept <double> (
pset,
"MessageLogger",
"double");
93 noneExcept <std::string> (
pset,
"MessageLogger",
"string",
94 "threshold",
"generate_preconfiguration_message");
98 if (!flaws.str().empty()) {
99 flaws <<
"\nThe above are from MessageLogger configuration validation.\n" 100 <<
"In most cases, these involve lines that the logger configuration code\n" 101 <<
"would not process, but which the cfg creator obviously meant to have " 112 (
pset,
"MessageLogger",
"destinations");
113 noDuplicates(
destinations,
"MessageLogger",
"destinations");
114 noKeywords(
destinations,
"MessageLogger",
"destinations");
115 noNonPSetUsage(pset,
destinations,
"MessageLogger",
"destinations");
119 (
pset,
"MessageLogger",
"statistics");
120 noDuplicates(
statistics,
"MessageLogger",
"statistics");
121 noKeywords(
statistics,
"MessageLogger",
"statistics");
122 noNonPSetUsage(pset,
statistics,
"MessageLogger",
"statistics");
125 (
pset,
"MessageLogger",
"fwkJobReports");
126 noDuplicates(
fwkJobReports,
"MessageLogger",
"fwkJobReports");
128 noNonPSetUsage(pset,
fwkJobReports,
"MessageLogger",
"fwkJobReports");
130 "MessageLogger",
"fwkJobReports",
"destinations");
132 "MessageLogger",
"fwkJobReports",
"statistics");
135 (
pset,
"MessageLogger",
"categories");
136 noDuplicates(
categories,
"MessageLogger",
"categories");
137 noKeywords(
categories,
"MessageLogger",
"categories");
138 noNonPSetUsage(pset,
categories,
"MessageLogger",
"categories");
140 "MessageLogger",
"categories",
"destinations");
142 "MessageLogger",
"categories",
"statistics");
144 "MessageLogger",
"categories",
"fwkJobReports");
146 messageIDs = check<vString>
147 (
pset,
"MessageLogger",
"messageIDs");
148 noDuplicates(messageIDs,
"MessageLogger",
"messageIDs");
149 noKeywords(messageIDs,
"MessageLogger",
"messageIDs");
150 noNonPSetUsage(pset, messageIDs,
"MessageLogger",
"messageIDs");
152 "MessageLogger",
"messageIDs",
"destinations");
154 "MessageLogger",
"messageIDs",
"statistics");
156 "MessageLogger",
"messageIDs",
"fwkJobReports");
158 "MessageLogger",
"messageIDs",
"categories");
167 (
pset,
"MessageLogger",
"debugModules");
170 flaws <<
"MessageLogger" <<
" PSet: \n" 171 <<
"debugModules contains wildcard character *" 173 <<
" other entries - * must be alone\n";
176 (
pset,
"MessageLogger",
"suppressDebug");
178 flaws <<
"MessageLogger" <<
" PSet: \n" 179 <<
"suppressDebug contains modules, but debugModules is not *\n" 180 <<
"Unless all the debugModules are enabled,\n" 181 <<
"suppressing specific modules is meaningless\n";
184 flaws <<
"MessageLogger" <<
" PSet: \n" 185 <<
"Use of wildcard (*) in suppressDebug is not supported\n" 186 <<
"By default, LogDebug is suppressed for all modules\n";
189 (
pset,
"MessageLogger",
"suppressInfo");
191 flaws <<
"MessageLogger" <<
" PSet: \n" 192 <<
"Use of wildcard (*) in suppressInfo is not supported\n";
195 (
pset,
"MessageLogger",
"suppressWarning");
197 flaws <<
"MessageLogger" <<
" PSet: \n" 198 <<
"Use of wildcard (*) in suppressWarning is not supported\n";
200 suppressError = check<vString>
201 (
pset,
"MessageLogger",
"suppressError");
202 if (wildcard(suppressError)) {
203 flaws <<
"MessageLogger" <<
" PSet: \n" 204 <<
"Use of wildcard (*) in suppressError is not supported\n";
215 vString::const_iterator
end = vStrings.end();
216 for ( vString::const_iterator
i = vStrings.begin();
i !=
end; ++
i ) {
217 if ( !allowedVstring(*
i) ) {
218 flaws <<
"MessageLogger" <<
" PSet: \n" 219 << (*i) <<
" is used as a vstring, " 220 <<
"but no such vstring is recognized\n";
224 end = vStrings.end();
225 for ( vString::const_iterator
i = vStrings.begin();
i !=
end; ++
i ) {
226 flaws <<
"MessageLogger" <<
" PSet: \n" 227 << (*i) <<
" is used as a tracked vstring: " 228 <<
"tracked parameters not allowed here\n";
236 if (s ==
"destinations")
return true;
237 if (s ==
"statistics")
return true;
238 if (s ==
"destinations")
return true;
239 if (s ==
"fwkJobReports")
return true;
240 if (s ==
"categories")
return true;
241 if (s ==
"messageIDs")
return true;
242 if (s ==
"debugModules")
return true;
243 if (s ==
"suppressInfo")
return true;
244 if (s ==
"suppressDebug")
return true;
245 if (s ==
"suppressWarning")
return true;
246 if (s ==
"suppressError")
return true;
256 if (checkThreshold(thresh))
return true;
257 flaws << psetName <<
" PSet: \n" 258 <<
"threshold has value " << thresh
259 <<
" which is not among {DEBUG, INFO, WARNING, ERROR}\n";
267 if (thresh ==
"WARNING")
return true;
268 if (thresh ==
"INFO")
return true;
269 if (thresh ==
"ERROR")
return true;
270 if (thresh ==
"DEBUG")
return true;
279 vString::const_iterator
end = v.end();
280 for (vString::const_iterator
i = v.begin();
i !=
end; ++
i) {
281 for (vString::const_iterator j =
i+1; j !=
end; ++j) {
283 flaws << psetName <<
" PSet: \n" 284 <<
"in vString " << parameterLabel
285 <<
" duplication of the string " << *
i <<
"\n";
297 vString::const_iterator end1 = v1.end();
298 vString::const_iterator end2 = v2.end();
299 for (vString::const_iterator
i = v1.begin();
i != end1; ++
i) {
300 for (vString::const_iterator j = v2.begin(); j != end2; ++j) {
302 flaws << psetName <<
" PSet: \n" 303 <<
"in vStrings " << p1 <<
" and " << p2
304 <<
" duplication of the string " << *
i <<
"\n";
315 vString::const_iterator
end = v.end();
316 bool coutPresent =
false;
317 bool cerrPresent =
false;
318 for (vString::const_iterator
i = v.begin();
i !=
end; ++
i) {
319 if ( *
i ==
"cout" ) coutPresent =
true;
320 if ( *
i ==
"cerr" ) cerrPresent =
true;
322 if (coutPresent && cerrPresent) {
323 flaws << psetName <<
" PSet: \n" 324 <<
"vString " << parameterLabel
325 <<
" has both cout and cerr \n";
334 vString::const_iterator
end = v.end();
335 for (vString::const_iterator
i = v.begin();
i !=
end; ++
i) {
336 if (!keywordCheck(*
i)) {
337 flaws << psetName <<
" PSet: \n" 338 <<
"vString " << parameterLabel
339 <<
" should not contain the keyword " << *
i <<
"\n";
348 if (word ==
"default")
return false;
349 if (word ==
"categories")
return false;
350 if (word ==
"messageIDs")
return false;
351 if (word ==
"fwkJobReports")
return false;
352 if (word ==
"destinations")
return false;
353 if (word ==
"statistics")
return false;
354 if (word ==
"debugModules")
return false;
355 if (word ==
"suppressInfo")
return false;
356 if (word ==
"suppressDebug")
return false;
357 if (word ==
"suppressWarning")
return false;
358 if (word ==
"suppressError")
return false;
359 if (word ==
"threshold")
return false;
360 if (word ==
"ERROR")
return false;
361 if (word ==
"WARNING")
return false;
362 if (word ==
"INFO")
return false;
363 if (word ==
"DEBUG")
return false;
364 if (word ==
"placeholder")
return false;
365 if (word ==
"limit")
return false;
366 if (word ==
"reportEvery")
return false;
367 if (word ==
"timespan")
return false;
368 if (word ==
"noLineBreaks")
return false;
369 if (word ==
"lineLength")
return false;
370 if (word ==
"noTimeStamps")
return false;
371 if (word ==
"output")
return false;
372 if (word ==
"filename")
return false;
373 if (word ==
"extension")
return false;
374 if (word ==
"reset")
return false;
375 if (word ==
"optionalPSet")
return false;
385 disallowedParam <int> (
pset,
v, psetName, parameterLabel,
"int" );
386 disallowedParam <unsigned int> (
pset,
v, psetName, parameterLabel,
"uint" );
387 disallowedParam <bool> (
pset,
v, psetName, parameterLabel,
"bool" );
388 disallowedParam <float> (
pset,
v, psetName, parameterLabel,
"float" );
389 disallowedParam <double> (
pset,
v, psetName, parameterLabel,
"double" );
390 disallowedParam <std::string> (
pset,
v, psetName, parameterLabel,
"string" );
391 disallowedParam <std::vector<std::string> >
392 (
pset,
v, psetName, parameterLabel,
"vstring" );
402 vString::const_iterator end1 = v.end();
403 vString::const_iterator end2 = params.end();
404 for (vString::const_iterator
i = v.begin();
i != end1; ++
i) {
405 for (vString::const_iterator j = params.begin(); j != end2; ++j) {
407 flaws << psetName <<
" PSet: \n" 408 << *
i <<
" (listed in vstring " << parameterLabel <<
")\n" 409 <<
"is used as a parameter of type " << type
410 <<
" instead of as a PSet \n";
421 vString::const_iterator
end = v.end();
422 for (vString::const_iterator
i = v.begin();
i !=
end; ++
i) {
423 if ((*
i) ==
"*")
return true;
434 vString::const_iterator
end = psnames.end();
435 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
440 if ( lookForMatch (messageIDs, *
i) )
continue;
441 if ( (*
i) ==
"default" )
continue;
443 bool ok_optionalPSet =
false;
453 if (ok_optionalPSet)
continue;
454 flaws <<
"MessageLogger " <<
" PSet: \n" 455 << *
i <<
" is an unrecognized name for a PSet\n";
461 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
462 flaws <<
"MessageLogger " <<
" PSet: \n" 463 <<
"PSet " << *
i <<
" is tracked - not allowed\n";
472 vString::const_iterator
begin = v.begin();
473 vString::const_iterator
end = v.end();
474 return (
std::find(begin, end, s) != end );
483 for ( std::vector<std::string>::const_iterator
i =
destinations.begin();
486 destinationPSet(d,*
i);
496 categoryPSets (pset, psetName);
500 noNoncategoryPsets (pset, psetName);
504 check <bool> (
pset, psetName,
"placeholder" );
506 if (!thresh.empty()) validateThreshold(thresh, psetName);
507 check <bool> (
pset, psetName,
"noLineBreaks" );
508 check <int> (
pset, psetName,
"lineLength" );
509 check <bool> (
pset, psetName,
"noTimeStamps" );
511 if ( (s ==
"cerr") || (s ==
"cout") ) {
512 flaws << psetName <<
" PSet: \n" 513 << s <<
" is not allowed as a value of filename \n";
515 s = check<std::string> (
pset,
"psetName",
"extension" );
516 if ( (s ==
"cerr") || (s ==
"cout") ) {
517 flaws << psetName <<
" PSet: \n" 518 << s <<
" is not allowed as a value of extension \n";
520 s = check<std::string> (
pset,
"psetName",
"output" );
524 noneExcept <int> (
pset, psetName,
"int",
"lineLength");
527 okbool.push_back (
"placeholder");
528 okbool.push_back (
"optionalPSet");
529 okbool.push_back (
"noLineBreaks");
530 okbool.push_back (
"noTimeStamps");
531 noneExcept <bool> (
pset, psetName,
"bool", okbool);
533 okstring.push_back (
"threshold");
534 okstring.push_back (
"output");
535 okstring.push_back (
"filename");
536 okstring.push_back (
"extension");
537 noneExcept <std::string> (
pset, psetName,
"string", okstring);
547 std::string psetName =
"default (at MessageLogger main level)";
551 categoryPSets (pset, psetName);
555 noNoncategoryPsets (pset, psetName);
559 catInts ( pset, psetName,
"default" );
563 check <bool> (
pset, psetName,
"placeholder" );
565 if (!thresh.empty()) validateThreshold(thresh, psetName);
566 check <bool> (
pset, psetName,
"noLineBreaks" );
567 check <int> (
pset, psetName,
"limit" );
568 check <int> (
pset, psetName,
"reportEvery" );
569 check <int> (
pset, psetName,
"timespan" );
570 check <int> (
pset, psetName,
"lineLength" );
571 check <bool> (
pset, psetName,
"noTimeStamps" );
575 okint.push_back(
"limit");
576 okint.push_back(
"reportEvery");
577 okint.push_back(
"timespan");
578 okint.push_back(
"lineLength");
579 noneExcept <int> (
pset, psetName,
"int", okint);
581 okbool.push_back (
"placeholder");
582 okbool.push_back (
"optionalPSet");
583 okbool.push_back (
"noLineBreaks");
584 okbool.push_back (
"noTimeStamps");
585 noneExcept <bool> (
pset, psetName,
"bool", okbool);
587 okstring.push_back (
"threshold");
588 noneExcept <std::string> (
pset, psetName,
"string", okstring);
597 std::vector<std::string>::const_iterator
end =
statistics.end();
598 for ( std::vector<std::string>::const_iterator
i =
statistics.begin();
602 statisticsPSet(d,*
i);
612 categoryPSets (pset, psetName);
616 noNoncategoryPsets (pset, psetName);
621 if (!thresh.empty()) validateThreshold(thresh, psetName);
622 check <bool> (
pset, psetName,
"placeholder" );
623 check <bool> (
pset, psetName,
"reset" );
625 if ( (s ==
"cerr") || (s ==
"cout") ) {
626 flaws << psetName <<
" PSet: \n" 627 << s <<
" is not allowed as a value of filename \n";
629 s = check<std::string> (
pset,
"psetName",
"extension" );
630 if ( (s ==
"cerr") || (s ==
"cout") ) {
631 flaws << psetName <<
" PSet: \n" 632 << s <<
" is not allowed as a value of extension \n";
634 s = check<std::string> (
pset,
"psetName",
"output" );
638 noneExcept <int> (
pset, psetName,
"int");
641 okbool.push_back (
"placeholder");
642 okbool.push_back (
"optionalPSet");
643 okbool.push_back (
"reset");
644 noneExcept <bool> (
pset, psetName,
"bool", okbool);
646 okstring.push_back (
"output");
647 okstring.push_back (
"filename");
648 okstring.push_back (
"extension");
649 okstring.push_back (
"threshold");
650 noneExcept <std::string> (
pset, psetName,
"string", okstring);
660 for ( std::vector<std::string>::const_iterator
i =
fwkJobReports.begin();
663 fwkJobReportPSet(d,*
i);
673 categoryPSets (pset, psetName);
677 noNoncategoryPsets (pset, psetName);
681 check <bool> (
pset, psetName,
"placeholder" );
683 if ( (s ==
"cerr") || (s ==
"cout") ) {
684 flaws << psetName <<
" PSet: \n" 685 << s <<
" is not allowed as a value of filename \n";
687 s = check<std::string> (
pset,
"psetName",
"extension" );
688 if ( (s ==
"cerr") || (s ==
"cout") ) {
689 flaws << psetName <<
" PSet: \n" 690 << s <<
" is not allowed as a value of extension \n";
692 s = check<std::string> (
pset,
"psetName",
"output" );
696 noneExcept <int> (
pset, psetName,
"int");
699 okbool.push_back (
"placeholder");
700 okbool.push_back (
"optionalPSet");
701 noneExcept <bool> (
pset, psetName,
"bool", okbool);
703 okstring.push_back (
"output");
704 okstring.push_back (
"filename");
705 okstring.push_back (
"extension");
706 noneExcept <std::string> (
pset, psetName,
"string", okstring);
716 vString::const_iterator
end = psnames.end();
717 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
719 if ( lookForMatch (messageIDs, *
i) )
continue;
720 if ( (*
i) ==
"default" )
continue;
721 if ( (*
i) ==
"ERROR" )
continue;
722 if ( (*
i) ==
"WARNING" )
continue;
723 if ( (*
i) ==
"INFO" )
continue;
724 if ( (*
i) ==
"DEBUG" )
continue;
726 bool ok_optionalPSet =
false;
736 if (ok_optionalPSet)
continue;
737 flaws << psetName <<
" PSet: \n" 738 << *
i <<
" is an unrecognized name for a PSet in this context \n";
744 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
745 flaws << psetName <<
" PSet: \n" 746 <<
"PSet " << *
i <<
" is tracked - not allowed\n";
755 categoryPSet (pset, psetName,
"ERROR" );
756 categoryPSet (pset, psetName,
"WARNING");
757 categoryPSet (pset, psetName,
"INFO" ) ;
758 categoryPSet (pset, psetName,
"DEBUG" );
759 if (psetName !=
"MessageLogger") categoryPSet (pset, psetName,
"default");
762 std::vector<std::string>::const_iterator
end =
categories.end();
763 for (std::vector<std::string>::const_iterator
i =
categories.begin();
765 categoryPSet(pset, psetName, *
i);
775 flaws << OuterPsetName <<
" PSet: \n" 776 <<
"Category PSet " << categoryName
777 <<
" is tracked - not allowed\n";
783 catInts ( c, psetName, categoryName );
784 catNone <unsigned int> (
c, psetName, categoryName,
"unsigned int" );
785 catBoolRestriction ( c, psetName, categoryName,
"bool" );
786 catNone <float> (
c, psetName, categoryName,
"float" );
787 catNone <double> (
c, psetName, categoryName,
"double" );
788 catNone <std::string> (
c, psetName, categoryName,
"string" );
789 catNone <vString> (
c, psetName, categoryName,
"vSting" );
790 catNoPSets ( c, psetName, categoryName );
800 vString::const_iterator
end = x.end();
801 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
802 if ( *
i ==
"limit" )
continue;
803 if ( *
i ==
"reportEvery" )
continue;
804 if ( *
i ==
"timespan" )
continue;
805 flaws << categoryName <<
" category PSet nested in " 806 << psetName <<
" PSet: \n" 807 << (*i) <<
" is not an allowed parameter within a category PSet \n";
811 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
812 flaws << categoryName <<
" category PSet nested in " 813 << psetName <<
" PSet: \n" 814 << (*i) <<
" is used as a tracked int \n" 815 <<
"Tracked parameters not allowed here \n";
827 vString::const_iterator
end = psnames.end();
828 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
829 flaws << categoryName <<
" category PSet nested in " 830 << psetName <<
" PSet: \n" 831 << *
i <<
" is used as a PSet\n" 832 <<
"PSets not allowed within a category PSet\n";
838 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
839 flaws << categoryName <<
" category PSet nested in " 840 << psetName <<
" PSet: \n" 841 << *
i <<
" is used as a tracked PSet\n" 842 <<
"tracked parameters not permitted, and " 843 <<
"PSets not allowed within a category PSet\n";
856 vString::const_iterator
end = x.end();
857 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
858 if ( ((*
i) ==
"placeholder") || ((*i) ==
"optionalPSet") )
continue;
859 flaws << categoryName <<
" category PSet nested in " 860 << psetName <<
" PSet: \n" 861 << (*i) <<
" is used as a " << type <<
"\n" 862 <<
"Usage of " << type <<
" is not recognized here\n";
866 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
867 flaws << categoryName <<
" category PSet nested in " 868 << psetName <<
" PSet: \n" 869 << (*i) <<
" is used as a tracked " << type <<
"\n" 870 <<
"Tracked parameters not allowed here, " 871 <<
" and even untracked it would not be recognized\n";
void psetLists(ParameterSet const &pset)
T getUntrackedParameter(std::string const &, T const &) const
void statisticsPSet(ParameterSet const &pset, std::string const &psetName)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool lookForMatch(vString const &v, std::string const &s)
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
bool wildcard(vString const &v)
void destinationPSet(ParameterSet const &pset, std::string const &psetName)
void vStringsCheck(ParameterSet const &pset, std::string const &psetName)
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< String > vString
void noCoutCerrClash(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
void fwkJobReportPSet(ParameterSet const &pset, std::string const &psetName)
void noKeywords(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void noDuplicates(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void catNoPSets(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
bool keywordCheck(std::string const &word)
void noBadParams(vString const &v, vString const ¶ms, std::string const &psetName, std::string const ¶meterLabel, std::string const &type)
void noNonPSetUsage(ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void destinationPSets(ParameterSet const &pset)
void noOtherPsets(ParameterSet const &pset)
bool checkThreshold(std::string const &thresh)
std::string operator()(ParameterSet const &pset)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
bool allowedVstring(std::string const &s)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void catBoolRestriction(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
void statisticsPSets(ParameterSet const &pset)
void categoryPSet(ParameterSet const &pset, std::string const &OuterPsetName, std::string const &categoryName)
void catInts(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
void messageLoggerPSet(ParameterSet const &pset)
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
void defaultPSet(ParameterSet const &main_pset)
void fwkJobReportPSets(ParameterSet const &pset)
void suppressionLists(ParameterSet const &pset)