41 ATH_MSG_ERROR(
"PixelID::wafer_id result is NOT ok. ID, range "
56 ATH_MSG_ERROR(
"PixelID::pixel_id result is NOT ok. ID, range "
70 if (range.match(expId)) {
72 if (not layer_disk_field.
empty()) {
88 if (range.match(expId)) {
90 if (not eta_field.
empty()) {
105 if (range.match(expId)) {
107 if (not eta_field.
empty()) {
133 if (range.match(expId)) {
135 if (not phi_field.
empty()) {
152 if (range.match(expId)) {
154 if (not phi_field.
empty()) {
171 if (range.match(expId)) {
173 if (not eta_field.
empty()) {
193 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
207 ATH_MSG_FATAL(
"PixelID::initialize_from_dict - cannot access InnerDetector dictionary");
220 ATH_MSG_FATAL(
" PixelID::initialize_from_dict - cannot get pixel id dictionary ");
230 if (
m_dict->get_label_value(
"barrel_endcap",
"barrel", barrel_value)) {
231 ATH_MSG_FATAL(
"Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary "
238 <<
"Set barrel field values: "
251 if (
m_dict->get_label_value(
"barrel_endcap",
"negative_dbm", dbm_value)) {
252 if (
m_dict->version().find(
"DBM") != std::string::npos) {
253 ATH_MSG_WARNING(
"Could not get value for label 'negative_dbm' of field 'barrel_endcap' in dictionary "
262 if (
m_dict->get_label_value(
"barrel_endcap",
"positive_dbm", dbm_value)) {
263 if (
m_dict->version().find(
"DBM") != std::string::npos) {
264 ATH_MSG_WARNING(
"Could not get value for label 'positive_dbm' of field 'barrel_endcap' in dictionary "
285 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
286 ATH_MSG_FATAL(
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
287 << atlasDict->
name());
294 if (
m_dict->get_label_value(
"part",
"Pixel", pixelField)) {
295 ATH_MSG_FATAL(
"Could not get value for label 'Pixel' of field 'part' in dictionary "
300 ATH_MSG_DEBUG(
"PixelID::initialize_from_dict Found field values: InDet/Pixel "
301 << inDetField <<
"/" << pixelField);
306 region_id.add(inDetField);
307 region_id.add(pixelField);
344 unsigned int nids = 0;
345 std::set<Identifier> ids;
349 for (
const auto & exp_id:rit) {
354 if (!(ids.insert(
id)).second) {
356 <<
"Error: duplicated id for wafer id. nid " << nids
358 <<
" exp id " << (std::string) exp_id
368 <<
"Error: set size NOT EQUAL to hash max. size " << ids.size()
375 std::set<Identifier>::const_iterator first = ids.begin();
376 std::set<Identifier>::const_iterator last = ids.end();
377 for (; first != last && nids <
m_wafer_vec.size(); ++first) {
390 unsigned short index = id;
403 unsigned short index = id;
416 unsigned short index = id;
429 unsigned short index = id;
466 for (
const auto & exp_id: rit) {
484 if (
get_hash(
id, hash_id, &wcontext)) {
485 ATH_MSG_FATAL(
"PixelID::init_neighbors - unable to get hash, exp/compact "
492 unsigned short index = hash_id;
506 if (
get_hash(
id, hash_id, &wcontext)) {
507 ATH_MSG_FATAL(
"PixelID::init_neighbors - unable to get previous phi hash, exp/compact "
523 if (
get_hash(
id, hash_id, &wcontext)) {
524 ATH_MSG_FATAL(
"PixelID::init_neighbors - unable to get next phi hash, exp/compact "
540 if (
get_hash(
id, hash_id, &wcontext)) {
541 ATH_MSG_FATAL(
"PixelID::init_neighbors - unable to get previous eta hash, exp/compact "
557 if (
get_hash(
id, hash_id, &wcontext)) {
558 ATH_MSG_FATAL(
"PixelID::init_neighbors - unable to get next eta hash, exp/compact "
574 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - dictionary NOT initialized");
594 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find pixel region index: id, reg "
605 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'subdet' field");
610 field =
m_dict->find_field(
"part");
614 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'part' field");
618 field =
m_dict->find_field(
"barrel_endcap");
622 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'barrel_endcap' field");
626 field =
m_dict->find_field(
"layer");
630 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'layer' field");
634 field =
m_dict->find_field(
"phi_module");
638 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'phi_module' field");
641 field =
m_dict->find_field(
"eta_module");
645 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'eta_module' field");
648 field =
m_dict->find_field(
"phi_index");
652 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'phi_index' field");
655 field =
m_dict->find_field(
"eta_index");
659 ATH_MSG_FATAL(
"PixelID::initLevelsFromDict - unable to find 'eta_index' field");
678 ATH_MSG_DEBUG(
"decode index and bit fields for each level:");
686 m_impl[i].ored_field().show();
690 std::cout <<
"PixelID::initLevelsFromDict - found levels \n";
752 size_t begin = (context) ? context->
begin_index() : 0;
754 size_t end = (context) ? context->
end_index() : 0;
783 size_t begin = (context) ? context->
begin_index() : 0;
784 size_t end = (context) ? context->
end_index() : 0;
809 for (; first != last; ++first, ++nids) {
818 ATH_MSG_ERROR(
"PixelID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
820 << (std::string) expId);
830 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
840 if (exp_id[0] != new_exp_id[0] ||
841 exp_id[1] != new_exp_id[1] ||
842 exp_id[2] != new_exp_id[2] ||
843 exp_id[3] != new_exp_id[3] ||
844 exp_id[4] != new_exp_id[4] ||
845 exp_id[5] != new_exp_id[5]) {
846 ATH_MSG_ERROR(
"PixelID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
847 << (std::string) new_exp_id
848 <<
" " << (std::string) exp_id
866 ATH_MSG_ERROR(
"PixelID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
873 ATH_MSG_DEBUG(
"PixelID::test_wafer_packing: Successfully tested " << nids <<
" ids.");
876 ATH_MSG_ERROR(
"PixelID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined.");
#define ATH_MSG_WARNING(x)
std::string formatOutput(std::string_view title, const IdDictFieldImplementation &idDictFieldImp)
This is an Identifier helper class for the Pixel subdetector.
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 pixel_field_value() const
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
bool is_pixel(Identifier id) const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Identifier pixel(void) const
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.
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
int eta_index(const Identifier &id) const
int layer_disk(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
int eta_module_max(const Identifier &id) const
size_type m_ETA_MODULE_INDEX
MultiRange m_full_wafer_range
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
size_type m_LAYER_DISK_INDEX
const_expanded_id_iterator pixel_end() const
const IdDictDictionary * m_dict
bool is_eta_module_max(const Identifier &id) const
For the barrel.
static constexpr std::array< std::string_view, nImplementations > m_implNames
void pixel_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
hash_vec m_prev_phi_wafer_vec
size_type m_pixel_region_index
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
size_type wafer_hash_max() const
int eta_module(const Identifier &id) const
size_type m_BARREL_EC_INDEX
int phi_index(const Identifier &id) const
const_id_iterator wafer_end() const
ExpandedIdentifier m_baseExpandedIdentifier
hash_vec m_next_phi_wafer_vec
int eta_index_max(const Identifier &id) const
Identifier::size_type size_type
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
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_pixel_hash_max
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)
size_type m_PHI_INDEX_INDEX
MultiRange::const_identifier_factory const_expanded_id_iterator
std::array< IdDictFieldImplementation, nImplementations > m_impl
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)
IdContext pixel_context() const
int phi_index_max(const Identifier &id) const
const_expanded_id_iterator pixel_begin() const
For pixel ids, only expanded id iterators are available.
size_type m_PHI_MODULE_INDEX
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
size_type m_wafer_hash_max
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
Identifier m_baseIdentifier
IdContext wafer_context() const
std::vector< Identifier >::const_iterator const_id_iterator
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
hash_vec m_prev_eta_wafer_vec
void test_wafer_packing() const
Tests of packing.
size_type m_ETA_INDEX_INDEX
int eta_module_min(const Identifier &id) const
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)
hash_vec m_next_eta_wafer_vec
int phi_module(const Identifier &id) const
bool is_eta_module_min(const Identifier &id) const
For the barrel.
MultiRange m_full_pixel_range
size_type pixel_hash_max() const
int phi_module_max(const Identifier &id) const
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::string formatOutput(std::string_view title, const IdDictFieldImplementation &idDictFieldImp)