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;
59 const ToolHandle<RpcPatFinder>* rpcPatFinder,
60 const bool dynamicDeltaRpc)
const
65 if( m_emulateNoRpcHit )
return StatusCode::SUCCESS;
67 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
68 std::vector<IdentifierHash> rpcHashList;
70 if (m_use_RoIBasedDataAccess) {
74 if (p_roids) m_regionSelector->lookup(ctx)->HashIDList(*p_roids, rpcHashList);
77 m_regionSelector->lookup(ctx)->HashIDList(fullscan_roi, rpcHashList);
86 m_regionSelector->lookup(ctx)->HashIDList(fullscan_roi, rpcHashList);
90 if (!rpcHashList.empty()) {
93 auto rpcPrepContainerHandle =
SG::makeHandle(m_rpcPrepContainerKey, ctx);
96 if (!rpcPrepContainerHandle.isValid()) {
97 ATH_MSG_ERROR(
"Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
98 return StatusCode::FAILURE;
100 ATH_MSG_DEBUG(
"RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
107 if( RPCcoll ==
nullptr ) {
111 if( RPCcoll->size() == 0) {
116 rpcCols.push_back(RPCcoll);
122 rpcHits.reserve( rpcHits.size() + rpc->size() );
127 const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(
id);
128 const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(
id);
129 const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(
id);
130 const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(
id);
131 const bool measuresPhi = m_idHelperSvc->rpcIdHelper().measuresPhi(
id);
132 const int stationEta = m_idHelperSvc->rpcIdHelper().stationEta(
id);
133 std::string
stationName = m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(
id));
146 const double hitx=globalpos.x();
147 const double hity=globalpos.y();
148 const double hitz=globalpos.z();
150 const double hittime = prd->time();
156 <<
" global positions x/y/z=" << hitx <<
"/" << hity <<
"/" << hitz
157 <<
" doubletR: " <<
doubletR <<
" doubletZ: " << doubletZ <<
" doubletPhi " <<
doubletPhi
158 <<
" gasGap " <<
gasGap <<
" layer " <<
layer <<
" time " << hittime
159 <<
" distToEtaReadout " << distToEtaReadout <<
" distToPhiReadout " << distToPhiReadout);
166 lutDigit.
time = hittime;
177 const float r2 = hitx*hitx+hity*hity;
178 float phi = std::atan2(hity,hitx);
179 const float l = std::sqrt(hitz*hitz+r2);
180 const float tan = std::sqrt( (
l-hitz)/(
l+hitz) );
182 const float deta = std::abs(p_roids->
eta() -
eta);
188 rpcHits.push_back(lutDigit);
190 float deta_thr = 0.1;
191 float dphi_thr = 0.1;
192 float dynamic_add = 0.02;
195 if( dynamicDeltaRpc ){
201 ATH_CHECK( m_recRPCRoiTool->RoIsize(p_roids->
roiWord(), RoiEtaMin, RoiEtaMax, RoiPhiMin, RoiPhiMax) );
202 ATH_MSG_DEBUG(
"RoI Phi min = " << RoiPhiMin <<
" RoI Phi max = " << RoiPhiMax <<
" RoI Eta min = " << RoiEtaMin <<
" RoI Eta max = " << RoiEtaMax );
203 deta_thr = std::abs( RoiEtaMax - RoiEtaMin )/2. + dynamic_add;
204 dphi_thr = std::abs( std::acos(
std::cos( RoiPhiMax - RoiPhiMin ) ) )/2. + dynamic_add;
209 if (m_use_RoIBasedDataAccess) {
210 if ( deta<deta_thr && dphi<dphi_thr)
213 if ( deta<0.15 && dphi<0.1)
219 return StatusCode::SUCCESS;
228 const ToolHandle<ClusterPatFinder>* clusterPatFinder,
229 const bool dynamicDeltaRpc)
const
233 if( m_emulateNoRpcHit )
234 return StatusCode::SUCCESS;
236 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
237 std::vector<IdentifierHash> rpcHashList;
238 std::vector<IdentifierHash> rpcHashList_cache;
240 if (m_use_RoIBasedDataAccess) {
244 if (p_roids) m_regionSelector->lookup(ctx)->HashIDList(*p_roids, rpcHashList);
247 m_regionSelector->lookup(ctx)->HashIDList(fullscan_roi, rpcHashList);
256 m_regionSelector->lookup(ctx)->HashIDList(fullscan_roi, rpcHashList);
261 if (!rpcHashList.empty()) {
265 auto rpcPrepContainerHandle =
SG::makeHandle(m_rpcPrepContainerKey, ctx);
266 rpcPrds = rpcPrepContainerHandle.cptr();
267 if (!rpcPrepContainerHandle.isValid()) {
268 ATH_MSG_ERROR(
"Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
269 return StatusCode::FAILURE;
271 ATH_MSG_DEBUG(
"RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
279 if( RPCcoll ==
nullptr ) {
283 if( RPCcoll->size() == 0) {
288 rpcHashList_cache.push_back(
id);
289 rpcCols.push_back(RPCcoll);
293 ATH_CHECK( m_clusterPreparator->clusteringRPCs(dynamicDeltaRpc, rpcCols, p_roids, clusterPatFinder, rpcLayerClusters) );
295 return StatusCode::SUCCESS;