1 #ifndef FWCore_MessageService_MessageServicePSetValidation_h 2 #define FWCore_MessageService_MessageServicePSetValidation_h 69 vString
const& params,
99 if (!pset.
exists(parameterLabel))
101 if (pset.
existsAs<
T>(parameterLabel,
false)) {
105 if (pset.
existsAs<
T>(parameterLabel,
true)) {
106 flaws << psetName <<
" PSet: \n" << parameterLabel <<
" is declared as tracked - needs to be untracked \n";
109 flaws << psetName <<
" PSet: \n" << parameterLabel <<
" is declared with incorrect type \n";
113 flaws << psetName <<
" PSet: \n" 114 << parameterLabel <<
" is declared but causes an exception when processed: \n" 120 template <
typename T>
127 noBadParams(v, params, psetName, parameterLabel, type);
129 noBadParams(v, params, psetName, parameterLabel, type);
132 template <
typename T>
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";
141 x = pset.template getParameterNamesForType<T>(
true);
143 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
144 if ((*
i) ==
"@service_type")
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";
153 template <
typename T>
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) {
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";
168 x = pset.template getParameterNamesForType<T>(
true);
170 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
171 if ((*
i) ==
"@service_type")
173 flaws << psetName <<
" PSet: \n" 174 << (*i) <<
" is used as a tracked " << type <<
"\n" 175 <<
"Tracked parameters not allowed here\n";
179 template <
typename T>
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) {
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";
192 x = pset.template getParameterNamesForType<T>(
true);
194 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
195 if ((*
i) ==
"@service_type")
197 flaws << psetName <<
" PSet: \n" 198 << (*i) <<
" is used as a tracked " << type <<
"\n" 199 <<
"Tracked parameters not allowed here\n";
203 template <
typename T>
207 vString
const& vok) {
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) {
213 for (vString::const_iterator vit = vok.begin(); vit !=
vend; ++vit) {
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";
223 x = pset.template getParameterNamesForType<T>(
true);
225 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
226 if ((*
i) ==
"@service_type")
228 flaws << psetName <<
" PSet: \n" 229 << (*i) <<
" is used as a tracked " << type <<
"\n" 230 <<
"Tracked parameters not allowed here\n";
234 template <
typename T>
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";
246 x = pset.template getParameterNamesForType<T>(
true);
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";
275 #endif // FWCore_MessageService_MessageServicePSetValidation_h
std::vector< std::string > messageIDs
T getParameter(std::string const &) const
void psetLists(ParameterSet const &pset)
T getUntrackedParameter(std::string const &, T const &) const
void statisticsPSet(ParameterSet const &pset, std::string const &psetName)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool lookForMatch(vString const &v, std::string const &s)
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
bool wildcard(vString const &v)
void destinationPSet(ParameterSet const &pset, std::string const &psetName)
void disallowedParam(ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const ¶meterLabel, std::string const &type)
void vStringsCheck(ParameterSet const &pset, std::string const &psetName)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< std::string > suppressInfo
char const * what() const override
std::vector< std::string > suppressWarning
std::vector< String > vString
void noCoutCerrClash(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type, std::string const &ok)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
std::vector< std::string > fwkJobReports
std::vector< std::string > suppressDebug
void fwkJobReportPSet(ParameterSet const &pset, std::string const &psetName)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type, vString const &vok)
T check(ParameterSet const &pset, std::string const &psetName, std::string const ¶meterLabel)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type, T const &ok1, T const &ok2)
void noKeywords(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void catNone(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type)
void noDuplicates(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
std::vector< std::string > suppressError
std::vector< std::string > statistics
void catNoPSets(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
std::vector< std::string > destinations
bool keywordCheck(std::string const &word)
void noBadParams(vString const &v, vString const ¶ms, std::string const &psetName, std::string const ¶meterLabel, std::string const &type)
void noNonPSetUsage(ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const ¶meterLabel)
std::vector< std::string > categories
void destinationPSets(ParameterSet const &pset)
void noOtherPsets(ParameterSet const &pset)
bool checkThreshold(std::string const &thresh)
std::string operator()(ParameterSet const &pset)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
bool allowedVstring(std::string const &s)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void catBoolRestriction(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
void statisticsPSets(ParameterSet const &pset)
void categoryPSet(ParameterSet const &pset, std::string const &OuterPsetName, std::string const &categoryName)
void catInts(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
void messageLoggerPSet(ParameterSet const &pset)
std::vector< std::string > debugModules
void defaultPSet(ParameterSet const &main_pset)
void fwkJobReportPSets(ParameterSet const &pset)
void suppressionLists(ParameterSet const &pset)