24 bool anyOf(std::string
const&
value, std::initializer_list<std::string> keys)
25 {
return std::find(keys.begin(), keys.end(),
value) != keys.end(); }
37 case CC:
return "charged";
38 case NC:
return "neutral";
39 case any:
return "any";
41 throw std::logic_error(
"icarus::WeakCurrentType::name()");
51 case any:
return "any";
53 throw std::logic_error(
"icarus::WeakCurrentType::shortName()");
64 auto char_toupper = [](
unsigned char c){
return std::toupper(c); };
65 std::transform(s.begin(), s.end(), std::back_inserter(S), char_toupper);
74 std::string
const SPEC = to_upper(spec);
76 if (anyOf(SPEC, {
"CHARGED",
"CC" }))
return CC;
77 if (anyOf(SPEC, {
"NEUTRAL",
"NC" }))
return NC;
78 if (anyOf(SPEC, {
"",
"ANY" }))
return any;
80 throw cet::exception(
"WeakCurrentType")
81 <<
"Invalid weak current specification: '" << spec <<
"'\n";
see a below echo S(symbol in a section other than those above)
process_name showerreco Particles Coinciding wih the Vertex services ScanOptions nu_mu NC
CurrentType fType
Type of current stored.
static CurrentType parse(std::string const &spec)
Converts a string into a WeakCurrentType.
A C++ type to describe the type of weak current.
process_name showerreco Particles Coinciding wih the Vertex services ScanOptions nu_mu CC
CurrentType
Type of weak current.
then echo File list $list not found else cat $list while read file do echo $file sed s
static std::string to_upper(std::string const &s)
Returns a upper-case copy of s.
std::string shortName() const