|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
    5 #include "GaudiKernel/MsgStream.h" 
   21     m_hgtd_region_index(0),
 
   26     m_PHI_MODULE_INDEX(4),
 
   27     m_ETA_MODULE_INDEX(5),
 
   44                            int eta_module )
 const 
   55         if(
m_msgSvc) 
log << MSG::ERROR << 
" HGTD_ID::wafer_id result is NOT ok. ID, range "  
   57         else std::cout << 
" ERROR HGTD_ID::wafer_id result is NOT ok. ID, range "  
   80         if(
m_msgSvc) 
log << MSG::ERROR << 
" HGTD_ID::pixel_id result is NOT ok. ID, range "  
   82         else std::cout << 
" ERROR HGTD_ID::pixel_id result is NOT ok. ID, range "  
   96         if (
range.match(expId)) {
 
   98             if (not layer_field.
empty()) {
 
  115         if (
range.match(expId)) {
 
  117             if (not phi_module_field.
empty()) {
 
  134         if (
range.match(expId)) {
 
  136             if (not eta_module_field.
empty()) {
 
  153         if (
range.match(expId)) {
 
  155             if (not eta_module_field.
empty()) {
 
  172         if (
range.match(expId)) {
 
  174             if (not phi_field.
empty()) {
 
  191         if (
range.match(expId)) {
 
  193             if (not eta_field.
empty()) {
 
  213     else         std::cout << 
" INFO Initialize from dictionary" << std::endl;
 
  218         else std::cout << 
" INFO Request to reinitialize not satisfied - tags have not changed" << std::endl;
 
  223         else         std::cout << 
" DEBUG (Re)initialize" << std::endl;
 
  234         if(
m_msgSvc) 
log << 
MSG::FATAL << 
" HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary " 
  236         else std::cout << 
" FATAL HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary " 
  253     if (atlasDict->
get_label_value(
"subdet", 
"InnerDetector", inDetField)) {
 
  254         if(
m_msgSvc) 
log << 
MSG::FATAL << 
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "  
  257         else std::cout << 
" FATAL Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "  
  266         if(
m_msgSvc) 
log << 
MSG::FATAL << 
"Could not get value for label 'HGTD' of field 'part' in dictionary "  
  269         else std::cout << 
" FATAL Could not get value for label 'HGTD' of field 'part' in dictionary "  
  275                      << 
"Found field values: InDet/HGTD "   
  279     else std::cout << 
" DEBUG HGTD_ID::initialize_from_dict "  
  280                    << 
"Found field values: InDet/HGTD "   
  310         std::cout << 
" DEBUG HGTD_ID::initialize_from_dict "  
  336     unsigned int nids = 0;
 
  337     std::set<Identifier> 
ids;
 
  342         auto last  = rit.
end();
 
  349             if(!(
ids.insert(
id)).second) {
 
  351                                  << 
" Error: duplicated id for wafer id. nid " << nids
 
  353                                  << 
" exp id " << (std::string)exp_id 
 
  355                 else std::cout << 
" FATAL HGTD_ID::init_hashes " 
  356                                << 
" Error: duplicated id for wafer id. nid " << nids
 
  358                                << 
" exp id " << (std::string)exp_id 
 
  367                          << 
" Error: set size NOT EQUAL to hash max. size " << 
ids.size()
 
  370         else std::cout << 
" FATAL HGTD_ID::init_hashes " 
  371                        << 
" Error: set size NOT EQUAL to hash max. size " << 
ids.size()
 
  378     std::set<Identifier>::const_iterator 
first = 
ids.begin();
 
  379     std::set<Identifier>::const_iterator last  = 
ids.end();
 
  451     else std::cout << 
" DEBUG HGTD_ID::init_neighbors " << std::endl;
 
  468         auto last  = rit.
end();
 
  488             if (
get_hash(
id, hash_id, &wcontext)) {
 
  491                 else std::cout << 
" FATAL HGTD_ID::init_neighbors - unable to get hash, exp/compact " 
  497             unsigned short index = hash_id;
 
  511                 if (
get_hash(
id, hash_id, &wcontext)) {
 
  512                     if(
m_msgSvc) 
log << 
MSG::FATAL << 
" HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact " 
  514                     else std::cout << 
" FATAL HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact " 
  529                 if (
get_hash(
id, hash_id, &wcontext)) {
 
  530                     if(
m_msgSvc) 
log << 
MSG::FATAL << 
" HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
 
  532                     else std::cout << 
" FATAL HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
 
  547                 if (
get_hash(
id, hash_id, &wcontext)) {
 
  548                     if(
m_msgSvc) 
log << 
MSG::FATAL << 
" HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact " 
  550                     else std::cout << 
" FATAL HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact " 
  565                 if (
get_hash(
id, hash_id, &wcontext)) {
 
  566                     if(
m_msgSvc) 
log << 
MSG::FATAL << 
" HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact " 
  568                     else std::cout << 
" FATAL HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact " 
  612         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - dictionary NOT initialized " << std::endl;
 
  632         if(
m_msgSvc) 
log << 
MSG::FATAL << 
"HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "   
  635         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "   
  659         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'subdet' field "          
  670         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'part' field " << std::endl;     
 
  680         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'endcap' field "  << std::endl;   
 
  689         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'layer' field "  << std::endl;   
 
  698         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'moduleInLayer' field "  << std::endl;   
 
  707         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_module' field "  << std::endl;   
 
  716         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_phi_index' field "  << std::endl;   
 
  725         else std::cout << 
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_index' field "  << std::endl;   
 
  753         std::cout << 
" DEBUG decode index and bit fields for each level: " << std::endl;
 
  822     std::cout << 
"HGTD_ID::initLevelsFromDict - found levels " << std::endl;
 
  906             std::cout << 
"Do not know how to calculate pixel id from hash yet!!" << std::endl;
 
  967                 if(
m_msgSvc) 
log << MSG::ERROR << 
"HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids " 
  969                                  << (std::string)expId << 
endmsg;
 
  970                 else std::cout << 
" ERROR HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "  
  972                                << (std::string)expId << std::endl;
 
  981         for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
 
  991             if (exp_id[0] != new_exp_id[0] ||
 
  992                 exp_id[1] != new_exp_id[1] ||
 
  993                 exp_id[2] != new_exp_id[2] ||
 
  994                 exp_id[3] != new_exp_id[3] ||
 
  995                 exp_id[4] != new_exp_id[4] ||
 
  996                 exp_id[5] != new_exp_id[5]) {
 
  997                 if(
m_msgSvc) 
log << MSG::ERROR << 
"HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids " 
  998                                  << (std::string)new_exp_id 
 
  999                                  << 
" " << (std::string)exp_id 
 
 1001                 else std::cout << 
" ERROR HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids " 
 1002                                << (std::string)new_exp_id 
 
 1003                                << 
" " << (std::string)exp_id 
 
 1020                 if(
m_msgSvc) 
log << MSG::ERROR << 
"HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids " 
 1023                 else std::cout << 
" ERROR HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids " 
 1032         else std::cout << 
" DEBUG HGTD_ID::test_wafer_packing: Successful tested "  
 1037         if(
m_msgSvc) 
log << MSG::ERROR << 
"HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "  
 1039         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