Skip to content
Snippets Groups Projects
Commit a99ed78b authored by Savanna Shaw's avatar Savanna Shaw Committed by Adam Edward Barton
Browse files

Fix bug in seeded TGC RDO to PRD decoding

The seeded TGC RDO to PRD decoding filters the RDOs to be decoded based on the onlineId of the RDO. However, the onlineId is not unique (an onlineId value can correspond to several different offline hash Id values), so we were sometimes decoding RDOs that fall outside of the RoI we are interested in. Adding an additional check that the offline HashId for the RDO is contained within the HashIds requested to be decoded to avoid decoding unwanted RDOs.
parent f6451c06
No related branches found
No related tags found
No related merge requests found
......@@ -199,7 +199,19 @@ StatusCode Muon::TgcRdoToPrepDataTool::decode(std::vector<IdentifierHash>& reque
TgcRdo::const_iterator itD = (*iRdo)->begin();
TgcRdo::const_iterator itD_e = (*iRdo)->end();
for(; itD!=itD_e; itD++) {
selectDecoder(itD, (*iRdo));
//Since OnlineIds are not unique, need some additional filtering on offline hashId
//to avoid decoding RDO outside of an RoI
Identifier offlineId;
IdentifierHash tgcHashId;
IdContext tgcContext = m_idHelperSvc->tgcIdHelper().module_context();
if(m_tgcCabling->getElementIDfromReadoutID(offlineId, (*itD)->subDetectorId(), (*itD)->rodId(), (*itD)->sswId(), (*itD)->slbId(), (*itD)->bitpos())){
if(m_idHelperSvc->tgcIdHelper().get_hash(offlineId, tgcHashId, &tgcContext)){
if(std::find(requestedIdHashVect.begin(), requestedIdHashVect.end(), tgcHashId) != requestedIdHashVect.end()){
selectDecoder(itD, (*iRdo));
}
}
}
}
m_decodedRdoCollVec.push_back(*iRdo);
}
......
......@@ -161,7 +161,19 @@ StatusCode Muon::TgcRdoToPrepDataToolMT::decode(std::vector<IdentifierHash>& req
TgcRdo::const_iterator itD = (*iRdo)->begin();
TgcRdo::const_iterator itD_e = (*iRdo)->end();
for(; itD!=itD_e; itD++) {
selectDecoder(itD, (*iRdo));
//Since OnlineIds are not unique, need some additional filtering on offline hashId
//to avoid decoding RDO outside of an RoI
Identifier offlineId;
IdentifierHash tgcHashId;
IdContext tgcContext = m_idHelperSvc->tgcIdHelper().module_context();
if(m_tgcCabling->getElementIDfromReadoutID(offlineId, (*itD)->subDetectorId(), (*itD)->rodId(), (*itD)->sswId(), (*itD)->slbId(), (*itD)->bitpos())){
if(m_idHelperSvc->tgcIdHelper().get_hash(offlineId, tgcHashId, &tgcContext)){
if(std::find(requestedIdHashVect.begin(), requestedIdHashVect.end(), tgcHashId) != requestedIdHashVect.end()){
selectDecoder(itD, (*iRdo));
}
}
}
}
m_decodedRdoCollVec.push_back(*iRdo);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment