150{
151
152
153 if (v_idHash.empty()) {
155 return StatusCode::SUCCESS;
156 }
159
160 for(const IdentifierHash& id : v_idHash) {
161
162
163 auto mdtCol = mdtPrds->indexFindPtr(id);
164
165 if( mdtCol == nullptr ) {
166 ATH_MSG_DEBUG(
"MDT prep data collection not found in Hash ID" << (
int)
id);
167 continue;
168 }
169 if( mdtCol->size() == 0 ) {
170 ATH_MSG_DEBUG(
"MDT prep data collection is empty in Hash ID" << (
int)
id);
171 continue;
172 }
173
176 << " with size " << mdtCol->size()
177 << "in Hash ID" << (int)id);
178
179 mdtHits.reserve( mdtHits.size() + mdtCol->size() );
180
181 for( const Muon::MdtPrepData* mdt : *mdtCol ) {
182
183 Identifier id = mdt->identify();
184
187 continue;
188 }
189
190 const MuonGM::MdtReadoutElement* mdtReadout = mdt->detectorElement();
192
193 TrigL2MuonSA::MdtHitData
tmp;
195
198 if(
tmp.TubeLayer > TubeLayers)
tmp.TubeLayer -= TubeLayers;
201 int Layer = (
tmp.Multilayer-1)*TubeLayers +
tmp.TubeLayer;
203
204 if(Layer==0 or
tmp.Tube ==0)
continue;
205
206 int drift = mdt->tdc();
207 tmp.DriftTime = drift;
208 tmp.LeadingCoarseTime = (drift>>5) & 0xfff;
209 tmp.LeadingFineTime = drift & 0x1f;
210 tmp.Adc = mdt->adc();
211
215
217 std::copy_n(chamberType.begin(), std::min<size_t>(4, chamberType.size()),
tmp.cType.begin());
218 tmp.readEle = mdtReadout;
219
221 char st = chamberType[1];
222 if (chamberType[0]=='E') {
228 }
229 else {
237 }
238
239 double &cXmid{
tmp.cXmid}, &cYmid{
tmp.cYmid}, &cPhip{
tmp.cPhip};
241 if(!muonStation->
endcap()){
242 cXmid = (trans.translation()).z();
244 }else{
245 cXmid = (trans.translation()).perp();
246 cYmid = (trans.translation()).z();
249 }
250 cPhip = (trans.translation()).phi();
251
253 R = -99999.;
Z = -99999.;
256
257 double dphi = 0;
259 if( cPhip*cphi>0 ) {
260 dphi = std::abs(cPhip - cphi);
261 } else {
262 if(std::abs(cphi) >
M_PI/2.) {
263 double phi1 = (cPhip>0.)? cPhip-
M_PI : cPhip+
M_PI;
264 double phi2 = (cphi >0.)? cphi -
M_PI : cphi +
M_PI;
265 dphi = std::abs(phi1) + std::abs(phi2);
266 }
267 else {
268 dphi = std::abs(cPhip) + std::abs(cphi);
269 }
270 }
271
272 if(muonStation->
endcap()==1)
R =
R *std::hypot(1, std::tan(dphi));
273
276 tmp.cInCo = 1./std::cos(std::atan(OrtoRadialPos/Rmin));
277 tmp.cPhi0 = cPhip - std::atan(OrtoRadialPos/Rmin);
278 if(cPhip<0. && (std::abs(
M_PI+cPhip) < 0.05) ) cPhip =
M_PI;
279
280 ATH_MSG_DEBUG(
" ...MDT hit Z/R/chamber/MultiLater/TubeLayer/Tube/Layer/adc/tdc = "
281 << Z <<
"/" << R <<
"/" << chamber <<
"/" <<
tmp.Multilayer <<
"/" <<
tmp.TubeLayer <<
"/"
282 <<
tmp.Tube <<
"/" << Layer <<
"/" <<
tmp.Adc <<
"/" << drift);
283
284 mdtHits.push_back(std::move(tmp));
285
286 }
287 }
288
289 return StatusCode::SUCCESS;
290}
Scalar perp() const
perp method - perpendicular length
#define ATH_CHECK
Evaluate an expression and check for errors.
int getNLayers() const
Returns the number of tube layers inside the multilayer.
int getMultilayer() const
Returns the multilayer represented by the readout element.
virtual const Amg::Vector3D & center(const Identifier &) const override final
Return the center of the surface associated with this identifier In the case of silicon it returns th...
int getStationPhi() const
double getStationS() const
Seems to be exclusively used by the MDTs --> Move it to MdtReadoutElement.
int getStationEta() const
const MuonStation * parentMuonStation() const
std::string getStationType() const
const Amg::Transform3D & getNominalAmdbLRSToGlobal() const
const Amg::Vector3D & getBlineFixedPointInAmdbLRS() const
double RsizeMdtStation() const
bool isPresent() const
Is the referenced object present in SG?
std::unordered_set< Identifier > m_DeadChannels
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtPrepContainerKey
double phi[N_STATION][N_SECTOR]
Eigen::Affine3d Transform3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
@ BarrelInner
Inner station in the barrel spectrometer.
@ EndcapOuter
Outer station in the endcap spectrometer.
@ BarrelMiddle
Middle station in the barrel spectrometer.
@ EndcapMiddle
Middle station in the endcap spectrometer.
@ BEE
BEE measurement point.
@ EndcapExtra
Extra station in the endcap spectrometer.
@ BarrelOuter
Outer station in the barrel spectrometer.
@ BME
BME measurement point.
@ EndcapInner
Inner station in the endcap spectrometer.