ATLAS Offline Software
Loading...
Searching...
No Matches
SpacePointCalibrator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
9
18
21
23
26
27#include "Acts/Utilities/MathHelpers.hpp"
28#include "Acts/Utilities/Enumerate.hpp"
29
30
31namespace {
32 constexpr double c_inv = 1./ Gaudi::Units::c_light;
33 static const SG::Decorator<int> dec_trackSign{"segmentFitDriftSign"};
34
36 inline Acts::BoundTrackParameters makeBoundPars(const ActsTrk::MutableTrackContainer::TrackStateProxy& state) {
37 return Acts::BoundTrackParameters{state.referenceSurface().getSharedPtr(),
38 state.parameters(), state.covariance(),
39 Acts::ParticleHypothesis::muon()};
40
41 }
42}
43
44namespace MuonR4{
45 using namespace Acts::UnitLiterals;
49 using namespace SegmentFit;
50
52 ATH_CHECK(m_geoCtxKey.initialize());
53 ATH_CHECK(m_idHelperSvc.retrieve());
54 ATH_CHECK(m_mdtCalibrationTool.retrieve(EnableTool{m_idHelperSvc->hasMDT()}));
55 ATH_CHECK(m_nswCalibTool.retrieve(EnableTool{m_idHelperSvc->hasMM() || m_idHelperSvc->hasSTGC()}));
56 ATH_CHECK(detStore()->retrieve(m_detMgr));
57 return StatusCode::SUCCESS;
58 }
59
61 const Amg::Vector3D& trackDir,
62 CalibSpacePointVec& hitsToCalib) const {
63 std::vector<int> signs = SeedingAux::strawSigns(trackPos, trackDir,
64 hitsToCalib);
65 for (const auto [spIdx, sp]: Acts::enumerate(hitsToCalib)) {
66 sp->setDriftRadius(sp->driftRadius() * signs[spIdx]);
67 }
68 }
70 const CalibratedSpacePoint& spacePoint,
71 const Amg::Vector3D& segPos,
72 const Amg::Vector3D& segDir,
73 const double timeDelay) const {
74 CalibSpacePointPtr calibSP{};
75 if (spacePoint.type() != xAOD::UncalibMeasType::Other){
76 calibSP = calibrate(ctx, spacePoint.spacePoint(), segPos, segDir, timeDelay);
77 } else {
78 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint);
79 }
80 if (spacePoint.fitState() == State::Outlier) {
81 calibSP->setFitState(State::Outlier);
82 } else if (spacePoint.fitState() == State::Duplicate) {
83 calibSP->setFitState(State::Duplicate);
84 }
85 return calibSP;
86 }
87
88 CalibSpacePointVec SpacePointCalibrator::calibrate(const Acts::CalibrationContext& cctx,
89 const Amg::Vector3D& segPos,
90 const Amg::Vector3D& segDir,
91 const double timeDelay,
92 const CalibSpacePointVec& spacePoints) const {
93 CalibSpacePointVec newCalib{};
94 const EventContext* ctx = cctx.get<const EventContext*>();
95 newCalib.reserve(spacePoints.size());
96 for (const CalibSpacePointPtr& sp : spacePoints){
97 newCalib.emplace_back(calibrate(*ctx, *sp, segPos, segDir, timeDelay));
98 }
99 return newCalib;
100 }
101
103 const SpacePoint* spacePoint,
104 const Amg::Vector3D& posInChamb,
105 const Amg::Vector3D& dirInChamb,
106 const double timeDelay) const {
107 const ActsTrk::GeometryContext* gctx{nullptr};
108 if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
109 return CalibSpacePointPtr{};
110 }
111 const Amg::Vector3D& spPos{spacePoint->localPosition()};
112 const Amg::Transform3D& locToGlob{spacePoint->msSector()->localToGlobalTransform(*gctx)};
113 const Amg::Vector3D& chDir{spacePoint->sensorDirection()};
114
115 // Adjust the space point position according to the external seed. But only if the space point
116 // is a 1D strip
117 Amg::Vector3D calibSpPos = spacePoint->dimension() == 2 ? spPos
118 : spPos + Amg::intersect<3>(posInChamb, dirInChamb, spPos, chDir).value_or(0) * chDir;
119
120 SpacePoint::Cov_t cov = spacePoint->covariance();
121 CalibSpacePointPtr calibSP{};
122 ATH_MSG_VERBOSE("Calibrate "<<(*spacePoint) <<" -> updated pos "<<Amg::toString(calibSpPos));
123 switch (spacePoint->type()) {
124 using enum xAOD::UncalibMeasType;
125 case MdtDriftCircleType: {
126 const Amg::Vector3D locClosestApproach = posInChamb
127 + Amg::intersect<3>(spPos, chDir,
128 posInChamb, dirInChamb).value_or(0) * dirInChamb;
129
130 Amg::Vector3D closestApproach{locToGlob* locClosestApproach};
131 const double timeOfArrival = closestApproach.mag() * c_inv + ActsTrk::timeToAthena(timeDelay);
132
133 if (spacePoint->dimension() == 1) [[likely]] {
134 auto* dc = static_cast<const xAOD::MdtDriftCircle*>(spacePoint->primaryMeasurement());
135 MdtCalibInput calibInput{*dc, *gctx};
136 calibInput.setTrackDirection(locToGlob.linear() * dirInChamb,
137 std::abs(dirInChamb.phi() - 90._degree) > 1.e-7 );
138 calibInput.setTimeOfFlight(timeOfArrival);
139 calibInput.setClosestApproach(std::move(closestApproach));
140 ATH_MSG_VERBOSE("Parse hit calibration "<<m_idHelperSvc->toString(dc->identify())<<", "<<calibInput);
141 MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(ctx, calibInput);
142 ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
143 State fitState{State::Valid};
145 if (calibOutput.status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
146 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
147 <<std::endl<<calibInput<<std::endl<<calibOutput);
148 fitState = State::FailedCalib;
149 cov[Acts::toUnderlying(AxisDefs::etaCov)] = dc->readoutElement()->innerTubeRadius();
150 } else {
151 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.driftRadiusUncert());
152 }
153 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
154 calibSP->setCovariance(cov);
155 calibSP->setDriftRadius(calibOutput.driftRadius());
157 double fastToF {(locToGlob * calibSP->localPosition()).norm() * c_inv};
158 calibSP->setTimeMeasurement(ActsTrk::timeToActs(dc->tdc() * IMdtCalibrationTool::tdcBinSize -
159 calibOutput.tubeT0() - fastToF - calibOutput.signalPropagationTime()));
160 ATH_MSG_VERBOSE("Mdt time Meas: " << ActsTrk::timeToAthena(calibSP->time())
161 << ", ToF / fastToF: " << fastToF << " / " << closestApproach.mag() * c_inv
162 << ", tubeT0: " << calibOutput.tubeT0() << ", Signal Prop Time: " << calibOutput.signalPropagationTime());
163 } else {
164 auto* dc = static_cast<const xAOD::MdtTwinDriftCircle*>(spacePoint->primaryMeasurement());
165 MdtCalibInput calibInput{*dc, *gctx};
166 calibInput.setClosestApproach(closestApproach);
167 calibInput.setTimeOfFlight(timeOfArrival);
168
169 MdtCalibInput twinInput{dc->twinIdentify(), dc->twinAdc(), dc->twinTdc(), dc->readoutElement(), *gctx};
170 twinInput.setClosestApproach(closestApproach);
171 twinInput.setTimeOfFlight(timeOfArrival);
172
173 MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(ctx,
174 std::move(calibInput),
175 std::move(twinInput));
176
177 State fitState{State::Valid};
178 if (calibOutput.primaryStatus() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
179 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
180 <<std::endl<<calibOutput);
181 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(dc->readoutElement()->innerTubeRadius());
182 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()));
183 fitState = State::FailedCalib;
184 } else {
185 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.uncertPrimaryR());
186 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(calibOutput.sigmaZ());
187 }
188 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
189 calibSP->setCovariance(cov);
190 calibSP->setDriftRadius(calibOutput.primaryDriftR());
192 double fastToF {(locToGlob * calibSP->localPosition()).norm() * c_inv};
193 double tubeT0 {m_mdtCalibrationTool->getCalibConstants(ctx, dc->identify())->tubeCalib->getCalib(dc->identify())->t0};
194 // Remember to add the signal propagation time!!
195 calibSP->setTimeMeasurement(ActsTrk::timeToActs(calibOutput.primaryTdc() * IMdtCalibrationTool::tdcBinSize - tubeT0 - fastToF));
196 }
197 break;
198 }
199 case RpcStripType: {
200 auto* strip = static_cast<const xAOD::RpcMeasurement*>(spacePoint->primaryMeasurement());
201
203 const Amg::Transform3D toGasGap{strip->readoutElement()->globalToLocalTransform(*gctx, strip->layerHash()) * locToGlob};
204 const Amg::Vector3D lPos = toGasGap * calibSpPos;
206 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
207
208 // @TODO the constants could be converted to what is needed here (units, inverse) at initialization/construction time
209 // in particular 1/m_rpcSignalVelocity
210 cov[Acts::toUnderlying(AxisDefs::timeCov)] = Acts::square(ActsTrk::timeToActs(m_rpcTimeResolution.value()));
211
212 const double time1 = strip->time()
213 - strip->readoutElement()->distanceToEdge(strip->layerHash(), lPos,
214 EdgeSide::readOut) /m_rpcSignalVelocity;
215
216 if (spacePoint->dimension() == 2) {
217 auto* strip2 = static_cast<const xAOD::RpcMeasurement*>(spacePoint->secondaryMeasurement());
218
219 const double time2 = strip2->time() -
220 strip2->readoutElement()->distanceToEdge(strip2->layerHash(),lPos, EdgeSide::readOut)/m_rpcSignalVelocity;
222 calibSP->setTimeMeasurement(ActsTrk::timeToActs(0.5*(time1 + time2)));
224 cov[Acts::toUnderlying(AxisDefs::timeCov)] += Acts::square(ActsTrk::timeToActs(0.5*(time1 - time2)));
225 } else {
226 calibSP->setTimeMeasurement(ActsTrk::timeToActs(time1));
227 }
228 calibSP->setCovariance(cov);
229 ATH_MSG_VERBOSE("Create rpc space point "<<m_idHelperSvc->toString(strip->identify())<<", dimension "<<spacePoint->dimension()
230 << ", at "<<Amg::toString(calibSP->localPosition())<<", uncalib time: "
231 <<strip->time()<<", calib time: "<<ActsTrk::timeToAthena(calibSP->time())<<" cov " <<calibSP->covariance()
232 <<", time Uncert: "<<ActsTrk::timeToAthena(std::sqrt(calibSP->covariance()[Acts::toUnderlying(AxisDefs::timeCov)])));
233 break;
234 }
235 case TgcStripType: {
236 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
238 if (spacePoint->primaryMeasurement()->measuresPhi()) {
239 const auto* strip = static_cast<const xAOD::TgcStrip*>(spacePoint->primaryMeasurement());
240 const Amg::Transform3D toGasGap{strip->readoutElement()->globalToLocalTransform(*gctx, strip->layerHash()) * locToGlob};
241 const Amg::Vector3D lPos = toGasGap * calibSP->localPosition();
242 const auto& sensorPlane = strip->readoutElement()->sensorLayout(strip->layerHash());
243 const auto& radialDesign = strip->readoutElement()->stripLayout(strip->layerHash());
244 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(
245 radialDesign.stripPitch(strip->channelNumber(), sensorPlane->to2D(lPos,true))) / 12.;
246 }
247 calibSP->setCovariance(cov);
248 break;
249 }
250 case MMClusterType: {
251 const xAOD::MMCluster* cluster = static_cast<const xAOD::MMCluster*>(spacePoint->primaryMeasurement());
252 Amg::Vector3D globalPos{locToGlob * posInChamb};
253 Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
254
255 std::pair<double, double> calibPosCov {calibrateMM(ctx, *gctx, *cluster, globalPos, globalDir)};
256
257 ATH_MSG_DEBUG("Calibrated pos and cov" << calibPosCov.first << " " << calibPosCov.second);
258 cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibPosCov.second;
259 Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTransform(*gctx, cluster->layerHash())};
260
261 // since we want to take the second coordiante from the external estimate we need to transform the sp posiiton to the layer frame, replace the precission coordinate and transform back
262 Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
263 ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
264 calibSpPosInLayer.x() = calibPosCov.first;
265 ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
266 calibSpPos = toChamberTrans * calibSpPosInLayer;
267
268 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
269 calibSP->setCovariance(cov);
270 ATH_MSG_DEBUG("calibrated MM cluster "<<m_idHelperSvc->toString(cluster->identify()) << " loc x old " << cluster->localPosition<1>()[0] << " new loc x " << calibSP->localPosition()[1] << "cov " << calibSP->covariance());
271
272 break;
273 }
274 case sTgcStripType: {
275 const auto* cluster = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->primaryMeasurement());
276
277 // We do not apply any correction for pads or wire only space points
278 if (cluster->channelType() != sTgcIdHelper::sTgcChannelTypes::Strip) {
279 ATH_MSG_DEBUG("Calibrating an sTGC Pad or wire " << m_idHelperSvc->toString(cluster->identify()));
280 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
281 calibSP->setCovariance(cov);
282 break;
283 }
284
285 std::optional<double> posAlongTheStrip{std::nullopt};
286
287 // check if the space point is a strip/wire combination and take the position along the strip from the wire measurement
288 if(spacePoint->secondaryMeasurement()) {
289 const auto* secMeas = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->secondaryMeasurement());
290 ATH_MSG_VERBOSE("Using secondary measurement "<< m_idHelperSvc->toString(secMeas->identify())<<" for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
291 // Extract scalar value - use 2D for pads (2 dimensions), 1D for wires (1 dimension)
292 if (secMeas->numDimensions() == 2) {
293 posAlongTheStrip = static_cast<double>(secMeas->localPosition<2>()[0]);
294 } else {
295 posAlongTheStrip = static_cast<double>(secMeas->localPosition<1>()[0]);
296 }
297 } else {
298 ATH_MSG_VERBOSE("No secondary measurement for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
299 }
300
301 Amg::Vector3D globalPos{locToGlob * posInChamb};
302 Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
303
304 const auto* stripClus = static_cast<const xAOD::sTgcStripCluster*>(cluster);
305 const auto [calibPos, calibCov] = calibratesTGC(ctx, *gctx, *stripClus, posAlongTheStrip, globalPos, globalDir);
306
307 ATH_MSG_DEBUG("Calibrated pos and cov" << calibPos << " " << calibCov);
308 cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibCov;
309 Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTransform(*gctx, cluster->layerHash())};
310
311 if (spacePoint->dimension() == 2) {
312 cov[Acts::toUnderlying(AxisDefs::phiCov)] *=
313 Acts::square(m_sTgcNonPrecCoordErrorScale.value());
314 }
315
316 // since we want to take the second coordiante from the external estimate we need to transform the sp posiiton to the layer frame, replace the precission coordinate and transform back
317 Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
318 ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
319 calibSpPosInLayer.x() = calibPos;
320 ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
321 calibSpPos = toChamberTrans * calibSpPosInLayer;
322
323 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
324 calibSP->setCovariance(cov);
325 ATH_MSG_DEBUG("calibrated sTGC cluster "<<m_idHelperSvc->toString(cluster->identify()) << " loc x old " << cluster->localPosition<1>()[0] << " new loc x " << calibSP->localPosition()[1] << "cov " << calibSP->covariance());
326 break;
327 }
328
329 default:
330 ATH_MSG_WARNING("Do not know how to calibrate "<<m_idHelperSvc->toString(spacePoint->identify()));
331 }
332 return calibSP;
333 }
334
336 const std::vector<const SpacePoint*>& spacePoints,
337 const Amg::Vector3D& posInChamb,
338 const Amg::Vector3D& dirInChamb,
339 const double timeDelay) const {
340 CalibSpacePointVec calibSpacePoints{};
341 calibSpacePoints.reserve(spacePoints.size());
342 for(const SpacePoint* spacePoint : spacePoints) {
343 CalibSpacePointPtr hit = calibrate(ctx, spacePoint, posInChamb, dirInChamb, timeDelay);
344 if (hit) {
345 calibSpacePoints.push_back(std::move(hit));
346 }
347 }
348 return calibSpacePoints;
349 }
350 double SpacePointCalibrator::driftVelocity(const Acts::CalibrationContext& ctx,
351 const CalibratedSpacePoint& spacePoint) const {
353
354 const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(*ctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
355 const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
356 return ActsTrk::velocityToActs(calibConsts->rtRelation->rt()->driftVelocity(driftTime.value_or(0.)));
357 }
358 return 0.;
359 }
360 double SpacePointCalibrator::driftAcceleration(const Acts::CalibrationContext& ctx,
361 const CalibratedSpacePoint& spacePoint) const {
363 const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(*ctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
364 const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
365 return ActsTrk::accelerationToActs(calibConsts->rtRelation->rt()->driftAcceleration(driftTime.value_or(0.)));
366 }
367 return 0.;
368 }
369
370 std::pair<double, double> SpacePointCalibrator::calibrateMM(const EventContext& ctx,
371 const ActsTrk::GeometryContext& gctx,
372 const xAOD::MMCluster& cluster,
373 const Amg::Vector3D& globalPos,
374 const Amg::Vector3D& globalDir) const {
375 std::vector<NSWCalib::CalibratedStrip> calibClus;
376 StatusCode sc = m_nswCalibTool->calibrateClus(ctx, gctx, cluster, globalPos, calibClus);
377 if(sc.isFailure()) {
378 ATH_MSG_WARNING("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
379 return std::make_pair(0., 0.);
380 }
381
382 Amg::Vector2D locPos{cluster.localPosition<1>()[0] * Amg::Vector2D::UnitX()};
383 Amg::Vector3D locDir = Muon::NswClustering::toLocal(cluster.readoutElement()->globalToLocalTransform(gctx, cluster.layerHash()), globalDir);
384
385 Amg::MatrixX calibCov{};
386 calibCov.resize(1,1);
387 calibCov(0,0) = cluster.localCovariance<1>()(0, 0);
388 ATH_MSG_DEBUG("old loc pos " << locPos[0] << " old cov" << calibCov(0,0) );
389
390 Muon::IMMClusterBuilderTool::RIO_Author rotAuthor = m_clusterBuilderToolMM->getCalibratedClusterPosition(ctx, calibClus, locDir ,locPos, calibCov);
391 if(rotAuthor == Muon::IMMClusterBuilderTool::RIO_Author::unKnownAuthor){
392 THROW_EXCEPTION("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
393 }
394 ATH_MSG_DEBUG("new loc pos " << locPos[0] << " new cov" << calibCov(0,0) );
395 return std::make_pair(locPos[0], Acts::square(m_mmStripErrorScale.value()) * calibCov(0,0));
396 }
397
398 std::pair<double, double> SpacePointCalibrator::calibratesTGC(const EventContext& /*ctx*/,
399 const ActsTrk::GeometryContext& gctx,
400 const xAOD::sTgcStripCluster& cluster,
401 std::optional<double> posAlongTheStrip,
402 const Amg::Vector3D& globalPos,
403 const Amg::Vector3D& /*globalDir*/) const{
404
405 // if the second coordiante was not provided by the wire, take it from the seed track position
406 if(!posAlongTheStrip) {
407 Amg::Vector3D extPosLocal = cluster.readoutElement()->globalToLocalTransform(gctx, cluster.layerHash()) * globalPos;
408 posAlongTheStrip = extPosLocal[1];
409 }
410
411 // For now just copying over the local position and covariance. Eventually this should apply corrections from B-Lines and as build geometry
412 return std::make_pair( cluster.localPosition<1>()[0], Acts::square(m_sTgcPrecCoordErrorScale.value()) * cluster.localCovariance<1>()(0,0));
413 }
414 void SpacePointCalibrator::calibrateCombinedPrd(const EventContext& ctx,
415 const ActsTrk::GeometryContext& gctx,
416 const xAOD::CombinedMuonStrip* combinedPrd,
417 ActsTrk::MutableTrackContainer::TrackStateProxy state) const {
418 const auto sl = ActsTrk::detail::xAODUncalibMeasCalibrator::pack(combinedPrd);
419
420 Amg::Vector2D cmbPos = xAOD::toEigen(combinedPrd->localPosition<2>());
421 AmgSymMatrix(2) cmbCov = xAOD::toEigen(combinedPrd->localCovariance<2>());
422 if (combinedPrd->type() == xAOD::UncalibMeasType::RpcStripType) {
423 if (m_useRpcTime) {
424 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
425 }
426 setState<2>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
427
428 } else if (combinedPrd->type() == xAOD::UncalibMeasType::TgcStripType) {
429 if (m_useTgcTime) {
430 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
431 }
432
433 setState<2>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
434
435 } else if(combinedPrd->type() == xAOD::UncalibMeasType::sTgcStripType) {
436 if (m_usesTgcTime) {
437 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
438 }
439 // combined sTGC Space points can be strip/wire, strip/pad or pad/wire combinations.
440 const auto* primMeas = static_cast<const xAOD::sTgcMeasurement*>(combinedPrd->primaryStrip());
441
442 if(primMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Strip) {
443 const auto* primStripMeas = static_cast<const xAOD::sTgcStripCluster*>(primMeas);
445 const Acts::BoundTrackParameters trackPars{makeBoundPars(state)};
446 std::pair<double, double> calibPosCov{calibratesTGC(ctx, gctx, *primStripMeas, cmbPos[1] ,
447 trackPars.position(gctx.context()),
448 trackPars.direction())};
449 cmbPos[0] = calibPosCov.first;
450 cmbCov(0,0) = calibPosCov.second;
451
452 // Loosen non-precision / second coordinate
453 cmbCov(1,1) *= Acts::square(m_sTgcNonPrecCoordErrorScale.value());
454 }
455 setState<2>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
456
457 } else {
458 THROW_EXCEPTION("Undefined uncalibrated measurement "
459 <<m_idHelperSvc->toString(combinedPrd->identify()));
460 }
461 }
462 void SpacePointCalibrator::calibrateSourceLink(const Acts::GeometryContext& geoctx,
463 const Acts::CalibrationContext& cctx,
464 const Acts::SourceLink& link,
465 ActsTrk::MutableTrackContainer::TrackStateProxy trackState) const {
466
468 const Acts::BoundTrackParameters trackPars{makeBoundPars(trackState)};
469
470
471 const auto* muonMeas = ActsTrk::detail::xAODUncalibMeasCalibrator::unpack(link);
472 const ActsTrk::GeometryContext* gctx = geoctx.get<const ActsTrk::GeometryContext*>();
473 const EventContext* ctx = cctx.get<const EventContext*>();
474 ATH_MSG_VERBOSE("Calibrate measurement "<<m_idHelperSvc->toString(xAOD::identify(muonMeas))
475 <<", smoothened: "<<trackState.hasSmoothed()<<", filtered: "<<trackState.hasFiltered()
476 <<", predicted: "<<trackState.hasPredicted()
477 <<" @\n"<<trackPars);
479 if (muonMeas->numDimensions() == 0u) {
480 calibrateCombinedPrd(*ctx, *gctx, static_cast<const xAOD::CombinedMuonStrip*>(muonMeas),
481 trackState);
482 return;
483
484 }
485 const Amg::Vector3D trackPos{trackPars.position(geoctx)};
486 const Amg::Vector3D trackDir{trackPars.direction()};
487
488 switch (muonMeas->type()){
489 using enum xAOD::UncalibMeasType;
490 case MdtDriftCircleType: {
491 const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(muonMeas);
492 MdtCalibInput calibInput{*dc, *gctx};
493 calibInput.setClosestApproach(trackPos);
494 //calibInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
495 calibInput.setTrackDirection(trackDir, true);
496 const double driftSign = m_MdtSignFromSegment ?
497 static_cast<double>(dec_trackSign(*dc)) :
498 Acts::copySign(1.,trackPars.parameters()[Acts::eBoundLoc0]);
499
501 if (muonMeas->numDimensions() == 1) [[likely]] {
502 MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(*ctx, calibInput);
503 ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
504 AmgVector(1) pos{AmgVector(1)::Zero()};
505 AmgSymMatrix(1) cov{AmgSymMatrix(1)::Identity()};
507 if (calibOutput.status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
508 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
509 <<std::endl<<calibInput<<std::endl<<calibOutput);
510 cov(Acts::eBoundLoc0,Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
511 } else {
512 pos[Acts::eBoundLoc0] = driftSign*calibOutput.driftRadius();
513 cov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.driftRadiusUncert(), 2);
514 }
515 setState<1>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
516 }
518 else {
519 const auto* twinDC = static_cast<const xAOD::MdtTwinDriftCircle*>(muonMeas);
520 MdtCalibInput twinInput{twinDC->twinIdentify(), twinDC->twinAdc(), twinDC->twinTdc(), twinDC->readoutElement(), *gctx};
521 twinInput.setClosestApproach(trackPos);
522 twinInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
523
524 MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(*ctx,
525 std::move(calibInput),
526 std::move(twinInput));
527 Amg::Vector2D locPos{Amg::Vector2D::Zero()};
528 AmgSymMatrix(2) locCov{AmgSymMatrix(2)::Identity()};
529 if (calibOutput.primaryStatus() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
530 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
531 <<std::endl<<calibOutput);
532 locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
533 locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()), 2);
534 } else {
535 locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.uncertPrimaryR(), 2);
536 locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(calibOutput.sigmaZ(), 2);
537 locPos[Acts::eBoundLoc0] = driftSign*calibOutput.primaryDriftR();
538 locPos[Acts::eBoundLoc1] = calibOutput.locZ();
539 }
540 setState<2>(ProjectorType::e2DimNoTime, locPos, locCov, link, trackState);
541 }
542 break;
543 } case RpcStripType: {
544 const auto* rpcClust = static_cast<const xAOD::RpcMeasurement*>(muonMeas);
546 if (rpcClust->numDimensions() == 1) [[likely]] {
547
548 if (!m_useRpcTime) {
549 const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotNoTime
551 setState<1>(proj, rpcClust->localPosition<1>(),
552 rpcClust->localCovariance<1>(), link, trackState);
553 } else {
554 AmgVector(2) measPars{AmgVector(2)::Zero()};
555 AmgSymMatrix(2) measCov{AmgSymMatrix(2)::Identity()};
556 measPars[0] = rpcClust->localPosition<1>()[0];
557 measCov(0,0) = rpcClust->localCovariance<1>()(0, 0);
558 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
559 measCov(1,1) = std::pow(m_rpcTimeResolution, 2);
560 const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotWithTime
562 setState<2>(proj, measPars, measCov, link, trackState);
563 }
564 }
566 else {
567 if (!m_useRpcTime) {
569 rpcClust->localPosition<2>(),
570 rpcClust->localCovariance<2>(), link, trackState);
571 } else {
572 AmgVector(3) measPars{AmgVector(3)::Zero()};
573 AmgSymMatrix(3) measCov{AmgSymMatrix(3)::Identity()};
574 measPars.block<2,1>(0,0) = xAOD::toEigen(rpcClust->localPosition<2>());
575 measCov.block<2,2>(0,0) = xAOD::toEigen(rpcClust->localCovariance<2>());
576 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
577 measCov(2,2) = std::pow(m_rpcTimeResolution, 2);
578 setState<3>(ProjectorType::e2DimWithTime, measPars, measCov, link, trackState);
579 }
580 }
581 break;
582 } case TgcStripType: {
583 const auto* tgcClust = static_cast<const xAOD::TgcStrip*>(muonMeas);
584 if (!m_useTgcTime) {
585 if (!tgcClust->measuresPhi()) {
587 tgcClust->localPosition<1>(),
588 tgcClust->localCovariance<1>(),
589 link, trackState);
590
591 } else {
592 const auto [pos, cov] = xAOD::positionAndCovariance(tgcClust);
593 setState<2>(ProjectorType::e1DimRotNoTime, pos, cov, link, trackState);
594
595 }
596 } else {
597 ATH_MSG_WARNING("Tgc time calibration to be implemented...");
598 }
599 break;
600 }
601 case MMClusterType: {
602 const auto* mmClust = static_cast<const xAOD::MMCluster*>(muonMeas);
603 std::pair<double, double> calibPosCov{calibrateMM(*ctx,* gctx, *mmClust, trackPos, trackDir)};
604 AmgVector(1) pos{AmgVector(1)(calibPosCov.first)};
605 AmgSymMatrix(1) cov{AmgSymMatrix(1)(calibPosCov.second)};
606
607 setState<1>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
608 break;
609 } case sTgcStripType: {
610 const auto* stgcClust = static_cast<const xAOD::sTgcMeasurement*>(muonMeas);
611
612 if(stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire) {
614 muonMeas->localPosition<1>(),
615 muonMeas->localCovariance<1>(), link, trackState);
616 } else if (stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad) {
618 stgcClust->localPosition<2>(),
619 stgcClust->localCovariance<2>(), link, trackState);
620 } else { // strips
621 const auto stgCluster = static_cast<const xAOD::sTgcStripCluster*>(muonMeas);
622 std::pair<double, double> calibPosCov{calibratesTGC(*ctx, *gctx, *stgCluster, std::nullopt, trackPos, trackDir)};
623 if(!m_usesTgcTime) {
624 AmgVector(1) pos{calibPosCov.first};
625 AmgSymMatrix(1) cov{calibPosCov.second};
626 setState<1>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
627 } else {
628 ATH_MSG_WARNING("sTGC time calibration to be implemented...");
629 AmgVector(2) pos{AmgVector(2)::Zero()};
630 AmgSymMatrix(2) cov{AmgSymMatrix(2)::Zero()};
631 pos[0] = calibPosCov.first;
632 pos[1] = stgCluster->time();
633 cov(0,0) = calibPosCov.second;
634 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
635 cov(1,1) = std::pow(25 /*ns*/, 2);
636
637 setState<2>(ProjectorType::e1DimWithTime, pos, cov, link, trackState);
638 }
639 }
640 break;
641 } case Other: {
643 auxCalibrator.calibrate(geoctx, cctx, link, trackState);
644 break;
645 } default: {
646 THROW_EXCEPTION("The parsed measurement is not a muon measurement. Please check.");
647 }
648 }
649 }
651 const auto [segPos, segLine] = makeLine(localSegmentPars(segment));
652 const Segment* detSeg = MuonR4::detailedSegment(segment);
653 for (const auto& meas : detSeg->measurements()) {
655 dec_trackSign(*meas->spacePoint()->primaryMeasurement()) =
656 SeedingAux::strawSign(segPos, segLine, *meas);
657 }
658 }
659 }
660
661 double SpacePointCalibrator::driftRadius(const Acts::CalibrationContext& cctx,
662 const CalibratedSpacePoint& spacePoint,
663 const double timeDelay) const {
665 const MuonCalib::MdtFullCalibData* calibConsts =
666 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
667 return calibConsts->rtRelation->rt()->radius(ActsTrk::timeToAthena(spacePoint.time() - timeDelay));
668 }
669 return 0.;
670 }
671
672 double SpacePointCalibrator::driftVelocity(const Acts::CalibrationContext& cctx,
673 const CalibratedSpacePoint& spacePoint,
674 const double timeDelay) const {
676 const MuonCalib::MdtFullCalibData* calibConsts =
677 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
678 return ActsTrk::velocityToActs(calibConsts->rtRelation->rt()->driftVelocity(ActsTrk::timeToAthena(spacePoint.time() - timeDelay)));
679 }
680 return 0.;
681 }
682 double SpacePointCalibrator::driftAcceleration(const Acts::CalibrationContext& cctx,
683 const CalibratedSpacePoint& spacePoint,
684 const double timeDelay) const {
686 const MuonCalib::MdtFullCalibData* calibConsts =
687 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
688 return ActsTrk::accelerationToActs(calibConsts->rtRelation->rt()->driftAcceleration(ActsTrk::timeToAthena(spacePoint.time() - timeDelay)));
689 }
690 return 0.;
691 }
692
693}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define AmgSymMatrix(dim)
#define AmgVector(rows)
bool hit(const Container &ids, int pdgId)
static Double_t sp
static Double_t sc
Acts::GeometryContext context() const
static Acts::SourceLink pack(const Ptr_t &measurement)
Pack the measurement type pointer to an Acts::SourceLink including the intermediate conversion into a...
@ e2DimWithTime
Project out the locY & time coordinate - (Applies to Rpc, Tgc, sTgc).
@ e2DimNoTime
Project out solely the locY - Complementary projector if the strip plane is rotated (Applies to Itk e...
@ e1DimWithTime
Project out the two spatial coordinates - (Applies to ITk pixel, BI-Rpc, sTgc pad).
@ e1DimRotNoTime
Project out solely the locX (Applies to Itk strips, Rpc, Tgc, sTgc, Mm).
@ e1DimRotWithTime
Project out the locX & time coordinate - (Applies to Rpc, Tgc, Mm, sTgc).
void setState(const ProjectorType projector, const pos_t &locpos, const cov_t &cov, Acts::SourceLink link, proxy_t &trackState) const
Copy the local position & covariance into the Acts track state proxy.
Source link calibrator implementation for xAOD::Uncalibrated measurements.
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, const MutableTrackStateBackend::TrackStateProxy trackState) const
: Interface method for the Acts fitter to calibrate the trajectory track states from the source link ...
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
static constexpr double tdcBinSize
Conversion to go from tdc counts -> drift Time.
void setClosestApproach(const Amg::Vector3D &approach)
Sets the closest approach.
void setTimeOfFlight(const double toF)
Sets the time of flight (Usually globPos.mag() * inverseSpeed of light).
void setTrackDirection(const Amg::Vector3D &trackDir, bool hasPhi)
Sets the direction of the externally determined track.
double driftRadiusUncert() const
Returns the uncertainty on the drift radius.
double driftRadius() const
Returns the drift radius of the calibrated object.
MdtDriftCircleStatus status() const
Status of the calibration.
double signalPropagationTime() const
Returns the signal propagation time.
double tubeT0() const
Returns the point in time where the muon typically enters the chamber.
MdtDriftCircleStatus primaryStatus() const
double primaryDriftR() const
double uncertPrimaryR() const
Amg::Transform3D globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const override final
Returns the transformation from the local coordinate system of the readout element into the global AT...
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
The calibrated Space point is created during the calibration process.
double driftRadius() const
: Returns the size of the drift radius
double time() const
Returns the measurement's recorded time.
const SpacePoint * spacePoint() const
The pointer to the space point out of which this space point has been built.
xAOD::UncalibMeasType type() const
Returns the space point type.
State
State flag to distinguish different space point states.
State fitState() const
Returns the state of the calibrated space point.
Acts::CloneablePtr< CalibratedSpacePoint > CalibSpacePointPtr
std::vector< CalibSpacePointPtr > CalibSpacePointVec
Placeholder for what will later be the muon segment EDM representation.
const MeasVec & measurements() const
Returns the associated measurements.
Gaudi::Property< bool > m_useRpcTime
Load the Rpc time on the track states for the track fit.
void calibrateCombinedPrd(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::CombinedMuonStrip *combinedPrd, ActsTrk::MutableTrackContainer::TrackStateProxy state) const
Calibrates the track states from a combined muon strip.
ToolHandle< Muon::IMMClusterBuilderTool > m_clusterBuilderToolMM
void calibrateSourceLink(const Acts::GeometryContext &geoctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &link, ActsTrk::MutableTrackContainer::TrackStateProxy state) const override final
double driftRadius(const Acts::CalibrationContext &cctx, const CalibratedSpacePoint &spacePoint, const double timeDelay) const override final
ToolHandle< Muon::INSWCalibTool > m_nswCalibTool
std::pair< double, double > calibratesTGC(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::sTgcStripCluster &cluster, std::optional< double > posAlongTheStrip, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
Calibrates the position and covariance of an sTGC (small-strip Thin Gap Chamber) cluster.
double driftVelocity(const Acts::CalibrationContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
ToolHandle< IMdtCalibrationTool > m_mdtCalibrationTool
CalibSpacePointPtr calibrate(const EventContext &ctx, const SpacePoint *spacePoint, const Amg::Vector3D &seedPosInChamb, const Amg::Vector3D &seedDirInChamb, const double timeDelay) const override final
Gaudi::Property< double > m_rpcSignalVelocity
How fast does an electron signal travel along an rpc strip.
void updateSigns(const Amg::Vector3D &trackPos, const Amg::Vector3D &trackDir, CalibSpacePointVec &hitsToCalib) const override final
StatusCode initialize() override final
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
const MuonGMR4::MuonDetectorManager * m_detMgr
Gaudi::Property< bool > m_MdtSignFromSegment
Gaudi::Property< bool > m_useTgcTime
Load the Tgc bunch crossing ID on the track states.
Gaudi::Property< bool > m_usesTgcTime
double driftAcceleration(const Acts::CalibrationContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
ActsTrk::GeoContextReadKey_t m_geoCtxKey
access to the ACTS geometry context
Gaudi::Property< double > m_rpcTimeResolution
std::pair< double, double > calibrateMM(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::MMCluster &cluster, const Amg::Vector3D &globalPos, const Amg::Vector3D &globalDir) const
Calibrates the position and covariance of a MicroMegas (MM) cluster.
void stampSignsOnMeasurements(const xAOD::MuonSegment &segment) const override final
Gaudi::Property< double > m_sTgcPrecCoordErrorScale
Scale factor applied to the sTGC strip measurement uncertainty.
Gaudi::Property< double > m_sTgcNonPrecCoordErrorScale
Scale factor applied to the sTGC non-precise coordinate measurement uncertainty.
Gaudi::Property< double > m_mmStripErrorScale
Scale factor applied to the MM strip measurement uncertainty.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
const Cov_t & covariance() const
Returns the covariance array.
const Identifier & identify() const
: Identifier of the primary measurement
unsigned dimension() const
Is the space point a 1D or combined 2D measurement.
std::array< double, 3 > Cov_t
Abrivation of the covariance type.
MMClusterOnTrack::Author RIO_Author
Refinement of the cluster position after the cluster calibration loop is ran with a complete external...
const xAOD::MuonMeasurement * primaryStrip() const
Returns the primary associated measurement.
virtual xAOD::UncalibMeasType type() const override final
Returns the type of the measurement type as a simple enumeration.
const MuonGMR4::MmReadoutElement * readoutElement() const override final
Retrieve the associated MmReadoutElement.
IdentifierHash layerHash() const override final
Returns the hash of the associated layer (Needed for surface retrieval).
virtual std::uint8_t measuresPhi() const =0
Returns whether the phi coordinate is measured.
const Identifier & identify() const
Returns the Athena identifier of the measurement.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
IdentifierHash layerHash() const override final
Returns the hash of the associated gasGap layer.
const MuonGMR4::sTgcReadoutElement * readoutElement() const override final
Retrieve the associated sTgcReadoutElement.
constexpr double velocityToActs(const double athenaV)
Converts a velocity from Athena to Acts units.
constexpr double accelerationToActs(const double athenaA)
Converts an acceleration from Athena to Acts units.
constexpr double timeToAthena(T actsT)
Converts a time unit from Acts to Athena units.
constexpr auto timeToActs(T athenaT)
Converts a time unit from Athena to Acts units.
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
This header ties the generic definitions in this package.
ISpacePointCalibrator::CalibSpacePointVec CalibSpacePointVec
CalibratedSpacePoint::State State
ISpacePointCalibrator::CalibSpacePointPtr CalibSpacePointPtr
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Amg::Vector3D toLocal(const Amg::Transform3D &toLocalTrans, const Amg::Vector3D &dir)
Rotates a direction vector into a local frame: x-axis : Parallell to the radial direction of the dete...
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MdtDriftCircle_v1 MdtDriftCircle
MdtTwinDriftCircle_v1 MdtTwinDriftCircle
TgcStrip_v1 TgcStrip
Definition TgcStripFwd.h:9
sTgcStripCluster_v1 sTgcStripCluster
UncalibMeasType
Define the type of the uncalibrated measurement.
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
RpcMeasurement_v1 RpcMeasurement
std::pair< Amg::Vector2D, AmgSymMatrix(2)> positionAndCovariance(const MuonMeasurement *oneDimMeas)
Returns the 1D position of the uncalibrated measurement expressed in the coordinate system of the mea...
MMCluster_v1 MMCluster
sTgcMeasurement_v1 sTgcMeasurement
MuonSegment_v1 MuonSegment
Reference the current persistent version:
CombinedMuonStrip_v1 CombinedMuonStrip
#define likely(x)
class which holds the full set of calibration constants for a given tube
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10