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 )
return StatusCode::SUCCESS;
66 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
67 std::vector<IdentifierHash> rpcHashList;
69 if (m_use_RoIBasedDataAccess) {
73 if (p_roids) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*p_roids, rpcHashList);
76 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
85 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
89 if (!rpcHashList.empty()) {
92 auto rpcPrepContainerHandle =
SG::makeHandle(m_rpcPrepContainerKey);
95 if (!rpcPrepContainerHandle.isValid()) {
96 ATH_MSG_ERROR(
"Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
97 return StatusCode::FAILURE;
99 ATH_MSG_DEBUG(
"RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
106 if( RPCcoll ==
nullptr ) {
110 if( RPCcoll->size() == 0) {
115 rpcCols.push_back(RPCcoll);
121 rpcHits.reserve( rpcHits.size() + rpc->size() );
126 const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(
id);
127 const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(
id);
128 const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(
id);
129 const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(
id);
130 const bool measuresPhi = m_idHelperSvc->rpcIdHelper().measuresPhi(
id);
131 const int stationEta = m_idHelperSvc->rpcIdHelper().stationEta(
id);
132 std::string
stationName = m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(
id));
145 const double hitx=globalpos.x();
146 const double hity=globalpos.y();
147 const double hitz=globalpos.z();
149 const double hittime = prd->time();
155 <<
" global positions x/y/z=" << hitx <<
"/" << hity <<
"/" << hitz
156 <<
" doubletR: " <<
doubletR <<
" doubletZ: " << doubletZ <<
" doubletPhi " <<
doubletPhi
157 <<
" gasGap " <<
gasGap <<
" layer " <<
layer <<
" time " << hittime
158 <<
" distToEtaReadout " << distToEtaReadout <<
" distToPhiReadout " << distToPhiReadout);
165 lutDigit.
time = hittime;
176 const float r2 = hitx*hitx+hity*hity;
177 float phi = std::atan2(hity,hitx);
178 const float l = std::sqrt(hitz*hitz+r2);
179 const float tan = std::sqrt( (
l-hitz)/(
l+hitz) );
181 const float deta = std::abs(p_roids->
eta() - eta);
187 rpcHits.push_back(lutDigit);
189 float deta_thr = 0.1;
190 float dphi_thr = 0.1;
191 float dynamic_add = 0.02;
194 if( dynamicDeltaRpc ){
200 ATH_CHECK( m_recRPCRoiTool->RoIsize(p_roids->
roiWord(), RoiEtaMin, RoiEtaMax, RoiPhiMin, RoiPhiMax) );
201 ATH_MSG_DEBUG(
"RoI Phi min = " << RoiPhiMin <<
" RoI Phi max = " << RoiPhiMax <<
" RoI Eta min = " << RoiEtaMin <<
" RoI Eta max = " << RoiEtaMax );
202 deta_thr = std::abs( RoiEtaMax - RoiEtaMin )/2. + dynamic_add;
203 dphi_thr = std::abs( std::acos(
std::cos( RoiPhiMax - RoiPhiMin ) ) )/2. + dynamic_add;
208 if (m_use_RoIBasedDataAccess) {
209 if ( deta<deta_thr && dphi<dphi_thr)
212 if ( deta<0.15 && dphi<0.1)
218 return StatusCode::SUCCESS;
226 const ToolHandle<ClusterPatFinder>* clusterPatFinder,
227 const bool dynamicDeltaRpc)
const
231 if( m_emulateNoRpcHit )
232 return StatusCode::SUCCESS;
234 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
235 std::vector<IdentifierHash> rpcHashList;
236 std::vector<IdentifierHash> rpcHashList_cache;
238 if (m_use_RoIBasedDataAccess) {
242 if (p_roids) m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(*p_roids, rpcHashList);
245 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
254 m_regionSelector->lookup( Gaudi::Hive::currentContext() )->HashIDList(fullscan_roi, rpcHashList);
259 if (!rpcHashList.empty()) {
263 auto rpcPrepContainerHandle =
SG::makeHandle(m_rpcPrepContainerKey);
264 rpcPrds = rpcPrepContainerHandle.cptr();
265 if (!rpcPrepContainerHandle.isValid()) {
266 ATH_MSG_ERROR(
"Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
267 return StatusCode::FAILURE;
269 ATH_MSG_DEBUG(
"RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
277 if( RPCcoll ==
nullptr ) {
281 if( RPCcoll->size() == 0) {
286 rpcHashList_cache.push_back(
id);
287 rpcCols.push_back(RPCcoll);
291 ATH_CHECK( m_clusterPreparator->clusteringRPCs(dynamicDeltaRpc, rpcCols, p_roids, clusterPatFinder, rpcLayerClusters) );
293 return StatusCode::SUCCESS;