17 const std::string&
name,
36 ATH_CHECK(m_rpcPrepContainerKey.initialize());
38 ATH_CHECK(m_clusterPreparator.retrieve());
41 return StatusCode::SUCCESS;
49 m_use_RoIBasedDataAccess = use_RoIBasedDataAccess;
58 const ToolHandle<RpcPatFinder>* rpcPatFinder,
59 const bool dynamicDeltaRpc)
const
64 if( m_emulateNoRpcHit )
65 return StatusCode::SUCCESS;
69 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
70 std::vector<IdentifierHash> rpcHashList;
71 std::vector<IdentifierHash> rpcHashListWithData;
72 std::vector<IdentifierHash> rpcHashList_cache;
74 if (m_use_RoIBasedDataAccess) {
78 if (iroi) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*iroi, rpcHashList);
81 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
85 std::vector<uint32_t> rpcRobList;
86 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->ROBIDList(*iroi, rpcRobList);
92 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
95 std::vector<uint32_t> rpcRobList;
96 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->ROBIDList(fullscan_roi, rpcRobList);
100 if (!rpcHashList.empty()) {
104 auto rpcPrepContainerHandle =
SG::makeHandle(m_rpcPrepContainerKey);
105 rpcPrds = rpcPrepContainerHandle.cptr();
106 if (!rpcPrepContainerHandle.isValid()) {
107 ATH_MSG_ERROR(
"Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
108 return StatusCode::FAILURE;
110 ATH_MSG_DEBUG(
"RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
117 if( RPCcoll ==
nullptr ) {
121 if( RPCcoll->size() == 0) {
126 rpcHashList_cache.push_back(
id);
127 rpcCols.push_back(RPCcoll);
133 rpcHits.reserve( rpcHits.size() + rpc->size() );
138 const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(
id);
139 const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(
id);
140 const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(
id);
141 const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(
id);
142 const bool measuresPhi = m_idHelperSvc->rpcIdHelper().measuresPhi(
id);
143 const int stationEta = m_idHelperSvc->rpcIdHelper().stationEta(
id);
144 std::string
stationName = m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(
id));
157 const double hitx=globalpos.x();
158 const double hity=globalpos.y();
159 const double hitz=globalpos.z();
161 const double hittime = prd->time();
167 <<
" global positions x/y/z=" << hitx <<
"/" << hity <<
"/" << hitz
168 <<
" doubletR: " <<
doubletR <<
" doubletZ: " << doubletZ <<
" doubletPhi " <<
doubletPhi
169 <<
" gasGap " <<
gasGap <<
" layer " <<
layer <<
" time " << hittime
170 <<
" distToEtaReadout " << distToEtaReadout <<
" distToPhiReadout " << distToPhiReadout);
177 lutDigit.
time = hittime;
188 const float r2 = hitx*hitx+hity*hity;
189 float phi = std::atan2(hity,hitx);
190 const float l = std::sqrt(hitz*hitz+r2);
191 const float tan = std::sqrt( (
l-hitz)/(
l+hitz) );
193 const float deta = std::abs(p_roids->
eta() - eta);
199 rpcHits.push_back(lutDigit);
201 float deta_thr = 0.1;
202 float dphi_thr = 0.1;
203 float dynamic_add = 0.02;
206 if( dynamicDeltaRpc ){
212 ATH_CHECK( m_recRPCRoiTool->RoIsize(p_roids->
roiWord(), RoiEtaMin, RoiEtaMax, RoiPhiMin, RoiPhiMax) );
213 ATH_MSG_DEBUG(
"RoI Phi min = " << RoiPhiMin <<
" RoI Phi max = " << RoiPhiMax <<
" RoI Eta min = " << RoiEtaMin <<
" RoI Eta max = " << RoiEtaMax );
214 deta_thr = std::abs( RoiEtaMax - RoiEtaMin )/2. + dynamic_add;
215 dphi_thr = std::abs( std::acos(
std::cos( RoiPhiMax - RoiPhiMin ) ) )/2. + dynamic_add;
220 if (m_use_RoIBasedDataAccess) {
221 if ( deta<deta_thr && dphi<dphi_thr)
224 if ( deta<0.15 && dphi<0.1)
230 return StatusCode::SUCCESS;
238 const ToolHandle<ClusterPatFinder>* clusterPatFinder,
239 const bool dynamicDeltaRpc)
const
243 if( m_emulateNoRpcHit )
244 return StatusCode::SUCCESS;
248 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
249 std::vector<IdentifierHash> rpcHashList;
250 std::vector<IdentifierHash> rpcHashList_cache;
252 if (m_use_RoIBasedDataAccess) {
256 if (iroi) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*iroi, rpcHashList);
259 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
268 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
273 if (!rpcHashList.empty()) {
277 auto rpcPrepContainerHandle =
SG::makeHandle(m_rpcPrepContainerKey);
278 rpcPrds = rpcPrepContainerHandle.cptr();
279 if (!rpcPrepContainerHandle.isValid()) {
280 ATH_MSG_ERROR(
"Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
281 return StatusCode::FAILURE;
283 ATH_MSG_DEBUG(
"RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
291 if( RPCcoll ==
nullptr ) {
295 if( RPCcoll->size() == 0) {
300 rpcHashList_cache.push_back(
id);
301 rpcCols.push_back(RPCcoll);
305 ATH_CHECK( m_clusterPreparator->clusteringRPCs(dynamicDeltaRpc, rpcCols, p_roids, clusterPatFinder, rpcLayerClusters) );
307 return StatusCode::SUCCESS;