Represents a type of weak current. More...
#include <WeakCurrentType.h>
Public Types | |
enum | CurrentType { CC, NC, any } |
Type of weak current. More... | |
Public Member Functions | |
constexpr | WeakCurrentType ()=default |
Default constructor: matches any current type. More... | |
constexpr | WeakCurrentType (CurrentType type) |
Constructor: assigns the specified current type. More... | |
WeakCurrentType (std::string const &spec) | |
operator int () const | |
String operations | |
std::string | name () const |
std::string | shortName () const |
operator std::string () const | |
Converts to the name() of the current. More... | |
Comparisons | |
constexpr bool | operator== (WeakCurrentType const &other) const |
Returns whether this current type is the same as the other . More... | |
constexpr bool | operator!= (WeakCurrentType const &other) const |
Returns whether this current type is different than the other . More... | |
Static Public Member Functions | |
static CurrentType | parse (std::string const &spec) |
Converts a string into a WeakCurrentType . More... | |
Static Private Member Functions | |
static std::string | to_upper (std::string const &s) |
Returns a upper-case copy of s . More... | |
Private Attributes | |
CurrentType | fType = any |
Type of current stored. More... | |
Represents a type of weak current.
This type can be initialised with a string (see parse()
) or a mnemonic value (CurrentType
).
Example of usage:
Definition at line 54 of file WeakCurrentType.h.
Type of weak current.
Enumerator | |
---|---|
CC |
Charged current. |
NC |
Neutral current. |
any |
Any interaction. |
Definition at line 59 of file WeakCurrentType.h.
|
default |
Default constructor: matches any current type.
|
inline |
Constructor: assigns the specified current type.
Definition at line 72 of file WeakCurrentType.h.
|
inlineexplicit |
Constructor: assigns the value interpreting the specification spec
.
WeakCurrentType::parse()
Definition at line 76 of file WeakCurrentType.h.
std::string icarus::WeakCurrentType::name | ( | ) | const |
Returns a string with the name of the current ("charged"
, "neutral"
, "any"
).
Definition at line 34 of file WeakCurrentType.cxx.
|
inline |
Definition at line 119 of file WeakCurrentType.h.
|
inline |
|
inline |
Returns whether this current type is different than the other
.
Definition at line 111 of file WeakCurrentType.h.
|
inline |
Returns whether this current type is the same as the other
.
Definition at line 107 of file WeakCurrentType.h.
|
static |
Converts a string into a WeakCurrentType
.
spec | the specification string to be converted |
cet::exception | (category "WeakCurrentType" ) if spec is not supported |
The case of spec
is irrelevant. Accepted values include the shortened name ("CC"
; see shortName()
), and the full name ("charged"
; see name()
). Also the empty string is converted to a CurrentType
of any
.
Definition at line 72 of file WeakCurrentType.cxx.
std::string icarus::WeakCurrentType::shortName | ( | ) | const |
Returns a string with the short name of the current ("CC"
, "NC"
, "any"
).
Definition at line 46 of file WeakCurrentType.cxx.
|
staticprivate |
Returns a upper-case copy of s
.
Definition at line 59 of file WeakCurrentType.cxx.
|
private |
Type of current stored.
Definition at line 138 of file WeakCurrentType.h.