 |
ATLAS Offline Software
|
Go to the documentation of this file.
25 const std::string&
group)
204 const std::string &dict_name) {
210 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" No dictionary found");
234 ATH_MSG_ERROR(
"reinitialize: dict names and tags vectors not the same length ");
261 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Failed to register dict tag");
266 m_helper = std::make_unique<AtlasDetectorIDHelper>().release();
270 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Initialization from dictionary failed.");
275 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Level initialization from dictionary failed.");
287 return id.fields() > 0 &&
id[0] ==
m_INDET_ID;
290 return id.fields() > 0 &&
id[0] ==
m_LAR_ID;
293 return id.fields() > 0 &&
id[0] ==
m_TILE_ID;
296 return id.fields() > 0 &&
id[0] ==
m_MUON_ID;
299 return id.fields() > 0 &&
id[0] ==
m_CALO_ID;
309 return is_indet(
id) &&
id.fields() > 1;
333 return is_lar_fcal(
id) &&
id.fields() > 3 &&std::abs(
id[3]) == 0;
370 std::string
result(
"Unable to decode id");
371 unsigned int max_index = (context) ? context->
end_index() : 999;
373 if (!
id.is_valid()) {
405 if (dict->unpack(
m_group, compact,
prefix, max_index, expId)) {
413 for (
unsigned int i = 0;
i < expId.fields(); ++
i) {
436 unsigned int max_index = (context) ? context->
end_index() : 999;
460 ATH_MSG_WARNING(__func__<<
":"<<__LINE__<<
" No dictionary could be associated to "<<
id);
564 auto assignSystemId = [
this, &
field](
const std::string& systemName,
566 bool mandatory =
true) ->
bool {
569 idToAssign =
label->value();
570 ATH_MSG_VERBOSE(
"Assign system "<<systemName<<
" to "<<idToAssign<<
".");
573 ATH_MSG_ERROR(
"initLevelsFromDict - label "<<systemName<<
" does NOT have a value ");
577 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find '"<<systemName<<
"' label");
580 ATH_MSG_DEBUG(
"initLevelsFromDict - unable to find '"<<systemName<<
"' label");
588 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access InnerDetector dictionary");
595 m_isHighLuminosityLHC = (versionString.find(
"ITk") != std::string::npos || versionString.find(
"P2-RUN4") != std::string::npos);
600 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for InnerDetector dictionary");
607 if (!assignSystemId(
"SCT",
m_SCT_ID)) {
614 if (!assignSystemId(
"LuminosityDetectors",
m_LUMI_ID, versionString.find(
"PLR") != std::string::npos ||
615 versionString.find(
"P2-RUN4") != std::string::npos)) {
626 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access ForwardDetectors dictionary");
638 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for ForwardDetectors dictionary");
641 if (!assignSystemId(
"ALFA",
m_ALFA_ID)) {
644 if (!assignSystemId(
"BCM",
m_BCM_ID)) {
650 if (!assignSystemId(
"ZDC",
m_ZDC_ID)) {
658 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access LArCalorimeter dictionary");
667 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for LArCalorimeter dictionary");
683 ATH_MSG_DEBUG(
"initLevelsFromDict - unable to find 'module' field for miniFCAL");
690 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access TileCalorimeter dictionary");
700 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access MuonSpectrometer dictionary");
719 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationName' field for MuonSpectrometer dictionary");
724 std::string stationNameString{};
727 int stationNameIndex{};
728 int maxStationNameIndex{-1};
733 stationNameIndex =
label.valued() ?
label.value() :
i;
735 maxStationNameIndex =
std::max(maxStationNameIndex, stationNameIndex);
746 stationNameString =
label.name();
749 stationNameIndex =
label.valued() ?
label.value() :
i;
752 bool found{
false}, stationNameFound{
false}, technologyFound{
false};
753 std::string techLabel{};
755 for (
size_type j = 0; j < nregions; ++j) {
759 stationNameFound = technologyFound =
false;
768 if (
range->field_name() ==
"stationName") {
770 if (
range->label() == stationNameString) {
772 stationNameFound =
true;
779 }
else if (
range->field_name() ==
"technology") {
780 technologyFound =
true;
781 techLabel =
range->label();
784 if (!stationNameFound || !technologyFound) {
789 if (techLabel ==
"MDT") {
791 }
else if (techLabel ==
"RPC") {
793 }
else if (techLabel ==
"CSC") {
795 }
else if (techLabel ==
"TGC"){
797 }
else if (techLabel ==
"MM") {
799 }
else if (techLabel ==
"STGC") {
826 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'technology' field for MuonSpectrometer dictionary");
830 if (!assignSystemId(
"MDT",
m_MDT_ID)) {
833 if (!assignSystemId(
"RPC",
m_RPC_ID)) {
836 if (!assignSystemId(
"TGC",
m_TGC_ID)) {
839 if (!assignSystemId(
"STGC",
m_STGC_ID,
false)) {
842 if (!assignSystemId(
"MM",
m_MM_ID,
false)) {
845 if (!assignSystemId(
"CSC",
m_CSC_ID,
false)) {
853 ATH_MSG_WARNING(
"initLevelsFromDict - Warning cannot access Calorimeter dictionary");
864 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_lvl1_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
870 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_lvl1_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
878 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
884 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_DMLar_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
893 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
899 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_DMTile_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
907 ATH_MSG_DEBUG(
"initLevelsFromDict - Could not get value for label 'no_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
name());
916 field = top_dict->find_field(
"subdet");
920 ATH_MSG_ERROR(
"initLevelsFromDict - - unable to find 'subdet' field from dict "
921 << top_dict->name());
925 if (!assignSystemId(
"InnerDetector",
m_INDET_ID)) {
928 if (!assignSystemId(
"ForwardDetectors",
m_FWD_ID)) {
931 if (!assignSystemId(
"LArCalorimeter",
m_LAR_ID)) {
934 if (!assignSystemId(
"TileCalorimeter",
m_TILE_ID)) {
938 if (!assignSystemId(
"MuonSpectrometer",
m_MUON_ID)) {
941 if (!assignSystemId(
"Calorimeter",
m_CALO_ID)) {
946 if (top_dict->name() ==
"InnerDetector") {
948 }
else if (top_dict->name() ==
"Calorimeter") {
950 }
else if (top_dict->name() ==
"LArCalorimeter") {
952 }
else if (top_dict->name() ==
"MuonSpectrometer") {
953 name =
"stationName";
954 }
else if (top_dict->name() ==
"TileCalorimeter") {
956 }
else if (top_dict->name() ==
"ForwardDetectors") {
966 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find field " <<
name <<
" from dict "<< top_dict->name());
970 ATH_MSG_ERROR(
"initLevelsFromDict - no top dictionary defined");
988 ATH_MSG_ERROR(
"initLevelsFromDict - ERROR det implementation is not enumerated: "
bool is_pixel(Identifier id) const
int indet_field_value() const
Provide efficient access to individual field values, for subclass idhelpers.
const IdDictDictionary * m_tile_dict
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
ExpandedIdentifier hgtd_exp(void) const
ExpandedIdentifier lucid_exp(void) 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
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.
ExpandedIdentifier tile_exp(void) const
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 IdDictDictionary * m_calo_dict
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.
const IdDictDictionary * m_lar_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
ExpandedIdentifier indet_exp(void) const
Detector systems:
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
ExpandedIdentifier zdc_exp(void) const
ExpandedIdentifier alfa_exp(void) const
Forward.
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
ExpandedIdentifier sct_exp(void) const
int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
ExpandedIdentifier lar_hec_exp(void) const
const Range::field & ored_field() const
Range::field m_lvl1_onl_field
ExpandedIdentifier lumi_exp(void) const
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
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
ExpandedIdentifier muon_exp(void) const
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
ExpandedIdentifier calo_exp(void) const
ExpandedIdentifier fwd_exp(void) const
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()
const IdDictDictionary * m_muon_dict
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.
ExpandedIdentifier lar_exp(void) const
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.
ExpandedIdentifier trt_exp(void) const
bool do_checks() const
Check whether or not to do checks for ids.
bool is_lvl1_online(Identifier id) const
bool is_stgc(Identifier id) const
ExpandedIdentifier bcm_exp(void) const
ExpandedIdentifier lar_fcal_exp(void) 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.
ExpandedIdentifier pixel_exp(void) const
Inner 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)
ExpandedIdentifier lar_em_exp(void) const
LAr.
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
const IdDictDictionary * m_indet_dict
const IdDictDictionary * m_fwd_dict