|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "GaudiKernel/MsgStream.h"
17 m_hgtd_region_index(0),
22 m_PHI_MODULE_INDEX(4),
23 m_ETA_MODULE_INDEX(5),
40 int eta_module )
const
51 if(
m_msgSvc)
log << MSG::ERROR <<
" HGTD_ID::wafer_id result is NOT ok. ID, range "
53 else std::cout <<
" ERROR HGTD_ID::wafer_id result is NOT ok. ID, range "
76 if(
m_msgSvc)
log << MSG::ERROR <<
" HGTD_ID::pixel_id result is NOT ok. ID, range "
78 else std::cout <<
" ERROR HGTD_ID::pixel_id result is NOT ok. ID, range "
92 if (
range.match(expId)) {
94 if (not layer_field.
empty()) {
111 if (
range.match(expId)) {
113 if (not phi_module_field.
empty()) {
130 if (
range.match(expId)) {
132 if (not eta_module_field.
empty()) {
149 if (
range.match(expId)) {
151 if (not eta_module_field.
empty()) {
168 if (
range.match(expId)) {
170 if (not phi_field.
empty()) {
187 if (
range.match(expId)) {
189 if (not eta_field.
empty()) {
209 else std::cout <<
" INFO Initialize from dictionary" << std::endl;
213 if(
m_msgSvc)
log << MSG::INFO <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
214 else std::cout <<
" INFO Request to reinitialize not satisfied - tags have not changed" << std::endl;
219 else std::cout <<
" DEBUG (Re)initialize" << std::endl;
230 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary "
232 else std::cout <<
" FATAL HGTD_ID::initialize_from_dict - cannot access InnerDetector dictionary "
249 if (atlasDict->
get_label_value(
"subdet",
"InnerDetector", inDetField)) {
250 if(
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
253 else std::cout <<
" FATAL Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
262 if(
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'HGTD' of field 'part' in dictionary "
265 else std::cout <<
" FATAL Could not get value for label 'HGTD' of field 'part' in dictionary "
271 <<
"Found field values: InDet/HGTD "
275 else std::cout <<
" DEBUG HGTD_ID::initialize_from_dict "
276 <<
"Found field values: InDet/HGTD "
306 std::cout <<
" DEBUG HGTD_ID::initialize_from_dict "
332 unsigned int nids = 0;
333 std::set<Identifier>
ids;
338 auto last = rit.
end();
345 if(!(
ids.insert(
id)).second) {
347 <<
" Error: duplicated id for wafer id. nid " << nids
349 <<
" exp id " << (std::string)exp_id
351 else std::cout <<
" FATAL HGTD_ID::init_hashes "
352 <<
" Error: duplicated id for wafer id. nid " << nids
354 <<
" exp id " << (std::string)exp_id
363 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
366 else std::cout <<
" FATAL HGTD_ID::init_hashes "
367 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
374 std::set<Identifier>::const_iterator
first =
ids.begin();
375 std::set<Identifier>::const_iterator last =
ids.end();
447 else std::cout <<
" DEBUG HGTD_ID::init_neighbors " << std::endl;
464 auto last = rit.
end();
484 if (
get_hash(
id, hash_id, &wcontext)) {
487 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get hash, exp/compact "
493 unsigned short index = hash_id;
507 if (
get_hash(
id, hash_id, &wcontext)) {
508 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
510 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get previous phi hash, exp/compact "
525 if (
get_hash(
id, hash_id, &wcontext)) {
526 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
528 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get next phi hash, exp/compact " <<
543 if (
get_hash(
id, hash_id, &wcontext)) {
544 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
546 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get previous eta hash, exp/compact "
561 if (
get_hash(
id, hash_id, &wcontext)) {
562 if(
m_msgSvc)
log <<
MSG::FATAL <<
" HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
564 else std::cout <<
" FATAL HGTD_ID::init_neighbors - unable to get next eta hash, exp/compact "
608 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - dictionary NOT initialized " << std::endl;
628 if(
m_msgSvc)
log <<
MSG::FATAL <<
"HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
631 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find hgtd region index: id, reg "
655 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'subdet' field "
666 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'part' field " << std::endl;
676 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'endcap' field " << std::endl;
685 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'layer' field " << std::endl;
694 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'moduleInLayer' field " << std::endl;
703 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_module' field " << std::endl;
712 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_phi_index' field " << std::endl;
721 else std::cout <<
" FATAL HGTD_ID::initLevelsFromDict - unable to find 'hgtd_eta_index' field " << std::endl;
749 std::cout <<
" DEBUG decode index and bit fields for each level: " << std::endl;
818 std::cout <<
"HGTD_ID::initLevelsFromDict - found levels " << std::endl;
902 std::cout <<
"Do not know how to calculate pixel id from hash yet!!" << std::endl;
963 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
965 << (std::string)expId <<
endmsg;
966 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
968 << (std::string)expId << std::endl;
977 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
987 if (exp_id[0] != new_exp_id[0] ||
988 exp_id[1] != new_exp_id[1] ||
989 exp_id[2] != new_exp_id[2] ||
990 exp_id[3] != new_exp_id[3] ||
991 exp_id[4] != new_exp_id[4] ||
992 exp_id[5] != new_exp_id[5]) {
993 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
994 << (std::string)new_exp_id
995 <<
" " << (std::string)exp_id
997 else std::cout <<
" 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
1016 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1019 else std::cout <<
" ERROR HGTD_ID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1028 else std::cout <<
" DEBUG HGTD_ID::test_wafer_packing: Successful tested "
1033 if(
m_msgSvc)
log << MSG::ERROR <<
"HGTD_ID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1035 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()
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
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
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_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)
int phi_index(const Identifier &id) const
std::string m_padInModuleColumn
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
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
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
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)
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 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)
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
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
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.
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)
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