37 m_neighboursByEta{invalidHashFunc, invalidHashFunc, invalidHashFunc , invalidHashFunc, invalidHashFunc},
135 for (
unsigned int i = 0; i != useRange.size(); ++i) {
136 const Range& range = useRange[i];
137 if (range.match(expId)) {
139 if (not thisField.
empty()) {
141 if (fieldIndx ==
ETA or fieldIndx ==
STRIP){
167 if (range.match(expId)) {
169 if (not eta_field.
empty()) {
221 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
246 if (
m_dict->get_label_value(
"barrel_endcap",
"barrel", barrel_value)) {
247 ATH_MSG_ERROR(
"Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary " +
m_dict->name());
263 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
264 ATH_MSG_ERROR(
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary " + atlasDict->
name());
270 if (
m_dict->get_label_value(
"part",
"SCT", sctField)) {
271 ATH_MSG_ERROR(
"Could not get value for label 'SCT' of field 'part' in dictionary " +
m_dict->name());
274 ATH_MSG_DEBUG(
"Found field values: SCT " << std::to_string(sctField));
278 region_id.add(inDetField);
279 region_id.add(sctField);
314 unsigned int nids = 0;
315 std::set<Identifier> ids;
319 for (
const auto & exp_id : rit) {
321 if (!(ids.insert(
id)).second) {
322 ATH_MSG_ERROR(
"duplicated id for wafer id. nid " + std::to_string(nids) +
" compact id " +
id.getString() +
" id " + std::string(exp_id));
334 std::set<Identifier>::const_iterator first = ids.begin();
335 std::set<Identifier>::const_iterator last = ids.end();
336 for (; first != last && nids <
m_wafer_vec.size(); ++first) {
373 if (!
get_id(hashId,
id, &wafer_context1)) {
374 return(
side(
id) ? hashId - 1 : hashId + 1);
432 if (!
get_id(hashId,
id, &wafer_context1)) {
433 other =
side(
id) ? hashId - 1 : hashId + 1;
468 for (
const auto & exp_id : rit) {
483 if (
get_hash(
id, hash_id, &wcontext)) {
489 unsigned short index = hash_id;
500 if (
get_hash(
id, hash_id, &wcontext)) {
501 ATH_MSG_ERROR(
"- unable to get previous phi hash, exp/compact " +
id.getString());
512 if (
get_hash(
id, hash_id, &wcontext)) {
513 ATH_MSG_ERROR(
"- unable to get next phi hash, exp/compact " +
id.getString());
524 if (
get_hash(
id, hash_id, &wcontext)) {
525 ATH_MSG_ERROR(
"- unable to get previous eta hash, exp/compact " +
id.getString());
536 if (
get_hash(
id, hash_id, &wcontext)) {
537 ATH_MSG_ERROR(
"- unable to get next eta hash, exp/compact " +
id.getString());
567 auto findField = [
this](
const std::string &name,
const size_t indx){
573 const auto lvl = (indx ==
ROW) ? MSG::DEBUG : MSG::ERROR;
574 msg() << lvl <<
"- unable to find '" << name <<
"' field " <<
endmsg;
579 if (not findField(
"subdet",
INDET))
return 1;
580 if (not findField(
"part",
SCT))
return 1;
581 if (not findField(
"barrel_endcap",
BARREL_EC))
return 1;
582 if (not findField(
"layer",
LAYER_DISK))
return 1;
583 if (not findField(
"phi_module",
PHI))
return 1;
584 if (not findField(
"eta_module",
ETA))
return 1;
585 if (not findField(
"side",
SIDE))
return 1;
587 if (not findField(
"strip",
STRIP))
return 1;
604 ATH_MSG_DEBUG(
"decode index and bit fields for each level: ");
653 size_t begin = (context) ? context->
begin_index() : 0;
655 size_t end = (context) ? context->
end_index() : 0;
665 ATH_MSG_ERROR(
"Do not know how to calculate strip id from hash yet!!");
704 size_t begin = (context) ? context->
begin_index() : 0;
705 size_t end = (context) ? context->
end_index() : 0;
723std::array<IdentifierHash, 5>
730 else return invalidHashes;
734std::array<IdentifierHash, 5>
741 else return invalidHashes;
This is an Identifier helper class for the SCT subdetector.
MsgStream & msg() const
The standard message stream.
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
int sct_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
AtlasDetectorID(const std::string &name, const std::string &group)
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
void clear()
Erase all fields.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
size_type begin_index() const
size_type end_index() const
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const IdDictFieldImplementation & implementation(size_t i) const
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
element_type get_minimum() const
Query the values.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
bool get_next(element_type current, element_type &next) const
element_type get_maximum() const
This is a "hash" representation of an Identifier.
bool is_valid() const
Check if id is in a valid state.
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::array< IdentifierHash, 5 > neighbours_by_phi(const IdentifierHash &idh) const
Identifier::size_type size_type
int phi_module_max(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override final
Initialization from the identifier dictionary.
hash_vec m_next_phi_wafer_vec
IdentifierHash nextInSequence(const IdentifierHash &id, const hash_vec &vectorOfHashes) const
int getMaxField(const Identifier &id, const ExpandedIdIndices &fieldIndx) const
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override final
Create hash id from compact id (return == 0 for OK)
std::array< size_t, NUM_INDICES > m_indices
const std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > & neighbour_calls_by_eta() const
return functions to give neighbours in order: opposite, eta minus, eta plus, phi minus,...
size_type wafer_hash_max() const
size_type m_strip_hash_max
size_type m_wafer_hash_max
const IdDictDictionary * m_dict
IdDictFieldImplementation m_eta_mod_impl
MultiRange::const_identifier_factory const_expanded_id_iterator
int layer_disk(const Identifier &id) const
int side(const Identifier &id) const
std::array< std::function< IdentifierHash(const IdentifierHash &)>, 5 > m_neighboursByEta
void get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context=0) const
Create expanded id from compact id (return == 0 for OK)
const_id_iterator wafer_end() const
bool is_phi_module_max(const Identifier &id) const
IdContext strip_context() const
IdDictFieldImplementation m_row_impl
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
bool is_eta_module_max(const Identifier &id) const
For the barrel.
IdDictFieldImplementation m_side_impl
std::vector< Identifier >::const_iterator const_id_iterator
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
int strip_max(const Identifier &id) const
int row(const Identifier &id) const
std::array< IdentifierHash, 5 > neighbours_by_eta(const IdentifierHash &idh) const
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (-999 == failure)
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override final
Create compact id from hash id (return == 0 for OK)
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
const_expanded_id_iterator strip_end() const
int phi_module(const Identifier &id) const
int strip(const Identifier &id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
size_type m_sct_region_index
Range::field m_barrel_field
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
void strip_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
IdDictFieldImplementation m_bec_impl
int eta_module_max(const Identifier &id) const
IdDictFieldImplementation m_phi_mod_impl
IdDictFieldImplementation m_indet_impl
int eta_module(const Identifier &id) const
IdDictFieldImplementation m_strip_impl
MultiRange m_full_strip_range
size_type strip_hash_max() const
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
IdContext wafer_context() const
int get_other_side(const IdentifierHash &id, IdentifierHash &other) const
Wafer hash on other side.
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
hash_vec m_next_eta_wafer_vec
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
const_expanded_id_iterator strip_begin() const
For strip ids, only expanded id iterators are available.
IdDictFieldImplementation m_sct_impl
bool is_eta_module_min(const Identifier &id) const
For the barrel.
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
hash_vec m_prev_eta_wafer_vec
int eta_module_min(const Identifier &id) const
MultiRange m_full_wafer_range
hash_vec m_prev_phi_wafer_vec
IdDictFieldImplementation m_lay_disk_impl