![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "GaudiKernel/MsgStream.h"
16 m_hgtd_region_index(0),
21 m_PHI_MODULE_INDEX(4),
22 m_ETA_MODULE_INDEX(5),
39 int eta_module )
const
50 if(
m_msgSvc)
log << MSG::ERROR <<
" HGTD_ID::wafer_id result is NOT ok. ID, range "
52 else std::cout <<
" ERROR HGTD_ID::wafer_id result is NOT ok. ID, range "
75 if(
m_msgSvc)
log << MSG::ERROR <<
" HGTD_ID::pixel_id result is NOT ok. ID, range "
77 else std::cout <<
" ERROR HGTD_ID::pixel_id result is NOT ok. ID, range "
91 if (
range.match(expId)) {
110 if (
range.match(expId)) {
129 if (
range.match(expId)) {
148 if (
range.match(expId)) {
167 if (
range.match(expId)) {
186 if (
range.match(expId)) {
208 else std::cout <<
" INFO Initialize from dictionary" << std::endl;
212 if(
m_msgSvc)
log << MSG::INFO <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
213 else std::cout <<
" INFO Request to reinitialize not satisfied - tags have not changed" << std::endl;
218 else std::cout <<
" DEBUG (Re)initialize" << std::endl;
229 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary "
231 else std::cout <<
" FATAL HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary "
248 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
249 if(
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
252 else std::cout <<
" FATAL Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
261 if(
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'HGTD' of field 'part' in dictionary "
264 else std::cout <<
" FATAL Could not get value for label 'HGTD' of field 'part' in dictionary "
270 <<
"Found field values: InDet/HGTD "
274 else std::cout <<
" DEBUG HGTD_ID::initialize_from_dict "
275 <<
"Found field values: InDet/HGTD "
305 std::cout <<
" DEBUG HGTD_ID::initialize_from_dict "
331 unsigned int nids = 0;
332 std::set<Identifier>
ids;
343 if(!(
ids.insert(
id)).second) {
345 <<
" Error: duplicated id for wafer id. nid " << nids
347 <<
" exp id " << (std::string)exp_id
349 else std::cout <<
" FATAL HGTD_ID::init_hashes "
350 <<
" Error: duplicated id for wafer id. nid " << nids
352 <<
" exp id " << (std::string)exp_id
361 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
364 else std::cout <<
" FATAL HGTD_ID::init_hashes "
365 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
372 std::set<Identifier>::const_iterator
first =
ids.begin();
373 std::set<Identifier>::const_iterator last =
ids.end();
445 else std::cout <<
" DEBUG HGTD_ID::init_neighbors " << std::endl;
482 if (
get_hash(
id, hash_id, &wcontext)) {
485 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get hash, exp/compact "
491 unsigned short index = hash_id;
505 if (
get_hash(
id, hash_id, &wcontext)) {
506 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
508 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
523 if (
get_hash(
id, hash_id, &wcontext)) {
524 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
526 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
541 if (
get_hash(
id, hash_id, &wcontext)) {
542 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
544 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
559 if (
get_hash(
id, hash_id, &wcontext)) {
560 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
562 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
606 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - dictionary NOT initialized " << std::endl;
626 if(
m_msgSvc)
log <<
MSG::FATAL <<
"HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
629 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
653 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'subdet' field "
664 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'part' field " << std::endl;
674 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'endcap' field " << std::endl;
683 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'layer' field " << std::endl;
692 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'moduleInLayer' field " << std::endl;
701 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_module' field " << std::endl;
710 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_phi_index' field " << std::endl;
719 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_index' field " << std::endl;
747 std::cout <<
" DEBUG decode index and bit fields for each level: " << std::endl;
816 std::cout <<
"HGTD_ID::initLevelsFromDict - found levels " << std::endl;
900 std::cout <<
"Do not know how to calculate pixel id from hash yet!!" << std::endl;
961 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
963 << (std::string)expId <<
endmsg;
964 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
966 << (std::string)expId << std::endl;
975 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
985 if (exp_id[0] != new_exp_id[0] ||
986 exp_id[1] != new_exp_id[1] ||
987 exp_id[2] != new_exp_id[2] ||
988 exp_id[3] != new_exp_id[3] ||
989 exp_id[4] != new_exp_id[4] ||
990 exp_id[5] != new_exp_id[5]) {
991 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
992 << (std::string)new_exp_id
993 <<
" " << (std::string)exp_id
995 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
996 << (std::string)new_exp_id
997 <<
" " << (std::string)exp_id
1014 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1017 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1026 else std::cout <<
" DEBUG HGTD_ID::test_wafer_packing: Successful tested "
1031 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1033 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
identifier_factory factory_end()
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
int endcap(const Identifier &id) const
Values of different levels (failure returns 0)
int eta_index(const Identifier &id) const
int eta_module_max(const Identifier &id) const
IdContext pixel_context(void) const
size_type end_index(void) const
IMessageSvc * m_msgSvc
pointer to the message service
bool decode_index() const
hash_vec m_prev_phi_wafer_vec
const_expanded_id_iterator pixel_end(void) const
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
const_id_iterator wafer_begin(void) const
Iterators over full set of ids. Wafer iterator is sorted.
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)
bool get_next(element_type current, element_type &next) const
int phi_index(const Identifier &id) const
std::string m_padInModuleColumn
IdDictFieldImplementation m_eta_index_impl
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
int hgtd_field_value() const
std::string m_moduleInRow
bool m_useNewIdentifierScheme
size_type m_ETA_INDEX_INDEX
size_type bits_offset() const
std::vector< IdDictRegion * > m_regions
size_type m_PHI_MODULE_INDEX
int eta_index_max(const Identifier &id) 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
void test_wafer_packing(void) const
Tests of packing.
int initLevelsFromDict(void)
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)
element_type get_minimum() const
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 wafer_hash_max(void) const
size_type begin_index(void) const
size_type pixel_hash_max(void) const
const_expanded_id_iterator pixel_begin(void) const
For pixel ids, only expanded id iterators are available.
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.
const_id_iterator wafer_end(void) const
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
element_type get_maximum() const
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.
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
value_type zeroing_mask() const
IdContext wafer_context(void) 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
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
IdDictFieldImplementation m_eta_mod_impl
This is the individual specification for the range of one ExpandedIdentifier field.
size_type cardinality() const
Computes a possible cardinality from all ranges.
int layer_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
std::vector< IdDictFieldImplementation > m_implementation
size_type m_hgtd_region_index
int phi_index_max(const Identifier &id) const
size_type m_PHI_INDEX_INDEX
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