![]() |
ATLAS Offline Software
|
Manage a list of identifiers. More...
#include <CaloIDHelper.h>
Public Member Functions | |
HashGroup () | |
Constructor. More... | |
template<class T > | |
int | init (T &parent, const std::string &type, const MultiRange &full_range, Identifier(T::*idfunc)(const ExpandedIdentifier &) const, size_type end_index) |
Initialize. More... | |
int | init (const std::string &name, const std::set< Identifier > &ids, size_type end_index, IMessageSvc *msgSvc, const MultiRange *full_range=0) |
Initialize. More... | |
size_type | hash_max () const |
Return one more than the largest hash code. More... | |
id_iterator | begin () const |
Return a begin iterator over the group's Identifiers. More... | |
id_iterator | end () const |
Return an end iterator over the group's Identifiers. More... | |
id_range | range () const |
Return an iterator range over the group's Identifiers. More... | |
Identifier | id (IdentifierHash hashId) const |
Return the identifier for a given hash code (no checking). More... | |
int | get_hash (Identifier id, IdentifierHash &hash_id) const |
Look up the hash code corresponding to an Identifier. More... | |
IdentifierHash | hash (Identifier id) const |
Look up the hash code corresponding to an Identifier. More... | |
const std::vector< Identifier > & | ids () const |
Return a vector of all Identifiers for this group. More... | |
size_type | end_index () const |
Return the ending index of the context for this group. More... | |
IdContext | context () const |
Return the context for this group. More... | |
Private Attributes | |
std::vector< Identifier > | m_id_vec |
List of Identifiers for this group. More... | |
size_type | m_end_index |
Ending index for this group's context. More... | |
Manage a list of identifiers.
The identifiers are kept in sorted order, and the index of an identifier in this list defines its hash value. We supply methods for converting between identifiers and the hash value; we also keep track of the corresponding ID context.
Most calo ID helpers will use two of these: one for channels (cells) and one for regiosn.
Definition at line 59 of file CaloIDHelper.h.
CaloIDHelper::HashGroup::HashGroup | ( | ) |
id_iterator CaloIDHelper::HashGroup::begin | ( | ) | const |
Return a begin iterator over the group's Identifiers.
IdContext CaloIDHelper::HashGroup::context | ( | ) | const |
Return the context for this group.
Definition at line 83 of file CaloIDHelper.cxx.
id_iterator CaloIDHelper::HashGroup::end | ( | ) | const |
Return an end iterator over the group's Identifiers.
size_type CaloIDHelper::HashGroup::end_index | ( | ) | const |
Return the ending index of the context for this group.
int CaloIDHelper::HashGroup::get_hash | ( | Identifier | id, |
IdentifierHash & | hash_id | ||
) | const |
Look up the hash code corresponding to an Identifier.
Look up the hash code corresponding ot an Identifier.
Uses binary search.
id | The identifier to look up. | |
[out] | hash_id | The corresponding hash code. |
Definition at line 68 of file CaloIDHelper.cxx.
IdentifierHash CaloIDHelper::HashGroup::hash | ( | Identifier | id | ) | const |
Look up the hash code corresponding to an Identifier.
Uses binary search.
id | The identifier to look up. |
size_type CaloIDHelper::HashGroup::hash_max | ( | ) | const |
Return one more than the largest hash code.
Identifier CaloIDHelper::HashGroup::id | ( | IdentifierHash | hashId | ) | const |
Return the identifier for a given hash code (no checking).
const std::vector<Identifier>& CaloIDHelper::HashGroup::ids | ( | ) | const |
Return a vector of all Identifiers for this group.
int CaloIDHelper::HashGroup::init | ( | const std::string & | name, |
const std::set< Identifier > & | ids, | ||
size_type | end_index, | ||
IMessageSvc * | msgSvc, | ||
const MultiRange * | full_range = 0 |
||
) |
Initialize.
name | Name of this group (only for error reporting). |
ids | Set of Identifiers comprising this group. |
end_index | The ending index for the context for this group. @parma msgSvc The global message service (may be 0, only for error reporting). |
full_range | The MultiRange corresponding to this group. If supplied, the side of the ids set is checked against the range's cardinality. |
Definition at line 43 of file CaloIDHelper.cxx.
int CaloIDHelper::HashGroup::init | ( | T & | parent, |
const std::string & | type, | ||
const MultiRange & | full_range, | ||
Identifier(T::*)(const ExpandedIdentifier &) const | idfunc, | ||
size_type | end_index | ||
) |
Initialize.
parent | The parent ID helper (in which idfunc is defined). |
type | A string to add on to the name. |
full_range | The MultiRange for to this group. |
idfunc | Function to convert from an ExpandedIdentifier to an Identifier for this group. |
end_index | The ending index for the context for this group. |
id_range CaloIDHelper::HashGroup::range | ( | ) | const |
Return an iterator range over the group's Identifiers.
|
private |
Ending index for this group's context.
Definition at line 155 of file CaloIDHelper.h.
|
private |
List of Identifiers for this group.
Definition at line 152 of file CaloIDHelper.h.