 |
ATLAS Offline Software
|
Go to the documentation of this file.
23 const std::string&
group)
202 const std::string &dict_name) {
208 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" No dictionary found");
232 ATH_MSG_ERROR(
"reinitialize: dict names and tags vectors not the same length ");
259 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Failed to register dict tag");
264 m_helper = std::make_unique<AtlasDetectorIDHelper>().release();
268 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Initialization from dictionary failed.");
273 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Level initialization from dictionary failed.");
285 return id.fields() > 0 &&
id[0] ==
m_INDET_ID;
288 return id.fields() > 0 &&
id[0] ==
m_LAR_ID;
291 return id.fields() > 0 &&
id[0] ==
m_TILE_ID;
294 return id.fields() > 0 &&
id[0] ==
m_MUON_ID;
297 return id.fields() > 0 &&
id[0] ==
m_CALO_ID;
307 return is_indet(
id) &&
id.fields() > 1;
331 return is_lar_fcal(
id) &&
id.fields() > 3 &&std::abs(
id[3]) == 0;
368 std::string
result(
"Unable to decode id");
369 unsigned int max_index = (context) ? context->
end_index() : 999;
371 if (!
id.is_valid()) {
403 if (dict->unpack(
m_group, compact,
prefix, max_index, expId)) {
411 for (
unsigned int i = 0;
i < expId.fields(); ++
i) {
434 unsigned int max_index = (context) ? context->
end_index() : 999;
458 ATH_MSG_WARNING(__func__<<
":"<<__LINE__<<
" No dictionary could be associated to "<<
id);
562 auto assignSystemId = [
this, &
field](
const std::string& systemName,
564 bool mandatory =
true) ->
bool {
567 idToAssign =
label->value();
568 ATH_MSG_VERBOSE(
"Assign system "<<systemName<<
" to "<<idToAssign<<
".");
571 ATH_MSG_ERROR(
"initLevelsFromDict - label "<<systemName<<
" does NOT have a value ");
575 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find '"<<systemName<<
"' label");
578 ATH_MSG_DEBUG(
"initLevelsFromDict - unable to find '"<<systemName<<
"' label");
586 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access InnerDetector dictionary");
593 m_isHighLuminosityLHC = (versionString.find(
"ITk") != std::string::npos || versionString.find(
"P2-RUN4") != std::string::npos);
598 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for InnerDetector dictionary");
605 if (!assignSystemId(
"SCT",
m_SCT_ID)) {
612 if (!assignSystemId(
"LuminosityDetectors",
m_LUMI_ID, versionString.find(
"PLR") != std::string::npos ||
613 versionString.find(
"P2-RUN4") != std::string::npos)) {
624 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access ForwardDetectors dictionary");
636 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for ForwardDetectors dictionary");
639 if (!assignSystemId(
"ALFA",
m_ALFA_ID)) {
642 if (!assignSystemId(
"BCM",
m_BCM_ID)) {
648 if (!assignSystemId(
"ZDC",
m_ZDC_ID)) {
656 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access LArCalorimeter dictionary");
665 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for LArCalorimeter dictionary");
681 ATH_MSG_DEBUG(
"initLevelsFromDict - unable to find 'module' field for miniFCAL");
688 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access TileCalorimeter dictionary");
698 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access MuonSpectrometer dictionary");
717 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationName' field for MuonSpectrometer dictionary");
722 std::string stationNameString{};
725 int stationNameIndex{};
726 int maxStationNameIndex{-1};
731 stationNameIndex =
label.valued() ?
label.value() :
i;
733 maxStationNameIndex =
std::max(maxStationNameIndex, stationNameIndex);
744 stationNameString =
label.name();
747 stationNameIndex =
label.valued() ?
label.value() :
i;
750 bool found{
false}, stationNameFound{
false}, technologyFound{
false};
751 std::string techLabel{};
753 for (
size_type j = 0; j < nregions; ++j) {
757 stationNameFound = technologyFound =
false;
766 if (
range->field_name() ==
"stationName") {
768 if (
range->label() == stationNameString) {
770 stationNameFound =
true;
777 }
else if (
range->field_name() ==
"technology") {
778 technologyFound =
true;
779 techLabel =
range->label();
782 if (!stationNameFound || !technologyFound) {
787 if (techLabel ==
"MDT") {
789 }
else if (techLabel ==
"RPC") {
791 }
else if (techLabel ==
"CSC") {
793 }
else if (techLabel ==
"TGC"){
795 }
else if (techLabel ==
"MM") {
797 }
else if (techLabel ==
"STGC") {
824 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'technology' field for MuonSpectrometer dictionary");
828 if (!assignSystemId(
"MDT",
m_MDT_ID)) {
831 if (!assignSystemId(
"RPC",
m_RPC_ID)) {
834 if (!assignSystemId(
"TGC",
m_TGC_ID)) {
837 if (!assignSystemId(
"STGC",
m_STGC_ID,
false)) {
840 if (!assignSystemId(
"MM",
m_MM_ID,
false)) {
843 if (!assignSystemId(
"CSC",
m_CSC_ID,
false)) {
851 ATH_MSG_WARNING(
"initLevelsFromDict - Warning cannot access Calorimeter dictionary");
862 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_lvl1_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
868 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_lvl1_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
876 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
882 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_DMLar_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
891 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
897 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_DMTile_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
905 ATH_MSG_DEBUG(
"initLevelsFromDict - Could not get value for label 'no_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
914 field = top_dict->find_field(
"subdet");
918 ATH_MSG_ERROR(
"initLevelsFromDict - - unable to find 'subdet' field from dict "
919 << top_dict->name());
923 if (!assignSystemId(
"InnerDetector",
m_INDET_ID)) {
926 if (!assignSystemId(
"ForwardDetectors",
m_FWD_ID)) {
929 if (!assignSystemId(
"LArCalorimeter",
m_LAR_ID)) {
932 if (!assignSystemId(
"TileCalorimeter",
m_TILE_ID)) {
936 if (!assignSystemId(
"MuonSpectrometer",
m_MUON_ID)) {
939 if (!assignSystemId(
"Calorimeter",
m_CALO_ID)) {
944 if (top_dict->name() ==
"InnerDetector") {
946 }
else if (top_dict->name() ==
"Calorimeter") {
948 }
else if (top_dict->name() ==
"LArCalorimeter") {
950 }
else if (top_dict->name() ==
"MuonSpectrometer") {
951 name =
"stationName";
952 }
else if (top_dict->name() ==
"TileCalorimeter") {
954 }
else if (top_dict->name() ==
"ForwardDetectors") {
964 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find field " <<
name <<
" from dict "<< top_dict->name());
968 ATH_MSG_ERROR(
"initLevelsFromDict - no top dictionary defined");
986 ATH_MSG_ERROR(
"initLevelsFromDict - ERROR det implementation is not enumerated: "
bool is_pixel(Identifier id) const
IdDictDictionary * m_muon_dict
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
bool is_forward(Identifier id) const
bool is_rpc(Identifier id) const
std::vector< unsigned int > m_muon_tech_bits
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
size_type lar_fcal_region_index() const
Identifier lumi(void) const
Identifier tile_dm(void) const
IdDictFieldImplementation m_indet_part_impl
AtlasDetectorIDHelper * m_helper
virtual void setMessageSvc(IMessageSvc *msgSvc) override
bool is_csc(Identifier id) const
const std::string & version() const
Dictionary version.
bool is_lar_fcal(Identifier id) const
Identifier mm(void) const
std::string show_to_string(void) const
bool is_lar(Identifier id) const
int muon_field_value() const
bool is_sct(Identifier id) const
Identifier lar_fcal(void) const
const IdDictRegion & region(size_t i) const
Region at index i.
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override
Create compact id from hash id (return == 0 for OK)
AtlasDetectorID(const std::string &name, const std::string &group)
size_type lvl1_region_index() const
size_type end_index() const
int calo_field_value() const
Identifier stgc(void) const
Identifier lar_dm(void) const
bool is_mm(Identifier id) const
Identifier mdt(void) const
virtual void set_do_checks(bool do_checks) override
void pack(int value, Identifier &id) const
IdDictDictionary * m_tile_dict
size_type pixel_region_index() const
IMessageSvc * m_msgSvc
pointer to the message service
std::string m_dict_version
Identifier lar_em(void) const
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
bool is_trt(Identifier id) const
size_type m_MUON_SUBDET_INDEX
const std::string & name() const
Dictionary name.
Identifier tgc(void) const
int m_LAR_FCAL_MODULE_INDEX
#define ATH_MSG_VERBOSE(x)
Identifier indet(void) const
Detector systems:
int lar_field_value() const
const std::string & file_name() const
Access to file name.
virtual bool do_neighbours(void) const override
Neighbour initialization is performed by default One can switch or query this mode for any idHelper w...
IdContext detsystem_context(void) const
IdContext (indicates id length) for detector systems.
IdDictField * find_field(const std::string &name) const
Identifier lar_hec(void) const
size_type mdt_region_index() const
bool is_lvl1_trig_towers(Identifier id) const
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override
Create hash id from compact id (return == 0 for OK)
virtual std::string dictionaryVersion(void) const override
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
void set_quiet(bool quiet)
Set flag for suppressing informational output.
Identifier::size_type size_type
const IdDictFieldImplementation & implementation(size_t i) const
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Range::field m_tile_dm_field
Identifier hgtd(void) const
Identifier lar(void) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const std::vector< std::string > & dict_tags(void) const
Version tags for subdet dictionaries.
virtual void set_do_neighbours(bool do_neighbours) override
void set_ored_field(const Range::field &ored_field)
msgSvc
Provide convenience handles for various services.
std::string m_group
Group name.
IdDictDictionary * m_calo_dict
const std::vector< std::string > & file_names(void) const
File names for subdet dictionaries.
bool is_plr(Identifier id) const
bool m_is_initialized_from_dict
IdDictFieldImplementation m_lar_part_impl
Identifier csc(void) const
bool is_tgc(Identifier id) const
IdDictFieldImplementation m_muon_mdt_impl
IdDictFieldImplementation m_lar_fcal_module_impl
bool is_tile_dm(Identifier id) const
bool m_isHighLuminosityLHC
Class to provide easy MsgStream access and capabilities.
Identifier calo(void) const
IdDictDictionary * m_fwd_dict
bool is_tile(Identifier id) const
bool is_lar_hec(Identifier id) const
const std::string & group() const
Group name for this helper.
Identifier tile(void) const
int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
const Range::field & ored_field() const
Range::field m_lvl1_onl_field
bool do_neighbours() const
Check whether or not to init neighbours.
bool m_quiet
If true, suppress DEBUG/INFO messages.
bool isEnumerated() const
IdDictFieldImplementation m_muon_rpc_impl
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
bool is_calo(Identifier id) const
int tile_field_value() const
int get_label_value(const std::string &field, const std::string &label, int &value) const
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
const IdDictRegionEntry & entry(size_t i) const
bool is_lar_minifcal(Identifier id) const
IdDictDictionary * m_indet_dict
void show(Identifier id, const IdContext *context=0, char sep='.') const
Short print out of any identifier (optionally provide separation character - default is '.
IdDictFieldImplementation m_calo_side_impl
bool is_indet(Identifier id) const
const std::vector< std::string > & dict_names(void) const
Dictionary names.
std::vector< std::string > m_dict_names
List of dictionary names used by this helper.
Range::field m_lar_dm_field
size_type lar_em_region_index() const
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
IdDictFieldImplementation m_muon_station_name_impl
void print(Identifier id, const IdContext *context=0) const
Expanded print out of any identifier.
Identifier lar_lvl1(void) const
Identifier trt(void) const
Identifier pixel(void) const
virtual ~AtlasDetectorID()
bool is_lumi(Identifier id) const
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
bool is_lar_dm(Identifier id) const
LAr/Tile dead material:
bool is_muon(Identifier id) const
IdDictFieldImplementation m_det_impl
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
size_type rpc_region_index() const
const std::string & dict_tag() const
Access to the dictionary tag.
std::vector< std::string > m_file_names
List of dictionary file names used by this helper.
#define ATH_MSG_WARNING(x)
Identifier muon(void) const
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
bool do_checks() const
Check whether or not to do checks for ids.
IdDictDictionary * m_lar_dict
bool is_lvl1_online(Identifier id) const
bool is_stgc(Identifier id) const
Identifier sct(void) const
size_t n_regions() const
Number of contained regions.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
int initLevelsFromDict(const IdDictMgr &dict_mgr)
IdContext subdet_context(void) const
IdContext (indicates id length) for sub-detector.
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
std::vector< std::string > m_dict_tags
List of dictionary versions used by this helper.
bool is_lar_em(Identifier id) const
void add_value(element_type value)
bool is_hgtd(Identifier id) const
bool is_mdt(Identifier id) const
Range::field m_lvl1_field
Identifier rpc(void) const
std::string to_range(const ExpandedIdentifier &id) const