CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 >
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 > suppressInfo
 
std::vector< std::string > suppressWarning
 

Detailed Description

Definition at line 43 of file MessageServicePSetValidation.h.

Member Typedef Documentation

Definition at line 48 of file MessageServicePSetValidation.h.

Definition at line 49 of file MessageServicePSetValidation.h.

Member Function Documentation

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

Definition at line 227 of file MessageServicePSetValidation.cc.

228 {
229  if (s == "destinations") return true;
230  if (s == "statistics") return true;
231  if (s == "destinations") return true;
232  if (s == "fwkJobReports") return true;
233  if (s == "categories") return true;
234  if (s == "messageIDs") return true;
235  if (s == "debugModules") return true;
236  if (s == "suppressInfo") return true;
237  if (s == "suppressDebug") return true;
238  if (s == "suppressWarning") return true;
239  return false;
240 } // allowedVstring
string s
Definition: asciidump.py:422
void edm::service::MessageServicePSetValidation::catBoolRestriction ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  categoryName,
std::string const &  type 
)
private

Definition at line 841 of file MessageServicePSetValidation.cc.

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

845 {
846  vString x = pset.getParameterNamesForType <bool> (false);
847  vString::const_iterator end = x.end();
848  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
849  if ( ((*i) == "placeholder") || ((*i) == "optionalPSet") ) continue;
850  flaws << categoryName << " category PSet nested in "
851  << psetName << " PSet: \n"
852  << (*i) << " is used as a " << type << "\n"
853  << "Usage of " << type << " is not recognized here\n";
854  }
855  x = pset.getParameterNamesForType <bool> (true);
856  end = x.end();
857  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
858  flaws << categoryName << " category PSet nested in "
859  << psetName << " PSet: \n"
860  << (*i) << " is used as a tracked " << type << "\n"
861  << "Tracked parameters not allowed here, "
862  <<" and even untracked it would not be recognized\n";
863  }
864 } // catBoolRestriction()
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
void edm::service::MessageServicePSetValidation::categoryPSet ( ParameterSet const &  pset,
std::string const &  OuterPsetName,
std::string const &  categoryName 
)
private

Definition at line 762 of file MessageServicePSetValidation.cc.

References trackerHits::c, edm::ParameterSet::existsAs(), and edm::ParameterSet::getUntrackedParameterSet().

764  {
765  if (pset.existsAs<ParameterSet> (categoryName, true)) {
766  flaws << OuterPsetName << " PSet: \n"
767  << "Category PSet " << categoryName
768  << " is tracked - not allowed\n";
769  return;
770  }
771  ParameterSet empty_PSet;
772  ParameterSet const& c = pset.getUntrackedParameterSet(categoryName,empty_PSet);
773  std::string const & psetName(OuterPsetName);
774  catInts ( c, psetName, categoryName );
775  catNone <unsigned int> ( c, psetName, categoryName, "unsigned int" );
776  catBoolRestriction ( c, psetName, categoryName, "bool" );
777  catNone <float> ( c, psetName, categoryName, "float" );
778  catNone <double> ( c, psetName, categoryName, "double" );
779  catNone <std::string> ( c, psetName, categoryName, "string" );
780  catNone <vString> ( c, psetName, categoryName, "vSting" );
781  catNoPSets ( c, psetName, categoryName );
782 } // categoryPSet
tuple pset
Definition: CrabTask.py:85
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 744 of file MessageServicePSetValidation.cc.

References ecalBxOrbitNumberGrapher_cfg::categories, end, and i.

745 {
746  categoryPSet (pset, psetName, "ERROR" );
747  categoryPSet (pset, psetName, "WARNING");
748  categoryPSet (pset, psetName, "INFO" ) ;
749  categoryPSet (pset, psetName, "DEBUG" );
750  if (psetName != "MessageLogger") categoryPSet (pset, psetName, "default");
751  // The above conditional is because default in the main level is treated
752  // as a set of defaults differnt from those of a simple category.
753  std::vector<std::string>::const_iterator end = categories.end();
754  for (std::vector<std::string>::const_iterator i = categories.begin();
755  i != end; ++i) {
756  categoryPSet(pset, psetName, *i);
757  }
758 } // categoryPSets
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
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 786 of file MessageServicePSetValidation.cc.

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

789 {
790  vString x = pset.getParameterNamesForType <int> (false);
791  vString::const_iterator end = x.end();
792  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
793  if ( *i == "limit" ) continue;
794  if ( *i == "reportEvery" ) continue;
795  if ( *i == "timespan" ) continue;
796  flaws << categoryName << " category PSet nested in "
797  << psetName << " PSet: \n"
798  << (*i) << " is not an allowed parameter within a category PSet \n";
799  }
800  x = pset.getParameterNamesForType <int> (true);
801  end = x.end();
802  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
803  flaws << categoryName << " category PSet nested in "
804  << psetName << " PSet: \n"
805  << (*i) << " is used as a tracked int \n"
806  << "Tracked parameters not allowed here \n";
807  }
808 } // catInts()
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
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 252 of file MessageServicePSetValidation.h.

References end, flaws, i, and ExpressReco_HICollisions_FallBack::x.

256  {
257  vString x = pset.template getParameterNamesForType <T> (false);
258  vString::const_iterator end = x.end();
259  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
260  flaws << categoryName << " category PSet nested in "
261  << psetName << " PSet: \n"
262  << (*i) << " is used as a " << type << "\n"
263  << "Usage of " << type << " is not recognized here\n";
264  }
265  x = pset.template getParameterNamesForType <T> (true);
266  end = x.end();
267  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
268  flaws << categoryName << " category PSet nested in "
269  << psetName << " PSet: \n"
270  << (*i) << " is used as a tracked " << type << "\n"
271  << "Tracked parameters not allowed here, "
272  <<" and even untracked it would not be recognized\n";
273  }
274  } // catNone()
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
void edm::service::MessageServicePSetValidation::catNoPSets ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  categoryName 
)
private

Definition at line 812 of file MessageServicePSetValidation.cc.

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

815 {
816  vString psnames;
817  pset.getParameterSetNames(psnames, false);
818  vString::const_iterator end = psnames.end();
819  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
820  flaws << categoryName << " category PSet nested in "
821  << psetName << " PSet: \n"
822  << *i << " is used as a PSet\n"
823  << "PSets not allowed within a category PSet\n";
824  }
825  psnames.clear();
826  unsigned int n = pset.getParameterSetNames(psnames, true);
827  if ( n > 0 ) {
828  end = psnames.end();
829  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
830  flaws << categoryName << " category PSet nested in "
831  << psetName << " PSet: \n"
832  << *i << " is used as a tracked PSet\n"
833  << "tracked parameters not permitted, and "
834  << "PSets not allowed within a category PSet\n";
835  }
836  }
837 } // catNoPSets
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
template<typename T >
T edm::service::MessageServicePSetValidation::check ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  parameterLabel 
)
inlineprivate

Definition at line 105 of file MessageServicePSetValidation.h.

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

108  {
109  T val = T();
110  try {
111  if (!pset.exists(parameterLabel)) return val;
112  if ( pset.existsAs<T> (parameterLabel, false) ) {
113  val = pset.getUntrackedParameter<T>(parameterLabel, val);
114  return val;
115  }
116  if ( pset.existsAs<T> (parameterLabel, true) ) {
117  flaws << psetName << " PSet: \n"
118  << parameterLabel
119  << " is declared as tracked - needs to be untracked \n";
120  val = pset.getParameter<T>(parameterLabel);
121  } else {
122  flaws << psetName << " PSet: \n"
123  << parameterLabel
124  << " is declared with incorrect type \n";
125  }
126  return val;
127  } catch (cms::Exception& e) {
128  flaws << psetName << " PSet: \n"
129  << parameterLabel
130  << " is declared but causes an exception when processed: \n"
131  << e.what() << "\n";
132  return val;
133  }
134  } // check()
virtual char const * what() const
Definition: Exception.cc:97
tuple pset
Definition: CrabTask.py:85
bool edm::service::MessageServicePSetValidation::checkThreshold ( std::string const &  thresh)
private

Definition at line 257 of file MessageServicePSetValidation.cc.

258 {
259  if (thresh == "WARNING") return true;
260  if (thresh == "INFO") return true;
261  if (thresh == "ERROR") return true;
262  if (thresh == "DEBUG") return true;
263  return false;
264 }
void edm::service::MessageServicePSetValidation::defaultPSet ( ParameterSet const &  main_pset)
private

Definition at line 534 of file MessageServicePSetValidation.cc.

References edm::ParameterSet::getUntrackedParameterSet(), CrabTask::pset, and ExpressReco_HICollisions_FallBack::thresh.

535 {
536  ParameterSet empty_PSet;
537  ParameterSet const& pset = main_pset.getUntrackedParameterSet("default",empty_PSet);
538  std::string psetName = "default (at MessageLogger main level)";
539 
540  // Category PSets
541 
542  categoryPSets (pset, psetName);
543 
544  // No other PSets -- unless they contain optionalPSet or placeholder=True
545 
546  noNoncategoryPsets (pset, psetName);
547 
548  // Parameters applying to the default category
549 
550  catInts ( pset, psetName, "default" );
551 
552  // General parameters
553 
554  check <bool> ( pset, psetName, "placeholder" );
555  std::string thresh = check<std::string> ( pset, "psetName", "threshold" );
556  if (!thresh.empty()) validateThreshold(thresh, psetName);
557  check <bool> ( pset, psetName, "noLineBreaks" );
558  check <int> ( pset, psetName, "limit" );
559  check <int> ( pset, psetName, "reportEvery" );
560  check <int> ( pset, psetName, "timespan" );
561  check <int> ( pset, psetName, "lineLength" );
562  check <bool> ( pset, psetName, "noTimeStamps" );
563 
564  // No other parameters
565  vString okint;
566  okint.push_back("limit");
567  okint.push_back("reportEvery");
568  okint.push_back("timespan");
569  okint.push_back("lineLength");
570  noneExcept <int> (pset, psetName, "int", okint);
571  vString okbool;
572  okbool.push_back ("placeholder");
573  okbool.push_back ("optionalPSet");
574  okbool.push_back ("noLineBreaks");
575  okbool.push_back ("noTimeStamps");
576  noneExcept <bool> (pset, psetName, "bool", okbool);
577  vString okstring;
578  okstring.push_back ("threshold");
579  noneExcept <std::string> (pset, psetName, "string", okstring);
580 
581 } // defaultPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
tuple pset
Definition: CrabTask.py:85
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 483 of file MessageServicePSetValidation.cc.

References CrabTask::pset, asciidump::s, and ExpressReco_HICollisions_FallBack::thresh.

484 {
485  // Category PSets
486 
487  categoryPSets (pset, psetName);
488 
489  // No other PSets -- unless they contain optionalPSet or placeholder=True
490 
491  noNoncategoryPsets (pset, psetName);
492 
493  // General parameters
494 
495  check <bool> ( pset, psetName, "placeholder" );
496  std::string thresh = check<std::string> ( pset, "psetName", "threshold" );
497  if (!thresh.empty()) validateThreshold(thresh, psetName);
498  check <bool> ( pset, psetName, "noLineBreaks" );
499  check <int> ( pset, psetName, "lineLength" );
500  check <bool> ( pset, psetName, "noTimeStamps" );
501  std::string s = check<std::string> ( pset, "psetName", "filename" );
502  if ( (s == "cerr") || (s == "cout") ) {
503  flaws << psetName << " PSet: \n"
504  << s << " is not allowed as a value of filename \n";
505  }
506  s = check<std::string> ( pset, "psetName", "extension" );
507  if ( (s == "cerr") || (s == "cout") ) {
508  flaws << psetName << " PSet: \n"
509  << s << " is not allowed as a value of extension \n";
510  }
511  s = check<std::string> ( pset, "psetName", "output" );
512 
513  // No other parameters
514 
515  noneExcept <int> (pset, psetName, "int", "lineLength");
516 
517  vString okbool;
518  okbool.push_back ("placeholder");
519  okbool.push_back ("optionalPSet");
520  okbool.push_back ("noLineBreaks");
521  okbool.push_back ("noTimeStamps");
522  noneExcept <bool> (pset, psetName, "bool", okbool);
523  vString okstring;
524  okstring.push_back ("threshold");
525  okstring.push_back ("output");
526  okstring.push_back ("filename");
527  okstring.push_back ("extension");
528  noneExcept <std::string> (pset, psetName, "string", okstring);
529 
530 } // destinationPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
tuple pset
Definition: CrabTask.py:85
bool validateThreshold(std::string const &thresh, std::string const &psetName)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
string s
Definition: asciidump.py:422
void edm::service::MessageServicePSetValidation::destinationPSets ( ParameterSet const &  pset)
private

Definition at line 470 of file MessageServicePSetValidation.cc.

References gather_cfg::destinations, end, edm::ParameterSet::getUntrackedParameterSet(), and i.

471 {
472  ParameterSet empty_PSet;
473  std::vector<std::string>::const_iterator end = destinations.end();
474  for ( std::vector<std::string>::const_iterator i = destinations.begin();
475  i != end; ++i ) {
476  ParameterSet const& d = pset.getUntrackedParameterSet(*i,empty_PSet);
477  destinationPSet(d,*i);
478  }
479 } // destinationPSets
int i
Definition: DBlmapReader.cc:9
void destinationPSet(ParameterSet const &pset, std::string const &psetName)
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
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 138 of file MessageServicePSetValidation.h.

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

143  {
144  vString params = pset.getParameterNamesForType <T> (true);
145  noBadParams(v, params, psetName, parameterLabel, type);
146  params = pset.getParameterNamesForType <T> (false);
147  noBadParams(v, params, psetName, parameterLabel, type);
148  } // disallowedParam()
type
Definition: HCALResponse.h:22
tuple pset
Definition: CrabTask.py:85
void noBadParams(vString const &v, vString const &params, std::string const &psetName, std::string const &parameterLabel, std::string const &type)
mathSSE::Vec4< T > v
void edm::service::MessageServicePSetValidation::fwkJobReportPSet ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 660 of file MessageServicePSetValidation.cc.

References CrabTask::pset, and asciidump::s.

661 {
662  // Category PSets
663 
664  categoryPSets (pset, psetName);
665 
666  // No other PSets -- unless they contain optionalPSet or placeholder=True
667 
668  noNoncategoryPsets (pset, psetName);
669 
670  // General parameters
671 
672  check <bool> ( pset, psetName, "placeholder" );
673  std::string s = check<std::string> ( pset, "psetName", "filename" );
674  if ( (s == "cerr") || (s == "cout") ) {
675  flaws << psetName << " PSet: \n"
676  << s << " is not allowed as a value of filename \n";
677  }
678  s = check<std::string> ( pset, "psetName", "extension" );
679  if ( (s == "cerr") || (s == "cout") ) {
680  flaws << psetName << " PSet: \n"
681  << s << " is not allowed as a value of extension \n";
682  }
683  s = check<std::string> ( pset, "psetName", "output" );
684 
685  // No other parameters
686 
687  noneExcept <int> (pset, psetName, "int");
688 
689  vString okbool;
690  okbool.push_back ("placeholder");
691  okbool.push_back ("optionalPSet");
692  noneExcept <bool> (pset, psetName, "bool", okbool);
693  vString okstring;
694  okstring.push_back ("output");
695  okstring.push_back ("filename");
696  okstring.push_back ("extension");
697  noneExcept <std::string> (pset, psetName, "string", okstring);
698 
699 } // fwkJobReportPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
tuple pset
Definition: CrabTask.py:85
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
string s
Definition: asciidump.py:422
void edm::service::MessageServicePSetValidation::fwkJobReportPSets ( ParameterSet const &  pset)
private

Definition at line 647 of file MessageServicePSetValidation.cc.

References end, ExpressReco_HICollisions_FallBack::fwkJobReports, edm::ParameterSet::getUntrackedParameterSet(), and i.

648 {
649  ParameterSet empty_PSet;
650  std::vector<std::string>::const_iterator end = fwkJobReports.end();
651  for ( std::vector<std::string>::const_iterator i = fwkJobReports.begin();
652  i != end; ++i ) {
653  ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet);
654  fwkJobReportPSet(d,*i);
655  }
656 } // fwkJobReportPSets
int i
Definition: DBlmapReader.cc:9
void fwkJobReportPSet(ParameterSet const &pset, std::string const &psetName)
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
bool edm::service::MessageServicePSetValidation::keywordCheck ( std::string const &  word)
private

Definition at line 338 of file MessageServicePSetValidation.cc.

339 {
340  if (word == "default") return false;
341  if (word == "categories") return false;
342  if (word == "messageIDs") return false;
343  if (word == "fwkJobReports") return false;
344  if (word == "destinations") return false;
345  if (word == "statistics") return false;
346  if (word == "debugModules") return false;
347  if (word == "suppressInfo") return false;
348  if (word == "suppressDebug") return false;
349  if (word == "suppressWarning")return false;
350  if (word == "threshold") return false;
351  if (word == "ERROR") return false;
352  if (word == "WARNING") return false;
353  if (word == "INFO") return false;
354  if (word == "DEBUG") return false;
355  if (word == "placeholder") return false;
356  if (word == "limit") return false;
357  if (word == "reportEvery") return false;
358  if (word == "timespan") return false;
359  if (word == "noLineBreaks") return false;
360  if (word == "lineLength") return false;
361  if (word == "noTimeStamps") return false;
362  if (word == "output") return false;
363  if (word == "filename") return false;
364  if (word == "extension") return false;
365  if (word == "reset") return false;
366  if (word == "optionalPSet") return false;
367  return true;
368 } // keywordCheck
bool edm::service::MessageServicePSetValidation::lookForMatch ( vString const &  v,
std::string const &  s 
)
private

Definition at line 461 of file MessageServicePSetValidation.cc.

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

462 {
463  vString::const_iterator begin = v.begin();
464  vString::const_iterator end = v.end();
465  return ( std::find(begin, end, s) != end );
466 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
#define end
Definition: vmac.h:38
#define begin
Definition: vmac.h:31
string s
Definition: asciidump.py:422
mathSSE::Vec4< T > v
void edm::service::MessageServicePSetValidation::messageLoggerPSet ( ParameterSet const &  pset)
private

Definition at line 41 of file MessageServicePSetValidation.cc.

References CfgNavigationSchool_cfi::defaultPSet, CrabTask::pset, and ExpressReco_HICollisions_FallBack::thresh.

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

References i, and j.

Referenced by disallowedParam().

392 {
393  vString::const_iterator end1 = v.end();
394  vString::const_iterator end2 = params.end();
395  for (vString::const_iterator i = v.begin(); i != end1; ++i) {
396  for (vString::const_iterator j = params.begin(); j != end2; ++j) {
397  if ( *i == *j ) {
398  flaws << psetName << " PSet: \n"
399  << *i << " (listed in vstring " << parameterLabel << ")\n"
400  << "is used as a parameter of type " << type
401  << " instead of as a PSet \n";
402  }
403  }
404  }
405 
406 } // noBadParams
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
mathSSE::Vec4< T > v
void edm::service::MessageServicePSetValidation::noCoutCerrClash ( vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 304 of file MessageServicePSetValidation.cc.

References end, and i.

306 {
307  vString::const_iterator end = v.end();
308  bool coutPresent = false;
309  bool cerrPresent = false;
310  for (vString::const_iterator i = v.begin(); i != end; ++i) {
311  if ( *i == "cout" ) coutPresent = true;
312  if ( *i == "cerr" ) cerrPresent = true;
313  }
314  if (coutPresent && cerrPresent) {
315  flaws << psetName << " PSet: \n"
316  << "vString " << parameterLabel
317  << " has both cout and cerr \n";
318  }
319 } // noCoutCerrClash(v)
int i
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:38
mathSSE::Vec4< T > v
void edm::service::MessageServicePSetValidation::noDuplicates ( vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 268 of file MessageServicePSetValidation.cc.

References end, i, and j.

270 {
271  vString::const_iterator end = v.end();
272  for (vString::const_iterator i = v.begin(); i != end; ++i) {
273  for (vString::const_iterator j = i+1; j != end; ++j) {
274  if ( *i == *j ) {
275  flaws << psetName << " PSet: \n"
276  << "in vString " << parameterLabel
277  << " duplication of the string " << *i << "\n";
278  }
279  }
280  }
281 } // noDuplicates(v)
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:38
mathSSE::Vec4< T > v
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 285 of file MessageServicePSetValidation.cc.

References i, and j.

288 {
289  vString::const_iterator end1 = v1.end();
290  vString::const_iterator end2 = v2.end();
291  for (vString::const_iterator i = v1.begin(); i != end1; ++i) {
292  for (vString::const_iterator j = v2.begin(); j != end2; ++j) {
293  if ( *i == *j ) {
294  flaws << psetName << " PSet: \n"
295  << "in vStrings " << p1 << " and " << p2
296  << " duplication of the string " << *i << "\n";
297  }
298  }
299  }
300 } // noDuplicates(v1,v2)
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
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 323 of file MessageServicePSetValidation.cc.

References end, and i.

325 {
326  vString::const_iterator end = v.end();
327  for (vString::const_iterator i = v.begin(); i != end; ++i) {
328  if (!keywordCheck(*i)) {
329  flaws << psetName << " PSet: \n"
330  << "vString " << parameterLabel
331  << " should not contain the keyword " << *i << "\n";
332  }
333  }
334 } // noKeywords(v)
int i
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:38
mathSSE::Vec4< T > v
template<typename T >
void edm::service::MessageServicePSetValidation::noneExcept ( ParameterSet const &  pset,
std::string const &  psetName,
std::string const &  type 
)
inlineprivate

Definition at line 151 of file MessageServicePSetValidation.h.

References end, flaws, i, and ExpressReco_HICollisions_FallBack::x.

153  {
154  vString x = pset.template getParameterNamesForType <T> (false);
155  vString::const_iterator end = x.end();
156  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
157  flaws << psetName << " PSet: \n"
158  << (*i) << " is used as a " << type << "\n"
159  << "Usage of " << type << " is not recognized here\n";
160  }
161  x = pset.template getParameterNamesForType <T> (true);
162  end = x.end();
163  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
164  if ( (*i) == "@service_type" ) continue;
165  flaws << psetName << " PSet: \n"
166  << (*i) << " is used as a tracked " << type << "\n"
167  << "Tracked parameters not allowed here, "
168  <<" and even untracked it would not be recognized\n";
169  }
170  } // noneExcept()
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
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 173 of file MessageServicePSetValidation.h.

References end, flaws, i, and ExpressReco_HICollisions_FallBack::x.

176  {
177  vString x = pset.template getParameterNamesForType <T> (false);
178  vString::const_iterator end = x.end();
179  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
180  std::string val = (*i);
181  if ( val != ok ) {
182  flaws << psetName << " PSet: \n"
183  << val << " is used as a " << type << "\n"
184  << "This usage is not recognized in this type of PSet\n";
185  }
186  }
187  x = pset.template getParameterNamesForType <T> (true);
188  end = x.end();
189  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
190  if ( (*i) == "@service_type" ) continue;
191  flaws << psetName << " PSet: \n"
192  << (*i) << " is used as a tracked " << type << "\n"
193  << "Tracked parameters not allowed here\n";
194  }
195  } // noneExcept(okValue)
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
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 198 of file MessageServicePSetValidation.h.

References end, flaws, i, and ExpressReco_HICollisions_FallBack::x.

201  {
202  vString x = pset.template getParameterNamesForType <T> (false);
203  vString::const_iterator end = x.end();
204  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
205  std::string val = (*i);
206  if ( (val != ok1) && (val != ok2) ) {
207  flaws << psetName << " PSet: \n"
208  << val << " is used as a " << type << "\n"
209  << "This usage is not recognized in this type of PSet\n";
210  }
211  }
212  x = pset.template getParameterNamesForType <T> (true);
213  end = x.end();
214  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
215  if ( (*i) == "@service_type" ) continue;
216  flaws << psetName << " PSet: \n"
217  << (*i) << " is used as a tracked " << type << "\n"
218  << "Tracked parameters not allowed here\n";
219  }
220  } // noneExcept(okValue1, okValue2)
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
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 223 of file MessageServicePSetValidation.h.

References end, flaws, newFWLiteAna::found, i, vend, and ExpressReco_HICollisions_FallBack::x.

226  {
227  vString x = pset.template getParameterNamesForType <T> (false);
228  vString::const_iterator end = x.end();
229  vString::const_iterator vend = vok.end();
230  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
231  bool found = false;
232  for (vString::const_iterator vit = vok.begin(); vit!=vend; ++vit) {
233  if ( *i == *vit ) found = true;
234  }
235  if ( !found ) {
236  flaws << psetName << " PSet: \n"
237  << *i << " is used as a " << type << "\n"
238  << "This usage is not recognized in this type of PSet\n";
239  }
240  }
241  x = pset.template getParameterNamesForType <T> (true);
242  end = x.end();
243  for ( vString::const_iterator i = x.begin(); i != end; ++i ) {
244  if ( (*i) == "@service_type" ) continue;
245  flaws << psetName << " PSet: \n"
246  << (*i) << " is used as a tracked " << type << "\n"
247  << "Tracked parameters not allowed here\n";
248  }
249  } // noneExcept(vok)
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
#define vend()
Definition: vmac.h:42
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
void edm::service::MessageServicePSetValidation::noNoncategoryPsets ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 703 of file MessageServicePSetValidation.cc.

References ecalBxOrbitNumberGrapher_cfg::categories, ExpressReco_HICollisions_FallBack::e, end, edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), i, and n.

704 {
705  vString psnames;
706  pset.getParameterSetNames(psnames, false);
707  vString::const_iterator end = psnames.end();
708  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
709  if ( lookForMatch (categories, *i) ) continue;
710  if ( lookForMatch (messageIDs, *i) ) continue;
711  if ( (*i) == "default" ) continue;
712  if ( (*i) == "ERROR" ) continue;
713  if ( (*i) == "WARNING" ) continue;
714  if ( (*i) == "INFO" ) continue;
715  if ( (*i) == "DEBUG" ) continue;
716  ParameterSet empty_PSet;
717  bool ok_optionalPSet = false;
718  try {
719  ParameterSet const& culprit =
720  pset.getUntrackedParameterSet((*i),empty_PSet);
721  ok_optionalPSet =
722  culprit.getUntrackedParameter<bool>("placeholder", ok_optionalPSet);
723  ok_optionalPSet =
724  culprit.getUntrackedParameter<bool>("optionalPSet", ok_optionalPSet);
725  } catch (cms::Exception& e) {
726  }
727  if (ok_optionalPSet) continue;
728  flaws << psetName << " PSet: \n"
729  << *i << " is an unrecognized name for a PSet in this context \n";
730  }
731  psnames.clear();
732  unsigned int n = pset.getParameterSetNames(psnames, true);
733  if ( n > 0 ) {
734  end = psnames.end();
735  for (vString::const_iterator i = psnames.begin(); i != end; ++i) {
736  flaws << psetName << " PSet: \n"
737  << "PSet " << *i << " is tracked - not allowed\n";
738  }
739  }
740 } // noNoncategoryPsets
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
bool lookForMatch(vString const &v, std::string const &s)
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
void edm::service::MessageServicePSetValidation::noNonPSetUsage ( ParameterSet const &  pset,
vString const &  v,
std::string const &  psetName,
std::string const &  parameterLabel 
)
private

Definition at line 372 of file MessageServicePSetValidation.cc.

References CrabTask::pset, and v.

375 {
376  disallowedParam <int> ( pset, v, psetName, parameterLabel, "int" );
377  disallowedParam <unsigned int> ( pset, v, psetName, parameterLabel, "uint" );
378  disallowedParam <bool> ( pset, v, psetName, parameterLabel, "bool" );
379  disallowedParam <float> ( pset, v, psetName, parameterLabel, "float" );
380  disallowedParam <double> ( pset, v, psetName, parameterLabel, "double" );
381  disallowedParam <std::string> ( pset, v, psetName, parameterLabel, "string" );
382  disallowedParam <std::vector<std::string> >
383  ( pset, v, psetName, parameterLabel, "vstring" );
384 } // noNonPSetUsage
tuple pset
Definition: CrabTask.py:85
mathSSE::Vec4< T > v
void edm::service::MessageServicePSetValidation::noOtherPsets ( ParameterSet const &  pset)
private

Definition at line 421 of file MessageServicePSetValidation.cc.

References ecalBxOrbitNumberGrapher_cfg::categories, gather_cfg::destinations, ExpressReco_HICollisions_FallBack::e, end, ExpressReco_HICollisions_FallBack::fwkJobReports, edm::ParameterSet::getParameterSetNames(), edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), i, n, and ExpressReco_HICollisions_FallBack::statistics.

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

Definition at line 33 of file MessageServicePSetValidation.cc.

34 {
36  return flaws.str();
37 } // operator() to validate the PSet passed in
tuple pset
Definition: CrabTask.py:85
void edm::service::MessageServicePSetValidation::psetLists ( ParameterSet const &  pset)
private

Definition at line 108 of file MessageServicePSetValidation.cc.

References ecalBxOrbitNumberGrapher_cfg::categories, gather_cfg::destinations, ExpressReco_HICollisions_FallBack::fwkJobReports, CrabTask::pset, and ExpressReco_HICollisions_FallBack::statistics.

109 {
110  destinations = check<vString>
111  (pset, "MessageLogger", "destinations");
112  noDuplicates(destinations,"MessageLogger", "destinations");
113  noKeywords(destinations,"MessageLogger", "destinations");
114  noNonPSetUsage(pset, destinations,"MessageLogger", "destinations");
115  // REMOVED: noCoutCerrClash(destinations,"MessageLogger", "destinations");
116 
117  statistics = check<vString>
118  (pset, "MessageLogger", "statistics");
119  noDuplicates(statistics,"MessageLogger", "statistics");
120  noKeywords(statistics,"MessageLogger", "statistics");
121  noNonPSetUsage(pset, statistics,"MessageLogger", "statistics");
122 
123  fwkJobReports = check<vString>
124  (pset, "MessageLogger", "fwkJobReports");
125  noDuplicates(fwkJobReports,"MessageLogger", "fwkJobReports");
126  noKeywords(fwkJobReports,"MessageLogger", "fwkJobReports");
127  noNonPSetUsage(pset, fwkJobReports,"MessageLogger", "fwkJobReports");
129  "MessageLogger", "fwkJobReports","destinations");
131  "MessageLogger", "fwkJobReports","statistics");
132 
133  categories = check<vString>
134  (pset, "MessageLogger", "categories");
135  noDuplicates(categories,"MessageLogger", "categories");
136  noKeywords(categories,"MessageLogger", "categories");
137  noNonPSetUsage(pset, categories,"MessageLogger", "categories");
139  "MessageLogger", "categories","destinations");
141  "MessageLogger", "categories","statistics");
143  "MessageLogger", "categories","fwkJobReports");
144 
145  messageIDs = check<vString>
146  (pset, "MessageLogger", "messageIDs");
147  noDuplicates(messageIDs,"MessageLogger", "messageIDs");
148  noKeywords(messageIDs,"MessageLogger", "messageIDs");
149  noNonPSetUsage(pset, messageIDs,"MessageLogger", "messageIDs");
151  "MessageLogger", "messageIDs","destinations");
153  "MessageLogger", "messageIDs","statistics");
155  "MessageLogger", "messageIDs","fwkJobReports");
157  "MessageLogger", "messageIDs","categories");
158 
159 } // psetLists
void noKeywords(vString const &v, std::string const &psetName, std::string const &parameterLabel)
tuple pset
Definition: CrabTask.py:85
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 599 of file MessageServicePSetValidation.cc.

References CrabTask::pset, asciidump::s, and ExpressReco_HICollisions_FallBack::thresh.

600 {
601  // Category PSets
602 
603  categoryPSets (pset, psetName);
604 
605  // No other PSets -- unless they contain optionalPSet or placeholder=True
606 
607  noNoncategoryPsets (pset, psetName);
608 
609  // General parameters
610 
611  std::string thresh = check<std::string> ( pset, "psetName", "threshold" );
612  if (!thresh.empty()) validateThreshold(thresh, psetName);
613  check <bool> ( pset, psetName, "placeholder" );
614  check <bool> ( pset, psetName, "reset" );
615  std::string s = check<std::string> ( pset, "psetName", "filename" );
616  if ( (s == "cerr") || (s == "cout") ) {
617  flaws << psetName << " PSet: \n"
618  << s << " is not allowed as a value of filename \n";
619  }
620  s = check<std::string> ( pset, "psetName", "extension" );
621  if ( (s == "cerr") || (s == "cout") ) {
622  flaws << psetName << " PSet: \n"
623  << s << " is not allowed as a value of extension \n";
624  }
625  s = check<std::string> ( pset, "psetName", "output" );
626 
627  // No other parameters
628 
629  noneExcept <int> (pset, psetName, "int");
630 
631  vString okbool;
632  okbool.push_back ("placeholder");
633  okbool.push_back ("optionalPSet");
634  okbool.push_back ("reset");
635  noneExcept <bool> (pset, psetName, "bool", okbool);
636  vString okstring;
637  okstring.push_back ("output");
638  okstring.push_back ("filename");
639  okstring.push_back ("extension");
640  okstring.push_back ("threshold");
641  noneExcept <std::string> (pset, psetName, "string", okstring);
642 
643 } // statisticsPSet
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
tuple pset
Definition: CrabTask.py:85
bool validateThreshold(std::string const &thresh, std::string const &psetName)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
string s
Definition: asciidump.py:422
void edm::service::MessageServicePSetValidation::statisticsPSets ( ParameterSet const &  pset)
private

Definition at line 585 of file MessageServicePSetValidation.cc.

References gather_cfg::destinations, end, edm::ParameterSet::getUntrackedParameterSet(), i, and ExpressReco_HICollisions_FallBack::statistics.

586 {
587  ParameterSet empty_PSet;
588  std::vector<std::string>::const_iterator end = statistics.end();
589  for ( std::vector<std::string>::const_iterator i = statistics.begin();
590  i != end; ++i ) {
591  if (lookForMatch(destinations, *i)) continue;
592  ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet);
593  statisticsPSet(d,*i);
594  }
595 } // statisticsPSets
int i
Definition: DBlmapReader.cc:9
void statisticsPSet(ParameterSet const &pset, std::string const &psetName)
bool lookForMatch(vString const &v, std::string const &s)
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
void edm::service::MessageServicePSetValidation::suppressionLists ( ParameterSet const &  pset)
private

Definition at line 163 of file MessageServicePSetValidation.cc.

References SQLiteCheck_cfg::debugModules, CrabTask::pset, MergeJob_cfg::suppressDebug, EcnaSystemPythonModuleInsert_1::suppressInfo, and MergeJob_cfg::suppressWarning.

164 {
165  debugModules = check<vString>
166  (pset, "MessageLogger", "debugModules");
167  bool dmStar = wildcard(debugModules);
168  if ( dmStar && debugModules.size() != 1) {
169  flaws << "MessageLogger" << " PSet: \n"
170  << "debugModules contains wildcard character *"
171  << " and also " << debugModules.size()-1
172  << " other entries - * must be alone\n";
173  }
174  suppressDebug = check<vString>
175  (pset, "MessageLogger", "suppressDebug");
176  if ( (suppressDebug.size() > 0) && (!dmStar) ) {
177  flaws << "MessageLogger" << " PSet: \n"
178  << "suppressDebug contains modules, but debugModules is not *\n"
179  << "Unless all the debugModules are enabled,\n"
180  << "suppressing specific modules is meaningless\n";
181  }
182  if (wildcard(suppressDebug)) {
183  flaws << "MessageLogger" << " PSet: \n"
184  << "Use of wildcard (*) in suppressDebug is not supported\n"
185  << "By default, LogDebug is suppressed for all modules\n";
186  }
187  suppressInfo = check<vString>
188  (pset, "MessageLogger", "suppressInfo");
189  if (wildcard(suppressInfo)) {
190  flaws << "MessageLogger" << " PSet: \n"
191  << "Use of wildcard (*) in suppressInfo is not supported\n";
192  }
193  suppressWarning = check<vString>
194  (pset, "MessageLogger", "suppressWarning");
195  if (wildcard(suppressWarning)) {
196  flaws << "MessageLogger" << " PSet: \n"
197  << "Use of wildcard (*) in suppressWarning is not supported\n";
198  }
199 
200 } // suppressionLists
tuple pset
Definition: CrabTask.py:85
bool edm::service::MessageServicePSetValidation::validateThreshold ( std::string const &  thresh,
std::string const &  psetName 
)
private

Definition at line 246 of file MessageServicePSetValidation.cc.

247 {
248  if (checkThreshold(thresh)) return true;
249  flaws << psetName << " PSet: \n"
250  << "threshold has value " << thresh
251  << " which is not among {DEBUG, INFO, WARNING, ERROR}\n";
252  return false;
253 } // validateThreshold
void edm::service::MessageServicePSetValidation::vStringsCheck ( ParameterSet const &  pset,
std::string const &  psetName 
)
private

Definition at line 205 of file MessageServicePSetValidation.cc.

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

206 {
207  vString vStrings = pset.getParameterNamesForType <vString> (false);
208  vString::const_iterator end = vStrings.end();
209  for ( vString::const_iterator i = vStrings.begin(); i != end; ++i ) {
210  if ( !allowedVstring(*i) ) {
211  flaws << "MessageLogger" << " PSet: \n"
212  << (*i) << " is used as a vstring, "
213  << "but no such vstring is recognized\n";
214  }
215  }
216  vStrings = pset.getParameterNamesForType <vString> (true);
217  end = vStrings.end();
218  for ( vString::const_iterator i = vStrings.begin(); i != end; ++i ) {
219  flaws << "MessageLogger" << " PSet: \n"
220  << (*i) << " is used as a tracked vstring: "
221  << "tracked parameters not allowed here\n";
222  }
223 } // vStringsCheck
int i
Definition: DBlmapReader.cc:9
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
bool edm::service::MessageServicePSetValidation::wildcard ( vString const &  v)
private

Definition at line 410 of file MessageServicePSetValidation.cc.

References end, and i.

411 {
412  vString::const_iterator end = v.end();
413  for (vString::const_iterator i = v.begin(); i != end; ++i) {
414  if ((*i) == "*") return true;
415  }
416  return false;
417 }
int i
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:38
mathSSE::Vec4< T > v

Member Data Documentation

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

Definition at line 283 of file MessageServicePSetValidation.h.

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

Definition at line 285 of file MessageServicePSetValidation.h.

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

Definition at line 280 of file MessageServicePSetValidation.h.

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

Definition at line 279 of file MessageServicePSetValidation.h.

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

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

Definition at line 282 of file MessageServicePSetValidation.h.

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

Definition at line 284 of file MessageServicePSetValidation.h.

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

Definition at line 281 of file MessageServicePSetValidation.h.

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

Definition at line 287 of file MessageServicePSetValidation.h.

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

Definition at line 286 of file MessageServicePSetValidation.h.

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

Definition at line 288 of file MessageServicePSetValidation.h.