52 ATH_MSG_ERROR(
" HGTD_ID::wafer_id result is NOT ok. ID, range "
74 ATH_MSG_ERROR(
" HGTD_ID::pixel_id result is NOT ok. ID, range "
88 if (range.match(expId)) {
90 if (not layer_field.
empty()) {
107 if (range.match(expId)) {
109 if (not phi_module_field.
empty()) {
126 if (range.match(expId)) {
128 if (not eta_module_field.
empty()) {
145 if (range.match(expId)) {
147 if (not eta_module_field.
empty()) {
164 if (range.match(expId)) {
166 if (not phi_field.
empty()) {
183 if (range.match(expId)) {
185 if (not eta_field.
empty()) {
207 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
222 ATH_MSG_FATAL(
" HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary ");
238 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
239 ATH_MSG_FATAL(
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
240 << atlasDict->
name());
246 if (
m_dict->get_label_value(
"part",
"HGTD", hgtdField)) {
247 ATH_MSG_FATAL(
"Could not get value for label 'HGTD' of field 'part' in dictionary "
252 <<
"Found field values: InDet/HGTD "
258 region_id.add(inDetField);
259 region_id.add(hgtdField);
290 unsigned int nids = 0;
291 std::set<Identifier> ids;
295 auto first = rit.
begin();
296 auto last = rit.
end();
297 for (; first != last; ++first) {
303 if(!(ids.insert(
id)).second) {
305 <<
" Error: duplicated id for wafer id. nid " << nids
307 <<
" exp id " << (std::string)exp_id
315 <<
" Error: set size NOT EQUAL to hash max. size " << ids.size()
321 std::set<Identifier>::const_iterator first = ids.begin();
322 std::set<Identifier>::const_iterator last = ids.end();
323 for (; first != last && nids <
m_wafer_vec.size(); ++first) {
339 unsigned short index = id;
351 unsigned short index = id;
363 unsigned short index = id;
375 unsigned short index = id;
408 auto first = rit.
begin();
409 auto last = rit.
end();
410 for (; first != last; ++first) {
429 if (
get_hash(
id, hash_id, &wcontext)) {
430 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get hash, exp/compact "
436 unsigned short index = hash_id;
450 if (
get_hash(
id, hash_id, &wcontext)) {
451 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
466 if (
get_hash(
id, hash_id, &wcontext)) {
467 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
482 if (
get_hash(
id, hash_id, &wcontext)) {
483 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
498 if (
get_hash(
id, hash_id, &wcontext)) {
499 ATH_MSG_FATAL(
" HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
526 ATH_MSG_FATAL(
" HGTD_ID::initLevelsFromDict - dictionary NOT initialized ");
546 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
567 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'subdet' field ");
571 field =
m_dict->find_field(
"part");
576 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'part' field ");
585 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'endcap' field " );
592 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'layer' field " );
599 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'moduleInLayer' field " );
607 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_module' field " );
615 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'hgtd_phi_index' field " );
623 ATH_MSG_FATAL(
"HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_index' field " );
639 ATH_MSG_DEBUG(
"decode index and bit fields for each level: ");
649 std::cout <<
"indet " <<
m_indet_impl.decode_index() <<
" "
656 std::cout <<
"hgtd " <<
m_hgtd_impl.decode_index() <<
" "
663 std::cout <<
"ec " <<
m_ec_impl.decode_index() <<
" "
664 << (std::string)
m_ec_impl.ored_field() <<
" "
670 std::cout <<
"layer " <<
m_layer_impl.decode_index() <<
" "
707 std::cout <<
"HGTD_ID::initLevelsFromDict - found levels " << std::endl;
778 size_t begin = (context) ? context->
begin_index(): 0;
780 size_t end = (context) ? context->
end_index() : 0;
791 std::cout <<
"Do not know how to calculate pixel id from hash yet!!" << std::endl;
812 size_t begin = (context) ? context->
begin_index(): 0;
813 size_t end = (context) ? context->
end_index() : 0;
841 for (; first != last; ++first, ++nids) {
850 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
852 << (std::string)expId);
861 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
871 if (exp_id[0] != new_exp_id[0] ||
872 exp_id[1] != new_exp_id[1] ||
873 exp_id[2] != new_exp_id[2] ||
874 exp_id[3] != new_exp_id[3] ||
875 exp_id[4] != new_exp_id[4] ||
876 exp_id[5] != new_exp_id[5]) {
877 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
878 << (std::string)new_exp_id
879 <<
" " << (std::string)exp_id
896 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
902 ATH_MSG_DEBUG(
"HGTD_ID::test_wafer_packing: Successful tested "
903 << nids <<
" ids. ");
906 ATH_MSG_ERROR(
"HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. ");
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
IdDictFieldImplementation m_layer_impl
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)
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
IdDictFieldImplementation m_phi_index_impl
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
IdDictFieldImplementation m_phi_mod_impl
void test_wafer_packing() const
Tests of packing.
IdDictFieldImplementation m_eta_index_impl
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
IdDictFieldImplementation m_hgtd_impl
MultiRange m_full_pixel_range
IdDictFieldImplementation m_indet_impl
bool m_useNewIdentifierScheme
std::string m_padInModuleRow
IdDictFieldImplementation m_ec_impl
hash_vec m_prev_phi_wafer_vec
std::string m_moduleInRow
IdDictFieldImplementation m_eta_mod_impl
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.
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.