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);
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 ){
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;
210 if ( deta<deta_thr && dphi<dphi_thr)
211 (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
213 if ( deta<0.15 && dphi<0.1)
214 (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
219 return StatusCode::SUCCESS;
228 const ToolHandle<ClusterPatFinder>* clusterPatFinder,
229 const bool dynamicDeltaRpc)
const
234 return StatusCode::SUCCESS;
236 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
237 std::vector<IdentifierHash> rpcHashList;
238 std::vector<IdentifierHash> rpcHashList_cache;
244 if (p_roids)
m_regionSelector->lookup(ctx)->HashIDList(*p_roids, rpcHashList);
261 if (!rpcHashList.empty()) {
266 rpcPrds = rpcPrepContainerHandle.cptr();
267 if (!rpcPrepContainerHandle.isValid()) {
269 return StatusCode::FAILURE;
279 if( RPCcoll ==
nullptr ) {
283 if( RPCcoll->size() == 0) {
288 rpcHashList_cache.push_back(
id);
289 rpcCols.push_back(RPCcoll);
295 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