|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/MsgStream.h"
37 if (
m_msgSvc)
log << MSG::ERROR <<
" PixelID::wafer_id result is NOT ok. ID, range "
39 else std::cout <<
" ERROR PixelID::wafer_id result is NOT ok. ID, range "
54 if (
m_msgSvc)
log << MSG::ERROR <<
" PixelID::pixel_id result is NOT ok. ID, range "
56 else std::cout <<
" ERROR PixelID::pixel_id result is NOT ok. ID, range "
69 if (
range.match(expId)) {
71 if (not layer_disk_field.
empty()) {
87 if (
range.match(expId)) {
89 if (not eta_field.
empty()) {
104 if (
range.match(expId)) {
106 if (not eta_field.
empty()) {
132 if (
range.match(expId)) {
134 if (not phi_field.
empty()) {
151 if (
range.match(expId)) {
153 if (not phi_field.
empty()) {
170 if (
range.match(expId)) {
172 if (not eta_field.
empty()) {
190 else std::cout <<
" INFO Initialize from dictionary" << std::endl;
194 if (
m_msgSvc)
log << MSG::INFO <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
195 else std::cout <<
" INFO Request to reinitialize not satisfied - tags have not changed" << std::endl;
199 else std::cout <<
" DEBUG (Re)initialize" << std::endl;
210 if (
m_msgSvc)
log <<
MSG::FATAL <<
" PixelID::initialize_from_dict - cannot access InnerDetector dictionary "
212 else std::cout <<
" FATAL PixelID::initialize_from_dict - cannot access InnerDetector dictionary "
225 if (
m_msgSvc)
log <<
MSG::FATAL <<
" PixelID::initialize_from_dict - cannot get pixel id dictionary "
227 else std::cout <<
" FATAL PixelID::initialize_from_dict - cannot get pixel id dictionary "
239 if (
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary "
242 else std::cout <<
" FATAL Could not get value for label 'barrel' of field 'barrel_endcap' in dictionary "
250 <<
"Set barrel field values: "
253 else std::cout <<
" DEBUG PixelID::initialize_from_dict "
254 <<
"Set barrel field values: "
271 "Could not get value for label 'negative_dbm' of field 'barrel_endcap' in dictionary "
274 else std::cout <<
" WARNING Could not get value for label 'negative_dbm' of field 'barrel_endcap' in dictionary "
286 "Could not get value for label 'positive_dbm' of field 'barrel_endcap' in dictionary "
289 else std::cout <<
" WARNING Could not get value for label 'positive_dbm' of field 'barrel_endcap' in dictionary "
299 <<
"Set dbm field values: "
302 else std::cout <<
" DEBUG PixelID::initialize_from_dict "
303 <<
"Set dbm field values: "
316 if (atlasDict->get_label_value(
"subdet",
"InnerDetector", inDetField)) {
317 if (
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
320 else std::cout <<
" FATAL Could not get value for label 'InnerDetector' of field 'subdet' in dictionary "
329 if (
m_msgSvc)
log <<
MSG::FATAL <<
"Could not get value for label 'Pixel' of field 'part' in dictionary "
332 else std::cout <<
" FATAL Could not get value for label 'Pixel' of field 'part' in dictionary "
338 <<
"Found field values: InDet/Pixel "
342 else std::cout <<
" DEBUG PixelID::initialize_from_dict "
343 <<
"Found field values: InDet/Pixel "
380 std::cout <<
" DEBUG PixelID::initialize_from_dict "
404 unsigned int nids = 0;
405 std::set<Identifier>
ids;
409 for (
const auto & exp_id:rit) {
414 if (!(
ids.insert(
id)).second) {
416 <<
" Error: duplicated id for wafer id. nid " << nids
418 <<
" exp id " << (std::string) exp_id
420 else std::cout <<
" FATAL PixelID::init_hashes "
421 <<
" Error: duplicated id for wafer id. nid " << nids
423 <<
" exp id " << (std::string) exp_id
432 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
435 else std::cout <<
" FATAL PixelID::init_hashes "
436 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
443 std::set<Identifier>::const_iterator
first =
ids.begin();
444 std::set<Identifier>::const_iterator last =
ids.end();
516 else std::cout <<
" DEBUG PixelID::init_neighbors " << std::endl;
536 for (
const auto & exp_id: rit) {
554 if (
get_hash(
id, hash_id, &wcontext)) {
557 else std::cout <<
" FATAL PixelID::init_neighbors - unable to get hash, exp/compact "
563 unsigned short index = hash_id;
577 if (
get_hash(
id, hash_id, &wcontext)) {
578 if (
m_msgSvc)
log <<
MSG::FATAL <<
" PixelID::init_neighbors - unable to get previous phi hash, exp/compact "
580 else std::cout <<
" FATAL PixelID::init_neighbors - unable to get previous phi hash, exp/compact "
595 if (
get_hash(
id, hash_id, &wcontext)) {
596 if (
m_msgSvc)
log <<
MSG::FATAL <<
" PixelID::init_neighbors - unable to get next phi hash, exp/compact " <<
598 else std::cout <<
" FATAL PixelID::init_neighbors - unable to get next phi hash, exp/compact " <<
613 if (
get_hash(
id, hash_id, &wcontext)) {
614 if (
m_msgSvc)
log <<
MSG::FATAL <<
" PixelID::init_neighbors - unable to get previous eta hash, exp/compact "
616 else std::cout <<
" FATAL PixelID::init_neighbors - unable to get previous eta hash, exp/compact "
631 if (
get_hash(
id, hash_id, &wcontext)) {
632 if (
m_msgSvc)
log <<
MSG::FATAL <<
" PixelID::init_neighbors - unable to get next eta hash, exp/compact "
634 else std::cout <<
" FATAL PixelID::init_neighbors - unable to get next eta hash, exp/compact "
651 else std::cout <<
" FATAL PixelID::initLevelsFromDict - dictionary NOT initialized " << std::endl;
671 if (
m_msgSvc)
log <<
MSG::FATAL <<
"PixelID::initLevelsFromDict - unable to find pixel region index: id, reg "
674 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find pixel region index: id, reg "
687 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'subdet' field "
697 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'part' field " << std::endl;
706 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'barrel_endcap' field " << std::endl;
715 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'layer' field " << std::endl;
724 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'phi_module' field " << std::endl;
732 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'eta_module' field " << std::endl;
740 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'phi_index' field " << std::endl;
748 else std::cout <<
" FATAL PixelID::initLevelsFromDict - unable to find 'eta_index' field " << std::endl;
782 std::cout <<
" DEBUG decode index and bit fields for each level: " << std::endl;
893 std::cout <<
"PixelID::initLevelsFromDict - found levels " << std::endl;
968 std::cout <<
"Do not know how to calculate pixel id from hash yet!!" << std::endl;
1023 "PixelID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
1025 << (std::string) expId <<
endmsg;
1026 else std::cout <<
" ERROR PixelID::test_wafer_packing: new and old compact id not equal. New/old/expanded ids "
1028 << (std::string) expId << std::endl;
1037 for (; first_pixel != last_pixel && nids < 1000; ++first_pixel, ++nids) {
1047 if (exp_id[0] != new_exp_id[0] ||
1048 exp_id[1] != new_exp_id[1] ||
1049 exp_id[2] != new_exp_id[2] ||
1050 exp_id[3] != new_exp_id[3] ||
1051 exp_id[4] != new_exp_id[4] ||
1052 exp_id[5] != new_exp_id[5]) {
1054 "PixelID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
1055 << (std::string) new_exp_id
1056 <<
" " << (std::string) exp_id
1058 else std::cout <<
" ERROR PixelID::test_wafer_packing: new and old expanded ids not equal. New/old/compact ids "
1059 << (std::string) new_exp_id
1060 <<
" " << (std::string) exp_id
1077 if (
m_msgSvc)
log << MSG::ERROR <<
"PixelID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1080 else std::cout <<
" ERROR PixelID::test_wafer_packing: new and old pixel ids not equal. New/old ids "
1089 else std::cout <<
" DEBUG PixelID::test_wafer_packing: Successful tested "
1094 "PixelID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
1097 " ERROR PixelID::test_wafer_packing: Unable to test wafer is packing - no dictionary has been defined. "
IdDictRegion * find_region(const std::string ®ion_name) const
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
bool is_pixel(Identifier id) const
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
IdDictFieldImplementation m_bec_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)
MultiRange build_multirange() const
Get MultiRange for full dictionary.
size_type m_wafer_hash_max
int phi_index(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
std::vector< Identifier >::const_iterator const_id_iterator
const_id_iterator wafer_end(void) const
IdContext pixel_context(void) const
bool is_eta_module_min(const Identifier &id) const
For the barrel.
identifier_factory factory_begin()
std::string show_to_string(void) const
IdDictFieldImplementation m_eta_mod_shift_impl
IdDictFieldImplementation m_bec_shift_impl
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
identifier_factory factory_end()
element_type get_minimum() const
Query the values.
IdDictFieldImplementation m_indet_impl
size_type cardinalityUpTo(const ExpandedIdentifier &id) const
hash_vec m_next_eta_wafer_vec
size_type end_index() const
size_type m_BARREL_EC_INDEX
IdDictFieldImplementation m_phi_index_impl
const_id_iterator wafer_begin(void) const
Iterators over full set of ids. Wafer iterator is sorted.
size_type m_ETA_INDEX_INDEX
IdDictFieldImplementation m_phi_mod_shift_impl
MultiRange m_full_pixel_range
int pixel_field_value() const
IdDictFieldImplementation m_eta_mod_impl
void pack(int value, Identifier &id) const
IMessageSvc * m_msgSvc
pointer to the message service
bool decode_index() const
element_type get_maximum() const
size_type m_ETA_MODULE_INDEX
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in phi (return == 0 for neighbor found)
ExpandedIdentifier m_baseExpandedIdentifier
int eta_module_max(const Identifier &id) const
size_type pixel_hash_max(void) const
IdDictField * find_field(const std::string &name) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
IdDictFieldImplementation m_bec_eta_mod_impl
int initLevelsFromDict(void)
size_type begin_index() const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
size_type m_pixel_hash_max
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in phi (return == 0 for neighbor found)
Identifier m_baseIdentifier
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)
int phi_index_max(const Identifier &id) const
int eta_index_max(const Identifier &id) const
const_expanded_id_iterator pixel_begin(void) const
For pixel ids, only expanded id iterators are available.
size_type bits_offset() const
MultiRange m_full_wafer_range
std::vector< IdDictRegion * > m_regions
void pixel_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
int eta_index(const Identifier &id) const
bool get_next(element_type current, element_type &next) const
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
Next wafer hash in eta (return == 0 for neighbor found)
const Range::field & ored_field() const
bool is_valid() const
Check if id is in a valid state.
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
int phi_module_max(const Identifier &id) const
int get_label_value(const std::string &field, const std::string &label, int &value) const
int layer_disk(const Identifier &id) const
void test_wafer_packing(void) const
Tests of packing.
int eta_module(const Identifier &id) const
hash_vec m_next_phi_wafer_vec
hash_vec m_prev_phi_wafer_vec
size_type wafer_hash_max(void) 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.
int layer_disk_max(const Identifier &id) const
Max/Min values for each field (error returns -999)
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)
bool is_eta_module_max(const Identifier &id) const
For the barrel.
size_type m_pixel_region_index
int match(const ExpandedIdentifier &id) const
Match an identifier.
Identifier pixel(void) const
int eta_module_min(const Identifier &id) const
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
IdContext wafer_context(void) const
void wafer_id_checks(int barrel_ec, int layer_disk, int phi_module, int eta_module) 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.
IdDictFieldImplementation m_eta_index_impl
IdDictFieldImplementation m_phi_mod_impl
Range::field m_barrel_field
bool is_phi_module_max(const Identifier &id) const
To check for when phi wrap around may be needed.
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
IdDictFieldImplementation m_lay_disk_shift_impl
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.
hash_vec m_prev_eta_wafer_vec
size_type m_LAYER_DISK_INDEX
unsigned long long value_type
Identifier::size_type size_type
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...
size_type m_PHI_MODULE_INDEX
int phi_module(const Identifier &id) const
const_expanded_id_iterator pixel_end(void) const
IdDictFieldImplementation m_lay_disk_impl
const IdDictDictionary * m_dict
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
std::vector< IdDictFieldImplementation > m_implementation
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
Previous wafer hash in eta (return == 0 for neighbor found)
void add_value(element_type value)
IdDictFieldImplementation m_pixel_impl
size_type m_PHI_INDEX_INDEX