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 static const SG::ConstAccessor<int> acc_trackSign{"segmentFitDriftSign"};
35
37 inline Acts::BoundTrackParameters makeBoundPars(const ActsTrk::MutableTrackContainer::TrackStateProxy& state) {
38 return Acts::BoundTrackParameters{state.referenceSurface().getSharedPtr(),
39 state.parameters(), state.covariance(),
40 Acts::ParticleHypothesis::muon()};
41
42 }
43}
44
45namespace MuonR4{
46 using namespace Acts::UnitLiterals;
50 using namespace SegmentFit;
51
53 ATH_CHECK(m_geoCtxKey.initialize());
54 ATH_CHECK(m_idHelperSvc.retrieve());
55 ATH_CHECK(m_mdtCalibrationTool.retrieve(EnableTool{m_idHelperSvc->hasMDT()}));
56 ATH_CHECK(m_nswCalibTool.retrieve(EnableTool{m_idHelperSvc->hasMM() || m_idHelperSvc->hasSTGC()}));
57 ATH_CHECK(detStore()->retrieve(m_detMgr));
58 return StatusCode::SUCCESS;
59 }
60
62 const Amg::Vector3D& trackDir,
63 CalibSpacePointVec& hitsToCalib) const {
64 std::vector<int> signs = SeedingAux::strawSigns(trackPos, trackDir,
65 hitsToCalib);
66 for (const auto [spIdx, sp]: Acts::enumerate(hitsToCalib)) {
67 sp->setDriftRadius(sp->driftRadius() * signs[spIdx]);
68 }
69 }
71 const CalibratedSpacePoint& spacePoint,
72 const Amg::Vector3D& segPos,
73 const Amg::Vector3D& segDir,
74 const double timeDelay) const {
75 CalibSpacePointPtr calibSP{};
76 if (spacePoint.type() != xAOD::UncalibMeasType::Other){
77 calibSP = calibrate(ctx, spacePoint.spacePoint(), segPos, segDir, timeDelay);
78 } else {
79 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint);
80 }
81 if (spacePoint.fitState() == State::Outlier) {
82 calibSP->setFitState(State::Outlier);
83 } else if (spacePoint.fitState() == State::Duplicate) {
84 calibSP->setFitState(State::Duplicate);
85 }
86 return calibSP;
87 }
88
89 CalibSpacePointVec SpacePointCalibrator::calibrate(const Acts::CalibrationContext& cctx,
90 const Amg::Vector3D& segPos,
91 const Amg::Vector3D& segDir,
92 const double timeDelay,
93 const CalibSpacePointVec& spacePoints) const {
94 CalibSpacePointVec newCalib{};
95 const EventContext* ctx = cctx.get<const EventContext*>();
96 newCalib.reserve(spacePoints.size());
97 for (const CalibSpacePointPtr& sp : spacePoints){
98 newCalib.emplace_back(calibrate(*ctx, *sp, segPos, segDir, timeDelay));
99 }
100 return newCalib;
101 }
102
104 const SpacePoint* spacePoint,
105 const Amg::Vector3D& posInChamb,
106 const Amg::Vector3D& dirInChamb,
107 const double timeDelay) const {
108 const ActsTrk::GeometryContext* gctx{nullptr};
109 if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
110 return CalibSpacePointPtr{};
111 }
112 const Amg::Vector3D& spPos{spacePoint->localPosition()};
113 const Acts::Transform3& locToGlob{spacePoint->msSector()->localToGlobalTransform(*gctx)};
114 const Amg::Vector3D& chDir{spacePoint->sensorDirection()};
115
116 // Adjust the space point position according to the external seed. But only if the space point
117 // is a 1D strip
118 Amg::Vector3D calibSpPos = spacePoint->dimension() == 2 ? spPos
119 : spPos + Amg::intersect<3>(posInChamb, dirInChamb, spPos, chDir).value_or(0) * chDir;
120
121 SpacePoint::Cov_t cov = spacePoint->covariance();
122 CalibSpacePointPtr calibSP{};
123 ATH_MSG_VERBOSE("Calibrate "<<(*spacePoint) <<" -> updated pos "<<Amg::toString(calibSpPos));
124 switch (spacePoint->type()) {
125 using enum xAOD::UncalibMeasType;
126 case MdtDriftCircleType: {
127 const Amg::Vector3D locClosestApproach = posInChamb
128 + Amg::intersect<3>(spPos, chDir,
129 posInChamb, dirInChamb).value_or(0) * dirInChamb;
130
131 Amg::Vector3D closestApproach{locToGlob* locClosestApproach};
132 const double timeOfArrival = closestApproach.mag() * c_inv + ActsTrk::timeToAthena(timeDelay);
133
134 if (spacePoint->dimension() == 1) [[likely]] {
135 auto* dc = static_cast<const xAOD::MdtDriftCircle*>(spacePoint->primaryMeasurement());
136 MdtCalibInput calibInput{*dc, *gctx};
137 calibInput.setTrackDirection(locToGlob.linear() * dirInChamb,
138 std::abs(dirInChamb.phi() - 90._degree) > 1.e-7 );
139 calibInput.setTimeOfFlight(timeOfArrival);
140 const auto magnitude = closestApproach.mag();
141 calibInput.setClosestApproach(std::move(closestApproach));
142 ATH_MSG_VERBOSE("Parse hit calibration "<<m_idHelperSvc->toString(dc->identify())<<", "<<calibInput);
143 MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(ctx, calibInput);
144 ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
145 State fitState{State::Valid};
147 if (calibOutput.status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
148 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
149 <<std::endl<<calibInput<<std::endl<<calibOutput);
150 fitState = State::FailedCalib;
151 cov[Acts::toUnderlying(AxisDefs::etaCov)] = dc->readoutElement()->innerTubeRadius();
152 } else {
153 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.driftRadiusUncert());
154 }
155 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
156 calibSP->setCovariance(cov);
157 calibSP->setDriftRadius(calibOutput.driftRadius());
159 double fastToF {(locToGlob * calibSP->localPosition()).norm() * c_inv};
160 calibSP->setTimeMeasurement(ActsTrk::timeToActs(dc->tdc() * IMdtCalibrationTool::tdcBinSize -
161 calibOutput.tubeT0() - fastToF - calibOutput.signalPropagationTime()));
162 ATH_MSG_VERBOSE("Mdt time Meas: " << ActsTrk::timeToAthena(calibSP->time())
163 << ", ToF / fastToF: " << fastToF << " / " << magnitude * c_inv
164 << ", tubeT0: " << calibOutput.tubeT0() << ", Signal Prop Time: " << calibOutput.signalPropagationTime());
165 } else {
166 auto* dc = static_cast<const xAOD::MdtTwinDriftCircle*>(spacePoint->primaryMeasurement());
167 MdtCalibInput calibInput{*dc, *gctx};
168 calibInput.setClosestApproach(closestApproach);
169 calibInput.setTimeOfFlight(timeOfArrival);
170
171 MdtCalibInput twinInput{dc->twinIdentify(), dc->twinAdc(), dc->twinTdc(), dc->readoutElement(), *gctx};
172 twinInput.setClosestApproach(closestApproach);
173 twinInput.setTimeOfFlight(timeOfArrival);
174
175 MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(ctx,
176 std::move(calibInput),
177 std::move(twinInput));
178
179 State fitState{State::Valid};
180 if (calibOutput.primaryStatus() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
181 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
182 <<std::endl<<calibOutput);
183 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(dc->readoutElement()->innerTubeRadius());
184 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()));
185 fitState = State::FailedCalib;
186 } else {
187 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.uncertPrimaryR());
188 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(calibOutput.sigmaZ());
189 }
190 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
191 calibSP->setCovariance(cov);
192 calibSP->setDriftRadius(calibOutput.primaryDriftR());
194 double fastToF {(locToGlob * calibSP->localPosition()).norm() * c_inv};
195 double tubeT0 {m_mdtCalibrationTool->getCalibConstants(ctx, dc->identify())->tubeCalib->getCalib(dc->identify())->t0};
196 // Remember to add the signal propagation time!!
197 calibSP->setTimeMeasurement(ActsTrk::timeToActs(calibOutput.primaryTdc() * IMdtCalibrationTool::tdcBinSize - tubeT0 - fastToF));
198 }
199 break;
200 }
201 case RpcStripType: {
202 auto* strip = static_cast<const xAOD::RpcMeasurement*>(spacePoint->primaryMeasurement());
203
205 const Acts::Transform3 toGasGap{strip->readoutElement()->globalToLocalTransform(*gctx, strip->layerHash()) * locToGlob};
206 const Amg::Vector3D lPos = toGasGap * calibSpPos;
208 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
209
210 // @TODO the constants could be converted to what is needed here (units, inverse) at initialization/construction time
211 // in particular 1/m_rpcSignalVelocity
212 cov[Acts::toUnderlying(AxisDefs::timeCov)] = Acts::square(ActsTrk::timeToActs(m_rpcTimeResolution.value()));
213
214 const double time1 = strip->time()
215 - strip->readoutElement()->distanceToEdge(strip->layerHash(), lPos,
216 EdgeSide::readOut) /m_rpcSignalVelocity;
217
218 if (spacePoint->dimension() == 2) {
219 auto* strip2 = static_cast<const xAOD::RpcMeasurement*>(spacePoint->secondaryMeasurement());
220
221 const double time2 = strip2->time() -
222 strip2->readoutElement()->distanceToEdge(strip2->layerHash(),lPos, EdgeSide::readOut)/m_rpcSignalVelocity;
224 calibSP->setTimeMeasurement(ActsTrk::timeToActs(0.5*(time1 + time2)));
226 cov[Acts::toUnderlying(AxisDefs::timeCov)] += Acts::square(ActsTrk::timeToActs(0.5*(time1 - time2)));
227 } else {
228 calibSP->setTimeMeasurement(ActsTrk::timeToActs(time1));
229 }
230 calibSP->setCovariance(cov);
231 ATH_MSG_VERBOSE("Create rpc space point "<<m_idHelperSvc->toString(strip->identify())<<", dimension "<<spacePoint->dimension()
232 << ", at "<<Amg::toString(calibSP->localPosition())<<", uncalib time: "
233 <<strip->time()<<", calib time: "<<ActsTrk::timeToAthena(calibSP->time())<<" cov " <<calibSP->covariance()
234 <<", time Uncert: "<<ActsTrk::timeToAthena(std::sqrt(calibSP->covariance()[Acts::toUnderlying(AxisDefs::timeCov)])));
235 break;
236 }
237 case TgcStripType: {
238 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
240 if (spacePoint->primaryMeasurement()->measuresPhi()) {
241 const auto* strip = static_cast<const xAOD::TgcStrip*>(spacePoint->primaryMeasurement());
242 const Acts::Transform3 toGasGap{strip->readoutElement()->globalToLocalTransform(*gctx, strip->layerHash()) * locToGlob};
243 const Amg::Vector3D lPos = toGasGap * calibSP->localPosition();
244 const auto& sensorPlane = strip->readoutElement()->sensorLayout(strip->layerHash());
245 const auto& radialDesign = strip->readoutElement()->stripLayout(strip->layerHash());
246 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(
247 radialDesign.stripPitch(strip->channelNumber(), sensorPlane->to2D(lPos,true))) / 12.;
248 }
249 calibSP->setCovariance(cov);
250 break;
251 }
252 case MMClusterType: {
253 const xAOD::MMCluster* cluster = static_cast<const xAOD::MMCluster*>(spacePoint->primaryMeasurement());
254 Amg::Vector3D globalPos{locToGlob * posInChamb};
255 Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
256
257 std::pair<double, double> calibPosCov {calibrateMM(ctx, *gctx, *cluster, globalPos, globalDir)};
258
259 ATH_MSG_DEBUG("Calibrated pos and cov" << calibPosCov.first << " " << calibPosCov.second);
260 cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibPosCov.second;
261 Acts::Transform3 toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTransform(*gctx, cluster->layerHash())};
262
263 // 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
264 Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
265 ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
266 calibSpPosInLayer.x() = calibPosCov.first;
267 ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
268 calibSpPos = toChamberTrans * calibSpPosInLayer;
269
270 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
271 calibSP->setCovariance(cov);
272 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());
273
274 break;
275 }
276 case sTgcStripType: {
277 const auto* cluster = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->primaryMeasurement());
278
279 // We do not apply any correction for pads or wire only space points
280 if (cluster->channelType() != sTgcIdHelper::sTgcChannelTypes::Strip) {
281 ATH_MSG_DEBUG("Calibrating an sTGC Pad or wire " << m_idHelperSvc->toString(cluster->identify()));
282 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
283 calibSP->setCovariance(cov);
284 break;
285 }
286
287 std::optional<double> posAlongTheStrip{std::nullopt};
288
289 // check if the space point is a strip/wire combination and take the position along the strip from the wire measurement
290 if(spacePoint->secondaryMeasurement()) {
291 const auto* secMeas = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->secondaryMeasurement());
292 ATH_MSG_VERBOSE("Using secondary measurement "<< m_idHelperSvc->toString(secMeas->identify())<<" for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
293 // Extract scalar value - use 2D for pads (2 dimensions), 1D for wires (1 dimension)
294 if (secMeas->numDimensions() == 2) {
295 posAlongTheStrip = static_cast<double>(secMeas->localPosition<2>()[0]);
296 } else {
297 posAlongTheStrip = static_cast<double>(secMeas->localPosition<1>()[0]);
298 }
299 } else {
300 ATH_MSG_VERBOSE("No secondary measurement for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
301 }
302
303 Amg::Vector3D globalPos{locToGlob * posInChamb};
304 Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
305
306 const auto* stripClus = static_cast<const xAOD::sTgcStripCluster*>(cluster);
307 const auto [calibPos, calibCov] = calibratesTGC(ctx, *gctx, *stripClus, posAlongTheStrip, globalPos, globalDir);
308
309 ATH_MSG_DEBUG("Calibrated pos and cov" << calibPos << " " << calibCov);
310 cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibCov;
311 Acts::Transform3 toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTransform(*gctx, cluster->layerHash())};
312
313 if (spacePoint->dimension() == 2) {
314 cov[Acts::toUnderlying(AxisDefs::phiCov)] *=
315 Acts::square(m_sTgcNonPrecCoordErrorScale.value());
316 }
317
318 // 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
319 Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
320 ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
321 calibSpPosInLayer.x() = calibPos;
322 ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
323 calibSpPos = toChamberTrans * calibSpPosInLayer;
324
325 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
326 calibSP->setCovariance(cov);
327 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());
328 break;
329 }
330
331 default:
332 ATH_MSG_WARNING("Do not know how to calibrate "<<m_idHelperSvc->toString(spacePoint->identify()));
333 }
334 return calibSP;
335 }
336
338 const std::vector<const SpacePoint*>& spacePoints,
339 const Amg::Vector3D& posInChamb,
340 const Amg::Vector3D& dirInChamb,
341 const double timeDelay) const {
342 CalibSpacePointVec calibSpacePoints{};
343 calibSpacePoints.reserve(spacePoints.size());
344 for(const SpacePoint* spacePoint : spacePoints) {
345 CalibSpacePointPtr hit = calibrate(ctx, spacePoint, posInChamb, dirInChamb, timeDelay);
346 if (hit) {
347 calibSpacePoints.push_back(std::move(hit));
348 }
349 }
350 return calibSpacePoints;
351 }
352 double SpacePointCalibrator::driftVelocity(const Acts::CalibrationContext& ctx,
353 const CalibratedSpacePoint& spacePoint) const {
355
356 const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(*ctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
357 const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
358 return ActsTrk::velocityToActs(calibConsts->rtRelation->rt()->driftVelocity(driftTime.value_or(0.)));
359 }
360 return 0.;
361 }
362 double SpacePointCalibrator::driftAcceleration(const Acts::CalibrationContext& ctx,
363 const CalibratedSpacePoint& spacePoint) const {
365 const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(*ctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
366 const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
367 return ActsTrk::accelerationToActs(calibConsts->rtRelation->rt()->driftAcceleration(driftTime.value_or(0.)));
368 }
369 return 0.;
370 }
371
372 std::pair<double, double> SpacePointCalibrator::calibrateMM(const EventContext& ctx,
373 const ActsTrk::GeometryContext& gctx,
374 const xAOD::MMCluster& cluster,
375 const Amg::Vector3D& globalPos,
376 const Amg::Vector3D& globalDir) const {
377 std::vector<NSWCalib::CalibratedStrip> calibClus;
378 StatusCode sc = m_nswCalibTool->calibrateClus(ctx, gctx, cluster, globalPos, calibClus);
379 if(sc.isFailure()) {
380 ATH_MSG_WARNING("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
381 return std::make_pair(0., 0.);
382 }
383
384 Amg::Vector2D locPos{cluster.localPosition<1>()[0] * Amg::Vector2D::UnitX()};
385 Amg::Vector3D locDir = Muon::NswClustering::toLocal(cluster.readoutElement()->globalToLocalTransform(gctx, cluster.layerHash()), globalDir);
386
387 Amg::MatrixX calibCov{};
388 calibCov.resize(1,1);
389 calibCov(0,0) = cluster.localCovariance<1>()(0, 0);
390 ATH_MSG_DEBUG("old loc pos " << locPos[0] << " old cov" << calibCov(0,0) );
391
392 Muon::IMMClusterBuilderTool::RIO_Author rotAuthor = m_clusterBuilderToolMM->getCalibratedClusterPosition(ctx, calibClus, locDir ,locPos, calibCov);
393 if(rotAuthor == Muon::IMMClusterBuilderTool::RIO_Author::unKnownAuthor){
394 THROW_EXCEPTION("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
395 }
396 ATH_MSG_DEBUG("new loc pos " << locPos[0] << " new cov" << calibCov(0,0) );
397 return std::make_pair(locPos[0], Acts::square(m_mmStripErrorScale.value()) * calibCov(0,0));
398 }
399
400 std::pair<double, double> SpacePointCalibrator::calibratesTGC(const EventContext& /*ctx*/,
401 const ActsTrk::GeometryContext& gctx,
402 const xAOD::sTgcStripCluster& cluster,
403 std::optional<double> posAlongTheStrip,
404 const Amg::Vector3D& globalPos,
405 const Amg::Vector3D& /*globalDir*/) const{
406
407 // if the second coordiante was not provided by the wire, take it from the seed track position
408 if(!posAlongTheStrip) {
409 Amg::Vector3D extPosLocal = cluster.readoutElement()->globalToLocalTransform(gctx, cluster.layerHash()) * globalPos;
410 posAlongTheStrip = extPosLocal[1];
411 }
412
413 // For now just copying over the local position and covariance. Eventually this should apply corrections from B-Lines and as build geometry
414 return std::make_pair( cluster.localPosition<1>()[0], Acts::square(m_sTgcPrecCoordErrorScale.value()) * cluster.localCovariance<1>()(0,0));
415 }
416 void SpacePointCalibrator::calibrateCombinedPrd(const EventContext& ctx,
417 const ActsTrk::GeometryContext& gctx,
418 const xAOD::CombinedMuonStrip* combinedPrd,
419 ActsTrk::MutableTrackContainer::TrackStateProxy state) const {
420 const auto sl = ActsTrk::detail::xAODUncalibMeasCalibrator::pack(combinedPrd);
421
422 Amg::Vector2D cmbPos = xAOD::toEigen(combinedPrd->localPosition<2>());
423 AmgSymMatrix(2) cmbCov = xAOD::toEigen(combinedPrd->localCovariance<2>());
424 if (combinedPrd->type() == xAOD::UncalibMeasType::RpcStripType) {
425 if (m_useRpcTime) {
426 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
427 }
428 setState<2>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
429
430 } else if (combinedPrd->type() == xAOD::UncalibMeasType::TgcStripType) {
431 if (m_useTgcTime) {
432 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
433 }
434
435 setState<2>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
436
437 } else if(combinedPrd->type() == xAOD::UncalibMeasType::sTgcStripType) {
438 if (m_usesTgcTime) {
439 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
440 }
441 // combined sTGC Space points can be strip/wire, strip/pad or pad/wire combinations.
442 const auto* primMeas = static_cast<const xAOD::sTgcMeasurement*>(combinedPrd->primaryStrip());
443
444 if(primMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Strip) {
445 const auto* primStripMeas = static_cast<const xAOD::sTgcStripCluster*>(primMeas);
447 const Acts::BoundTrackParameters trackPars{makeBoundPars(state)};
448 std::pair<double, double> calibPosCov{calibratesTGC(ctx, gctx, *primStripMeas, cmbPos[1] ,
449 trackPars.position(gctx.context()),
450 trackPars.direction())};
451 cmbPos[0] = calibPosCov.first;
452 cmbCov(0,0) = calibPosCov.second;
453
454 // Loosen non-precision / second coordinate
455 cmbCov(1,1) *= Acts::square(m_sTgcNonPrecCoordErrorScale.value());
456 }
457 setState<2>(ProjectorType::e2DimNoTime, cmbPos, cmbCov, sl, state);
458
459 } else {
460 THROW_EXCEPTION("Undefined uncalibrated measurement "
461 <<m_idHelperSvc->toString(combinedPrd->identify()));
462 }
463 }
464 void SpacePointCalibrator::calibrateSourceLink(const Acts::GeometryContext& geoctx,
465 const Acts::CalibrationContext& cctx,
466 const Acts::SourceLink& link,
467 ActsTrk::MutableTrackContainer::TrackStateProxy trackState) const {
468
470 const Acts::BoundTrackParameters trackPars{makeBoundPars(trackState)};
471
472
473 const auto* muonMeas = ActsTrk::detail::xAODUncalibMeasCalibrator::unpack(link);
474 const ActsTrk::GeometryContext* gctx = geoctx.get<const ActsTrk::GeometryContext*>();
475 const EventContext* ctx = cctx.get<const EventContext*>();
476 ATH_MSG_VERBOSE("Calibrate measurement "<<m_idHelperSvc->toString(xAOD::identify(muonMeas))
477 <<", smoothened: "<<trackState.hasSmoothed()<<", filtered: "<<trackState.hasFiltered()
478 <<", predicted: "<<trackState.hasPredicted()
479 <<" @\n"<<trackPars);
481 if (muonMeas->numDimensions() == 0u) {
482 calibrateCombinedPrd(*ctx, *gctx, static_cast<const xAOD::CombinedMuonStrip*>(muonMeas),
483 trackState);
484 return;
485
486 }
487 const Amg::Vector3D trackPos{trackPars.position(geoctx)};
488 const Amg::Vector3D trackDir{trackPars.direction()};
489
490 switch (muonMeas->type()){
491 using enum xAOD::UncalibMeasType;
492 case MdtDriftCircleType: {
493 const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(muonMeas);
494 MdtCalibInput calibInput{*dc, *gctx};
495 calibInput.setClosestApproach(trackPos);
496 //calibInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
497 calibInput.setTrackDirection(trackDir, true);
498 const double driftSign = m_MdtSignFromSegment ?
499 static_cast<double>(acc_trackSign(*dc)) :
500 Acts::copySign(1.,trackPars.parameters()[Acts::eBoundLoc0]);
502 if (muonMeas->numDimensions() == 1) [[likely]] {
503 MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(*ctx, calibInput);
504 ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
505 AmgVector(1) pos{AmgVector(1)::Zero()};
506 AmgSymMatrix(1) cov{AmgSymMatrix(1)::Identity()};
508 if (calibOutput.status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
509 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
510 <<std::endl<<calibInput<<std::endl<<calibOutput);
511 cov(Acts::eBoundLoc0,Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
512 } else {
513 pos[Acts::eBoundLoc0] = driftSign*calibOutput.driftRadius();
514 cov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.driftRadiusUncert(), 2);
515 }
516 setState<1>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
517 }
519 else {
520 const auto* twinDC = static_cast<const xAOD::MdtTwinDriftCircle*>(muonMeas);
521 MdtCalibInput twinInput{twinDC->twinIdentify(), twinDC->twinAdc(), twinDC->twinTdc(), twinDC->readoutElement(), *gctx};
522 twinInput.setClosestApproach(trackPos);
523 twinInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
524
525 MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(*ctx,
526 std::move(calibInput),
527 std::move(twinInput));
528 Amg::Vector2D locPos{Amg::Vector2D::Zero()};
529 AmgSymMatrix(2) locCov{AmgSymMatrix(2)::Identity()};
530 if (calibOutput.primaryStatus() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
531 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
532 <<std::endl<<calibOutput);
533 locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
534 locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()), 2);
535 } else {
536 locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.uncertPrimaryR(), 2);
537 locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(calibOutput.sigmaZ(), 2);
538 locPos[Acts::eBoundLoc0] = driftSign*calibOutput.primaryDriftR();
539 locPos[Acts::eBoundLoc1] = calibOutput.locZ();
540 }
541 setState<2>(ProjectorType::e2DimNoTime, locPos, locCov, link, trackState);
542 }
543 break;
544 } case RpcStripType: {
545 const auto* rpcClust = static_cast<const xAOD::RpcMeasurement*>(muonMeas);
547 if (rpcClust->numDimensions() == 1) [[likely]] {
548
549 if (!m_useRpcTime) {
550 const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotNoTime
552 setState<1>(proj, rpcClust->localPosition<1>(),
553 rpcClust->localCovariance<1>(), link, trackState);
554 } else {
555 AmgVector(2) measPars{AmgVector(2)::Zero()};
556 AmgSymMatrix(2) measCov{AmgSymMatrix(2)::Identity()};
557 measPars[0] = rpcClust->localPosition<1>()[0];
558 measCov(0,0) = rpcClust->localCovariance<1>()(0, 0);
559 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
560 measCov(1,1) = std::pow(m_rpcTimeResolution, 2);
561 const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotWithTime
563 setState<2>(proj, measPars, measCov, link, trackState);
564 }
565 }
567 else {
568 if (!m_useRpcTime) {
570 rpcClust->localPosition<2>(),
571 rpcClust->localCovariance<2>(), link, trackState);
572 } else {
573 AmgVector(3) measPars{AmgVector(3)::Zero()};
574 AmgSymMatrix(3) measCov{AmgSymMatrix(3)::Identity()};
575 measPars.block<2,1>(0,0) = xAOD::toEigen(rpcClust->localPosition<2>());
576 measCov.block<2,2>(0,0) = xAOD::toEigen(rpcClust->localCovariance<2>());
577 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
578 measCov(2,2) = std::pow(m_rpcTimeResolution, 2);
579 setState<3>(ProjectorType::e2DimWithTime, measPars, measCov, link, trackState);
580 }
581 }
582 break;
583 } case TgcStripType: {
584 const auto* tgcClust = static_cast<const xAOD::TgcStrip*>(muonMeas);
585 if (!m_useTgcTime) {
586 if (!tgcClust->measuresPhi()) {
588 tgcClust->localPosition<1>(),
589 tgcClust->localCovariance<1>(),
590 link, trackState);
591
592 } else {
593 const auto [pos, cov] = xAOD::positionAndCovariance(tgcClust);
594 setState<2>(ProjectorType::e1DimRotNoTime, pos, cov, link, trackState);
595
596 }
597 } else {
598 ATH_MSG_WARNING("Tgc time calibration to be implemented...");
599 }
600 break;
601 }
602 case MMClusterType: {
603 const auto* mmClust = static_cast<const xAOD::MMCluster*>(muonMeas);
604 std::pair<double, double> calibPosCov{calibrateMM(*ctx,* gctx, *mmClust, trackPos, trackDir)};
605 AmgVector(1) pos{AmgVector(1)(calibPosCov.first)};
606 AmgSymMatrix(1) cov{AmgSymMatrix(1)(calibPosCov.second)};
607
608 setState<1>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
609 break;
610 } case sTgcStripType: {
611 const auto* stgcClust = static_cast<const xAOD::sTgcMeasurement*>(muonMeas);
612
613 if(stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire) {
615 muonMeas->localPosition<1>(),
616 muonMeas->localCovariance<1>(), link, trackState);
617 } else if (stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad) {
619 stgcClust->localPosition<2>(),
620 stgcClust->localCovariance<2>(), link, trackState);
621 } else { // strips
622 const auto stgCluster = static_cast<const xAOD::sTgcStripCluster*>(muonMeas);
623 std::pair<double, double> calibPosCov{calibratesTGC(*ctx, *gctx, *stgCluster, std::nullopt, trackPos, trackDir)};
624 if(!m_usesTgcTime) {
625 AmgVector(1) pos{calibPosCov.first};
626 AmgSymMatrix(1) cov{calibPosCov.second};
627 setState<1>(ProjectorType::e1DimNoTime, pos, cov, link, trackState);
628 } else {
629 ATH_MSG_WARNING("sTGC time calibration to be implemented...");
630 AmgVector(2) pos{AmgVector(2)::Zero()};
631 AmgSymMatrix(2) cov{AmgSymMatrix(2)::Zero()};
632 pos[0] = calibPosCov.first;
633 pos[1] = stgCluster->time();
634 cov(0,0) = calibPosCov.second;
635 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
636 cov(1,1) = std::pow(25 /*ns*/, 2);
637
638 setState<2>(ProjectorType::e1DimWithTime, pos, cov, link, trackState);
639 }
640 }
641 break;
642 } case Other: {
644 auxCalibrator.calibrate(geoctx, cctx, link, trackState);
645 break;
646 } default: {
647 THROW_EXCEPTION("The parsed measurement is not a muon measurement. Please check.");
648 }
649 }
650 }
652 const auto [segPos, segLine] = makeLine(localSegmentPars(segment));
653 const Segment* detSeg = MuonR4::detailedSegment(segment);
654 for (const auto& meas : detSeg->measurements()) {
656 const int sign = SeedingAux::strawSign(segPos, segLine, *meas);
657 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" Stamp: "<<sign<<" onto "
658 <<m_idHelperSvc->toString(meas->spacePoint()->identify()));
659 dec_trackSign(*meas->spacePoint()->primaryMeasurement()) =sign;
660 }
661 }
662 }
663
664 double SpacePointCalibrator::driftRadius(const Acts::CalibrationContext& cctx,
665 const CalibratedSpacePoint& spacePoint,
666 const double timeDelay) const {
668 const MuonCalib::MdtFullCalibData* calibConsts =
669 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
670 return calibConsts->rtRelation->rt()->radius(ActsTrk::timeToAthena(spacePoint.time() - timeDelay));
671 }
672 return 0.;
673 }
674
675 double SpacePointCalibrator::driftVelocity(const Acts::CalibrationContext& cctx,
676 const CalibratedSpacePoint& spacePoint,
677 const double timeDelay) const {
679 const MuonCalib::MdtFullCalibData* calibConsts =
680 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
681 return ActsTrk::velocityToActs(calibConsts->rtRelation->rt()->driftVelocity(ActsTrk::timeToAthena(spacePoint.time() - timeDelay)));
682 }
683 return 0.;
684 }
685 double SpacePointCalibrator::driftAcceleration(const Acts::CalibrationContext& cctx,
686 const CalibratedSpacePoint& spacePoint,
687 const double timeDelay) const {
689 const MuonCalib::MdtFullCalibData* calibConsts =
690 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
691 return ActsTrk::accelerationToActs(calibConsts->rtRelation->rt()->driftAcceleration(ActsTrk::timeToAthena(spacePoint.time() - timeDelay)));
692 }
693 return 0.;
694 }
695
696}
#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
int sign(int a)
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 &tgContext, const Acts::CalibrationContext &calContext, 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
Acts::Transform3 globalToLocalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the global ATLAS coordinate system into the local coordinate system o...
const Acts::Transform3 & 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 Acts::Transform3 & 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...
Helper class to provide constant type-safe access to aux data.
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::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