ATLAS Offline Software
RpcCablingMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONCABLINGDATA_RPCCABLINGMAP_H
5 #define MUONCABLINGDATA_RPCCABLINGMAP_H
6 
7 #include <set>
8 #include <unordered_map>
9 
13 
14 #include "Identifier/Identifier.h"
16 
17 /**********************************************
18  *
19  * @brief NRPC map data object
20  *
21  **********************************************/
22 
23 class RpcIdHelper;
24 namespace Muon {
25  class IMuonIdHelperSvc;
26 
27  class RpcCablingMap {
28  public:
30  /* mapping from hashid to ROB identifier as Subdetector+Rodid */
31  using ChamberToROBMap = std::unordered_map<IdentifierHash, uint32_t>;
32  using ROBToChamberMap = std::unordered_map<uint32_t, std::vector<IdentifierHash>>;
33  using ListOfROB = std::vector<uint32_t>;
34 
45  bool operator<(const GasGapToTdcAssociation &other) const {
46  return firstStrip < other.firstStrip;
47  }
48  };
57  };
64  };
65 
67  RpcCablingMap(const IMuonIdHelperSvc* idHelperSvc);
69 
71  bool getOfflineId(RpcCablingData &cabling_data, MsgStream& log) const;
72 
74  bool getOnlineId(RpcCablingData &cabling_data, MsgStream& log) const;
75 
76 
83  bool convert(const RpcCablingData &translationCache, Identifier &id, bool checkValid = true) const;
87  bool convert(const Identifier &id, RpcCablingData &translationCache, bool setSideBit) const;
91  bool insertChannels(CoolDBEntry&& dbEntry, MsgStream& log);
93  std::set<FlatCablePtr> flatCables() const;
96  bool finalize(MsgStream& log);
97 
99  uint32_t getROBId(const IdentifierHash& stationCode, MsgStream& log) const;
102  ListOfROB getROBId(const std::vector<IdentifierHash>& rpcHashVector, MsgStream& log) const;
104  const std::vector<IdentifierHash>& getChamberHashVec(const uint32_t ROBI, MsgStream& log) const;
105 
106  std::vector<IdentifierHash> getChamberHashVec(const ListOfROB& ROBs, MsgStream& log) const;
107 
109  const ListOfROB& getAllROBId() const;
110 
111 
112  private:
115  using AllTdcsPerGasGap = std::vector<GasGapToTdcAssociation>;
116  using AllGasGapsPerTdc = std::vector<TdcToGasGapAssociation>;
117  using OfflToOnlMap = std::map<RpcCablingOfflineID, AllTdcsPerGasGap>;
118  using OnlToOfflMap = std::map<RpcCablingOnlineID, AllGasGapsPerTdc>;
119 
124 
127 
130  };
131 }
132 
133 #include "AthenaKernel/CLASS_DEF.h"
134 #include "AthenaKernel/CondCont.h"
135 CLASS_DEF( Muon::RpcCablingMap , 195104634 , 1 );
137 #endif
Muon::RpcCablingMap::~RpcCablingMap
~RpcCablingMap()
GeoModel::TransientConstSharedPtr< Muon::RpcFlatCableTranslator >
Muon::RpcCablingMap::CoolDBEntry::flatCable
FlatCablePtr flatCable
Pointer to the flat cable card.
Definition: RpcCablingMap.h:63
CondCont.h
Hold mappings of ranges to condition objects.
Muon::RpcCablingMap::RpcCablingMap
RpcCablingMap(const IMuonIdHelperSvc *idHelperSvc)
Constructor taking the IdHelperSvc.
Definition: RpcCablingMap.cxx:14
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
RpcCablingData.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Muon::RpcCablingMap::m_onToOffline
OnlToOfflMap m_onToOffline
Map storing the connection from online -> offline channels.
Definition: RpcCablingMap.h:121
Muon::RpcCablingMap::AllTdcsPerGasGap
std::vector< GasGapToTdcAssociation > AllTdcsPerGasGap
Definition: RpcCablingMap.h:115
createCablingJSON.cabling_data
dictionary cabling_data
Definition: createCablingJSON.py:46
CONDCONT_DEF
CONDCONT_DEF(Muon::RpcCablingMap, 138104006)
Muon::RpcCablingOfflineID
Struct to represent the offline identifier of the Rpc measurement decomposed into the particular fiel...
Definition: RpcCablingData.h:39
Muon::RpcCablingMap::TdcToGasGapAssociation
Helper struct to associate all Tdcs to their corresponding strips in the gasGap.
Definition: RpcCablingMap.h:50
Muon::RpcCablingMap::GasGapToTdcAssociation::flatCable
FlatCablePtr flatCable
Pointer to the flat cable card.
Definition: RpcCablingMap.h:41
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::RpcCablingMap::getOnlineId
bool getOnlineId(RpcCablingData &cabling_data, MsgStream &log) const
return the online id given the offline id
Definition: RpcCablingMap.cxx:50
Muon::RpcCablingMap::GasGapToTdcAssociation::operator<
bool operator<(const GasGapToTdcAssociation &other) const
Ordering operator by strip.
Definition: RpcCablingMap.h:45
RpcIdHelper
Definition: RpcIdHelper.h:51
Muon::RpcCablingMap::finalize
bool finalize(MsgStream &log)
Performs consistency checks for the cabling data (I.e.
Definition: RpcCablingMap.cxx:153
Muon::RpcCablingMap::m_listOfROB
ListOfROB m_listOfROB
full list of ROBs
Definition: RpcCablingMap.h:129
Muon::RpcCablingMap::m_offToOnline
OfflToOnlMap m_offToOnline
Map to cache the offline -> online conversions *‍/.
Definition: RpcCablingMap.h:123
Muon::RpcCablingMap::CoolDBEntry::firstStrip
uint8_t firstStrip
Lowest strip number covered by the cable.
Definition: RpcCablingMap.h:61
Muon::RpcCablingMap::insertChannels
bool insertChannels(CoolDBEntry &&dbEntry, MsgStream &log)
Inserts a new dbEntry into the map.
Definition: RpcCablingMap.cxx:122
Muon::RpcCablingMap::GasGapToTdcAssociation
Helper struct to associate all strips in an eta/phi gasGap to the corresponding Tdc.
Definition: RpcCablingMap.h:37
Muon::RpcCablingMap::TdcToGasGapAssociation::gasGapID
RpcCablingOfflineID gasGapID
Associated tdc chip.
Definition: RpcCablingMap.h:54
Muon::RpcCablingMap::convert
bool convert(const RpcCablingData &translationCache, Identifier &id, bool checkValid=true) const
Converts the translation cache back to an Identifier.
Definition: RpcCablingMap.cxx:19
Muon::RpcCablingMap::flatCables
std::set< FlatCablePtr > flatCables() const
Returns the list of all Rpc flat cable cards.
Definition: RpcCablingMap.cxx:231
Muon::RpcCablingMap::m_rpcIdHelper
const RpcIdHelper & m_rpcIdHelper
Pointer to the RpcIdHelper.
Definition: RpcCablingMap.h:114
Muon::RpcCablingMap::m_chambROBs
ChamberToROBMap m_chambROBs
Definition: RpcCablingMap.h:125
Muon::RpcCablingMap
Definition: RpcCablingMap.h:27
Muon::RpcCablingMap::m_ROBHashes
ROBToChamberMap m_ROBHashes
Definition: RpcCablingMap.h:126
Muon::RpcCablingData
Helper struct that is parsed to the cabling map to translate between the offline & online Identifiers...
Definition: RpcCablingData.h:94
Muon::RpcCablingMap::CoolDBEntry
Helper struct to ship all information from the Database
Definition: RpcCablingMap.h:59
IdentifierHash.h
Muon::RpcCablingOnlineID
In an analogous way to the RpcCablingOfflineID, the RpcCablingOnlineID, holds all information needed ...
Definition: RpcCablingData.h:77
CLASS_DEF
CLASS_DEF(Muon::RpcCablingMap, 195104634, 1)
Muon::RpcCablingMap::OnlToOfflMap
std::map< RpcCablingOnlineID, AllGasGapsPerTdc > OnlToOfflMap
Definition: RpcCablingMap.h:118
Muon::RpcCablingMap::OfflToOnlMap
std::map< RpcCablingOfflineID, AllTdcsPerGasGap > OfflToOnlMap
Definition: RpcCablingMap.h:117
Muon::RpcCablingMap::getROBId
uint32_t getROBId(const IdentifierHash &stationCode, MsgStream &log) const
return the ROD id of a given chamber, given the hash id
Definition: RpcCablingMap.cxx:187
Muon::RpcCablingMap::TdcToGasGapAssociation::firstStrip
uint8_t firstStrip
first strip
Definition: RpcCablingMap.h:56
Muon::RpcCablingMap::getOfflineId
bool getOfflineId(RpcCablingData &cabling_data, MsgStream &log) const
return the offline id given the online id
Definition: RpcCablingMap.cxx:93
RpcFlatCableTranslator.h
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TransientConstSharedPtr.h
Muon::RpcCablingMap::GasGapToTdcAssociation::tdcID
RpcCablingOnlineID tdcID
Associated tdc chip.
Definition: RpcCablingMap.h:43
Muon::RpcCablingMap::TdcToGasGapAssociation::flatCable
FlatCablePtr flatCable
Pointer to the flat cable card.
Definition: RpcCablingMap.h:52
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
Muon::RpcCablingMap::ListOfROB
std::vector< uint32_t > ListOfROB
Definition: RpcCablingMap.h:33
Muon::RpcCablingMap::AllGasGapsPerTdc
std::vector< TdcToGasGapAssociation > AllGasGapsPerTdc
Definition: RpcCablingMap.h:116
TrigPartialEventBuildingConfig.ROBs
ROBs
Definition: TrigPartialEventBuildingConfig.py:122
Muon::RpcCablingMap::getChamberHashVec
const std::vector< IdentifierHash > & getChamberHashVec(const uint32_t ROBI, MsgStream &log) const
return a HashId list for a given ROD
Definition: RpcCablingMap.cxx:206
Muon::RpcCablingMap::GasGapToTdcAssociation::firstStrip
uint8_t firstStrip
Lowest strip number covered by the cable.
Definition: RpcCablingMap.h:39
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CLASS_DEF.h
macros to associate a CLID to a type
Muon::RpcCablingMap::getAllROBId
const ListOfROB & getAllROBId() const
return the full list of ROD id
Definition: RpcCablingMap.cxx:228
Muon::RpcCablingMap::ROBToChamberMap
std::unordered_map< uint32_t, std::vector< IdentifierHash > > ROBToChamberMap
Definition: RpcCablingMap.h:32
Muon::RpcCablingMap::ChamberToROBMap
std::unordered_map< IdentifierHash, uint32_t > ChamberToROBMap
typedef to implement the csm mapping to ROB
Definition: RpcCablingMap.h:31
Identifier
Definition: IdentifierFieldParser.cxx:14