59 const ToolHandle<RpcPatFinder>* rpcPatFinder,
60 const bool dynamicDeltaRpc)
const
67 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
68 std::vector<IdentifierHash> rpcHashList;
74 if (p_roids)
m_regionSelector->lookup(ctx)->HashIDList(*p_roids, rpcHashList);
90 if (!rpcHashList.empty()) {
96 if (!rpcPrepContainerHandle.isValid()) {
98 return StatusCode::FAILURE;
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);
131 const bool measuresPhi =
m_idHelperSvc->rpcIdHelper().measuresPhi(
id);
132 const int stationEta =
m_idHelperSvc->rpcIdHelper().stationEta(
id);
137 if (stationName.substr(0,2)==
"BO") layer = 4;
139 layer += 2*(doubletR-1);
141 if (stationName.substr(0,3)==
"BML"&&stationEta==7) layer+=2;
146 const double hitx=globalpos.x();
147 const double hity=globalpos.y();
148 const double hitz=globalpos.z();
150 const double hittime = prd->time();
155 ATH_MSG_DEBUG(
"Selected Rpc Collection: station name:" << stationName
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;
175 lutDigit.
layer = layer;
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) );
181 const float eta = -std::log(tan);
183 throw std::runtime_error(
"p_roids is nullptr in prepareData");
185 const float deta = std::abs(p_roids->
eta() -
eta);
191 rpcHits.push_back(std::move(lutDigit));
193 float deta_thr = 0.1;
194 float dphi_thr = 0.1;
195 float dynamic_add = 0.02;
198 if( dynamicDeltaRpc ){
205 ATH_MSG_DEBUG(
"RoI Phi min = " << RoiPhiMin <<
" RoI Phi max = " << RoiPhiMax <<
" RoI Eta min = " << RoiEtaMin <<
" RoI Eta max = " << RoiEtaMax );
206 deta_thr = std::abs( RoiEtaMax - RoiEtaMin )/2. + dynamic_add;
207 dphi_thr = std::abs( std::acos( std::cos( RoiPhiMax - RoiPhiMin ) ) )/2. + dynamic_add;
213 if ( deta<deta_thr && dphi<dphi_thr)
214 (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
216 if ( deta<0.15 && dphi<0.1)
217 (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
222 return StatusCode::SUCCESS;
231 const ToolHandle<ClusterPatFinder>* clusterPatFinder,
232 const bool dynamicDeltaRpc)
const
237 return StatusCode::SUCCESS;
239 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
240 std::vector<IdentifierHash> rpcHashList;
241 std::vector<IdentifierHash> rpcHashList_cache;
247 if (p_roids)
m_regionSelector->lookup(ctx)->HashIDList(*p_roids, rpcHashList);
264 if (!rpcHashList.empty()) {
269 rpcPrds = rpcPrepContainerHandle.cptr();
270 if (!rpcPrepContainerHandle.isValid()) {
272 return StatusCode::FAILURE;
282 if( RPCcoll ==
nullptr ) {
286 if( RPCcoll->size() == 0) {
291 rpcHashList_cache.push_back(
id);
292 rpcCols.push_back(RPCcoll);
298 return StatusCode::SUCCESS;
StatusCode prepareData(const EventContext &ctx, const TrigRoiDescriptor *p_roids, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::RpcLayerHits &rpcLayerHits, const ToolHandle< RpcPatFinder > *rpcPatFinder, const bool dynamicDeltaRpc) const