54 ATH_MSG_ERROR(
" HGTD_ID::wafer_id result is NOT ok. ID, range "
76 ATH_MSG_ERROR(
" HGTD_ID::pixel_id result is NOT ok. ID, range "
90 if (range.match(expId)) {
92 if (not layer_field.
empty()) {
109 if (range.match(expId)) {
111 if (not phi_module_field.
empty()) {
128 if (range.match(expId)) {
130 if (not eta_module_field.
empty()) {
147 if (range.match(expId)) {
149 if (not eta_module_field.
empty()) {
166 if (range.match(expId)) {
168 if (not phi_field.
empty()) {
185 if (range.match(expId)) {
187 if (not eta_field.
empty()) {
209 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
224 ATH_MSG_FATAL(
" HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary ");
240 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
241 ATH_MSG_FATAL(
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
242 << atlasDict->
name());
248 if (
m_dict->get_label_value(
"part",
"HGTD", hgtdField)) {
249 ATH_MSG_FATAL(
"Could not get value for label 'HGTD' of field 'part' in dictionary "
254 <<
"Found field values: InDet/HGTD "
260 region_id.add(inDetField);
261 region_id.add(hgtdField);
292 unsigned int nids = 0;
293 std::set<Identifier> ids;
297 auto first = rit.
begin();
298 auto last = rit.
end();
299 for (; first != last; ++first) {
305 if(!(ids.insert(
id)).second) {
307 <<
" Error: duplicated id for wafer id. nid " << nids
309 <<
" exp id " << (std::string)exp_id
317 <<
" Error: set size NOT EQUAL to hash max. size " << ids.size()
323 std::set<Identifier>::const_iterator first = ids.begin();
324 std::set<Identifier>::const_iterator last = ids.end();
325 for (; first != last && nids <
m_wafer_vec.size(); ++first) {
341 unsigned short index = id;
353 unsigned short index = id;
365 unsigned short index = id;
377 unsigned short index = id;
410 auto first = rit.
begin();
411 auto last = rit.
end();
412 for (; first != last; ++first) {
431 if (
get_hash(
id, hash_id, &wcontext)) {
432 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get hash, exp/compact "
438 unsigned short index = hash_id;
452 if (
get_hash(
id, hash_id, &wcontext)) {
453 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
468 if (
get_hash(
id, hash_id, &wcontext)) {
469 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
484 if (
get_hash(
id, hash_id, &wcontext)) {
485 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
500 if (
get_hash(
id, hash_id, &wcontext)) {
501 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
528 ATH_MSG_FATAL(
" HGTD_ID::initLevelsFromDict - dictionary NOT initialized ");
548 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
569 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'subdet' field ");
573 field =
m_dict->find_field(
"part");
578 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'part' field ");
587 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'endcap' field " );
594 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'layer' field " );
601 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'moduleInLayer' field " );
609 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_module' field " );
617 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'hgtd_phi_index' field " );
625 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_index' field " );
641 ATH_MSG_DEBUG(
"decode index and bit fields for each level:");
650 msg() <<
"HGTD_ID::initLevelsFromDict - found levels \n";
721 size_t begin = (context) ? context->
begin_index(): 0;
723 size_t end = (context) ? context->
end_index() : 0;
755 size_t begin = (context) ? context->
begin_index(): 0;
756 size_t end = (context) ? context->
end_index() : 0;
784 for (; first != last; ++first, ++nids) {
793 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
795 << (std::string)expId);
804 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
814 if (exp_id[0] != new_exp_id[0] ||
815 exp_id[1] != new_exp_id[1] ||
816 exp_id[2] != new_exp_id[2] ||
817 exp_id[3] != new_exp_id[3] ||
818 exp_id[4] != new_exp_id[4] ||
819 exp_id[5] != new_exp_id[5]) {
820 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
821 << (std::string)new_exp_id
822 <<
" " << (std::string)exp_id
839 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
845 ATH_MSG_DEBUG(
"HGTD_ID::test_wafer_packing: Successful tested "
846 << nids <<
" ids. ");
849 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. ");
std::string formatOutput(std::string_view title, const IdDictFieldImplementation &idDictFieldImp)
MsgStream & msg() const
The standard message stream.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
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.
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
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 hgtd_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.
ConstRangeIterator end() const
ConstRangeIterator begin() const
void clear()
Erase all fields.
hash_vec m_next_phi_wafer_vec
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
int eta_module(const Identifier &id) const
size_type m_ETA_MODULE_INDEX
void pixel_id_checks(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
std::string m_padInModuleColumn
size_type m_PHI_INDEX_INDEX
hash_vec m_prev_eta_wafer_vec
int eta_index(const Identifier &id) const
Identifier wafer_id(int endcap, int layer, int phi_module, int eta_module) const
For a single crystal.
void wafer_id_checks(int endcap, int layer, int phi_module, int eta_module) const
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const
Create compact id from hash id (return == 0 for OK)
void set_useNewIdentifierScheme(bool switchIntoNewIdentifier)
std::array< IdDictFieldImplementation, nImplementations > m_impl
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
int phi_module_max(const Identifier &id) const
Identifier pixel_id(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Identifier::size_type size_type
size_type wafer_hash_max() const
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
MultiRange::const_identifier_factory const_expanded_id_iterator
hash_vec m_next_eta_wafer_vec
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
int phi_index(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
MultiRange m_full_wafer_range
size_type m_PHI_MODULE_INDEX
IdContext pixel_context() const
const_id_iterator wafer_end() const
static constexpr std::array< std::string_view, nImplementations > m_implNames
int eta_index_max(const Identifier &id) const
IdContext wafer_context() const
int phi_index_max(const Identifier &id) const
size_type m_hgtd_region_index
int eta_module_max(const Identifier &id) const
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
size_type m_ETA_INDEX_INDEX
std::string m_moduleInLayer_Or_Row
const IdDictDictionary * m_dict
size_type pixel_hash_max() const
int layer_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
const_expanded_id_iterator pixel_end() const
int layer(const Identifier &id) const
void test_wafer_packing() const
Tests of packing.
bool get_useNewIdentifierScheme() const
int endcap(const Identifier &id) const
Values of different levels (failure returns 0)
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)
size_type m_wafer_hash_max
const_expanded_id_iterator pixel_begin() const
For pixel ids, only expanded id iterators are available.
std::vector< Identifier >::const_iterator const_id_iterator
MultiRange m_full_pixel_range
bool m_useNewIdentifierScheme
std::string m_padInModuleRow
hash_vec m_prev_phi_wafer_vec
std::string m_moduleInRow
int eta_module_min(const Identifier &id) const
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
size_type m_pixel_hash_max
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const
Create hash id from compact id (return == 0 for OK)
int phi_module(const Identifier &id) const
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.
constexpr bool is_valid() const
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::string formatOutput(std::string_view title, const IdDictFieldImplementation &idDictFieldImp)