CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::service::MessageServicePSetValidation Class Reference

#include <MessageServicePSetValidation.h>

Public Member Functions

std::string operator() (ParameterSet const &pset)
 

Private Types

typedef std::string String
 
typedef std::vector< StringvString
 

Private Member Functions

bool allowedVstring (std::string const &s)
 
void catBoolRestriction (ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
 
void categoryPSet (ParameterSet const &pset, std::string const &OuterPsetName, std::string const &categoryName)
 
void categoryPSets (ParameterSet const &pset, std::string const &psetName)
 
void catInts (ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
 
template<typename T >
void catNone (ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
 
void catNoPSets (ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
 
template<typename T >
T check (ParameterSet const &pset, std::string const &psetName, std::string const &parameterLabel)
 
bool checkThreshold (std::string const &thresh)
 
void defaultPSet (ParameterSet const &main_pset)
 
void destinationPSet (ParameterSet const &pset, std::string const &psetName)
 
void destinationPSets (ParameterSet const &pset)
 
template<typename T >
void disallowedParam (ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const &parameterLabel, std::string const &type)
 
void fwkJobReportPSet (ParameterSet const &pset, std::string const &psetName)
 
void fwkJobReportPSets (ParameterSet const &pset)
 
bool keywordCheck (std::string const &word)
 
bool lookForMatch (vString const &v, std::string const &s)
 
void messageLoggerPSet (ParameterSet const &pset)
 
void noBadParams (vString const &v, vString const &params, std::string const &psetName, std::string const &parameterLabel, std::string const &type)
 
void noCoutCerrClash (vString const &v, std::string const &psetName, std::string const &parameterLabel)
 
void noDuplicates (vString const &v, std::string const &psetName, std::string const &parameterLabel)
 
void noDuplicates (vString const &v1, vString const &v2, std::string const &psetName, std::string const &p1, std::string const &p2)
 
void noKeywords (vString const &v, std::string const &psetName, std::string const &parameterLabel)
 
template<typename T >
void noneExcept (ParameterSet const &pset, std::string const &psetName, std::string const &type)
 
template<typename T >
void noneExcept (ParameterSet const &pset, std::string const &psetName, std::string const &type, std::string const &ok)
 
template<typename T >
void noneExcept (ParameterSet const &pset, std::string const &psetName, std::string const &type, T const &ok1, T const &ok2)
 
template<typename T >
void noneExcept (ParameterSet const &pset, std::string const &psetName, std::string const &type, vString const &vok)
 
void noNoncategoryPsets (ParameterSet const &pset, std::string const &psetName)
 
void noNonPSetUsage (ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const &parameterLabel)
 
void noOtherPsets (ParameterSet const &pset)
 
void psetLists (ParameterSet const &pset)
 
void statisticsPSet (ParameterSet const &pset, std::string const &psetName)
 
void statisticsPSets (ParameterSet const &pset)
 
void suppressionLists (ParameterSet const &pset)
 
bool validateThreshold (std::string const &thresh, std::string const &psetName)
 
void vStringsCheck (ParameterSet const &pset, std::string const &psetName)
 
bool wildcard (vString const &v)
 

Private Attributes

std::vector< std::string > categories
 
std::vector< std::string > debugModules
 
std::vector< std::string > destinations
 
std::ostringstream flaws
 
std::vector< std::string > fwkJobReports
 
std::vector< std::string > messageIDs
 
std::vector< std::string > statistics
 
std::vector< std::string > suppressDebug
 
std::vector< std::string > suppressError
 
std::vector< std::string > suppressInfo
 
std::vector< std::string > suppressWarning
 

Detailed Description

Definition at line 42 of file MessageServicePSetValidation.h.

Member Typedef Documentation

Definition at line 47 of file MessageServicePSetValidation.h.

Definition at line 48 of file MessageServicePSetValidation.h.

Member Function Documentation

bool edm::service::MessageServicePSetValidation::allowedVstring ( std::string const &  s)
private

Definition at line 201 of file MessageServicePSetValidation.cc.

201  {
202  if (s == "destinations")
203  return true;
204  if (s == "statistics")
205  return true;
206  if (s == "destinations")
207  return true;
208  if (s == "fwkJobReports")
209  return true;
210  if (s == "categories")
211  return true;
212  if (s == "messageIDs")
213  return true;
214  if (s == "debugModules")
215  return true;
216  if (s == "suppressInfo")
217  return true;
218  if (s == "suppressDebug")
219  return true;
220  if (s == "suppressWarning")
221  return true;
222  if (s == "suppressError")
223  return true;
224  return false;
225  } // allowedVstring
void edm::service::MessageServicePSetValidation::catBoolRestriction ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  categoryName,
std::string const &  type 
)
private

Definition at line 797 of file MessageServicePSetValidation.cc.

References end, edm::ParameterSet::getParameterNamesForType(), and mps_fire::i.

800  {
801  vString x = pset.getParameterNamesForType<bool>(false);
802  vString::const_iterator end = x.end();
803  for (vString::const_iterator i = x.begin(); i != end; ++i) {
804  if (((*i) == "placeholder") || ((*i) == "optionalPSet"))
805  continue;
806  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
807  << (*i) << " is used as a " << type << "\n"
808  << "Usage of " << type << " is not recognized here\n";
809  }
810  x = pset.getParameterNamesForType<bool>(true);
811  end = x.end();
812  for (vString::const_iterator i = x.begin(); i != end; ++i) {
813  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
814  << (*i) << " is used as a tracked " << type << "\n"
815  << "Tracked parameters not allowed here, "
816  << " and even untracked it would not be recognized\n";
817  }
818  } // catBoolRestriction()
type
Definition: HCALResponse.h:21
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::categoryPSet ( ParameterSet const &  pset,
std::string const &  OuterPsetName,
std::string const &  categoryName 
)
private

Definition at line 728 of file MessageServicePSetValidation.cc.

References EnergyCorrector::c, edm::ParameterSet::existsAs(), edm::ParameterSet::getUntrackedParameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

730  {
731  if (pset.existsAs<ParameterSet>(categoryName, true)) {
732  flaws << OuterPsetName << " PSet: \n"
733  << "Category PSet " << categoryName << " is tracked - not allowed\n";
734  return;
735  }
736  ParameterSet empty_PSet;
737  ParameterSet const& c = pset.getUntrackedParameterSet(categoryName, empty_PSet);
738  std::string const& psetName(OuterPsetName);
739  catInts(c, psetName, categoryName);
740  catNone<unsigned int>(c, psetName, categoryName, "unsigned int");
741  catBoolRestriction(c, psetName, categoryName, "bool");
742  catNone<float>(c, psetName, categoryName, "float");
743  catNone<double>(c, psetName, categoryName, "double");
744  catNone<std::string>(c, psetName, categoryName, "string");
745  catNone<vString>(c, psetName, categoryName, "vSting");
746  catNoPSets(c, psetName, categoryName);
747  } // categoryPSet
void catNoPSets(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
void catBoolRestriction(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
void catInts(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
void edm::service::MessageServicePSetValidation::categoryPSets ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 712 of file MessageServicePSetValidation.cc.

References myMessageLogger_cff::categories, end, and mps_fire::i.

713  {
714  categoryPSet(pset, psetName, "ERROR");
715  categoryPSet(pset, psetName, "WARNING");
716  categoryPSet(pset, psetName, "INFO");
717  categoryPSet(pset, psetName, "DEBUG");
718  if (psetName != "MessageLogger")
719  categoryPSet(pset, psetName, "default");
720  // The above conditional is because default in the main level is treated
721  // as a set of defaults differnt from those of a simple category.
722  std::vector<std::string>::const_iterator end = categories.end();
723  for (std::vector<std::string>::const_iterator i = categories.begin(); i != end; ++i) {
724  categoryPSet(pset, psetName, *i);
725  }
726  } // categoryPSets
#define end
Definition: vmac.h:39
void categoryPSet(ParameterSet const &pset, std::string const &OuterPsetName, std::string const &categoryName)
void edm::service::MessageServicePSetValidation::catInts ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  categoryName 
)
private

Definition at line 749 of file MessageServicePSetValidation.cc.

References end, edm::ParameterSet::getParameterNamesForType(), and mps_fire::i.

751  {
752  vString x = pset.getParameterNamesForType<int>(false);
753  vString::const_iterator end = x.end();
754  for (vString::const_iterator i = x.begin(); i != end; ++i) {
755  if (*i == "limit")
756  continue;
757  if (*i == "reportEvery")
758  continue;
759  if (*i == "timespan")
760  continue;
761  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
762  << (*i) << " is not an allowed parameter within a category PSet \n";
763  }
764  x = pset.getParameterNamesForType<int>(true);
765  end = x.end();
766  for (vString::const_iterator i = x.begin(); i != end; ++i) {
767  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
768  << (*i) << " is used as a tracked int \n"
769  << "Tracked parameters not allowed here \n";
770  }
771  } // catInts()
#define end
Definition: vmac.h:39
template<typename T >
void edm::service::MessageServicePSetValidation::catNone ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  categoryName,
std::string const &  type 
)
inlineprivate

Definition at line 235 of file MessageServicePSetValidation.h.

References end, flaws, and mps_fire::i.

238  {
239  vString x = pset.template getParameterNamesForType<T>(false);
240  vString::const_iterator end = x.end();
241  for (vString::const_iterator i = x.begin(); i != end; ++i) {
242  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
243  << (*i) << " is used as a " << type << "\n"
244  << "Usage of " << type << " is not recognized here\n";
245  }
246  x = pset.template getParameterNamesForType<T>(true);
247  end = x.end();
248  for (vString::const_iterator i = x.begin(); i != end; ++i) {
249  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
250  << (*i) << " is used as a tracked " << type << "\n"
251  << "Tracked parameters not allowed here, "
252  << " and even untracked it would not be recognized\n";
253  }
254  } // catNone()
type
Definition: HCALResponse.h:21
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::catNoPSets ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  categoryName 
)
private

Definition at line 773 of file MessageServicePSetValidation.cc.

References end, edm::ParameterSet::getParameterSetNames(), mps_fire::i, and gen::n.

775  {
776  vString psnames;
777  pset.getParameterSetNames(psnames, false);
778  vString::const_iterator end = psnames.end();
779  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
780  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
781  << *i << " is used as a PSet\n"
782  << "PSets not allowed within a category PSet\n";
783  }
784  psnames.clear();
785  unsigned int n = pset.getParameterSetNames(psnames, true);
786  if (n > 0) {
787  end = psnames.end();
788  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
789  flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n"
790  << *i << " is used as a tracked PSet\n"
791  << "tracked parameters not permitted, and "
792  << "PSets not allowed within a category PSet\n";
793  }
794  }
795  } // catNoPSets
#define end
Definition: vmac.h:39
template<typename T >
T edm::service::MessageServicePSetValidation::check ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  parameterLabel 
)
inlineprivate

Definition at line 96 of file MessageServicePSetValidation.h.

References MillePedeFileConverter_cfg::e, edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), flaws, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), heppy_batch::val, and cms::Exception::what().

96  {
97  T val = T();
98  try {
99  if (!pset.exists(parameterLabel))
100  return val;
101  if (pset.existsAs<T>(parameterLabel, false)) {
102  val = pset.getUntrackedParameter<T>(parameterLabel, val);
103  return val;
104  }
105  if (pset.existsAs<T>(parameterLabel, true)) {
106  flaws << psetName << " PSet: \n" << parameterLabel << " is declared as tracked - needs to be untracked \n";
107  val = pset.getParameter<T>(parameterLabel);
108  } else {
109  flaws << psetName << " PSet: \n" << parameterLabel << " is declared with incorrect type \n";
110  }
111  return val;
112  } catch (cms::Exception& e) {
113  flaws << psetName << " PSet: \n"
114  << parameterLabel << " is declared but causes an exception when processed: \n"
115  << e.what() << "\n";
116  return val;
117  }
118  } // check()
char const * what() const override
Definition: Exception.cc:103
long double T
bool edm::service::MessageServicePSetValidation::checkThreshold ( std::string const &  thresh)
private

Definition at line 236 of file MessageServicePSetValidation.cc.

236  {
237  if (thresh == "WARNING")
238  return true;
239  if (thresh == "INFO")
240  return true;
241  if (thresh == "ERROR")
242  return true;
243  if (thresh == "DEBUG")
244  return true;
245  return false;
246  }
void edm::service::MessageServicePSetValidation::defaultPSet ( ParameterSet const &  main_pset)
private

Definition at line 516 of file MessageServicePSetValidation.cc.

References edm::ParameterSet::getUntrackedParameterSet(), muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, and scrapingFilter_cfi::thresh.

516  {
517  ParameterSet empty_PSet;
518  ParameterSet const& pset = main_pset.getUntrackedParameterSet("default", empty_PSet);
519  std::string psetName = "default (at MessageLogger main level)";
520 
521  // Category PSets
522 
523  categoryPSets(pset, psetName);
524 
525  // No other PSets -- unless they contain optionalPSet or placeholder=True
526 
527  noNoncategoryPsets(pset, psetName);
528 
529  // Parameters applying to the default category
530 
531  catInts(pset, psetName, "default");
532 
533  // General parameters
534 
535  check<bool>(pset, psetName, "placeholder");
536  std::string thresh = check<std::string>(pset, "psetName", "threshold");
537  if (!thresh.empty())
538  validateThreshold(thresh, psetName);
539  check<bool>(pset, psetName, "noLineBreaks");
540  check<int>(pset, psetName, "limit");
541  check<int>(pset, psetName, "reportEvery");
542  check<int>(pset, psetName, "timespan");
543  check<int>(pset, psetName, "lineLength");
544  check<bool>(pset, psetName, "noTimeStamps");
545 
546  // No other parameters
547  vString okint;
548  okint.push_back("limit");
549  okint.push_back("reportEvery");
550  okint.push_back("timespan");
551  okint.push_back("lineLength");
552  noneExcept<int>(pset, psetName, "int", okint);
553  vString okbool;
554  okbool.push_back("placeholder");
555  okbool.push_back("optionalPSet");
556  okbool.push_back("noLineBreaks");
557  okbool.push_back("noTimeStamps");
558  noneExcept<bool>(pset, psetName, "bool", okbool);
559  vString okstring;
560  okstring.push_back("threshold");
561  noneExcept<std::string>(pset, psetName, "string", okstring);
562 
563  } // defaultPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void catInts(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
void edm::service::MessageServicePSetValidation::destinationPSet ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 468 of file MessageServicePSetValidation.cc.

References muonDTDigis_cfi::pset, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and scrapingFilter_cfi::thresh.

469  {
470  // Category PSets
471 
472  categoryPSets(pset, psetName);
473 
474  // No other PSets -- unless they contain optionalPSet or placeholder=True
475 
476  noNoncategoryPsets(pset, psetName);
477 
478  // General parameters
479 
480  check<bool>(pset, psetName, "placeholder");
481  std::string thresh = check<std::string>(pset, "psetName", "threshold");
482  if (!thresh.empty())
483  validateThreshold(thresh, psetName);
484  check<bool>(pset, psetName, "noLineBreaks");
485  check<int>(pset, psetName, "lineLength");
486  check<bool>(pset, psetName, "noTimeStamps");
487  std::string s = check<std::string>(pset, "psetName", "filename");
488  if ((s == "cerr") || (s == "cout")) {
489  flaws << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n";
490  }
491  s = check<std::string>(pset, "psetName", "extension");
492  if ((s == "cerr") || (s == "cout")) {
493  flaws << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n";
494  }
495  s = check<std::string>(pset, "psetName", "output");
496 
497  // No other parameters
498 
499  noneExcept<int>(pset, psetName, "int", "lineLength");
500 
501  vString okbool;
502  okbool.push_back("placeholder");
503  okbool.push_back("optionalPSet");
504  okbool.push_back("noLineBreaks");
505  okbool.push_back("noTimeStamps");
506  noneExcept<bool>(pset, psetName, "bool", okbool);
507  vString okstring;
508  okstring.push_back("threshold");
509  okstring.push_back("output");
510  okstring.push_back("filename");
511  okstring.push_back("extension");
512  noneExcept<std::string>(pset, psetName, "string", okstring);
513 
514  } // destinationPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void edm::service::MessageServicePSetValidation::destinationPSets ( ParameterSet const &  pset)
private

Definition at line 459 of file MessageServicePSetValidation.cc.

References edmIntegrityCheck::d, myMessageLogger_cff::destinations, end, edm::ParameterSet::getUntrackedParameterSet(), and mps_fire::i.

459  {
460  ParameterSet empty_PSet;
461  std::vector<std::string>::const_iterator end = destinations.end();
462  for (std::vector<std::string>::const_iterator i = destinations.begin(); i != end; ++i) {
463  ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet);
464  destinationPSet(d, *i);
465  }
466  } // destinationPSets
void destinationPSet(ParameterSet const &pset, std::string const &psetName)
#define end
Definition: vmac.h:39
template<typename T >
void edm::service::MessageServicePSetValidation::disallowedParam ( ParameterSet const &  pset,
vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel,
std::string const &  type 
)
inlineprivate

Definition at line 121 of file MessageServicePSetValidation.h.

References edm::ParameterSet::getParameterNamesForType(), and noBadParams().

125  {
126  vString params = pset.getParameterNamesForType<T>(true);
127  noBadParams(v, params, psetName, parameterLabel, type);
128  params = pset.getParameterNamesForType<T>(false);
129  noBadParams(v, params, psetName, parameterLabel, type);
130  } // disallowedParam()
type
Definition: HCALResponse.h:21
void noBadParams(vString const &v, vString const &params, std::string const &psetName, std::string const &parameterLabel, std::string const &type)
long double T
void edm::service::MessageServicePSetValidation::fwkJobReportPSet ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 630 of file MessageServicePSetValidation.cc.

References muonDTDigis_cfi::pset, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

631  {
632  // Category PSets
633 
634  categoryPSets(pset, psetName);
635 
636  // No other PSets -- unless they contain optionalPSet or placeholder=True
637 
638  noNoncategoryPsets(pset, psetName);
639 
640  // General parameters
641 
642  check<bool>(pset, psetName, "placeholder");
643  std::string s = check<std::string>(pset, "psetName", "filename");
644  if ((s == "cerr") || (s == "cout")) {
645  flaws << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n";
646  }
647  s = check<std::string>(pset, "psetName", "extension");
648  if ((s == "cerr") || (s == "cout")) {
649  flaws << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n";
650  }
651  s = check<std::string>(pset, "psetName", "output");
652 
653  // No other parameters
654 
655  noneExcept<int>(pset, psetName, "int");
656 
657  vString okbool;
658  okbool.push_back("placeholder");
659  okbool.push_back("optionalPSet");
660  noneExcept<bool>(pset, psetName, "bool", okbool);
661  vString okstring;
662  okstring.push_back("output");
663  okstring.push_back("filename");
664  okstring.push_back("extension");
665  noneExcept<std::string>(pset, psetName, "string", okstring);
666 
667  } // fwkJobReportPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void edm::service::MessageServicePSetValidation::fwkJobReportPSets ( ParameterSet const &  pset)
private

Definition at line 621 of file MessageServicePSetValidation.cc.

References edmIntegrityCheck::d, end, MessageLogger_cfi::fwkJobReports, edm::ParameterSet::getUntrackedParameterSet(), and mps_fire::i.

621  {
622  ParameterSet empty_PSet;
623  std::vector<std::string>::const_iterator end = fwkJobReports.end();
624  for (std::vector<std::string>::const_iterator i = fwkJobReports.begin(); i != end; ++i) {
625  ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet);
626  fwkJobReportPSet(d, *i);
627  }
628  } // fwkJobReportPSets
void fwkJobReportPSet(ParameterSet const &pset, std::string const &psetName)
#define end
Definition: vmac.h:39
bool edm::service::MessageServicePSetValidation::keywordCheck ( std::string const &  word)
private

Definition at line 309 of file MessageServicePSetValidation.cc.

309  {
310  if (word == "default")
311  return false;
312  if (word == "categories")
313  return false;
314  if (word == "messageIDs")
315  return false;
316  if (word == "fwkJobReports")
317  return false;
318  if (word == "destinations")
319  return false;
320  if (word == "statistics")
321  return false;
322  if (word == "debugModules")
323  return false;
324  if (word == "suppressInfo")
325  return false;
326  if (word == "suppressDebug")
327  return false;
328  if (word == "suppressWarning")
329  return false;
330  if (word == "suppressError")
331  return false;
332  if (word == "threshold")
333  return false;
334  if (word == "ERROR")
335  return false;
336  if (word == "WARNING")
337  return false;
338  if (word == "INFO")
339  return false;
340  if (word == "DEBUG")
341  return false;
342  if (word == "placeholder")
343  return false;
344  if (word == "limit")
345  return false;
346  if (word == "reportEvery")
347  return false;
348  if (word == "timespan")
349  return false;
350  if (word == "noLineBreaks")
351  return false;
352  if (word == "lineLength")
353  return false;
354  if (word == "noTimeStamps")
355  return false;
356  if (word == "output")
357  return false;
358  if (word == "filename")
359  return false;
360  if (word == "extension")
361  return false;
362  if (word == "reset")
363  return false;
364  if (word == "optionalPSet")
365  return false;
366  return true;
367  } // keywordCheck
bool edm::service::MessageServicePSetValidation::lookForMatch ( vString const &  v,
std::string const &  s 
)
private

Definition at line 453 of file MessageServicePSetValidation.cc.

References begin, end, and spr::find().

453  {
454  vString::const_iterator begin = v.begin();
455  vString::const_iterator end = v.end();
456  return (std::find(begin, end, s) != end);
457  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
void edm::service::MessageServicePSetValidation::messageLoggerPSet ( ParameterSet const &  pset)
private

Definition at line 35 of file MessageServicePSetValidation.cc.

References muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, and scrapingFilter_cfi::thresh.

35  {
36  // Four types of material are allowed at the MessageLogger level:
37  // PSet lists (such as destinations or categories
38  // Suppression lists, such as SuppressInfo or debugModules
39  // General parameters, such as threshold or messageSummaryToJobReport
40  // Nested PSets, such as those for each destination
41 
42  // PSet lists
43 
44  psetLists(pset);
45 
46  // Suppression lists
47 
49 
50  // No other vstrings
51 
52  vStringsCheck(pset, "MessageLogger");
53 
54  // General Parameters
55 
56  check<bool>(pset, "MessageLogger", "messageSummaryToJobReport");
57  std::string dumps = check<std::string>(pset, "MessageLogger", "generate_preconfiguration_message");
58  std::string thresh = check<std::string>(pset, "MessageLogger", "threshold");
59  if (!thresh.empty())
60  validateThreshold(thresh, "MessageLogger");
61  check<unsigned int>(pset, "MessageLogger", "waiting_threshold");
62 
63  // Nested PSets
64 
65  destinationPSets(pset);
66  defaultPSet(pset);
67  statisticsPSets(pset);
68  fwkJobReportPSets(pset);
69  categoryPSets(pset, "MessageLogger");
70 
71  // No other PSets -- unless they contain optionalPSet or placeholder=True
72 
73  noOtherPsets(pset);
74 
75  // Nothing else -- look for int, unsigned int, bool, float, double, string
76 
77  noneExcept<int>(pset, "MessageLogger", "int");
78  noneExcept<unsigned int>(pset, "MessageLogger", "unsigned int", "waiting_threshold");
79  noneExcept<bool>(pset, "MessageLogger", "bool", "messageSummaryToJobReport");
80  // Note - at this, the upper MessageLogger PSet level, the use of
81  // optionalPSet makes no sense, so we are OK letting that be a flaw
82  noneExcept<float>(pset, "MessageLogger", "float");
83  noneExcept<double>(pset, "MessageLogger", "double");
84  noneExcept<std::string>(pset, "MessageLogger", "string", "threshold", "generate_preconfiguration_message");
85 
86  // Append explanatory information if flaws were found
87 
88  if (!flaws.str().empty()) {
89  flaws << "\nThe above are from MessageLogger configuration validation.\n"
90  << "In most cases, these involve lines that the logger configuration code\n"
91  << "would not process, but which the cfg creator obviously meant to have "
92  << "effect.\n";
93  }
94 
95  } // messageLoggerPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
void vStringsCheck(ParameterSet const &pset, std::string const &psetName)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
void edm::service::MessageServicePSetValidation::noBadParams ( vString const &  v,
vString const &  params,
std::string const &  psetName,
std::string const &  parameterLabel,
std::string const &  type 
)
private

Definition at line 382 of file MessageServicePSetValidation.cc.

References mps_fire::i.

Referenced by disallowedParam().

386  {
387  vString::const_iterator end1 = v.end();
388  vString::const_iterator end2 = params.end();
389  for (vString::const_iterator i = v.begin(); i != end1; ++i) {
390  for (vString::const_iterator j = params.begin(); j != end2; ++j) {
391  if (*i == *j) {
392  flaws << psetName << " PSet: \n"
393  << *i << " (listed in vstring " << parameterLabel << ")\n"
394  << "is used as a parameter of type " << type << " instead of as a PSet \n";
395  }
396  }
397  }
398 
399  } // noBadParams
type
Definition: HCALResponse.h:21
void edm::service::MessageServicePSetValidation::noCoutCerrClash ( vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 279 of file MessageServicePSetValidation.cc.

References end, and mps_fire::i.

281  {
282  vString::const_iterator end = v.end();
283  bool coutPresent = false;
284  bool cerrPresent = false;
285  for (vString::const_iterator i = v.begin(); i != end; ++i) {
286  if (*i == "cout")
287  coutPresent = true;
288  if (*i == "cerr")
289  cerrPresent = true;
290  }
291  if (coutPresent && cerrPresent) {
292  flaws << psetName << " PSet: \n"
293  << "vString " << parameterLabel << " has both cout and cerr \n";
294  }
295  } // noCoutCerrClash(v)
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::noDuplicates ( vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 248 of file MessageServicePSetValidation.cc.

References end, and mps_fire::i.

250  {
251  vString::const_iterator end = v.end();
252  for (vString::const_iterator i = v.begin(); i != end; ++i) {
253  for (vString::const_iterator j = i + 1; j != end; ++j) {
254  if (*i == *j) {
255  flaws << psetName << " PSet: \n"
256  << "in vString " << parameterLabel << " duplication of the string " << *i << "\n";
257  }
258  }
259  }
260  } // noDuplicates(v)
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::noDuplicates ( vString const &  v1,
vString const &  v2,
std::string const &  psetName,
std::string const &  p1,
std::string const &  p2 
)
private

Definition at line 262 of file MessageServicePSetValidation.cc.

References mps_fire::i.

266  {
267  vString::const_iterator end1 = v1.end();
268  vString::const_iterator end2 = v2.end();
269  for (vString::const_iterator i = v1.begin(); i != end1; ++i) {
270  for (vString::const_iterator j = v2.begin(); j != end2; ++j) {
271  if (*i == *j) {
272  flaws << psetName << " PSet: \n"
273  << "in vStrings " << p1 << " and " << p2 << " duplication of the string " << *i << "\n";
274  }
275  }
276  }
277  } // noDuplicates(v1,v2)
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
void edm::service::MessageServicePSetValidation::noKeywords ( vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 297 of file MessageServicePSetValidation.cc.

References end, and mps_fire::i.

299  {
300  vString::const_iterator end = v.end();
301  for (vString::const_iterator i = v.begin(); i != end; ++i) {
302  if (!keywordCheck(*i)) {
303  flaws << psetName << " PSet: \n"
304  << "vString " << parameterLabel << " should not contain the keyword " << *i << "\n";
305  }
306  }
307  } // noKeywords(v)
#define end
Definition: vmac.h:39
template<typename T >
void edm::service::MessageServicePSetValidation::noneExcept ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  type 
)
inlineprivate

Definition at line 133 of file MessageServicePSetValidation.h.

References end, flaws, and mps_fire::i.

133  {
134  vString x = pset.template getParameterNamesForType<T>(false);
135  vString::const_iterator end = x.end();
136  for (vString::const_iterator i = x.begin(); i != end; ++i) {
137  flaws << psetName << " PSet: \n"
138  << (*i) << " is used as a " << type << "\n"
139  << "Usage of " << type << " is not recognized here\n";
140  }
141  x = pset.template getParameterNamesForType<T>(true);
142  end = x.end();
143  for (vString::const_iterator i = x.begin(); i != end; ++i) {
144  if ((*i) == "@service_type")
145  continue;
146  flaws << psetName << " PSet: \n"
147  << (*i) << " is used as a tracked " << type << "\n"
148  << "Tracked parameters not allowed here, "
149  << " and even untracked it would not be recognized\n";
150  }
151  } // noneExcept()
type
Definition: HCALResponse.h:21
#define end
Definition: vmac.h:39
template<typename T >
void edm::service::MessageServicePSetValidation::noneExcept ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  type,
std::string const &  ok 
)
inlineprivate

Definition at line 154 of file MessageServicePSetValidation.h.

References end, flaws, mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and heppy_batch::val.

157  {
158  vString x = pset.template getParameterNamesForType<T>(false);
159  vString::const_iterator end = x.end();
160  for (vString::const_iterator i = x.begin(); i != end; ++i) {
161  std::string val = (*i);
162  if (val != ok) {
163  flaws << psetName << " PSet: \n"
164  << val << " is used as a " << type << "\n"
165  << "This usage is not recognized in this type of PSet\n";
166  }
167  }
168  x = pset.template getParameterNamesForType<T>(true);
169  end = x.end();
170  for (vString::const_iterator i = x.begin(); i != end; ++i) {
171  if ((*i) == "@service_type")
172  continue;
173  flaws << psetName << " PSet: \n"
174  << (*i) << " is used as a tracked " << type << "\n"
175  << "Tracked parameters not allowed here\n";
176  }
177  } // noneExcept(okValue)
type
Definition: HCALResponse.h:21
#define end
Definition: vmac.h:39
template<typename T >
void edm::service::MessageServicePSetValidation::noneExcept ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  type,
T const &  ok1,
T const &  ok2 
)
inlineprivate

Definition at line 180 of file MessageServicePSetValidation.h.

References end, flaws, mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and heppy_batch::val.

181  {
182  vString x = pset.template getParameterNamesForType<T>(false);
183  vString::const_iterator end = x.end();
184  for (vString::const_iterator i = x.begin(); i != end; ++i) {
185  std::string val = (*i);
186  if ((val != ok1) && (val != ok2)) {
187  flaws << psetName << " PSet: \n"
188  << val << " is used as a " << type << "\n"
189  << "This usage is not recognized in this type of PSet\n";
190  }
191  }
192  x = pset.template getParameterNamesForType<T>(true);
193  end = x.end();
194  for (vString::const_iterator i = x.begin(); i != end; ++i) {
195  if ((*i) == "@service_type")
196  continue;
197  flaws << psetName << " PSet: \n"
198  << (*i) << " is used as a tracked " << type << "\n"
199  << "Tracked parameters not allowed here\n";
200  }
201  } // noneExcept(okValue1, okValue2)
type
Definition: HCALResponse.h:21
#define end
Definition: vmac.h:39
template<typename T >
void edm::service::MessageServicePSetValidation::noneExcept ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  type,
vString const &  vok 
)
inlineprivate

Definition at line 204 of file MessageServicePSetValidation.h.

References end, flaws, runEdmFileComparison::found, mps_fire::i, and vend.

207  {
208  vString x = pset.template getParameterNamesForType<T>(false);
209  vString::const_iterator end = x.end();
210  vString::const_iterator vend = vok.end();
211  for (vString::const_iterator i = x.begin(); i != end; ++i) {
212  bool found = false;
213  for (vString::const_iterator vit = vok.begin(); vit != vend; ++vit) {
214  if (*i == *vit)
215  found = true;
216  }
217  if (!found) {
218  flaws << psetName << " PSet: \n"
219  << *i << " is used as a " << type << "\n"
220  << "This usage is not recognized in this type of PSet\n";
221  }
222  }
223  x = pset.template getParameterNamesForType<T>(true);
224  end = x.end();
225  for (vString::const_iterator i = x.begin(); i != end; ++i) {
226  if ((*i) == "@service_type")
227  continue;
228  flaws << psetName << " PSet: \n"
229  << (*i) << " is used as a tracked " << type << "\n"
230  << "Tracked parameters not allowed here\n";
231  }
232  } // noneExcept(vok)
type
Definition: HCALResponse.h:21
#define vend()
Definition: vmac.h:43
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::noNoncategoryPsets ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 669 of file MessageServicePSetValidation.cc.

References myMessageLogger_cff::categories, MillePedeFileConverter_cfg::e, end, edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), mps_fire::i, and gen::n.

670  {
671  vString psnames;
672  pset.getParameterSetNames(psnames, false);
673  vString::const_iterator end = psnames.end();
674  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
675  if (lookForMatch(categories, *i))
676  continue;
677  if (lookForMatch(messageIDs, *i))
678  continue;
679  if ((*i) == "default")
680  continue;
681  if ((*i) == "ERROR")
682  continue;
683  if ((*i) == "WARNING")
684  continue;
685  if ((*i) == "INFO")
686  continue;
687  if ((*i) == "DEBUG")
688  continue;
689  ParameterSet empty_PSet;
690  bool ok_optionalPSet = false;
691  try {
692  ParameterSet const& culprit = pset.getUntrackedParameterSet((*i), empty_PSet);
693  ok_optionalPSet = culprit.getUntrackedParameter<bool>("placeholder", ok_optionalPSet);
694  ok_optionalPSet = culprit.getUntrackedParameter<bool>("optionalPSet", ok_optionalPSet);
695  } catch (cms::Exception& e) {
696  }
697  if (ok_optionalPSet)
698  continue;
699  flaws << psetName << " PSet: \n" << *i << " is an unrecognized name for a PSet in this context \n";
700  }
701  psnames.clear();
702  unsigned int n = pset.getParameterSetNames(psnames, true);
703  if (n > 0) {
704  end = psnames.end();
705  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
706  flaws << psetName << " PSet: \n"
707  << "PSet " << *i << " is tracked - not allowed\n";
708  }
709  }
710  } // noNoncategoryPsets
T getUntrackedParameter(std::string const &, T const &) const
bool lookForMatch(vString const &v, std::string const &s)
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::noNonPSetUsage ( ParameterSet const &  pset,
vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 369 of file MessageServicePSetValidation.cc.

References muonDTDigis_cfi::pset, and findQualityFiles::v.

372  {
373  disallowedParam<int>(pset, v, psetName, parameterLabel, "int");
374  disallowedParam<unsigned int>(pset, v, psetName, parameterLabel, "uint");
375  disallowedParam<bool>(pset, v, psetName, parameterLabel, "bool");
376  disallowedParam<float>(pset, v, psetName, parameterLabel, "float");
377  disallowedParam<double>(pset, v, psetName, parameterLabel, "double");
378  disallowedParam<std::string>(pset, v, psetName, parameterLabel, "string");
379  disallowedParam<std::vector<std::string> >(pset, v, psetName, parameterLabel, "vstring");
380  } // noNonPSetUsage
void edm::service::MessageServicePSetValidation::noOtherPsets ( ParameterSet const &  pset)
private

Definition at line 410 of file MessageServicePSetValidation.cc.

References myMessageLogger_cff::categories, myMessageLogger_cff::destinations, MillePedeFileConverter_cfg::e, end, MessageLogger_cfi::fwkJobReports, edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), mps_fire::i, gen::n, and myMessageLogger_cff::statistics.

410  {
411  vString psnames;
412  pset.getParameterSetNames(psnames, false);
413  vString::const_iterator end = psnames.end();
414  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
415  if (lookForMatch(destinations, *i))
416  continue;
417  if (lookForMatch(statistics, *i))
418  continue;
420  continue;
421  if (lookForMatch(categories, *i))
422  continue;
423  if (lookForMatch(messageIDs, *i))
424  continue;
425  if ((*i) == "default")
426  continue;
427  ParameterSet empty_PSet;
428  bool ok_optionalPSet = false;
429  try {
430  ParameterSet const& culprit = pset.getUntrackedParameterSet((*i), empty_PSet);
431  ok_optionalPSet = culprit.getUntrackedParameter<bool>("placeholder", ok_optionalPSet);
432  ok_optionalPSet = culprit.getUntrackedParameter<bool>("optionalPSet", ok_optionalPSet);
433  } catch (cms::Exception& e) {
434  }
435  if (ok_optionalPSet)
436  continue;
437  flaws << "MessageLogger "
438  << " PSet: \n"
439  << *i << " is an unrecognized name for a PSet\n";
440  }
441  psnames.clear();
442  unsigned int n = pset.getParameterSetNames(psnames, true);
443  if (n > 0) {
444  end = psnames.end();
445  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
446  flaws << "MessageLogger "
447  << " PSet: \n"
448  << "PSet " << *i << " is tracked - not allowed\n";
449  }
450  }
451  }
T getUntrackedParameter(std::string const &, T const &) const
bool lookForMatch(vString const &v, std::string const &s)
#define end
Definition: vmac.h:39
std::string edm::service::MessageServicePSetValidation::operator() ( ParameterSet const &  pset)

Definition at line 30 of file MessageServicePSetValidation.cc.

30  {
32  return flaws.str();
33  } // operator() to validate the PSet passed in
void edm::service::MessageServicePSetValidation::psetLists ( ParameterSet const &  pset)
private

Definition at line 97 of file MessageServicePSetValidation.cc.

References myMessageLogger_cff::categories, myMessageLogger_cff::destinations, MessageLogger_cfi::fwkJobReports, muonDTDigis_cfi::pset, and myMessageLogger_cff::statistics.

97  {
98  destinations = check<vString>(pset, "MessageLogger", "destinations");
99  noDuplicates(destinations, "MessageLogger", "destinations");
100  noKeywords(destinations, "MessageLogger", "destinations");
101  noNonPSetUsage(pset, destinations, "MessageLogger", "destinations");
102  // REMOVED: noCoutCerrClash(destinations,"MessageLogger", "destinations");
103 
104  statistics = check<vString>(pset, "MessageLogger", "statistics");
105  noDuplicates(statistics, "MessageLogger", "statistics");
106  noKeywords(statistics, "MessageLogger", "statistics");
107  noNonPSetUsage(pset, statistics, "MessageLogger", "statistics");
108 
109  fwkJobReports = check<vString>(pset, "MessageLogger", "fwkJobReports");
110  noDuplicates(fwkJobReports, "MessageLogger", "fwkJobReports");
111  noKeywords(fwkJobReports, "MessageLogger", "fwkJobReports");
112  noNonPSetUsage(pset, fwkJobReports, "MessageLogger", "fwkJobReports");
113  noDuplicates(fwkJobReports, destinations, "MessageLogger", "fwkJobReports", "destinations");
114  noDuplicates(fwkJobReports, statistics, "MessageLogger", "fwkJobReports", "statistics");
115 
116  categories = check<vString>(pset, "MessageLogger", "categories");
117  noDuplicates(categories, "MessageLogger", "categories");
118  noKeywords(categories, "MessageLogger", "categories");
119  noNonPSetUsage(pset, categories, "MessageLogger", "categories");
120  noDuplicates(categories, destinations, "MessageLogger", "categories", "destinations");
121  noDuplicates(categories, statistics, "MessageLogger", "categories", "statistics");
122  noDuplicates(categories, fwkJobReports, "MessageLogger", "categories", "fwkJobReports");
123 
124  messageIDs = check<vString>(pset, "MessageLogger", "messageIDs");
125  noDuplicates(messageIDs, "MessageLogger", "messageIDs");
126  noKeywords(messageIDs, "MessageLogger", "messageIDs");
127  noNonPSetUsage(pset, messageIDs, "MessageLogger", "messageIDs");
128  noDuplicates(messageIDs, destinations, "MessageLogger", "messageIDs", "destinations");
129  noDuplicates(messageIDs, statistics, "MessageLogger", "messageIDs", "statistics");
130  noDuplicates(messageIDs, fwkJobReports, "MessageLogger", "messageIDs", "fwkJobReports");
131  noDuplicates(messageIDs, fwkJobReports, "MessageLogger", "messageIDs", "categories");
132 
133  } // psetLists
void noKeywords(vString const &v, std::string const &psetName, std::string const &parameterLabel)
void noDuplicates(vString const &v, std::string const &psetName, std::string const &parameterLabel)
void noNonPSetUsage(ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const &parameterLabel)
void edm::service::MessageServicePSetValidation::statisticsPSet ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 576 of file MessageServicePSetValidation.cc.

References muonDTDigis_cfi::pset, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and scrapingFilter_cfi::thresh.

577  {
578  // Category PSets
579 
580  categoryPSets(pset, psetName);
581 
582  // No other PSets -- unless they contain optionalPSet or placeholder=True
583 
584  noNoncategoryPsets(pset, psetName);
585 
586  // General parameters
587 
588  std::string thresh = check<std::string>(pset, "psetName", "threshold");
589  if (!thresh.empty())
590  validateThreshold(thresh, psetName);
591  check<bool>(pset, psetName, "placeholder");
592  check<bool>(pset, psetName, "reset");
593  std::string s = check<std::string>(pset, "psetName", "filename");
594  if ((s == "cerr") || (s == "cout")) {
595  flaws << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n";
596  }
597  s = check<std::string>(pset, "psetName", "extension");
598  if ((s == "cerr") || (s == "cout")) {
599  flaws << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n";
600  }
601  s = check<std::string>(pset, "psetName", "output");
602 
603  // No other parameters
604 
605  noneExcept<int>(pset, psetName, "int");
606 
607  vString okbool;
608  okbool.push_back("placeholder");
609  okbool.push_back("optionalPSet");
610  okbool.push_back("reset");
611  noneExcept<bool>(pset, psetName, "bool", okbool);
612  vString okstring;
613  okstring.push_back("output");
614  okstring.push_back("filename");
615  okstring.push_back("extension");
616  okstring.push_back("threshold");
617  noneExcept<std::string>(pset, psetName, "string", okstring);
618 
619  } // statisticsPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void edm::service::MessageServicePSetValidation::statisticsPSets ( ParameterSet const &  pset)
private

Definition at line 565 of file MessageServicePSetValidation.cc.

References edmIntegrityCheck::d, myMessageLogger_cff::destinations, end, edm::ParameterSet::getUntrackedParameterSet(), mps_fire::i, and myMessageLogger_cff::statistics.

565  {
566  ParameterSet empty_PSet;
567  std::vector<std::string>::const_iterator end = statistics.end();
568  for (std::vector<std::string>::const_iterator i = statistics.begin(); i != end; ++i) {
569  if (lookForMatch(destinations, *i))
570  continue;
571  ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet);
572  statisticsPSet(d, *i);
573  }
574  } // statisticsPSets
void statisticsPSet(ParameterSet const &pset, std::string const &psetName)
bool lookForMatch(vString const &v, std::string const &s)
#define end
Definition: vmac.h:39
void edm::service::MessageServicePSetValidation::suppressionLists ( ParameterSet const &  pset)
private

Definition at line 135 of file MessageServicePSetValidation.cc.

References MessageLogger_cfi::debugModules, muonDTDigis_cfi::pset, benchmark_cfg::suppressDebug, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::suppressInfo, and benchmark_cfg::suppressWarning.

135  {
136  debugModules = check<vString>(pset, "MessageLogger", "debugModules");
137  bool dmStar = wildcard(debugModules);
138  if (dmStar && debugModules.size() != 1) {
139  flaws << "MessageLogger"
140  << " PSet: \n"
141  << "debugModules contains wildcard character *"
142  << " and also " << debugModules.size() - 1 << " other entries - * must be alone\n";
143  }
144  suppressDebug = check<vString>(pset, "MessageLogger", "suppressDebug");
145  if ((!suppressDebug.empty()) && (!dmStar)) {
146  flaws << "MessageLogger"
147  << " PSet: \n"
148  << "suppressDebug contains modules, but debugModules is not *\n"
149  << "Unless all the debugModules are enabled,\n"
150  << "suppressing specific modules is meaningless\n";
151  }
152  if (wildcard(suppressDebug)) {
153  flaws << "MessageLogger"
154  << " PSet: \n"
155  << "Use of wildcard (*) in suppressDebug is not supported\n"
156  << "By default, LogDebug is suppressed for all modules\n";
157  }
158  suppressInfo = check<vString>(pset, "MessageLogger", "suppressInfo");
159  if (wildcard(suppressInfo)) {
160  flaws << "MessageLogger"
161  << " PSet: \n"
162  << "Use of wildcard (*) in suppressInfo is not supported\n";
163  }
164  suppressWarning = check<vString>(pset, "MessageLogger", "suppressWarning");
165  if (wildcard(suppressWarning)) {
166  flaws << "MessageLogger"
167  << " PSet: \n"
168  << "Use of wildcard (*) in suppressWarning is not supported\n";
169  }
170  suppressError = check<vString>(pset, "MessageLogger", "suppressError");
171  if (wildcard(suppressError)) {
172  flaws << "MessageLogger"
173  << " PSet: \n"
174  << "Use of wildcard (*) in suppressError is not supported\n";
175  }
176 
177  } // suppressionLists
bool edm::service::MessageServicePSetValidation::validateThreshold ( std::string const &  thresh,
std::string const &  psetName 
)
private

Definition at line 227 of file MessageServicePSetValidation.cc.

228  {
229  if (checkThreshold(thresh))
230  return true;
231  flaws << psetName << " PSet: \n"
232  << "threshold has value " << thresh << " which is not among {DEBUG, INFO, WARNING, ERROR}\n";
233  return false;
234  } // validateThreshold
void edm::service::MessageServicePSetValidation::vStringsCheck ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 179 of file MessageServicePSetValidation.cc.

References end, edm::ParameterSet::getParameterNamesForType(), and mps_fire::i.

180  {
181  vString vStrings = pset.getParameterNamesForType<vString>(false);
182  vString::const_iterator end = vStrings.end();
183  for (vString::const_iterator i = vStrings.begin(); i != end; ++i) {
184  if (!allowedVstring(*i)) {
185  flaws << "MessageLogger"
186  << " PSet: \n"
187  << (*i) << " is used as a vstring, "
188  << "but no such vstring is recognized\n";
189  }
190  }
191  vStrings = pset.getParameterNamesForType<vString>(true);
192  end = vStrings.end();
193  for (vString::const_iterator i = vStrings.begin(); i != end; ++i) {
194  flaws << "MessageLogger"
195  << " PSet: \n"
196  << (*i) << " is used as a tracked vstring: "
197  << "tracked parameters not allowed here\n";
198  }
199  } // vStringsCheck
#define end
Definition: vmac.h:39
bool edm::service::MessageServicePSetValidation::wildcard ( vString const &  v)
private

Definition at line 401 of file MessageServicePSetValidation.cc.

References end, and mps_fire::i.

401  {
402  vString::const_iterator end = v.end();
403  for (vString::const_iterator i = v.begin(); i != end; ++i) {
404  if ((*i) == "*")
405  return true;
406  }
407  return false;
408  }
#define end
Definition: vmac.h:39

Member Data Documentation

std::vector<std::string> edm::service::MessageServicePSetValidation::categories
private

Definition at line 261 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::debugModules
private

Definition at line 263 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::destinations
private

Definition at line 258 of file MessageServicePSetValidation.h.

std::ostringstream edm::service::MessageServicePSetValidation::flaws
private

Definition at line 257 of file MessageServicePSetValidation.h.

Referenced by catNone(), check(), and noneExcept().

std::vector<std::string> edm::service::MessageServicePSetValidation::fwkJobReports
private

Definition at line 260 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::messageIDs
private

Definition at line 262 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::statistics
private

Definition at line 259 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::suppressDebug
private

Definition at line 265 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::suppressError
private

Definition at line 267 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::suppressInfo
private

Definition at line 264 of file MessageServicePSetValidation.h.

std::vector<std::string> edm::service::MessageServicePSetValidation::suppressWarning
private

Definition at line 266 of file MessageServicePSetValidation.h.