61{
62
63 rpcHits.clear();
64
66
67 std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
68 std::vector<IdentifierHash> rpcHashList;
69
71
73
74 if (p_roids)
m_regionSelector->lookup(ctx)->HashIDList(*p_roids, rpcHashList);
75 else {
78 }
80
81 } else {
82
84
88 }
89
90 if (!rpcHashList.empty()) {
91
92
95
96 if (!rpcPrepContainerHandle.isValid()) {
98 return StatusCode::FAILURE;
99 } else {
101 }
102
103
104 for(const IdentifierHash& id : rpcHashList) {
106
107 if( RPCcoll == nullptr ) {
108 continue;
109 }
110
111 if( RPCcoll->size() == 0) {
113 continue;
114 }
115
116 rpcCols.push_back(RPCcoll);
117 }
118 }
119
121
122 rpcHits.reserve( rpcHits.size() + rpc->size() );
123 for( const Muon::RpcPrepData* prd : *rpc ) {
124
125 const Identifier id = prd->identify();
126
129 const int doubletZ =
m_idHelperSvc->rpcIdHelper().doubletZ(
id);
131 const bool measuresPhi =
m_idHelperSvc->rpcIdHelper().measuresPhi(
id);
134
136
138
140
142
144
146 const double hitx=globalpos.x();
147 const double hity=globalpos.y();
148 const double hitz=globalpos.z();
149
150 const double hittime = prd->time();
151 const MuonGM::RpcReadoutElement* detEl = prd->detectorElement();
154
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);
160
161 TrigL2MuonSA::RpcHitData lutDigit;
162
166 lutDigit.
time = hittime;
176
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");
184 }
185 const float deta = std::abs(p_roids->
eta() -
eta);
187
191 rpcHits.push_back(std::move(lutDigit));
192
193 float deta_thr = 0.1;
194 float dphi_thr = 0.1;
195 float dynamic_add = 0.02;
196
197
198 if( dynamicDeltaRpc ){
200 double RoiPhiMin(0);
201 double RoiPhiMax(0);
202 double RoiEtaMin(0);
203 double RoiEtaMax(0);
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;
210 }
211
213 if ( deta<deta_thr && dphi<dphi_thr)
214 (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
215 } else {
216 if ( deta<0.15 && dphi<0.1)
217 (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
218 }
219 }
220 }
221
222 return StatusCode::SUCCESS;
223}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x,...)
Athena::TPCnvVers::Current TrigRoiDescriptor
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
double distanceToEtaReadout(const Amg::Vector3D &P) const
double distanceToPhiReadout(const Amg::Vector3D &P) const
virtual double phi() const override final
Methods to retrieve data members.
virtual double eta() const override final
Gaudi::Property< bool > m_emulateNoRpcHit
bool m_use_RoIBasedDataAccess
virtual unsigned int roiWord() const override final
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
constexpr uint8_t stationEta
1 to 3
MuonPrepDataContainerT< RpcPrepData > RpcPrepDataContainer
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection
l
Printing final latex table to .tex output file.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())