 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "GaudiKernel/MsgStream.h"
18 m_hgtd_region_index(0),
23 m_PHI_MODULE_INDEX(4),
24 m_ETA_MODULE_INDEX(5),
41 int eta_module )
const
52 if(
m_msgSvc)
log << MSG::ERROR <<
" HGTD_ID::wafer_id result is NOT ok. ID, range "
54 else std::cout <<
" ERROR HGTD_ID::wafer_id result is NOT ok. ID, range "
77 if(
m_msgSvc)
log << MSG::ERROR <<
" HGTD_ID::pixel_id result is NOT ok. ID, range "
79 else std::cout <<
" ERROR HGTD_ID::pixel_id result is NOT ok. ID, range "
93 if (
range.match(expId)) {
95 if (not layer_field.
empty()) {
112 if (
range.match(expId)) {
114 if (not phi_module_field.
empty()) {
131 if (
range.match(expId)) {
133 if (not eta_module_field.
empty()) {
150 if (
range.match(expId)) {
152 if (not eta_module_field.
empty()) {
169 if (
range.match(expId)) {
171 if (not phi_field.
empty()) {
188 if (
range.match(expId)) {
190 if (not eta_field.
empty()) {
210 else std::cout <<
" INFO Initialize from dictionary" << std::endl;
215 else std::cout <<
" INFO Request to reinitialize not satisfied - tags have not changed" << std::endl;
220 else std::cout <<
" DEBUG (Re)initialize" << std::endl;
231 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary "
233 else std::cout <<
" FATAL HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary "
250 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
251 if(
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
254 else std::cout <<
" FATAL Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
263 if(
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'HGTD' of field 'part' in dictionary "
266 else std::cout <<
" FATAL Could not get value for label 'HGTD' of field 'part' in dictionary "
272 <<
"Found field values: InDet/HGTD "
276 else std::cout <<
" DEBUG HGTD_ID::initialize_from_dict "
277 <<
"Found field values: InDet/HGTD "
307 std::cout <<
" DEBUG HGTD_ID::initialize_from_dict "
333 unsigned int nids = 0;
334 std::set<Identifier>
ids;
339 auto last = rit.
end();
346 if(!(
ids.insert(
id)).second) {
348 <<
" Error: duplicated id for wafer id. nid " << nids
350 <<
" exp id " << (std::string)exp_id
352 else std::cout <<
" FATAL HGTD_ID::init_hashes "
353 <<
" Error: duplicated id for wafer id. nid " << nids
355 <<
" exp id " << (std::string)exp_id
364 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
367 else std::cout <<
" FATAL HGTD_ID::init_hashes "
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();
448 else std::cout <<
" DEBUG HGTD_ID::init_neighbors " << std::endl;
465 auto last = rit.
end();
485 if (
get_hash(
id, hash_id, &wcontext)) {
488 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get hash, exp/compact "
494 unsigned short index = hash_id;
508 if (
get_hash(
id, hash_id, &wcontext)) {
509 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
511 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
526 if (
get_hash(
id, hash_id, &wcontext)) {
527 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
529 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
544 if (
get_hash(
id, hash_id, &wcontext)) {
545 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
547 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
562 if (
get_hash(
id, hash_id, &wcontext)) {
563 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
565 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
609 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - dictionary NOT initialized " << std::endl;
629 if(
m_msgSvc)
log <<
MSG::FATAL <<
"HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
632 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
656 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'subdet' field "
667 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'part' field " << std::endl;
677 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'endcap' field " << std::endl;
686 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'layer' field " << std::endl;
695 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'moduleInLayer' field " << std::endl;
704 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_module' field " << std::endl;
713 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_phi_index' field " << std::endl;
722 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_index' field " << std::endl;
750 std::cout <<
" DEBUG decode index and bit fields for each level: " << std::endl;
819 std::cout <<
"HGTD_ID::initLevelsFromDict - found levels " << std::endl;
903 std::cout <<
"Do not know how to calculate pixel id from hash yet!!" << std::endl;
964 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
966 << (std::string)expId <<
endmsg;
967 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
969 << (std::string)expId << std::endl;
978 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
988 if (exp_id[0] != new_exp_id[0] ||
989 exp_id[1] != new_exp_id[1] ||
990 exp_id[2] != new_exp_id[2] ||
991 exp_id[3] != new_exp_id[3] ||
992 exp_id[4] != new_exp_id[4] ||
993 exp_id[5] != new_exp_id[5]) {
994 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
995 << (std::string)new_exp_id
996 <<
" " << (std::string)exp_id
998 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
999 << (std::string)new_exp_id
1000 <<
" " << (std::string)exp_id
1017 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1020 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1029 else std::cout <<
" DEBUG HGTD_ID::test_wafer_packing: Successful tested "
1034 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1036 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
IdDictRegion * find_region(const std::string ®ion_name) const
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
IdDictFieldImplementation m_phi_index_impl
MultiRange build_multirange() const
Get MultiRange for full dictionary.
MultiRange m_full_wafer_range
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
int eta_module_min(const Identifier &id) const
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
const IdDictDictionary * m_dict
identifier_factory factory_begin()
std::string show_to_string(void) const
size_type wafer_hash_max() const
const IdDictRegion & region(size_t i) const
Region at index i.
identifier_factory factory_end()
element_type get_minimum() const
Query the values.
IdDictFieldImplementation m_hgtd_impl
size_type cardinalityUpTo(const ExpandedIdentifier &id) const
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
bool get_useNewIdentifierScheme() const
size_type end_index() const
const_id_iterator wafer_end() const
int endcap(const Identifier &id) const
Values of different levels (failure returns 0)
int eta_index(const Identifier &id) const
const_id_iterator wafer_begin() const
Iterators over full set of ids. Wafer iterator is sorted.
int eta_module_max(const Identifier &id) const
IMessageSvc * m_msgSvc
pointer to the message service
bool decode_index() const
hash_vec m_prev_phi_wafer_vec
element_type get_maximum() const
const std::string & name() const
Dictionary name.
void wafer_id_checks(int endcap, int layer, int phi_module, int eta_module) const
int layer(const Identifier &id) const
IdDictFieldImplementation m_ec_impl
size_type m_wafer_hash_max
IdDictField * find_field(const std::string &name) const
hash_vec m_next_phi_wafer_vec
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)
Identifier wafer_id(int endcap, int layer, int phi_module, int eta_module) const
For a single crystal.
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)
int phi_index(const Identifier &id) const
std::string m_padInModuleColumn
const IdDictFieldImplementation & implementation(size_t i) const
IdDictFieldImplementation m_eta_index_impl
size_type begin_index() const
std::string m_padInModuleRow
void pixel_id_checks(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
size_type m_pixel_hash_max
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
int hgtd_field_value() const
std::string m_moduleInRow
bool m_useNewIdentifierScheme
size_type m_ETA_INDEX_INDEX
size_type bits_offset() const
size_type m_PHI_MODULE_INDEX
int eta_index_max(const Identifier &id) const
bool get_next(element_type current, element_type &next) const
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)
size_type m_ETA_MODULE_INDEX
hash_vec m_prev_eta_wafer_vec
ConstRangeIterator begin() const
const Range::field & ored_field() const
IdDictFieldImplementation m_phi_mod_impl
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
const_expanded_id_iterator pixel_begin() const
For pixel ids, only expanded id iterators are available.
bool is_valid() const
Check if id is in a valid state.
int phi_module_max(const Identifier &id) 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.
hash_vec m_next_eta_wafer_vec
MultiRange m_full_pixel_range
IdDictFieldImplementation m_indet_impl
int get_label_value(const std::string &field, const std::string &label, int &value) const
Identifier::size_type size_type
size_type pixel_hash_max() const
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Identifier pixel_id(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
IdContext pixel_context() const
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
int match(const ExpandedIdentifier &id) const
Match an identifier.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
value_type zeroing_mask() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
int eta_module(const Identifier &id) const
std::vector< Identifier >::const_iterator const_id_iterator
void set_useNewIdentifierScheme(bool switchIntoNewIdentifier)
int phi_module(const Identifier &id) const
std::string m_moduleInLayer_Or_Row
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
void clear()
Erase all fields.
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
const_expanded_id_iterator pixel_end() const
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
IdDictFieldImplementation m_eta_mod_impl
ConstRangeIterator end() const
size_type cardinality() const
Computes a possible cardinality from all ranges.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
int layer_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdContext wafer_context() const
size_type m_hgtd_region_index
int phi_index_max(const Identifier &id) const
size_type m_PHI_INDEX_INDEX
void test_wafer_packing() const
Tests of packing.
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
IdDictFieldImplementation m_layer_impl