7 #include "GaudiKernel/ThreadLocalContext.h"
15 #include "GeoModelHelpers/throwExcept.h"
23 const EventContext& ctx)
24 : m_rpcIdHelper{idHelper} {
27 if (m_xaodHandle.record(std::make_unique<xAOD::RpcStripContainer>(),
28 std::make_unique<xAOD::RpcStripAuxContainer>()).isFailure()) {
38 const IdentifierHash& rpcHashId, MsgStream&
msg) {
39 std::unique_ptr<Muon::RpcPrepDataCollection>& coll =
40 m_rpcPrepDataCollections[rpcHashId];
43 if (m_rpcIdHelper.get_id(rpcHashId,
id, &m_modContext)) {
44 msg << MSG::ERROR <<
"Module hash creation failed. " <<
id <<
endmsg;
47 coll = std::make_unique<Muon::RpcPrepDataCollection>(rpcHashId);
54 const IdentifierHash& rpcHashId, MsgStream&
msg) {
55 std::unique_ptr<Muon::RpcCoinDataCollection>& coll =
56 m_rpcCoinDataCollections[rpcHashId];
59 if (m_rpcIdHelper.get_id(rpcHashId,
id, &m_modContext)) {
60 msg << MSG::ERROR <<
"Module hash creation failed. " <<
id <<
endmsg;
63 coll = std::make_unique<Muon::RpcCoinDataCollection>(rpcHashId);
71 const std::string&
name,
81 << m_producePRDfromTriggerWords);
82 ATH_MSG_INFO(
"reduceCablingOverlap " << m_reduceCablingOverlap);
83 ATH_MSG_INFO(
"solvePhiAmbiguities " << m_solvePhiAmbiguities);
85 if (m_solvePhiAmbiguities && (!m_reduceCablingOverlap)) {
87 "Inconsistent setting of properties (solvePhiAmbiguities entails "
88 "reduceCablingOverlap)");
90 m_reduceCablingOverlap =
true;
93 << m_etaphi_coincidenceTime);
95 << m_overlap_timeTolerance);
96 ATH_MSG_INFO(
"Correct prd time from cool db " << m_RPCInfoFromDb);
97 ATH_CHECK(m_rpcRdoDecoderTool.retrieve());
100 ATH_CHECK(m_readKey.initialize(m_RPCInfoFromDb));
101 ATH_CHECK(m_rdoContainerKey.initialize());
102 ATH_CHECK(m_rdoNrpcContainerKey.initialize(!m_rdoNrpcContainerKey.empty()));
103 ATH_CHECK(m_nRpcCablingKey.initialize(!m_rdoNrpcContainerKey.empty()));
106 ATH_CHECK(m_rpcPrepDataContainerKey.initialize());
107 ATH_CHECK(m_rpcCoinDataContainerKey.initialize());
112 ATH_CHECK(m_xAODKey.initialize(!m_xAODKey.empty()));
113 return StatusCode::SUCCESS;
116 const EventContext& ctx,
State& state)
const {
117 if (!m_prdContainerCacheKey.key().empty()) {
121 ATH_MSG_FATAL(
"Invalid UpdateHandle " << m_prdContainerCacheKey.key());
122 return StatusCode::FAILURE;
125 std::make_unique<Muon::RpcPrepDataContainer>(
update.ptr());
130 state.
m_prepDataCont = std::make_unique<Muon::RpcPrepDataContainer>(
131 m_idHelperSvc->rpcIdHelper().module_hash_max());
133 if (m_coindataContainerCacheKey.key().empty()) {
135 state.
m_coinDataCont = std::make_unique<Muon::RpcCoinDataContainer>(
136 m_idHelperSvc->rpcIdHelper().module_hash_max());
140 m_coindataContainerCacheKey, ctx};
143 << m_coindataContainerCacheKey.key());
144 return StatusCode::FAILURE;
147 std::make_unique<Muon::RpcCoinDataContainer>(
update.ptr());
153 return StatusCode::SUCCESS;
158 const std::vector<IdentifierHash>& idVect)
const {
160 "Calling Core decode function from MT decode function (hash vector)");
161 State state(m_idHelperSvc->rpcIdHelper(), m_xAODKey, ctx);
162 ATH_CHECK(loadProcessedChambers(ctx, state));
164 ATH_CHECK(decodeImpl(ctx, state, idVect,
true));
166 ATH_MSG_DEBUG(
"Core decode processed in MT decode (hash vector)");
168 ATH_CHECK(transferAndRecordPrepData(ctx, state));
169 ATH_CHECK(transferAndRecordCoinData(ctx, state));
171 return StatusCode::SUCCESS;
177 const EventContext& ctx,
const std::vector<uint32_t>& robIds)
const {
179 "Calling Core decode function from MT decode function (ROB vector)");
180 State state(m_idHelperSvc->rpcIdHelper(), m_xAODKey, ctx);
181 ATH_CHECK(loadProcessedChambers(ctx, state));
183 ATH_CHECK(decodeImpl(ctx, state, robIds,
true));
185 ATH_MSG_DEBUG(
"Core decode processed in MT decode (ROB vector)");
187 ATH_CHECK(transferAndRecordPrepData(ctx, state));
188 ATH_CHECK(transferAndRecordCoinData(ctx, state));
190 return StatusCode::SUCCESS;
193 const EventContext& ctx)
const {
194 State state(m_idHelperSvc->rpcIdHelper(), m_xAODKey, ctx);
195 ATH_CHECK(loadProcessedChambers(ctx, state));
196 ATH_CHECK(transferAndRecordPrepData(ctx, state));
197 ATH_CHECK(transferAndRecordCoinData(ctx, state));
198 return StatusCode::SUCCESS;
202 const EventContext& ctx,
State& state)
const {
205 if (!collection || collection->empty())
211 ATH_MSG_DEBUG(
"RpcPrepDataCollection already contained in IDC "
212 << m_idHelperSvc->toString(collection->identify()));
226 m_rpcPrepDataContainerKey, ctx};
228 ATH_MSG_DEBUG(
"Created container " << m_rpcPrepDataContainerKey.key());
230 return StatusCode::SUCCESS;
234 const EventContext& ctx,
State& state)
const {
235 if (!m_producePRDfromTriggerWords) {
236 return StatusCode::SUCCESS;
241 if (!collection || collection->empty())
247 ATH_MSG_DEBUG(
"RpcCoinDataCollection already contained in IDC "
248 << m_idHelperSvc->toString(collection->identify()));
261 m_rpcCoinDataContainerKey, ctx};
264 ATH_MSG_DEBUG(
"Created container " << m_rpcCoinDataContainerKey.key());
268 return StatusCode::SUCCESS;
274 const std::vector<IdentifierHash>& idVect,
275 bool firstTimeInTheEvent)
const {
276 int sizeVectorRequested = idVect.size();
277 ATH_MSG_DEBUG(
"Decode method called for " << sizeVectorRequested
278 <<
" offline collections");
279 if (sizeVectorRequested == 0)
284 std::vector<IdentifierHash> idVectToBeDecoded;
285 idVectToBeDecoded.reserve(idVect.size());
287 if (firstTimeInTheEvent) {
291 ATH_MSG_DEBUG(
"Whole event has already been decoded; nothing to do.");
292 return StatusCode::SUCCESS;
294 if (sizeVectorRequested == 0)
298 if (sizeVectorRequested != 0) {
302 for (
const IdentifierHash& itHashId : idVect) {
304 idVectToBeDecoded.push_back(itHashId);
306 if (idVectToBeDecoded.empty()) {
308 "All requested offline collections have already been decoded; "
310 return StatusCode::SUCCESS;
313 <<
" offline collections have not yet been decoded and "
314 "will be decoded now.");
317 "The list of offline collection hash ids to be decoded:");
318 for (
const IdentifierHash& itHashId : idVectToBeDecoded)
327 "Stored empty container. Decoding RPC RDO into RPC PrepRawData is "
329 return StatusCode::SUCCESS;
339 std::vector<IdentifierHash> rdoHashVec;
340 if (sizeVectorRequested != 0) {
342 "Looking for pads IdHash to be decoded for the requested collection "
344 ATH_CHECK(rpcCabling->giveRDO_fromPRD(idVectToBeDecoded, rdoHashVec));
348 IdContext rpcContext = m_idHelperSvc->rpcIdHelper().module_context();
351 ATH_MSG_DEBUG(
"Retrieving Rpc PAD container from the store");
353 if (!rdoContainerHandle.isValid()) {
355 return StatusCode::FAILURE;
360 if (rdoContainerHandle->numberOfCollections() == 0) {
362 ATH_MSG_DEBUG(
"Empty pad container - no rpc rdo in this event ");
363 return StatusCode::SUCCESS;
368 bool processingetaview{
true}, processingphiview{
false};
369 if (!m_solvePhiAmbiguities)
370 processingetaview =
false;
371 bool doingSecondLoopAmbigColls =
false;
372 while (processingetaview || processingphiview || (!m_solvePhiAmbiguities)) {
373 int ipad{0}, nPrepRawData{0}, nPhiPrepRawData{0}, nEtaPrepRawData{0};
374 if (processingphiview)
377 if (processingetaview)
383 if (sizeVectorRequested != 0) {
385 for (
const IdentifierHash& iPadHash : rdoHashVec) {
386 const RpcPad* rdoColl = rdoContainerHandle->indexFindPtr(iPadHash);
389 << iPadHash <<
" not found in the rdoContainerHandle.");
396 <<
", with " << rdoColl->
size()
398 ATH_CHECK(processPad(ctx, state, rdoColl, processingetaview,
399 processingphiview, nPrepRawData, idVectToBeDecoded, doingSecondLoopAmbigColls));
404 for (
const RpcPad* rdoColl : *rdoContainerHandle) {
406 if (rdoColl->empty())
410 << (
int)(rdoColl->identifyHash())
411 <<
", with " << rdoColl->size()
414 ATH_CHECK(processPad(ctx, state, rdoColl, processingetaview,
415 processingphiview, nPrepRawData, idVectToBeDecoded, doingSecondLoopAmbigColls));
419 if (processingetaview) {
420 processingetaview =
false;
421 processingphiview =
true;
422 nEtaPrepRawData = nPrepRawData;
423 ATH_MSG_DEBUG(
"*** " << nEtaPrepRawData <<
" eta PrepRawData registered");
425 processingphiview =
false;
426 nPhiPrepRawData = nPrepRawData - nEtaPrepRawData;
427 ATH_MSG_DEBUG(
"*** " << nPhiPrepRawData <<
" phi PrepRawData registered");
430 doingSecondLoopAmbigColls =
true;
431 processingetaview =
true;
433 <<
" ambiguous collections were stored:");
434 idVectToBeDecoded.clear();
438 idVectToBeDecoded.push_back(itAmbiColl);
441 ATH_CHECK(rpcCabling->giveRDO_fromPRD(idVectToBeDecoded, rdoHashVec));
444 if (!m_solvePhiAmbiguities) {
445 ATH_MSG_DEBUG(
"*** " << nPrepRawData <<
" PrepRawData registered");
451 return StatusCode::SUCCESS;
456 const EventContext& ctx,
State& state,
const std::vector<uint32_t>& robIds,
457 bool firstTimeInTheEvent)
const {
461 int sizeVectorRequested = robIds.size();
462 ATH_MSG_DEBUG(
"Decode method called for " << sizeVectorRequested <<
" ROBs");
464 std::vector<uint32_t> robIdsToBeDecoded;
465 robIdsToBeDecoded.reserve(robIds.size());
467 if (firstTimeInTheEvent) {
471 ATH_MSG_DEBUG(
"Whole event has already been decoded; nothing to do.");
472 return StatusCode::SUCCESS;
479 robIdsToBeDecoded.push_back(robid);
482 if (robIdsToBeDecoded.empty()) {
484 "All requested ROBs have already been decoded; nothing to do.");
485 return StatusCode::SUCCESS;
488 <<
" ROBs have not yet been decoded and will be decoded now.");
491 for (
uint32_t robid : robIdsToBeDecoded)
500 if (state.
m_decodedRobIds.size() == rpcCabling->giveFullListOfRobIds().size())
506 "Stored empty container. Decoding RPC RDO into RPC PrepRawData is "
508 return StatusCode::SUCCESS;
514 ATH_MSG_DEBUG(
"Retrieving Rpc PAD container from the store");
516 if (!rdoContainerHandle.isValid()) {
518 return StatusCode::SUCCESS;
523 if (rdoContainerHandle->empty()) {
525 ATH_MSG_DEBUG(
"Empty pad container - no rpc rdo in this event ");
526 return StatusCode::SUCCESS;
531 std::vector<IdentifierHash> rdoHashVec;
533 13 * robIdsToBeDecoded.size());
534 ATH_CHECK(rpcCabling->giveRDO_fromROB(robIdsToBeDecoded, rdoHashVec));
537 bool processingetaview =
true;
538 bool processingphiview =
false;
539 if (!m_solvePhiAmbiguities)
540 processingetaview =
false;
541 while (processingetaview || processingphiview || (!m_solvePhiAmbiguities)) {
542 int ipad{0}, nPrepRawData{0}, nPhiPrepRawData{0}, nEtaPrepRawData{0};
543 if (processingphiview)
546 if (processingetaview)
554 for (
const IdentifierHash& padHashId : rdoHashVec) {
555 const RpcPad* rdoColl = rdoContainerHandle->indexFindPtr(padHashId);
558 << (
unsigned int)padHashId
559 <<
" not found in the rdoContainerHandle.");
564 << ipad <<
", online id " << (
int)(rdoColl->
identifyHash())
565 <<
", with " << rdoColl->
size() <<
" CM inside ");
566 CHECK(processPad(ctx, state, rdoColl, processingetaview,
567 processingphiview, nPrepRawData, rdoHashVec,
false));
570 if (processingetaview) {
571 processingetaview =
false;
572 processingphiview =
true;
573 nEtaPrepRawData = nPrepRawData;
574 ATH_MSG_DEBUG(
"*** " << nEtaPrepRawData <<
" eta PrepRawData registered");
576 processingphiview =
false;
577 nPhiPrepRawData = nPrepRawData - nEtaPrepRawData;
578 ATH_MSG_DEBUG(
"*** " << nPhiPrepRawData <<
" phi PrepRawData registered");
580 if (!m_solvePhiAmbiguities) {
581 ATH_MSG_DEBUG(
"*** " << nPrepRawData <<
" PrepRawData registered");
588 return StatusCode::SUCCESS;
593 const EventContext& ctx,
State& state,
const RpcPad* rdoColl,
594 bool& processingetaview,
bool& processingphiview,
int& nPrepRawData,
595 const std::vector<IdentifierHash>& idVect,
596 bool doingSecondLoopAmbigColls)
const {
598 const RpcIdHelper& idHelper = m_idHelperSvc->rpcIdHelper();
601 ATH_MSG_DEBUG(
"***************** Start of processPad eta/phiview "
602 << processingetaview <<
"/" << processingphiview);
608 << padId <<
" m_logic sector ID " << sectorId);
611 Identifier oldId{0}, oldIdTrg{0};
615 IdentifierHash rpcHashId{0};
624 for (; itCM != itCM_e; ++itCM) {
626 bool etaview =
false;
629 bool highPtCm =
false;
631 uint16_t cmaId = (*itCM)->onlineId();
633 << icm <<
" CM online ID " << cmaId
634 <<
" with n. of hits = " << (*itCM)->size());
662 if (processingetaview && (!etaview))
664 if (processingphiview && etaview)
674 for (; itD != itD_e; ++itD) {
678 unsigned short overlap = 99;
681 bool solvePhiAmb_thisHit = m_solvePhiAmbiguities;
682 bool reduceCablOvl_thisHit = m_reduceCablingOverlap;
688 << rpcChan->
time() <<
" ijk "
690 if (rpcChan->
ijk() < 7)
696 bool triggerHit =
false;
698 processTriggerHitHypothesis(itD, itD_e, highPtCm, triggerHit,
threshold,
706 solvePhiAmb_thisHit =
false;
707 reduceCablOvl_thisHit =
false;
709 "RpcFiredChannel: it's a triggerHit or a lowPt coinc. in a high pt "
711 <<
" ijk = " << rpcChan->
ijk() <<
" isHighPtCM " << highPtCm
712 <<
" thr/ovl = " <<
threshold <<
"/" << overlap);
717 std::vector<Identifier> digitVec{m_rpcRdoDecoderTool->getOfflineData(
718 rpcChan, sectorId, padId, cmaId,
time, rpcCabling.cptr())};
721 int nMatchingEtaHits = 0;
722 int nDuplicatePhiHits = 0;
723 bool unsolvedAmbiguity =
false;
724 bool notFinished =
true;
733 while (notFinished) {
736 "size of the corresponding list of ID = " << digitVec.size());
737 if (digitVec.empty()) {
742 for (
const Identifier&
channelId : digitVec) {
745 rpcHashId = m_idHelperSvc->moduleHash(
channelId);
751 if (!idVect.empty() &&
752 std::find(idVect.begin(), idVect.end(), rpcHashId) == idVect.end()) {
756 << m_idHelperSvc->toString(
channelId) <<
" time "
758 ATH_MSG_DEBUG(
" oldID = " << m_idHelperSvc->toString(oldId) <<
759 " oldIDtrg = " << m_idHelperSvc->toString(oldIdTrg));
760 bool hasAMatchingEtaHit = 0;
763 if ((oldIdTrg !=
parentId) || !collectionTrg) {
767 << m_idHelperSvc->toString(
parentId) <<
" hash = "
768 <<
static_cast<unsigned int>(rpcHashId));
772 << m_idHelperSvc->toString(oldIdTrg));
774 }
else if ((oldId !=
parentId) || !collection) {
778 << m_idHelperSvc->toString(
parentId) <<
" hash = "
779 <<
static_cast<unsigned int>(rpcHashId));
783 << m_idHelperSvc->toString(oldId));
789 bool duplicate =
false;
790 if (reduceCablOvl_thisHit) {
791 if (collection->begin() != collection->end()) {
794 << collection->size());
795 int current_dbphi{0}, current_dbz{0}, current_gg{0};
796 if (processingphiview) {
798 m_idHelperSvc->rpcIdHelper().doubletPhi(
channelId);
799 current_dbz = m_idHelperSvc->rpcIdHelper().doubletZ(
channelId);
800 current_gg = m_idHelperSvc->rpcIdHelper().gasGap(
channelId);
802 "Check also for eta hits matching dbz, dbphi, gg "
803 << current_dbz <<
" " << current_dbphi <<
" "
809 fabs(
time - rpc->time()) < m_overlap_timeTolerance) {
811 hasAMatchingEtaHit =
false;
816 float previous_time = rpc->time();
818 if (
time < previous_time) {
821 "time of the prd previously stored is now updated with "
823 << previous_time <<
" -> " << rpc->time());
829 if (processingphiview) {
830 if (solvePhiAmb_thisHit) {
831 if (!unsolvedAmbiguity) {
832 if (m_idHelperSvc->rpcIdHelper().measuresPhi(
833 rpc->identify()) == 0) {
837 m_idHelperSvc->rpcIdHelper().doubletZ(
840 m_idHelperSvc->rpcIdHelper().doubletPhi(
843 m_idHelperSvc->rpcIdHelper().gasGap(
845 if (fabs(
time - rpc->time()) <
846 m_etaphi_coincidenceTime) {
847 hasAMatchingEtaHit =
true;
849 "There's a matching eta hit with id "
850 << m_idHelperSvc->toString(
865 if (hasAMatchingEtaHit)
869 if (processingphiview && duplicate)
877 if (solvePhiAmb_thisHit && (!etaview))
879 <<
" hasAMatchingEtaHit = "
880 << hasAMatchingEtaHit);
885 " solvePhiAmb_thisHit, processingetaview, processingphiview, "
886 "hasAMatchingEtaHit, unsolvedAmbiguity "
887 << solvePhiAmb_thisHit <<
" " << processingetaview <<
" "
888 << processingphiview <<
" " << hasAMatchingEtaHit <<
" "
889 << unsolvedAmbiguity);
890 if ((!solvePhiAmb_thisHit) || processingetaview ||
891 (processingphiview &&
892 (hasAMatchingEtaHit || unsolvedAmbiguity))) {
893 if (unsolvedAmbiguity) {
894 if (idVect.empty()) {
900 "unsolvedAmbiguity is true, adding collection with hash "
902 << (
int)rpcHashId <<
" to ambiguous collections vector");
906 ambiguousCollections.insert(rpcHashId);
908 "collection not yet processed; added to ambiguous "
909 "collection vector; going to the next offline "
912 }
else if (!doingSecondLoopAmbigColls) {
913 ambiguousCollections.insert(rpcHashId);
915 "collection already processed and "
916 "doingSecondLoopAmbigColls=false; added to ambiguous "
917 "collection vector; going to the next offline channel "
922 "collection already processed and "
923 "doingSecondLoopAmbigColls=true; trying to store data "
925 "unsolvedAmbiguity");
935 hasAMatchingEtaHit =
false;
938 "Detector Element not found for Identifier from the "
941 <<
"> =>>ignore this hit");
944 hasAMatchingEtaHit =
false;
946 if (m_idHelperSvc->rpcIdHelper().stationNameString(
947 m_idHelperSvc->rpcIdHelper().stationName(
channelId)) ==
950 "Identifier from the cabling service <"
952 <<
"> inconsistent with the geometry of detector element "
954 << m_idHelperSvc->toString(descriptor->
identify())
955 <<
"> =>>ignore this hit /// there are unmasked "
959 "Identifier from the cabling service <"
961 <<
"> inconsistent with the geometry of detector element "
963 << m_idHelperSvc->toString(descriptor->
identify())
964 <<
"> =>>ignore this hit");
973 << tempGlobalPosition.x() <<
", "
974 << tempGlobalPosition.y() <<
", "
975 << tempGlobalPosition.z() <<
") ");
979 tempGlobalPosition, tempGlobalPosition, pointLocPos);
982 std::vector<Identifier> identifierList{
channelId};
986 m_idHelperSvc->rpcIdHelper().measuresPhi(
channelId));
989 double errPos = stripWidth / std::sqrt(12.0);
992 mat *= errPos * errPos;
995 int ambiguityFlag = 0;
996 if (solvePhiAmb_thisHit) {
997 if (processingetaview)
999 if (unsolvedAmbiguity)
1000 ambiguityFlag = digitVec.size();
1001 else if (hasAMatchingEtaHit)
1002 ambiguityFlag = nMatchingEtaHits;
1006 if (m_RPCInfoFromDb) {
1008 std::optional<double> StripTimeFromCool = readHandle->getStripTime(
channelId);
1009 if (StripTimeFromCool) {
1010 time -= (*StripTimeFromCool);
1018 channelId, rpcHashId, pointLocPos, identifierList,
1020 rpcChan->
ijk(),
threshold, overlap, cmaId, padId, sectorId,
1025 " Adding RpcCoinData @ "
1026 << newCoinData <<
" to collection "
1027 << m_idHelperSvc->toString(collectionTrg->identify()));
1030 collectionTrg->size());
1031 collectionTrg->push_back(newCoinData);
1035 <<
"ambiguityFlag = " << ambiguityFlag);
1038 channelId, rpcHashId, pointLocPos, identifierList,
1044 << newPrepData <<
" to collection "
1045 << m_idHelperSvc->toString(collection->identify()));
1048 collection->size());
1049 collection->push_back(newPrepData);
1055 if (!m_xAODKey.empty()) {
1056 auto xprd = state.
m_xaodHandle->push_back(std::make_unique<xAOD::RpcStrip>());
1057 xprd->setIdentifier(
channelId.get_compact());
1061 xprd->setMeasurement(m_idHelperSvc->detElementHash(
channelId), locpos,
cov);
1066 xprd->setTime(
static_cast<float>(
time));
1067 xprd->setTriggerInfo(rpcChan->
ijk());
1068 xprd->setAmbiguityFlag(ambiguityFlag);
1080 "processingphiview, nMatchingEtaHits, nDuplicatePhiHits, "
1081 "unsolvedAmbiguity, solvePhiAmb_thisHit : "
1082 << processingphiview <<
", " << nMatchingEtaHits <<
", "
1083 << nDuplicatePhiHits <<
", " << unsolvedAmbiguity <<
", "
1084 << solvePhiAmb_thisHit);
1085 if ((processingphiview && (nMatchingEtaHits == 0)) &&
1086 (nDuplicatePhiHits == 0) && (!unsolvedAmbiguity) &&
1087 (solvePhiAmb_thisHit)) {
1088 unsolvedAmbiguity =
true;
1093 "No eta prepData matching any phi hit from this CM hit \n"
1094 <<
"loop once again and store all phi digits potentially "
1095 "generating this CM hit");
1096 }
else if (unsolvedAmbiguity)
1097 notFinished =
false;
1099 notFinished =
false;
1104 ATH_MSG_DEBUG(
"***************** Stop of processPad eta/phiview "
1105 << processingetaview <<
"/" << processingphiview
1106 <<
"***************** for Pad online Id " << padId
1107 <<
" m_logic sector ID " << sectorId);
1109 return StatusCode::SUCCESS;
1113 State& state)
const {
1114 if (m_rdoNrpcContainerKey.empty()) {
1116 return StatusCode::SUCCESS;
1119 ATH_MSG_DEBUG(
"Retrieving Nrpc RDO container from the store");
1121 m_rdoNrpcContainerKey, ctx};
1122 if (!rdoNrpcContainerHandle.isPresent()) {
1123 ATH_MSG_ERROR(
"Retrieval of NRPC RDO " << m_rdoNrpcContainerKey.fullKey()
1124 <<
" container failed !");
1125 return StatusCode::FAILURE;
1128 if (rdoNrpcContainerHandle->empty()) {
1130 ATH_MSG_DEBUG(
"Empty NRPC RDO container - no nrpc rdo in this event ");
1131 return StatusCode::SUCCESS;
1133 ATH_MSG_DEBUG(
"Not empty NRPC RDO container in this event ");
1136 if (!readCdo.isValid()) {
1137 ATH_MSG_ERROR(
"Could not retrieve " << m_nRpcCablingKey.fullKey()
1138 <<
" from the conditions store");
1139 return StatusCode::FAILURE;
1144 for (
const xAOD::NRPCRDO* nrpcrdo : *rdoNrpcContainerHandle) {
1151 Identifier chanId{};
1152 if (!readCdo->getOfflineId(
cabling_data, msgStream()) ||
1155 return StatusCode::FAILURE;
1157 const IdentifierHash rpcHashId = m_idHelperSvc->moduleHash(chanId);
1162 muDetMgr->getRpcReadoutElement(chanId);
1165 std::vector<Identifier> identifierList{chanId};
1168 ATH_MSG_DEBUG(
"RPC RDO->PrepRawdata " << m_idHelperSvc->toString(chanId)
1169 <<
" global position "
1176 const double stripWidth = descriptor->
StripWidth(
1177 m_idHelperSvc->rpcIdHelper().measuresPhi(chanId));
1179 const double errPos = stripWidth / std::sqrt(12.0);
1182 mat *= errPos * errPos;
1184 int ambiguityFlag = 0;
1186 const float time = nrpcrdo->time();
1188 const float timeoverthr = nrpcrdo->timeoverthr();
1191 new RpcPrepData(chanId, rpcHashId, pointLocPos, identifierList,
mat,
1192 descriptor,
time, timeoverthr, 0, ambiguityFlag);
1195 collection->
size());
1198 return StatusCode::SUCCESS;
1205 bool& triggerHit,
unsigned short&
threshold,
unsigned short& overlap,
1209 if ((highPtCm && rpcChan->
ijk() < 2) || (rpcChan->
ijk() > 5)) {
1214 if (!m_producePRDfromTriggerWords) {
1219 if (rpcChan->
ijk() == 7) {
1224 if (rpcChan->
ijk() == 6) {
1228 cmtype =
" in low pT CM ";
1230 cmtype =
" in high pT CM ";
1232 <<
" bcid is " << rpcChan->
bcid()
1233 <<
" time is " << rpcChan->
time()
1234 <<
" ch " << rpcChan->
channel());
1237 while (itDnext != itD_end) {
1241 <<
" bcid is " << rpcChan->
bcid()
1243 << rpcChanNext->
time());
1244 if (rpcChanNext->
ijk() < 7)
1247 if (rpcChanNext->
ijk() == 7) {
1249 if (rpcChanNext->
bcid() == rpcChan->
bcid() &&
1250 rpcChanNext->
time() == rpcChan->
time()) {
1252 << rpcChanNext->
thr() <<
"/" << rpcChanNext->
ovl());
1254 overlap = rpcChanNext->
ovl();
1257 "ijk =7 after a ijk = 6 BUT bdid/tick don't match - will not "
1258 "assign threshold/overlap ");
1264 if (rpcChanNext->
ijk() == 6) {
1269 "RPC cm hit with ijk = 6 not followed by ijk = 6 or 7 - will "
1270 "not assign threshold / overlap");
1281 << rpcChan->
ijk() <<
" threshold / overlap = " <<
threshold