ATLAS Offline Software
Loading...
Searching...
No Matches
SpacePointCalibrator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
5
9
18
21
23
26
27
28#include "Acts/Utilities/MathHelpers.hpp"
29#include "Acts/Utilities/Enumerate.hpp"
30
31
32namespace {
33 constexpr double c_inv = 1./ Gaudi::Units::c_light;
34 static const SG::Decorator<int> dec_trackSign{"segmentFitDriftSign"};
35}
36
37namespace MuonR4{
38 using namespace Acts::UnitLiterals;
42 using namespace SegmentFit;
43
45 ATH_CHECK(m_geoCtxKey.initialize());
46 ATH_CHECK(m_idHelperSvc.retrieve());
47 ATH_CHECK(m_mdtCalibrationTool.retrieve(EnableTool{m_idHelperSvc->hasMDT()}));
48 ATH_CHECK(m_nswCalibTool.retrieve(EnableTool{m_idHelperSvc->hasMM() || m_idHelperSvc->hasSTGC()}));
49 ATH_CHECK(detStore()->retrieve(m_detMgr));
50 return StatusCode::SUCCESS;
51 }
52
54 const Amg::Vector3D& trackDir,
55 CalibSpacePointVec& hitsToCalib) const {
56 std::vector<int> signs = SeedingAux::strawSigns(trackPos, trackDir,
57 hitsToCalib);
58 for (const auto [spIdx, sp]: Acts::enumerate(hitsToCalib)) {
59 sp->setDriftRadius(sp->driftRadius() * signs[spIdx]);
60 }
61 }
63 const CalibratedSpacePoint& spacePoint,
64 const Amg::Vector3D& segPos,
65 const Amg::Vector3D& segDir,
66 const double timeDelay) const {
67 CalibSpacePointPtr calibSP{};
68 if (spacePoint.type() != xAOD::UncalibMeasType::Other){
69 calibSP = calibrate(ctx, spacePoint.spacePoint(), segPos, segDir, timeDelay);
70 } else {
71 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint);
72 }
73 if (spacePoint.fitState() == State::Outlier) {
74 calibSP->setFitState(State::Outlier);
75 } else if (spacePoint.fitState() == State::Duplicate) {
76 calibSP->setFitState(State::Duplicate);
77 }
78 return calibSP;
79 }
80
81 CalibSpacePointVec SpacePointCalibrator::calibrate(const Acts::CalibrationContext& cctx,
82 const Amg::Vector3D& segPos,
83 const Amg::Vector3D& segDir,
84 const double timeDelay,
85 const CalibSpacePointVec& spacePoints) const {
86 CalibSpacePointVec newCalib{};
87 const EventContext* ctx = cctx.get<const EventContext*>();
88 newCalib.reserve(spacePoints.size());
89 for (const CalibSpacePointPtr& sp : spacePoints){
90 newCalib.emplace_back(calibrate(*ctx, *sp, segPos, segDir, timeDelay));
91 }
92 return newCalib;
93 }
94
96 const SpacePoint* spacePoint,
97 const Amg::Vector3D& posInChamb,
98 const Amg::Vector3D& dirInChamb,
99 const double timeDelay) const {
100 const ActsTrk::GeometryContext* gctx{nullptr};
101 if (!SG::get(gctx, m_geoCtxKey, ctx).isSuccess()) {
102 return nullptr;
103 }
104 const Amg::Vector3D& spPos{spacePoint->localPosition()};
105 const Amg::Transform3D& locToGlob{spacePoint->msSector()->localToGlobalTransform(*gctx)};
106 const Amg::Vector3D& chDir{spacePoint->sensorDirection()};
107
108 // Adjust the space point position according to the external seed. But only if the space point
109 // is a 1D strip
110 Amg::Vector3D calibSpPos = spacePoint->dimension() == 2 ? spPos
111 : spPos + Amg::intersect<3>(posInChamb, dirInChamb, spPos, chDir).value_or(0) * chDir;
112
113 SpacePoint::Cov_t cov = spacePoint->covariance();
114 CalibSpacePointPtr calibSP{};
115 ATH_MSG_VERBOSE("Calibrate "<<(*spacePoint) <<" -> updated pos "<<Amg::toString(calibSpPos));
116 switch (spacePoint->type()) {
118 const Amg::Vector3D locClosestApproach = posInChamb
119 + Amg::intersect<3>(spPos, chDir,
120 posInChamb, dirInChamb).value_or(0) * dirInChamb;
121
122 Amg::Vector3D closestApproach{locToGlob* locClosestApproach};
123 const double timeOfArrival = closestApproach.mag() * c_inv + ActsTrk::timeToAthena(timeDelay);
124
125 if (ATH_LIKELY(spacePoint->dimension() == 1)) {
126 auto* dc = static_cast<const xAOD::MdtDriftCircle*>(spacePoint->primaryMeasurement());
127 MdtCalibInput calibInput{*dc, *gctx};
128 calibInput.setTrackDirection(locToGlob.linear() * dirInChamb,
129 Acts::abs(dirInChamb.phi() - 90._degree) > 1.e-7 );
130 calibInput.setTimeOfFlight(timeOfArrival);
131 calibInput.setClosestApproach(std::move(closestApproach));
132 ATH_MSG_VERBOSE("Parse hit calibration "<<m_idHelperSvc->toString(dc->identify())<<", "<<calibInput);
133 MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(ctx, calibInput);
134 ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
135 State fitState{State::Valid};
137 if (calibOutput.status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
138 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
139 <<std::endl<<calibInput<<std::endl<<calibOutput);
140 fitState = State::FailedCalib;
141 cov[Acts::toUnderlying(AxisDefs::etaCov)] = dc->readoutElement()->innerTubeRadius();
142 } else {
143 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.driftRadiusUncert());
144 }
145 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
146 calibSP->setCovariance(cov);
147 calibSP->setDriftRadius(calibOutput.driftRadius());
149 double fastToF {(locToGlob * calibSP->localPosition()).norm() * c_inv};
150 calibSP->setTimeMeasurement(ActsTrk::timeToActs(dc->tdc() * IMdtCalibrationTool::tdcBinSize -
151 calibOutput.tubeT0() - fastToF - calibOutput.signalPropagationTime()));
152 ATH_MSG_VERBOSE("Mdt time Meas: " << ActsTrk::timeToAthena(calibSP->time())
153 << ", ToF / fastToF: " << fastToF << " / " << closestApproach.mag() * c_inv
154 << ", tubeT0: " << calibOutput.tubeT0() << ", Signal Prop Time: " << calibOutput.signalPropagationTime());
155 } else {
156 auto* dc = static_cast<const xAOD::MdtTwinDriftCircle*>(spacePoint->primaryMeasurement());
157 MdtCalibInput calibInput{*dc, *gctx};
158 calibInput.setClosestApproach(closestApproach);
159 calibInput.setTimeOfFlight(timeOfArrival);
160
161 MdtCalibInput twinInput{dc->twinIdentify(), dc->twinAdc(), dc->twinTdc(), dc->readoutElement(), *gctx};
162 twinInput.setClosestApproach(closestApproach);
163 twinInput.setTimeOfFlight(timeOfArrival);
164
165 MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(ctx,
166 std::move(calibInput),
167 std::move(twinInput));
168
169 State fitState{State::Valid};
170 if (calibOutput.primaryStatus() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
171 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
172 <<std::endl<<calibOutput);
173 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(dc->readoutElement()->innerTubeRadius());
174 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()));
175 fitState = State::FailedCalib;
176 } else {
177 cov[Acts::toUnderlying(AxisDefs::etaCov)] = Acts::square(calibOutput.uncertPrimaryR());
178 cov[Acts::toUnderlying(AxisDefs::phiCov)] = Acts::square(calibOutput.sigmaZ());
179 }
180 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos), fitState);
181 calibSP->setCovariance(cov);
182 calibSP->setDriftRadius(calibOutput.primaryDriftR());
184 double fastToF {(locToGlob * calibSP->localPosition()).norm() * c_inv};
185 double tubeT0 {m_mdtCalibrationTool->getCalibConstants(ctx, dc->identify())->tubeCalib->getCalib(dc->identify())->t0};
186 // Remember to add the signal propagation time!!
187 calibSP->setTimeMeasurement(ActsTrk::timeToActs(calibOutput.primaryTdc() * IMdtCalibrationTool::tdcBinSize - tubeT0 - fastToF));
188 }
189 break;
190 }
192 auto* strip = static_cast<const xAOD::RpcMeasurement*>(spacePoint->primaryMeasurement());
193
195 const Amg::Transform3D toGasGap{strip->readoutElement()->globalToLocalTransform(*gctx, strip->layerHash()) * locToGlob};
196 const Amg::Vector3D lPos = toGasGap * calibSpPos;
198 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
199
200 cov[Acts::toUnderlying(AxisDefs::timeCov)] = Acts::square(ActsTrk::timeToActs(m_rpcTimeResolution));
201
202 const double time1 = strip->time()
203 - strip->readoutElement()->distanceToEdge(strip->layerHash(), lPos,
204 EdgeSide::readOut) /m_rpcSignalVelocity;
205
206 if (spacePoint->dimension() == 2) {
207 auto* strip2 = static_cast<const xAOD::RpcMeasurement*>(spacePoint->secondaryMeasurement());
208
209 const double time2 = strip2->time() -
210 strip2->readoutElement()->distanceToEdge(strip2->layerHash(),lPos, EdgeSide::readOut)/m_rpcSignalVelocity;
212 calibSP->setTimeMeasurement(ActsTrk::timeToActs(0.5*(time1 + time2)));
214 cov[Acts::toUnderlying(AxisDefs::timeCov)] += Acts::square(ActsTrk::timeToActs(0.5*(time1 - time2)));
215 } else {
216 calibSP->setTimeMeasurement(ActsTrk::timeToActs(time1));
217 }
218 calibSP->setCovariance(cov);
219 ATH_MSG_VERBOSE("Create rpc space point "<<m_idHelperSvc->toString(strip->identify())<<", dimension "<<spacePoint->dimension()
220 << ", at "<<Amg::toString(calibSP->localPosition())<<", uncalib time: "
221 <<strip->time()<<", calib time: "<<ActsTrk::timeToAthena(calibSP->time())<<" cov " <<calibSP->covariance()
222 <<", time Uncert: "<<ActsTrk::timeToAthena(std::sqrt(calibSP->covariance()[Acts::toUnderlying(AxisDefs::timeCov)])));
223 break;
224 }
226 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
227 calibSP->setCovariance(cov);
228 break;
229 }
231 const xAOD::MMCluster* cluster = static_cast<const xAOD::MMCluster*>(spacePoint->primaryMeasurement());
232 Amg::Vector3D globalPos{locToGlob * posInChamb};
233 Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
234
235 std::pair<double, double> calibPosCov {calibrateMM(ctx, *gctx, *cluster, globalPos, globalDir)};
236
237 ATH_MSG_DEBUG("Calibrated pos and cov" << calibPosCov.first << " " << calibPosCov.second);
238 cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibPosCov.second;
239 Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTransform(*gctx, cluster->layerHash())};
240
241 // 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
242 Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
243 ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
244 calibSpPosInLayer.x() = calibPosCov.first;
245 ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
246 calibSpPos = toChamberTrans * calibSpPosInLayer;
247
248 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
249 calibSP->setCovariance(cov);
250 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());
251
252 break;
253 }
255 const auto* cluster = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->primaryMeasurement());
256
257 // We do not apply any correction for pads or wire only space points
258 if (cluster->channelType() != sTgcIdHelper::sTgcChannelTypes::Strip) {
259 ATH_MSG_DEBUG("Calibrating an sTGC Pad or wire " << m_idHelperSvc->toString(cluster->identify()));
260 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
261 calibSP->setCovariance(cov);
262 break;
263 }
264
265 std::optional<double> posAlongTheStrip{std::nullopt};
266
267 // check if the space point is a strip/wire combination and take the position along the strip from the wire measurement
268 if(spacePoint->secondaryMeasurement()) {
269 const auto* secMeas = static_cast<const xAOD::sTgcMeasurement*>(spacePoint->secondaryMeasurement());
270 ATH_MSG_VERBOSE("Using secondary measurement "<< m_idHelperSvc->toString(secMeas->identify())<<" for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
271 // Extract scalar value - use 2D for pads (2 dimensions), 1D for wires (1 dimension)
272 if (secMeas->numDimensions() == 2) {
273 posAlongTheStrip = static_cast<double>(secMeas->localPosition<2>()[0]);
274 } else {
275 posAlongTheStrip = static_cast<double>(secMeas->localPosition<1>()[0]);
276 }
277 } else {
278 ATH_MSG_VERBOSE("No secondary measurement for sTGC strip cluster " << m_idHelperSvc->toString(cluster->identify()));
279 }
280
281 Amg::Vector3D globalPos{locToGlob * posInChamb};
282 Amg::Vector3D globalDir{locToGlob.linear() * dirInChamb};
283
284 const auto* stripClus = static_cast<const xAOD::sTgcStripCluster*>(cluster);
285 const auto [calibPos, calibCov] = calibratesTGC(ctx, *gctx, *stripClus, posAlongTheStrip, globalPos, globalDir);
286
287 ATH_MSG_DEBUG("Calibrated pos and cov" << calibPos << " " << calibCov);
288 cov[Acts::toUnderlying(AxisDefs::etaCov)] = calibCov;
289 Amg::Transform3D toChamberTrans{ locToGlob.inverse() * cluster->readoutElement()->localToGlobalTransform(*gctx, cluster->layerHash())};
290
291 // 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
292 Amg::Vector3D calibSpPosInLayer = toChamberTrans.inverse() * calibSpPos;
293 ATH_MSG_DEBUG("in layer before calibration" << Amg::toString(calibSpPosInLayer));
294 calibSpPosInLayer.x() = calibPos;
295 ATH_MSG_DEBUG("in layer after calibration" << Amg::toString(calibSpPosInLayer));
296 calibSpPos = toChamberTrans * calibSpPosInLayer;
297
298 calibSP = std::make_unique<CalibratedSpacePoint>(spacePoint, std::move(calibSpPos));
299 calibSP->setCovariance(cov);
300 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());
301 break;
302 }
303
304 default:
305 ATH_MSG_WARNING("Do not know how to calibrate "<<m_idHelperSvc->toString(spacePoint->identify()));
306 }
307 return calibSP;
308 }
309
311 const std::vector<const SpacePoint*>& spacePoints,
312 const Amg::Vector3D& posInChamb,
313 const Amg::Vector3D& dirInChamb,
314 const double timeDelay) const {
315 CalibSpacePointVec calibSpacePoints{};
316 calibSpacePoints.reserve(spacePoints.size());
317 for(const SpacePoint* spacePoint : spacePoints) {
318 CalibSpacePointPtr hit = calibrate(ctx, spacePoint, posInChamb, dirInChamb, timeDelay);
319 if (hit) {
320 calibSpacePoints.push_back(std::move(hit));
321 }
322 }
323 return calibSpacePoints;
324 }
325 double SpacePointCalibrator::driftVelocity(const Acts::CalibrationContext& ctx,
326 const CalibratedSpacePoint& spacePoint) const {
328
329 const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(*ctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
330 const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
331 return ActsTrk::velocityToActs(calibConsts->rtRelation->rt()->driftVelocity(driftTime.value_or(0.)));
332 }
333 return 0.;
334 }
335 double SpacePointCalibrator::driftAcceleration(const Acts::CalibrationContext& ctx,
336 const CalibratedSpacePoint& spacePoint) const {
338 const MuonCalib::MdtFullCalibData* calibConsts = m_mdtCalibrationTool->getCalibConstants(*ctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
339 const std::optional<double> driftTime = calibConsts->rtRelation->tr()->driftTime(spacePoint.driftRadius());
340 return ActsTrk::accelerationToActs(calibConsts->rtRelation->rt()->driftAcceleration(driftTime.value_or(0.)));
341 }
342 return 0.;
343 }
344
345 std::pair<double, double> SpacePointCalibrator::calibrateMM(const EventContext& ctx,
346 const ActsTrk::GeometryContext& gctx,
347 const xAOD::MMCluster& cluster,
348 const Amg::Vector3D& globalPos,
349 const Amg::Vector3D& globalDir) const {
350 std::vector<NSWCalib::CalibratedStrip> calibClus;
351 StatusCode sc = m_nswCalibTool->calibrateClus(ctx, gctx, cluster, globalPos, calibClus);
352 if(sc.isFailure()) {
353 ATH_MSG_WARNING("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
354 return std::make_pair(0., 0.);
355 }
356
357 Amg::Vector2D locPos{cluster.localPosition<1>()[0] * Amg::Vector2D::UnitX()};
358 Amg::Vector3D locDir = Muon::NswClustering::toLocal(cluster.readoutElement()->globalToLocalTransform(gctx, cluster.layerHash()), globalDir);
359
360 Amg::MatrixX calibCov{};
361 calibCov.resize(1,1);
362 calibCov(0,0) = cluster.localCovariance<1>()(0, 0);
363 ATH_MSG_DEBUG("old loc pos " << locPos[0] << " old cov" << calibCov(0,0) );
364
365 Muon::IMMClusterBuilderTool::RIO_Author rotAuthor = m_clusterBuilderToolMM->getCalibratedClusterPosition(ctx, calibClus, locDir ,locPos, calibCov);
366 if(rotAuthor == Muon::IMMClusterBuilderTool::RIO_Author::unKnownAuthor){
367 THROW_EXCEPTION("Failed to calibrate MM cluster "<<m_idHelperSvc->toString(cluster.identify()));
368 }
369 ATH_MSG_DEBUG("new loc pos " << locPos[0] << " new cov" << calibCov(0,0) );
370 return std::make_pair(locPos[0], calibCov(0,0));
371 }
372
373 std::pair<double, double> SpacePointCalibrator::calibratesTGC(const EventContext& /*ctx*/,
374 const ActsTrk::GeometryContext& gctx,
375 const xAOD::sTgcStripCluster& cluster,
376 std::optional<double> posAlongTheStrip,
377 const Amg::Vector3D& globalPos,
378 const Amg::Vector3D& /*globalDir*/) const{
379
380 // if the second coordiante was not provided by the wire, take it from the seed track position
381 if(!posAlongTheStrip) {
382 Amg::Vector3D extPosLocal = cluster.readoutElement()->globalToLocalTransform(gctx, cluster.layerHash()) * globalPos;
383 posAlongTheStrip = extPosLocal[1];
384 }
385
386 // For now just copying over the local position and covariance. Eventually this should apply corrections from B-Lines and as build geometry
387
388 return std::make_pair(cluster.localPosition<1>()[0], cluster.localCovariance<1>()(0,0));
389 }
390 void SpacePointCalibrator::calibrateCombinedPrd(const EventContext& ctx,
391 const ActsTrk::GeometryContext& gctx,
392 const xAOD::CombinedMuonStrip* combinedPrd,
393 ActsTrk::MutableTrackContainer::TrackStateProxy state) const {
394 const auto sl = ActsTrk::detail::xAODUncalibMeasCalibrator::pack(combinedPrd);
395 if (combinedPrd->type() == xAOD::UncalibMeasType::RpcStripType) {
396 if (m_useRpcTime) {
397 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
398 }
399 Amg::Vector2D cmbPos{combinedPrd->primaryStrip()->localPosition<1>()[0],
400 combinedPrd->secondaryStrip()->localPosition<1>()[0]};
401 AmgSymMatrix(2) cmbCov{AmgSymMatrix(2)::Identity()};
402 cmbCov (0, 0) = combinedPrd->primaryStrip()->localCovariance<1>()(0,0);
403 cmbCov (1, 1) = combinedPrd->secondaryStrip()->localCovariance<1>()(0,0);
405
406
407 } else if (combinedPrd->type() == xAOD::UncalibMeasType::TgcStripType) {
408 if (m_useTgcTime) {
409 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
410 }
411 const auto* wireMeas = static_cast<const xAOD::TgcStrip*>(combinedPrd->primaryStrip());
412 const auto* stripMeas = static_cast<const xAOD::TgcStrip*>(combinedPrd->secondaryStrip());
413
414 const auto& radialDesign = stripMeas->readoutElement()->stripLayout(stripMeas->layerHash());
415 const auto& wireDesign = wireMeas->readoutElement()->wireGangLayout(wireMeas->layerHash());
416
417 const double dirDots = radialDesign.stripDir(stripMeas->channelNumber()).dot(wireDesign.stripNormal());
419 AmgSymMatrix(2) stereoTrf{AmgSymMatrix(2)::Identity()};
420 const double invDist = 1. / (1. - Acts::square(dirDots));
421 stereoTrf(0, 0) = stereoTrf(1, 1) = invDist;
422 stereoTrf(0, 1) = stereoTrf(1, 0) = -dirDots * invDist;
423
424 Amg::Vector2D cmbPos{wireMeas->localPosition<1>()[0],
425 stripMeas->localPosition<1>()[0]};
426 AmgSymMatrix(2) cmbCov{AmgSymMatrix(2)::Identity()};
427 cmbCov (0, 0) = wireMeas->localCovariance<1>()(0,0);
428 cmbCov (1, 1) = stripMeas->localCovariance<1>()(0,0);
429
431 stereoTrf*cmbCov*stereoTrf.transpose(), sl, state);
432
433 } else if(combinedPrd->type() == xAOD::UncalibMeasType::sTgcStripType) {
434 if (m_usesTgcTime) {
435 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" Implement me");
436 }
437 Amg::Vector2D cmbPos {Amg::Vector2D::Zero()};
438 AmgSymMatrix(2) cmbCov{AmgSymMatrix(2)::Identity()};
439
440 // combined sTGC Space points can be strip/wire, strip/pad or pad/wire combinations.
441 const auto* primMeas = static_cast<const xAOD::sTgcMeasurement*>(combinedPrd->primaryStrip());
442 const auto* secMeas = static_cast<const xAOD::sTgcMeasurement*>(combinedPrd->secondaryStrip());
443 if(primMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Strip) {
444 const auto* primStripMeas = static_cast<const xAOD::sTgcStripCluster*>(primMeas);
446 const Acts::BoundTrackParameters trackPars{state.referenceSurface().getSharedPtr(),
447 state.parameters(), state.covariance(),
448 Acts::ParticleHypothesis::muon()};
449 std::pair<double, double> calibPosCov{calibratesTGC(ctx, gctx, *primStripMeas, cmbPos[1] , trackPars.position(gctx.context()), trackPars.direction())};
450 cmbPos[0] = calibPosCov.first;
451 cmbCov(0,0) = calibPosCov.second;
452
453 if(secMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire){
454 cmbPos[1] = secMeas->localPosition<1>()[0];
455 cmbCov(1,1) = secMeas->localCovariance<1>()(0,0);
456 } else if (secMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad){
457 cmbPos[1] = secMeas->localPosition<2>()[1];
458 cmbCov(1,1) = secMeas->localCovariance<2>()(1,1);
459 } else {
460 THROW_EXCEPTION("Unexpected secondary measurement type for combined sTGC space point "
461 <<m_idHelperSvc->toString(xAOD::identify(combinedPrd))
462 << "secondary measurement " << m_idHelperSvc->toString(xAOD::identify(secMeas)));
463 }
464 } else if (primMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad) {
465 cmbPos[0] = primMeas->localPosition<2>()[0];
466 cmbCov(0,0) = primMeas->localCovariance<2>()(0,0);
467
468 if (secMeas->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire){
469 cmbPos[1] = secMeas->localPosition<1>()[0];
470 cmbCov(1,1) = secMeas->localCovariance<1>()(0,0);
471 } else {
472 THROW_EXCEPTION("Unexpected secondary measurement type for combined sTGC space point "
473 << m_idHelperSvc->toString(xAOD::identify(combinedPrd))
474 << "secondary measurement " << m_idHelperSvc->toString(xAOD::identify(secMeas)));
475 }
476 } else {
477 THROW_EXCEPTION("Unexpected primary measurement type for combined sTGC space point "
478 <<m_idHelperSvc->toString(xAOD::identify(combinedPrd)));
479 }
480
482
483 } else {
484 THROW_EXCEPTION("Undefined uncalibrated measurement "
485 <<m_idHelperSvc->toString(xAOD::identify(combinedPrd)));
486 }
487 }
488 void SpacePointCalibrator::calibrateSourceLink(const Acts::GeometryContext& geoctx,
489 const Acts::CalibrationContext& cctx,
490 const Acts::SourceLink& link,
491 ActsTrk::MutableTrackContainer::TrackStateProxy trackState) const {
492
494 const Acts::BoundTrackParameters trackPars{trackState.referenceSurface().getSharedPtr(),
495 trackState.parameters(), trackState.covariance(),
496 Acts::ParticleHypothesis::muon()};
497
498
499 const auto* muonMeas = ActsTrk::detail::xAODUncalibMeasCalibrator::unpack(link);
500 const ActsTrk::GeometryContext* gctx = geoctx.get<const ActsTrk::GeometryContext*>();
501 const EventContext* ctx = cctx.get<const EventContext*>();
502 ATH_MSG_VERBOSE("Calibrate measurement "<<m_idHelperSvc->toString(xAOD::identify(muonMeas))
503 <<" @ surface "<<trackState.referenceSurface().geometryId());
505 if (muonMeas->numDimensions() == 0u) {
506 calibrateCombinedPrd(*ctx, *gctx, static_cast<const xAOD::CombinedMuonStrip*>(muonMeas),
507 trackState);
508 return;
509
510 }
511 const Amg::Vector3D trackPos{trackPars.position(geoctx)};
512 const Amg::Vector3D trackDir{trackPars.direction()};
513
514 switch (muonMeas->type()){
515 using enum xAOD::UncalibMeasType;
516 case MdtDriftCircleType: {
517 const auto* dc = static_cast<const xAOD::MdtDriftCircle*>(muonMeas);
518 MdtCalibInput calibInput{*dc, *gctx};
519 calibInput.setClosestApproach(trackPos);
520 //calibInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
521 calibInput.setTrackDirection(trackDir, true);
522 const double driftSign = m_MdtSignFromSegment ?
523 static_cast<double>(dec_trackSign(*dc)) :
524 Acts::copySign(1.,trackPars.parameters()[Acts::eBoundLoc0]);
525
527 if (ATH_LIKELY(muonMeas->numDimensions() == 1)) {
528 MdtCalibOutput calibOutput = m_mdtCalibrationTool->calibrate(*ctx, calibInput);
529 ATH_MSG_VERBOSE("Returned calibration object "<<calibOutput);
530 AmgVector(1) pos{AmgVector(1)::Zero()};
531 AmgSymMatrix(1) cov{AmgSymMatrix(1)::Identity()};
533 if (calibOutput.status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
534 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
535 <<std::endl<<calibInput<<std::endl<<calibOutput);
536 cov(Acts::eBoundLoc0,Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
537 } else {
538 pos[Acts::eBoundLoc0] = driftSign*calibOutput.driftRadius();
539 cov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.driftRadiusUncert(), 2);
540 }
542 }
544 else {
545 const auto* twinDC = static_cast<const xAOD::MdtTwinDriftCircle*>(muonMeas);
546 MdtCalibInput twinInput{twinDC->twinIdentify(), twinDC->twinAdc(), twinDC->twinTdc(), twinDC->readoutElement(), *gctx};
547 twinInput.setClosestApproach(trackPos);
548 twinInput.setTimeOfFlight(trackPars.parameters()[Acts::eBoundTime]);
549
550 MdtCalibTwinOutput calibOutput = m_mdtCalibrationTool->calibrateTwinTubes(*ctx,
551 std::move(calibInput),
552 std::move(twinInput));
553 Amg::Vector2D locPos{Amg::Vector2D::Zero()};
554 AmgSymMatrix(2) locCov{AmgSymMatrix(2)::Identity()};
555 if (calibOutput.primaryStatus() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime) {
556 ATH_MSG_DEBUG("Failed to create a valid hit from "<<m_idHelperSvc->toString(dc->identify())
557 <<std::endl<<calibOutput);
558 locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(dc->readoutElement()->innerTubeRadius(), 2);
559 locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(0.5* dc->readoutElement()->activeTubeLength(dc->measurementHash()), 2);
560 } else {
561 locCov(Acts::eBoundLoc0, Acts::eBoundLoc0) = std::pow(calibOutput.uncertPrimaryR(), 2);
562 locCov(Acts::eBoundLoc1, Acts::eBoundLoc1) = std::pow(calibOutput.sigmaZ(), 2);
563 locPos[Acts::eBoundLoc0] = driftSign*calibOutput.primaryDriftR();
564 locPos[Acts::eBoundLoc1] = calibOutput.locZ();
565 }
567 }
568 break;
569 } case RpcStripType: {
570 const auto* rpcClust = static_cast<const xAOD::RpcMeasurement*>(muonMeas);
572 if (ATH_LIKELY(rpcClust->numDimensions() == 1)) {
573
574 if (!m_useRpcTime) {
575 const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotNoTime
578 rpcClust->localPosition<1>(),
579 rpcClust->localCovariance<1>(), link, trackState);
580 } else {
581 AmgVector(2) measPars{AmgVector(2)::Zero()};
582 AmgSymMatrix(2) measCov{AmgSymMatrix(2)::Identity()};
583 measPars[0] = rpcClust->localPosition<1>()[0];
584 measCov(0,0) = rpcClust->localCovariance<1>()(0, 0);
585 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
586 measCov(1,1) = std::pow(m_rpcTimeResolution, 2);
587 const auto proj = rpcClust->measuresPhi() ? ProjectorType::e1DimRotWithTime
590 measPars, measCov, link, trackState);
591 }
592 }
594 else {
595 if (!m_useRpcTime) {
597 rpcClust->localPosition<2>(),
598 rpcClust->localCovariance<2>(), link, trackState);
599 } else {
600 AmgVector(3) measPars{AmgVector(3)::Zero()};
601 AmgSymMatrix(3) measCov{AmgSymMatrix(3)::Identity()};
602 measPars.block<2,1>(0,0) = xAOD::toEigen(rpcClust->localPosition<2>());
603 measCov.block<2,2>(0,0) = xAOD::toEigen(rpcClust->localCovariance<2>());
604 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
605 measCov(2,2) = std::pow(m_rpcTimeResolution, 2);
607 measPars, measCov, link, trackState);
608 }
609 }
610 break;
611 } case TgcStripType: {
612 const auto* tgcClust = static_cast<const xAOD::TgcStrip*>(muonMeas);
613 if (!m_useTgcTime) {
614 const auto proj = tgcClust->measuresPhi() ? ProjectorType::e1DimRotNoTime
617 tgcClust->localPosition<1>(),
618 tgcClust->localCovariance<1>(), link, trackState);
619 } else {
620 ATH_MSG_WARNING("Tgc time calibration to be implemented...");
621 }
622 break;
623 }
624 case MMClusterType: {
625 const auto* mmClust = static_cast<const xAOD::MMCluster*>(muonMeas);
626 std::pair<double, double> calibPosCov{calibrateMM(*ctx,* gctx, *mmClust, trackPos, trackDir)};
627 AmgVector(1) pos{AmgVector(1)(calibPosCov.first)};
628 AmgSymMatrix(1) cov{AmgSymMatrix(1)(calibPosCov.second)};
629
631 pos, cov, link, trackState);
632 break;
633 } case sTgcStripType: {
634 const auto* stgcClust = static_cast<const xAOD::sTgcMeasurement*>(muonMeas);
635
636 if(stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Wire) {
638 muonMeas->localPosition<1>(),
639 muonMeas->localCovariance<1>(), link, trackState);
640 } else if (stgcClust->channelType() == sTgcIdHelper::sTgcChannelTypes::Pad) {
642 stgcClust->localPosition<2>(),
643 stgcClust->localCovariance<2>(), link, trackState);
644 } else { // strips
645 const auto stgCluster = static_cast<const xAOD::sTgcStripCluster*>(muonMeas);
646 std::pair<double, double> calibPosCov{calibratesTGC(*ctx, *gctx, *stgCluster, std::nullopt, trackPos, trackDir)};
647 if(!m_usesTgcTime) {
648 AmgVector(1) pos{calibPosCov.first};
649 AmgSymMatrix(1) cov{calibPosCov.second};
651 pos, cov, link, trackState);
652 } else {
653 ATH_MSG_WARNING("sTGC time calibration to be implemented...");
654 AmgVector(2) pos{AmgVector(2)::Zero()};
655 AmgSymMatrix(2) cov{AmgSymMatrix(2)::Zero()};
656 pos[0] = calibPosCov.first;
657 pos[1] = stgCluster->time();
658 cov(0,0) = calibPosCov.second;
659 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<"Please fix me using the ActsInterops package");
660 cov(1,1) = std::pow(25 /*ns*/, 2);
661
663 pos, cov, link, trackState);
664 }
665 }
666 break;
667 } default: {
668 THROW_EXCEPTION("The parsed measurement is not a muon measurement. Please check.");
669 }
670 }
671 }
673 const auto [segPos, segLine] = makeLine(localSegmentPars(segment));
674 const Segment* detSeg = MuonR4::detailedSegment(segment);
675 for (const auto& meas : detSeg->measurements()) {
677 dec_trackSign(*meas->spacePoint()->primaryMeasurement()) =
678 SeedingAux::strawSign(segPos, segLine, *meas);
679 }
680 }
681 }
682
683 double SpacePointCalibrator::driftRadius(const Acts::CalibrationContext& cctx,
684 const CalibratedSpacePoint& spacePoint,
685 const double timeDelay) const {
687 const MuonCalib::MdtFullCalibData* calibConsts =
688 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
689 return calibConsts->rtRelation->rt()->radius(ActsTrk::timeToAthena(spacePoint.time() - timeDelay));
690 }
691 return 0.;
692 }
693
694 double SpacePointCalibrator::driftVelocity(const Acts::CalibrationContext& cctx,
695 const CalibratedSpacePoint& spacePoint,
696 const double timeDelay) const {
698 const MuonCalib::MdtFullCalibData* calibConsts =
699 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
700 return ActsTrk::velocityToActs(calibConsts->rtRelation->rt()->driftVelocity(ActsTrk::timeToAthena(spacePoint.time() - timeDelay)));
701 }
702 return 0.;
703 }
704 double SpacePointCalibrator::driftAcceleration(const Acts::CalibrationContext& cctx,
705 const CalibratedSpacePoint& spacePoint,
706 const double timeDelay) const {
708 const MuonCalib::MdtFullCalibData* calibConsts =
709 m_mdtCalibrationTool->getCalibConstants(*cctx.get<const EventContext*>(), spacePoint.spacePoint()->identify());
710 return ActsTrk::accelerationToActs(calibConsts->rtRelation->rt()->driftAcceleration(ActsTrk::timeToAthena(spacePoint.time() - timeDelay)));
711 }
712 return 0.;
713 }
714
715}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define ATH_LIKELY(x)
#define AmgSymMatrix(dim)
#define AmgVector(rows)
static Double_t sp
static Double_t sc
Acts::GeometryContext context() const
@ 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, TrackState_t< trajectory_t > &trackState) const
Copy the local position & covariance into the Acts track state proxy.
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
static Acts::SourceLink pack(const xAOD::UncalibratedMeasurement *meas)
Helper method to pack an uncalibrated measurement to an Acts source link.
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
const Amg::Transform3D & localToGlobalTransform(const ActsTrk::GeometryContext &ctx) const
Returns the transformation from the local coordinate system of the readout element into the global AT...
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 &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.
std::unique_ptr< 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.
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
access to the ACTS geometry context
Gaudi::Property< bool > m_usesTgcTime
double driftAcceleration(const Acts::CalibrationContext &ctx, const CalibratedSpacePoint &spacePoint) const override final
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
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
unsigned dimension() const
Is the space point a 1D or combined 2D measurement.
const xAOD::UncalibratedMeasurement * secondaryMeasurement() const
std::array< double, 3 > Cov_t
Abrivation of the covariance type.
const Identifier & identify() const
: Identifier of the primary measurement
const Cov_t & covariance() const
Returns the covariance array.
const xAOD::UncalibratedMeasurement * primaryMeasurement() const
MMClusterOnTrack::Author RIO_Author
Refinement of the cluster position after the cluster calibration loop is ran with a complete external...
Helper class to provide type-safe access to aux data.
Definition Decorator.h:59
const xAOD::UncalibratedMeasurement * secondaryStrip() const
Returns the secondary associated measurement.
const xAOD::UncalibratedMeasurement * 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 Identifier & identify() const
: Returns the Athena identifier of the micro mega cluster It's constructed from the measurementHash &...
IdentifierHash layerHash() const
Returns the hash of the associated layer (Needed for surface retrieval)
const MuonGMR4::MmReadoutElement * readoutElement() const
Retrieve the associated MmReadoutElement.
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
Returns the hash of the associated gasGap layer.
const MuonGMR4::sTgcReadoutElement * readoutElement() const
Retrieve the associated sTgcReadoutElement.
constexpr double timeToAthena(const double actsT)
Converts a time unit from Acts to Athena units.
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 timeToActs(const double 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...
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
MMCluster_v1 MMCluster
sTgcMeasurement_v1 sTgcMeasurement
MuonSegment_v1 MuonSegment
Reference the current persistent version:
CombinedMuonStrip_v1 CombinedMuonStrip
class which holds the full set of calibration constants for a given tube
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10