Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
187 const std::string &dict_name) {
193 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" No dictionary found");
217 ATH_MSG_ERROR(
"reinitialize: dict names and tags vectors not the same length ");
244 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Failed to register dict tag");
249 m_helper = std::make_unique<AtlasDetectorIDHelper>().release();
253 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Initialization from dictionary failed.");
258 ATH_MSG_ERROR(__func__<<
":"<<__LINE__<<
" - Level initialization from dictionary failed.");
270 return id.fields() > 0 &&
id[0] ==
m_INDET_ID;
273 return id.fields() > 0 &&
id[0] ==
m_LAR_ID;
276 return id.fields() > 0 &&
id[0] ==
m_TILE_ID;
279 return id.fields() > 0 &&
id[0] ==
m_MUON_ID;
282 return id.fields() > 0 &&
id[0] ==
m_CALO_ID;
292 return is_indet(
id) &&
id.fields() > 1;
316 return is_lar_fcal(
id) &&
id.fields() > 3 &&std::abs(
id[3]) == 0;
353 std::string
result(
"Unable to decode id");
354 unsigned int max_index = (context) ? context->
end_index() : 999;
384 if (dict->unpack(compact,
prefix, max_index, expId)) {
392 for (
unsigned int i = 0;
i < expId.fields(); ++
i) {
415 unsigned int max_index = (context) ? context->
end_index() : 999;
439 ATH_MSG_WARNING(__func__<<
":"<<__LINE__<<
" No dictionary could be associated to "<<
id);
442 if (dict->unpack(compact,
prefix, max_index,
" ",
result)) {
543 auto assignSystemId = [
this, &
field](
const std::string& systemName,
545 bool mandatory =
true) ->
bool {
548 idToAssign =
label->m_value;
549 ATH_MSG_VERBOSE(
"Assign system "<<systemName<<
" to "<<idToAssign<<
".");
552 ATH_MSG_ERROR(
"initLevelsFromDict - label "<<systemName<<
" does NOT have a value ");
556 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find '"<<systemName<<
"' label");
559 ATH_MSG_DEBUG(
"initLevelsFromDict - unable to find '"<<systemName<<
"' label");
567 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access InnerDetector dictionary");
574 m_isHighLuminosityLHC = (versionString.find(
"ITk") != std::string::npos || versionString.find(
"P2-RUN4") != std::string::npos);
579 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for InnerDetector dictionary");
586 if (!assignSystemId(
"SCT",
m_SCT_ID)) {
593 if (!assignSystemId(
"LuminosityDetectors",
m_LUMI_ID, versionString.find(
"PLR") != std::string::npos ||
594 versionString.find(
"P2-RUN4") != std::string::npos)) {
605 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access ForwardDetectors dictionary");
617 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for ForwardDetectors dictionary");
620 if (!assignSystemId(
"ALFA",
m_ALFA_ID)) {
623 if (!assignSystemId(
"BCM",
m_BCM_ID)) {
629 if (!assignSystemId(
"ZDC",
m_ZDC_ID)) {
637 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access LArCalorimeter dictionary");
646 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field for LArCalorimeter dictionary");
662 ATH_MSG_DEBUG(
"initLevelsFromDict - unable to find 'module' field for miniFCAL");
669 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access TileCalorimeter dictionary");
679 ATH_MSG_WARNING(
"initLevelsFromDict - cannot access MuonSpectrometer dictionary");
698 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationName' field for MuonSpectrometer dictionary");
703 std::string stationNameString{};
704 const std::vector<IdDictLabel *>& stationNameLabels =
field->m_labels;
707 int stationNameIndex{};
708 int maxStationNameIndex{-1};
712 stationNameIndex = stationNameLabels[
i]->m_valued ? stationNameLabels[
i]->m_value :
i;
714 maxStationNameIndex =
std::max(maxStationNameIndex, stationNameIndex);
725 stationNameString = stationNameLabels[
i]->m_name;
728 stationNameIndex = stationNameLabels[
i]->m_valued ? stationNameLabels[
i]->m_value :
i;
731 bool found{
false}, stationNameFound{
false}, technologyFound{
false};
732 std::string techLabel{};
733 for (
size_type j = 0; j < muonRegions.size(); ++j) {
738 stationNameFound = technologyFound =
false;
745 if (
range->m_field_name ==
"stationName") {
747 if (
range->m_label == stationNameString) {
749 stationNameFound =
true;
756 }
else if (
range->m_field_name ==
"technology") {
757 technologyFound =
true;
758 techLabel =
range->m_label;
761 if (!stationNameFound || !technologyFound) {
766 if (techLabel ==
"MDT") {
768 }
else if (techLabel ==
"RPC") {
770 }
else if (techLabel ==
"CSC") {
772 }
else if (techLabel ==
"TGC"){
774 }
else if (techLabel ==
"MM") {
776 }
else if (techLabel ==
"STGC") {
803 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'technology' field for MuonSpectrometer dictionary");
807 if (!assignSystemId(
"MDT",
m_MDT_ID)) {
810 if (!assignSystemId(
"RPC",
m_RPC_ID)) {
813 if (!assignSystemId(
"TGC",
m_TGC_ID)) {
816 if (!assignSystemId(
"STGC",
m_STGC_ID,
false)) {
819 if (!assignSystemId(
"MM",
m_MM_ID,
false)) {
822 if (!assignSystemId(
"CSC",
m_CSC_ID,
false)) {
830 ATH_MSG_WARNING(
"initLevelsFromDict - Warning cannot access Calorimeter dictionary");
841 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_lvl1_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
m_name);
847 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_lvl1_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
m_name);
855 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_DMLar_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
m_name);
861 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_DMLar_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
m_name);
870 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'negative_DMTile_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
m_name);
876 ATH_MSG_ERROR(
"initLevelsFromDict - Could not get value for label 'positive_DMTile_side' of field 'DetZside' in dictionary " <<
m_calo_dict->
m_name);
893 field = top_dict->find_field(
"subdet");
897 ATH_MSG_ERROR(
"initLevelsFromDict - - unable to find 'subdet' field from dict "
898 << top_dict->m_name);
902 if (!assignSystemId(
"InnerDetector",
m_INDET_ID)) {
905 if (!assignSystemId(
"ForwardDetectors",
m_FWD_ID)) {
908 if (!assignSystemId(
"LArCalorimeter",
m_LAR_ID)) {
911 if (!assignSystemId(
"TileCalorimeter",
m_TILE_ID)) {
915 if (!assignSystemId(
"MuonSpectrometer",
m_MUON_ID)) {
918 if (!assignSystemId(
"Calorimeter",
m_CALO_ID)) {
923 if (top_dict->m_name ==
"InnerDetector") {
925 }
else if (top_dict->m_name ==
"Calorimeter") {
927 }
else if (top_dict->m_name ==
"LArCalorimeter") {
929 }
else if (top_dict->m_name ==
"MuonSpectrometer") {
930 name =
"stationName";
931 }
else if (top_dict->m_name ==
"TileCalorimeter") {
933 }
else if (top_dict->m_name ==
"ForwardDetectors") {
943 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find field " <<
name <<
" from dict "<< top_dict->m_name);
947 ATH_MSG_ERROR(
"initLevelsFromDict - no top dictionary defined");
966 ATH_MSG_ERROR(
"initLevelsFromDict - ERROR det implementation is not enumerated: "
bool is_pixel(Identifier id) const
const std::string & dict_tag(void) const
Access to the dictionary tag.
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
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
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)
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
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
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
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.
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
std::vector< IdDictRegion * > m_regions
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
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
std::vector< IdDictRegionEntry * > m_entries
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
const std::string & file_name(void) const
Access to file name.
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
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
AtlasDetectorID(const std::string &name="AtlasDetectorID")
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
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
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.
std::vector< IdDictFieldImplementation > m_implementation
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
std::vector< IdDictRegion * > m_all_regions