Represents an identifier of a LHA element, possibly containing several sub-ids.
More...
|
template<typename... Args>
requires (std::convertible_to<Args, long> && ...) |
| | LhaID (Args... sub_ids) |
| | Constructs an LhaID from a list of integral sub-ids.
|
| |
| | LhaID (const std::string &parts) |
| | Constructs an LhaID from a string of underscore-separated integers.
|
| |
| | LhaID (const std::vector< long > &sub_ids) |
| | Constructs an LhaID from an explicit vector of sub-ids.
|
| |
| | LhaID (std::vector< long > &&sub_ids) |
| |
| | LhaID (long id) |
| | Constructs an LhaID with a single identifier.
|
| |
| std::string | to_string () const |
| | Returns the canonical string representation of this LhaID.
|
| |
| std::vector< long > | get_parts () const |
| | Returns the underlying vector of sub-ids.
|
| |
| | operator long () const |
| | Implicit conversion of a trivial LhaID to a long integer.
|
| |
Represents an identifier of a LHA element, possibly containing several sub-ids.
An LhaID is internally stored as a sequence of integer parts. This allows one to represent both simple one-dimensional identifiers (e.g. a PDG code) and multi-dimensional indices (e.g. block/row/column) in a uniform way.
The canonical string representation is obtained by joining the parts with underscores, for example:
- parts = { 511 } → "511"
- parts = { 5, 2 } → "5_2"
- parts = { 321, 1, 3 } → "321_1_3"
The type also supports:
- comparison operators (lexicographic on parts),
- a conversion to long for trivial (single-part) IDs, with a warning if information would be lost.
- Examples
- examples/dependency_management_example.cpp.
Definition at line 56 of file LhaID.h.
| LhaID::operator long |
( |
| ) |
const |
Implicit conversion of a trivial LhaID to a long integer.
This conversion is intended for IDs that contain a single part (e.g. simple PDG codes). If parts contains more than one element, a warning is emitted via LOG_WARN and only the first element is returned, effectively discarding information.
- Returns
- The first element of parts.
- Warning
- For multi-part IDs, only the first component is kept.
Definition at line 30 of file LhaID.cpp.