20 bool valid{!check_valid};
51 if (log.level()<= MSG::DEBUG) {
52 log<<MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": test "<<translatorCache<<
endmsg;
57 log << MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": The offline identifier "
58 << offId <<
" is unknown " <<
endmsg;
63 if (log.level() <= MSG::DEBUG) {
64 log<<MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": Chamber "<<offId<<
" has "
65 <<tdcs.size()<<
" cards "<<
endmsg;
68 const AllTdcsPerGasGap::const_iterator onlineCardItr =
73 if (onlineCardItr != itr->second.end()) {
79 translatorCache.
channelId = (*tdcChannel);
80 if (log.level() <= MSG::DEBUG) {
81 log <<MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": Mapped to card "
85 }
else if (log.level() <= MSG::DEBUG) {
86 log <<MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
":\n"<<(*onlineCard.
flatCable)<<
endmsg;
89 log << MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": No tdc channel could be found for the object "
94 OnlToOfflMap::const_iterator itr =
m_onToOffline.find(translatorCache);
96 log << MSG::DEBUG <<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": The tdc chip "
109 if (log.level() <= MSG::DEBUG) {
110 log <<MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": -- Card "
115 log << MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": No tdc channel could be found for the object "
126 offToOnl.
tdcID = onlCh;
133 return a.firstStrip < b.firstStrip;
139 onlToOff.flatCable = entry.flatCable;
143 return a.firstStrip < b.firstStrip;
146 if (log.level()<= MSG::DEBUG) {
147 log<<MSG::DEBUG<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__<<
": Add new cabling channel "
148 <<offCh<<std::format(
"firstStrip: {:2d}", entry.firstStrip)<<
" - "<<onlCh
149 <<std::format(
"flatCable: {:2d}", entry.flatCable->id())<<
endmsg;
152 int sub = entry.subDetector;
153 int rod = entry.boardSector;
155 int32_t hardId = (sub << 16) | rod;
158 if (!robInitialized) {
166 log << MSG::ERROR <<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__
167 <<
": finalize() -- No data has been loaded " <<
endmsg;
177 if (!
convert(RobOffId, chId,
true)) {
178 log << MSG::ERROR<<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__
179 <<
": Could not construct an offline identifier from " << chamber.gasGapID <<
endmsg;
184 log << MSG::ERROR <<
"RpcCablingMap::"<<__func__<<
"() - "<<__LINE__
185 <<
": Failed to generate a hash for " << chamber.gasGapID <<
endmsg;
188 uint32_t hardId = (card.subDetector << 16) | card.boardSector;
190 std::vector<IdentifierHash>& robHashes =
m_ROBHashes[hardId];
191 if (std::ranges::find(robHashes, hash) == robHashes.end()){
192 robHashes.push_back(hash);
199 ChamberToROBMap::const_iterator it =
m_chambROBs.find(stationCode);
203 if (log.level() <= MSG::WARNING) {
204 log << MSG::WARNING <<
"Station code " << stationCode <<
" not found !! "<<
endmsg;
211 toRet.reserve(rpcHashVector.size());
213 toRet.push_back(
getROBId(hash, log));
218 ROBToChamberMap::const_iterator itr =
m_ROBHashes.find(ROBI);
222 if (log.level() <= MSG::WARNING) {
223 log << MSG::WARNING <<
"ROB ID " << ROBI <<
" not found ! " <<
endmsg;
225 static const std::vector<IdentifierHash> dummy;
229 std::unordered_set<IdentifierHash> hashSet{};
230 for (
const uint32_t rob : ROBs) {
232 hashSet.insert(hashFromROB.begin(), hashFromROB.end());
234 std::vector<IdentifierHash> hashVec{};
235 hashVec.insert(hashVec.end(), hashSet.begin(), hashSet.end());
243 std::set<FlatCablePtr> cables{};
246 cables.insert(assoc.flatCable);
This is a "hash" representation of an Identifier.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
OnlToOfflMap m_onToOffline
Map storing the connection from online -> offline channels.
OfflToOnlMap m_offToOnline
Map to cache the offline -> online conversions */.
bool convert(const RpcCablingData &translationCache, Identifier &id, bool checkValid=true) const
Converts the translation cache back to an Identifier.
bool insertChannels(CoolDBEntry &&dbEntry, MsgStream &log)
Inserts a new dbEntry into the map.
const ListOfROB & getAllROBId() const
return the full list of ROD id
const RpcIdHelper & m_rpcIdHelper
Pointer to the RpcIdHelper.
bool getOfflineId(RpcCablingData &cabling_data, MsgStream &log) const
return the offline id given the online id
RpcCablingMap(const IMuonIdHelperSvc *idHelperSvc)
Constructor taking the IdHelperSvc.
const std::vector< IdentifierHash > & getChamberHashVec(const uint32_t ROBI, MsgStream &log) const
return a HashId list for a given ROD
std::vector< GasGapToTdcAssociation > AllTdcsPerGasGap
ROBToChamberMap m_ROBHashes
std::vector< uint32_t > ListOfROB
bool finalize(MsgStream &log)
Performs consistency checks for the cabling data (I.e.
ListOfROB m_listOfROB
full list of ROBs
bool getOnlineId(RpcCablingData &cabling_data, MsgStream &log) const
return the online id given the offline id
ChamberToROBMap m_chambROBs
std::set< FlatCablePtr > flatCables() const
Returns the list of all Rpc flat cable cards.
uint32_t getROBId(const IdentifierHash &stationCode, MsgStream &log) const
return the ROD id of a given chamber, given the hash id
static constexpr uint8_t firstStrip
Convention of the lowest strip number.
std::optional< uint8_t > tdcChannel(uint8_t strip, MsgStream &log) const
Returns the connected tdc channel connected to a strip.
static constexpr uint8_t readStrips
Number of channels covered by one chip.
std::optional< uint8_t > stripChannel(uint8_t tdcChannel, MsgStream &log) const
Returns the strip channel connected to a strip.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Helper struct that is parsed to the cabling map to translate between the offline & online Identifiers...
uint8_t channelId
Online board channel number.
uint8_t strip
Offline strip number.
Helper struct to ship all information from the Database.
Helper struct to associate all strips in an eta/phi gasGap to the corresponding Tdc.
FlatCablePtr flatCable
Pointer to the flat cable card.
RpcCablingOnlineID tdcID
Associated tdc chip.
uint8_t firstStrip
Lowest strip number covered by the cable.
Helper struct to associate all Tdcs to their corresponding strips in the gasGap.
uint8_t firstStrip
first strip
FlatCablePtr flatCable
Pointer to the flat cable card.
RpcCablingOfflineID gasGapID
Associated tdc chip.
Struct to represent the offline identifier of the Rpc measurement decomposed into the particular fiel...
int8_t & phi
Eta index of the RPC station.
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
int8_t & doubletZ
doublet Phi -> 1,2
int8_t & doubletPhi
doublet R -> 1,2
int8_t & doubletR
Station phi of the RPC station.
int8_t & gasGap
doublet Z -> 1,2
bool measuresPhi() const
: Does the channel measure phi
void setMeasPhiAndSide(bool measPhi, bool stripSide)
Sets the measuresPhi & stripSide fields of the cabling data object.
In an analogous way to the RpcCablingOfflineID, the RpcCablingOnlineID, holds all information needed ...