ATLAS Offline Software
Loading...
Searching...
No Matches
ActsToTrkConverterTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7// Trk
10#include "TrkSurfaces/Surface.h"
11#include "TrkTrack/Track.h"
12
13// ATHENA
14#include "GaudiKernel/IInterface.h"
19#include "TrkSurfaces/Surface.h"
21
24
30// PACKAGE
34
39
40// ACTS
41#include "Acts/Surfaces/StrawSurface.hpp"
42#include "Acts/Surfaces/PerigeeSurface.hpp"
43#include "Acts/Surfaces/PlaneSurface.hpp"
44
45#include "Acts/Surfaces/RectangleBounds.hpp"
46#include "Acts/Surfaces/TrapezoidBounds.hpp"
47#include "Acts/Surfaces/CylinderBounds.hpp"
48#include "Acts/Surfaces/DiscBounds.hpp"
49#include "Acts/Surfaces/LineBounds.hpp"
50#include "Acts/Surfaces/RadialBounds.hpp"
51#include "Acts/Surfaces/DiamondBounds.hpp"
52
53#include "Acts/Definitions/Units.hpp"
54#include "Acts/EventData/BoundTrackParameters.hpp"
55#include "Acts/EventData/VectorTrackContainer.hpp"
56#include "Acts/EventData/TransformationHelpers.hpp"
57#include "Acts/Geometry/TrackingGeometry.hpp"
58#include "Acts/Propagator/detail/JacobianEngine.hpp"
59#include "Acts/Surfaces/detail/PlanarHelper.hpp"
60
62#include "Acts/EventData/TrackStatePropMask.hpp"
63#include "Acts/EventData/SourceLink.hpp"
64
72
73// STL
74#include <cmath>
75#include <iostream>
76#include <memory>
77#include <random>
78#include <format>
79
80namespace ActsTrk {
81
82using namespace Acts::UnitLiterals;
83
84std::unique_ptr<Trk::TrackParameters> rotateParams(const Trk::TrackParameters& inPars,
85 const Trk::Surface& target) {
86 const Amg::Vector3D& pos = inPars.position();
87 const Amg::Vector3D& mom = inPars.momentum();
88 using namespace Acts::PlanarHelper;
89
90 const auto isect = intersectPlane(pos, mom.normalized(), target.normal(), target.center());
91 std::optional<AmgSymMatrix(5)> cov{};
92 if (inPars.covariance()) {
93 AmgSymMatrix(5) rot {AmgSymMatrix(5)::Identity()};
94 rot.block<2,2>(0,0) = AmgSymMatrix(2){Eigen::Rotation2D{90._degree}};
95 cov = rot.transpose() * (*inPars.covariance()) * rot;
96 }
97 return target.createUniqueTrackParameters(isect.position(), mom,
98 std::copysign(1., inPars.parameters()[Trk::qOverP]),
99 std::move(cov));
100}
101
102
104 ATH_MSG_DEBUG("Initializing ACTS to ATLAS converter tool");
105
106 ATH_CHECK(m_trkSummaryTool.retrieve());
107 ATH_CHECK(m_ROTcreator.retrieve());
108 ATH_CHECK(m_geometryConvTool.retrieve());
111 ATH_CHECK(m_keyMdt.initialize(SG::AllowEmpty));
112 ATH_CHECK(m_keyRpc.initialize(SG::AllowEmpty));
113 ATH_CHECK(m_keyTgc.initialize(SG::AllowEmpty));
114 ATH_CHECK(m_keyMm.initialize(SG::AllowEmpty));
116 if (!m_keyMdt.empty() || !m_keyRpc.empty() || !m_keyTgc.empty() ||
117 !m_keyMm.empty() || !m_keyStgc.empty()) {
118 ATH_CHECK(m_idHelperSvc.retrieve());
119 }
120 ATH_CHECK(m_compRotCreator.retrieve(EnableTool{!m_keyRpc.empty() || !m_keyTgc.empty()}));
121 return StatusCode::SUCCESS;
122}
123
124std::vector<Acts::SourceLink>
126 std::vector<Acts::SourceLink> sourceLinks{};
127 sourceLinks.reserve(track.measurementsOnTrack()->size() +
128 track.outliersOnTrack()->size());
129 detail::MeasurementCalibratorBase::pack(track.measurementsOnTrack()->stdcont(), sourceLinks);
130 detail::MeasurementCalibratorBase::pack(track.outliersOnTrack()->stdcont(), sourceLinks);
131 return sourceLinks;
132}
134 const TrackCollection& trackColl,
135 ActsTrk::MutableTrackContainer& outTrackcoll) const {
136 const Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
137 ATH_MSG_VERBOSE("Calling trkTrackCollectionToActsTrackContainer with "
138 << trackColl.size() << " tracks.");
139 unsigned int trkCount = 0;
140 std::vector<Identifier> failedIds; // Keep track of Identifiers of failed conversions
141 for (const Trk::Track* trk : trackColl) {
142 // Do conversions!
143 const Trk::TrackStates *trackStates = trk->trackStateOnSurfaces();
144
145 auto actsTrack = outTrackcoll.getTrack(outTrackcoll.addTrack());
146 auto& trackStateContainer = outTrackcoll.trackStateContainer();
147
148 ATH_MSG_VERBOSE("Track "<<trkCount++<<" has " << trackStates->size()
149 << " track states on surfaces.");
150 // basic quantities copy
151 actsTrack.chi2() = trk->fitQuality()->chiSquared();
152 actsTrack.nDoF() = trk->fitQuality()->numberDoF();
153
154 // loop over track states on surfaces, convert and add them to the ACTS
155 // container
156 bool first_tsos = true; // We need to handle the first one differently
157 int measurementsCount = 0;
158 for (const Trk::TrackStateOnSurface* tsos : *trackStates) {
159
160 // Setup the mask
161 Acts::TrackStatePropMask mask = Acts::TrackStatePropMask::None;
162 if (tsos->measurementOnTrack()) {
163 mask |= Acts::TrackStatePropMask::Calibrated;
164 }
165 if (tsos->trackParameters()) {
166 mask |= Acts::TrackStatePropMask::Smoothed;
167 }
168
169 // Setup the index of the trackstate
170 auto index = Acts::kTrackIndexInvalid;
171 if (!first_tsos) {
172 index = actsTrack.tipIndex();
173 }
174 auto actsTSOS = trackStateContainer.getTrackState(trackStateContainer.addTrackState(mask, index));
175 ATH_MSG_VERBOSE("TipIndex: " << actsTrack.tipIndex() << " TSOS index within trajectory: "<< actsTSOS.index());
176 actsTrack.tipIndex() = actsTSOS.index();
177
178 if (tsos->trackParameters()) {
179 // TODO This try/catch is temporary and should be removed once the sTGC problem is fixed.
180 try {
181 ATH_MSG_VERBOSE("Converting track parameters.");
182 // TODO - work out whether we should set predicted, filtered, smoothed
183 const Acts::BoundTrackParameters parameters = m_geometryConvTool->convertTrackParametersToActs(ctx, *tsos->trackParameters());
184 ATH_MSG_VERBOSE("Track parameters: " << parameters.parameters());
185 // Sanity check on positions
186 if (!actsTrackParameterPositionCheck(parameters, *(tsos->trackParameters()), tgContext)) {
187 failedIds.push_back(tsos->trackParameters()->associatedSurface().associatedDetectorElementIdentifier());
188 }
189
190 if (first_tsos) {
191 // This is the first track state, so we need to set the track
192 // parameters
193 actsTrack.parameters() = parameters.parameters();
194 actsTrack.covariance() = *parameters.covariance();
195 actsTrack.setReferenceSurface(parameters.referenceSurface().getSharedPtr());
196 first_tsos = false;
197 } else {
198 actsTSOS.setReferenceSurface(parameters.referenceSurface().getSharedPtr());
199 // Since we're converting final Trk::Tracks, let's assume they're smoothed
200 actsTSOS.smoothed() = parameters.parameters();
201 actsTSOS.smoothedCovariance() = *parameters.covariance();
202 // Not yet implemented in MultiTrajectory.icc
203 // actsTSOS.typeFlags().setHasParameters();
204 if (!(actsTSOS.hasSmoothed() && actsTSOS.hasReferenceSurface())) {
205 ATH_MSG_WARNING("TrackState does not have smoothed state ["
206 << actsTSOS.hasSmoothed()
207 << "] or reference surface ["
208 << actsTSOS.hasReferenceSurface() << "].");
209 } else {
210 ATH_MSG_VERBOSE("TrackState has smoothed state and reference surface.");
211 }
212 }
213 } catch (const std::exception& e){
214 ATH_MSG_ERROR("Unable to convert TrackParameter with exception ["<<e.what()<<"]. Will be missing from ACTS track."
215 <<(*tsos->trackParameters()));
216 }
217 }
218 if (tsos->measurementOnTrack()) {
219 auto &measurement = *(tsos->measurementOnTrack());
220 actsTSOS.typeFlags().setIsMeasurement();
221
222 measurementsCount++;
223 // const Acts::Surface &surface =
224 // convertSurfaceToActs(measurement.associatedSurface());
225 // Commented for the moment because Surfaces not yet implemented in
226 // MultiTrajectory.icc
227
228 int dim = measurement.localParameters().dimension();
229 actsTSOS.allocateCalibrated(dim);
230 if (dim == 1) {
231 actsTSOS.calibrated<1>() = measurement.localParameters();
232 actsTSOS.calibratedCovariance<1>() = measurement.localCovariance();
233 } else if (dim == 2) {
234 actsTSOS.calibrated<2>() = measurement.localParameters();
235 actsTSOS.calibratedCovariance<2>() = measurement.localCovariance();
236 } else {
237 throw std::domain_error("Cannot handle measurement dim>2");
238 }
239 actsTSOS.setUncalibratedSourceLink(detail::TrkMeasurementCalibrator::pack(tsos->measurementOnTrack()));
240
241 } // end if measurement
242 } // end loop over track states
243 actsTrack.nMeasurements() = measurementsCount;
244 ATH_MSG_VERBOSE("TrackProxy has " << actsTrack.nTrackStates()
245 << " track states on surfaces.");
246 }
247 ATH_MSG_VERBOSE("Finished converting " << trackColl.size() << " tracks.");
248
249 if (!failedIds.empty()){
250 ATH_MSG_WARNING("Failed to convert "<<failedIds.size()<<" track parameters.");
251 for (auto id : failedIds){
252 ATH_MSG_WARNING("-> Failed for Identifier "<<m_idHelperSvc->toString(id));
253 }
254 }
255 ATH_MSG_VERBOSE("ACTS Track container has " << outTrackcoll.size() << " tracks.");
256}
258 const Acts::BoundTrackParameters &parameters,
259 const Trk::TrackParameters &trkparameters,
260 const Acts::GeometryContext &gctx) const {
261 auto actsPos = parameters.position(gctx);
262
263 if ( (actsPos - trkparameters.position()).mag() > 0.1) {
264 ATH_MSG_WARNING("Parameter position mismatch. Acts \n"
265 << actsPos << " vs Trk \n"
266 << trkparameters.position());
267 ATH_MSG_WARNING("Acts surface:");
268 ATH_MSG_WARNING(parameters.referenceSurface().toString(gctx));
269 ATH_MSG_WARNING("Trk surface:");
270 ATH_MSG_WARNING(trkparameters.associatedSurface());
271 return false;
272 }
273 return true;
274}
275
276std::unique_ptr<Trk::Track> ActsToTrkConverterTool::convertFitResult(const EventContext& ctx,
277 TrackFitResult_t& fitResult,
278 const Trk::TrackInfo::TrackFitter fitAuthor) const {
279
280 if (not fitResult.ok()) {
281 ATH_MSG_VERBOSE("Fit did not converge");
282 return nullptr;
283 }
284 return convertActsTrack(ctx, fitResult.value(), fitAuthor);
285}
286
287template <typename Proxy_t>
288 std::unique_ptr<Trk::Track>
290 const Proxy_t& acts_track,
291 const Trk::TrackInfo::TrackFitter fitAuthor) const{
292
293
294 const Acts::CalibrationContext cctx{getCalibrationContext(ctx)};
295 const Acts::GeometryContext tgContext{m_trackingGeometryTool->getGeometryContext(ctx).context()};
296
297 auto finalTrajectory = std::make_unique<Trk::TrackStates>();
298 int nDoF{0};
299
300 double chi2{0};
301
302 // Loop over all the output state to create track state
303 acts_track.container().trackStateContainer().visitBackwards(acts_track.tipIndex(),
304 [&] (const auto &state) -> void {
305 if (!state.hasReferenceSurface()) {
306 return;
307 }
308 // First only consider state with an associated detector element
309 if (!m_convertMaterial && !state.referenceSurface().isSensitive()) {
310 return;
311 }
312
313 if (const auto* associatedDetEl = dynamic_cast<const IDetectorElementBase*>(
314 state.referenceSurface().surfacePlacement());
315 associatedDetEl != nullptr) {
316 ATH_MSG_VERBOSE("Associated det: "<<associatedDetEl->detectorType());
317 }
318
319 auto flag = state.typeFlags();
320 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - "<<", hole: "<<flag.isHole()
321 <<", outlier: "<<flag.isOutlier()<<", measurement: "<<flag.isMeasurement()<<"/"
322 <<flag.hasMeasurement()<<", "<<m_convertOutliers<<", "<<m_convertHoles
323 <<", has SL: "<<state.hasUncalibratedSourceLink());
324 // We need to determine the type of state
325 TrkTSOSMask typePattern;
326 std::unique_ptr<Trk::TrackParameters> trkPars = m_geometryConvTool->convertTrackParametersToTrk(ctx,
327 acts_track.createParametersFromState(state));
328 std::unique_ptr<Trk::MeasurementBase> trkMeasurement{};
329
330
331 // State is a hole (no associated measurement), use predicted parameters
332 if (flag.isHole()) {
333 if (!m_convertHoles) { return; }
334 typePattern.set(Trk::TrackStateOnSurface::Hole);
335 } if (flag.isOutlier()) {
336 if (!m_convertOutliers) { return; }
337 typePattern.set(Trk::TrackStateOnSurface::Outlier);
338 }
339 if (flag.hasMeasurement()) {
340 typePattern.set(Trk::TrackStateOnSurface::Measurement);
341 nDoF = state.calibratedSize();
342 chi2 = state.chi2();
343 const auto slType = detail::MeasurementCalibratorBase::getType(state.getUncalibratedSourceLink());
344 switch (slType) {
345 using enum detail::SourceLinkType;
346 case TrkMeasurement:
347 trkMeasurement = m_measCalib.unpack(state.getUncalibratedSourceLink())->uniqueClone();
348 break;
349 case TrkPrepRawData:
350 trkMeasurement = m_prdCalib.createROT(tgContext, cctx, state.getUncalibratedSourceLink(), state);
351 break;
352 case xAODUnCalibMeas:
353 appendMeasTSOS(ctx, detail::xAODUncalibMeasCalibrator::unpack(state.getUncalibratedSourceLink()),
354 typePattern, Trk::FitQualityOnSurface{chi2, nDoF},
355 std::move(trkPars), *finalTrajectory);
356 return;
357 default:
358 THROW_EXCEPTION("Invalid "<<slType<<" type parsed.");
359 }
360 }
361 auto perState = std::make_unique<Trk::TrackStateOnSurface>(Trk::FitQualityOnSurface{chi2, nDoF},
362 std::move(trkMeasurement),
363 std::move(trkPars), nullptr, typePattern);
364 // If a state was succesfully created add it to the trajectory
365 ATH_MSG_VERBOSE("State succesfully created, adding it to the trajectory");
366 finalTrajectory->insert(finalTrajectory->begin(), std::move(perState));
367 });
368 // Convert the perigee state and add it to the trajectory
369 std::unique_ptr<Trk::TrackParameters> per = m_geometryConvTool->convertTrackParametersToTrk(ctx, acts_track.createParametersAtReference());
370 TrkTSOSMask typePattern;
371 typePattern.set(Trk::TrackStateOnSurface::Perigee);
372 finalTrajectory->insert(finalTrajectory->begin(),
373 std::make_unique<Trk::TrackStateOnSurface>(nullptr, std::move(per), nullptr, typePattern));
374 // Create the track using the states
375 Trk::TrackInfo newInfo{fitAuthor, ParticleHypothesis::convertTrk(acts_track.particleHypothesis())};
376 auto newtrack = std::make_unique<Trk::Track>(newInfo, std::move(finalTrajectory), nullptr);
377 constexpr bool suppressHoleSearch = false;
378 m_trkSummaryTool->updateTrackSummary(ctx, *newtrack, suppressHoleSearch);
379 ATH_MSG_VERBOSE("Created new track "<<(*newtrack->trackSummary()));
380 return newtrack;
381 }
382
383 std::unique_ptr<TrackCollection>
385 const ActsTrk::TrackContainer& trackCont) const {
386 auto outColl = std::make_unique<TrackCollection>();
387 for (const ActsTrk::TrackContainer::ConstTrackProxy& trk : trackCont) {
388 outColl->push_back(convertActsTrack(ctx, trk, m_fitAuthor));
389 }
390 return outColl;
391 }
392 void ActsToTrkConverterTool::appendMeasTSOS(const EventContext& ctx,
394 const TrkTSOSMask typePattern,
395 Trk::FitQualityOnSurface&& quality,
396 std::unique_ptr<Trk::TrackParameters> trkPars,
397 Trk::TrackStates& states) const {
398 std::unique_ptr<Trk::MeasurementBase> rot{};
399 switch (meas->type()) {
400 using enum xAOD::UncalibMeasType;
401 case PixelClusterType: {
402 static const SG::AuxElement::ConstAccessor<ElementLink<InDet::PixelClusterCollection>> acc_prdLink("pixelClusterLink");
403 if (acc_prdLink.isAvailable(*meas) && acc_prdLink(*meas).isValid()) {
404 rot.reset(m_ROTcreator->correct(**acc_prdLink(*meas), *trkPars, ctx));
405 } else {
406 ATH_MSG_WARNING(__func__<<" () "<<__LINE__<<" - The pixel xAOD -> prd accessor is invalid");
407 }
408 break;
409 } case StripClusterType: {
410 static const SG::AuxElement::ConstAccessor<ElementLink<InDet::SCT_ClusterCollection>> acc_prdLink("sctClusterLink");
411 if (acc_prdLink.isAvailable(*meas) && acc_prdLink(*meas).isValid()) {
412 rot.reset(m_ROTcreator->correct(**acc_prdLink(*meas), *trkPars, ctx));
413 } else {
414 ATH_MSG_WARNING(__func__<<" () "<<__LINE__<<" - The strip xAOD -> prd accessor is invalid");
415 }
416 break;
417 } case MdtDriftCircleType:
418 case MMClusterType: {
419 const Identifier& id = static_cast<const xAOD::MuonMeasurement*>(meas)->identify();
420 const IdentifierHash modHash = m_idHelperSvc->moduleHash(id);
421 const auto* prd = meas->type() == MdtDriftCircleType ? fetchPrd(ctx, m_keyMdt, id, modHash)
422 : fetchPrd(ctx, m_keyMm, id, modHash);
423 assert(prd != nullptr);
424 rot.reset(m_ROTcreator->correct(*prd, *trkPars, ctx));
425 break;
426 } case TgcStripType:
427 case RpcStripType:
428 case sTgcStripType: {
429 const Identifier& id = static_cast<const xAOD::MuonMeasurement*>(meas)->identify();
430 const IdentifierHash modHash = m_idHelperSvc->moduleHash(id);
432 const Trk::PrepRawData* prd{nullptr}, *prd1{nullptr};
433
434 if (meas->numDimensions() == 0) {
435 const auto* muonMeas = static_cast<const xAOD::CombinedMuonStrip*>(meas);
436 if (meas->type() == RpcStripType) {
437 prd = fetchPrd(ctx, m_keyRpc, id, modHash);
438 prd1 = fetchPrd(ctx, m_keyRpc, muonMeas->secondaryStrip()->identify(), modHash);
439 } else if (meas->type() == TgcStripType) {
440 prd = fetchPrd(ctx, m_keyTgc, id, modHash);
441 prd1 = fetchPrd(ctx, m_keyTgc, muonMeas->secondaryStrip()->identify(), modHash);
442 } else {
443 prd = fetchPrd(ctx, m_keyStgc, id, modHash);
444 prd1 = fetchPrd(ctx, m_keyStgc, muonMeas->secondaryStrip()->identify(), modHash);
445 }
446 assert(prd != nullptr);
447 assert(prd1 != nullptr);
448
450 const Trk::Surface& phiSurface = prd1->detectorElement()->surface(prd1->identify());
451 auto phiPars = rotateParams(*trkPars, phiSurface);
452 assert(phiPars != nullptr);
453 std::unique_ptr<Trk::MeasurementBase> phiRot{};
454 if (meas->type() != sTgcStripType) {
455 phiRot = m_compRotCreator->createBroadCluster(std::list{prd1}, 1.);
456 rot = m_compRotCreator->createBroadCluster(std::list{prd}, 1.);
457 } else {
458 phiRot.reset(m_ROTcreator->correct(*prd1, *phiPars, ctx));
459 rot.reset(m_ROTcreator->correct(*prd, *trkPars, ctx));
460 }
461 assert(phiRot != nullptr);
462 states.insert(states.begin(),
463 std::make_unique<Trk::TrackStateOnSurface>(quality,
464 std::move(phiRot),
465 std::move(phiPars), nullptr, typePattern));
466 } else {
467 const auto* prd = meas->type() == RpcStripType ? fetchPrd(ctx, m_keyRpc, id, modHash)
468 :
469 meas->type() == TgcStripType ? fetchPrd(ctx, m_keyTgc, id, modHash)
470 : fetchPrd(ctx, m_keyStgc, id, modHash);
471 assert(prd != nullptr);
472 // Track parameter representation needs to change towards a phi surface
473 if (m_idHelperSvc->measuresPhi(id)) {
474 ATH_MSG_VERBOSE("Convert the track parameters "<<m_idHelperSvc->toString(id)
475 <<", "<<m_idHelperSvc->toStringDetEl(prd->detectorElement()->identify()));
476 const Trk::Surface& target = prd->detectorElement()->surface(id);
477 trkPars = rotateParams(*trkPars, target);
478 }
480 rot.reset(m_ROTcreator->correct(*prd, *trkPars, ctx));
481 }
482 break;
483 } default:
484 ATH_MSG_WARNING("Measurement type "<<meas->type()<<" is not implemented");
485 return;
486 }
487 assert(rot != nullptr);
488 assert(trkPars != nullptr);
489 states.insert(states.begin(),
490 std::make_unique<Trk::TrackStateOnSurface>(std::move(quality), std::move(rot),
491 std::move(trkPars), nullptr, typePattern));
492
493 }
494 template <typename PrdType_t>
497 const Identifier& prdId,
498 const IdentifierHash& hash) const{
499 const PrdType_t* container{nullptr};
500 if (key.empty() || !SG::get(container, key, ctx).isSuccess()) {
501 THROW_EXCEPTION("Failed to retrieve container "<<key.fullKey());
502 }
503 const auto* coll = container->indexFindPtr(hash);
504 if (coll == nullptr){
505 ATH_MSG_WARNING("fetchPrd() - Failed to find a valid collection for "<<prdId.getString()<<", key: "<<key.fullKey());
506 return nullptr;
507 }
508 for (const Trk::PrepRawData* prd : *coll) {
509 if (prd->identify() == prdId) {
510 return prd;
511 }
512 }
513 ATH_MSG_WARNING("fetchPrd() - Prep data object "<<prdId.getString()<<" is not in "<<key.fullKey());
514 return nullptr;
515 }
516} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define AmgSymMatrix(dim)
if(pathvar)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
std::bitset< Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes > TrkTSOSMask
Abrivate the state mask for the TSOS.
bool actsTrackParameterPositionCheck(const Acts::BoundTrackParameters &actsParameter, const Trk::TrackParameters &tsos, const Acts::GeometryContext &gctx) const
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Tools needed to create Trk::Tracks from the ACts fit result.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual std::unique_ptr< Trk::Track > convertFitResult(const EventContext &ctx, TrackFitResult_t &fitResult, const Trk::TrackInfo::TrackFitter fitAuthor) const override final
std::unique_ptr< Trk::Track > convertActsTrack(const EventContext &ctx, const Proxy_t &track, const Trk::TrackInfo::TrackFitter fitAuthor) const
Helper function to convert a Acts TrackPoxy (which may be const or not) into a Trk::Track.
Gaudi::Property< bool > m_convertOutliers
Flag to convert the outlier states.
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
virtual StatusCode initialize() override
PublicToolHandle< IGeometryRealmConvTool > m_geometryConvTool
PublicToolHandle< ITrackingGeometryTool > m_trackingGeometryTool
ToolHandle< Muon::IMuonCompetingClustersOnTrackCreator > m_compRotCreator
detail::TrkPrepRawDataCalibrator m_prdCalib
virtual std::unique_ptr< TrackCollection > convertActsToTrkContainer(const EventContext &ctx, const ActsTrk::TrackContainer &trackCont) const override final
Converts the Acts track container to a Trk::Track collection.
Gaudi::Property< bool > m_convertHoles
Flag to convert the hole states.
ToolHandle< Trk::IRIO_OnTrackCreator > m_ROTcreator
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_keyMm
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_keyMdt
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
const Trk::PrepRawData * fetchPrd(const EventContext &ctx, const SG::ReadHandleKey< PrdType_t > &key, const Identifier &prdId, const IdentifierHash &hash) const
Searches a Prd object from a collection according to the measurement's Identifier and the container's...
void appendMeasTSOS(const EventContext &ctx, const xAOD::UncalibratedMeasurement *meas, const TrkTSOSMask typePattern, Trk::FitQualityOnSurface &&quality, std::unique_ptr< Trk::TrackParameters > trkPars, Trk::TrackStates &states) const
Append the translated TSOS at the beginning of the states container corresponding to the parsed measu...
Trk::TrackInfo::TrackFitter m_fitAuthor
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_keyStgc
virtual std::vector< Acts::SourceLink > trkTrackToSourceLinks(const Trk::Track &track) const override
Converts the Trk measurement track states into a vector of Acts::Source links.
Gaudi::Property< bool > m_convertMaterial
Flag to convert the material states (non sensitive) Acts -> Trk conversion.
virtual void convertTrkToActsContainer(const EventContext &ctx, const TrackCollection &trackColl, ActsTrk::MutableTrackContainer &outTrackcoll) const override
Convert the passed Trk::TrackCollection into an Acts Track object and appends the result to the passe...
base class interface providing the bare minimal interface extension.
static Acts::SourceLink pack(const Ptr_t &measurement)
Pack the measurement type pointer to an Acts::SourceLink including the intermediate conversion into a...
Class to calibrate the Acts track states with uncalibrated Trk::PrepRaw data objects.
size_type size() const noexcept
Returns the number of elements in the collection.
This is a "hash" representation of an Identifier.
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Property holding a SG store/key/clid from which a ReadHandle is made.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
Abstract Base Class for tracking surfaces.
Definition Surface.h:79
Contains information about the 'fitter' of this track.
TrackFitter
enums to identify who created this track and what propertis does it have.
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
virtual Identifier identify() const =0
Identifier.
virtual const Surface & surface() const =0
Return surface associated with this detector element.
virtual unsigned int numDimensions() const =0
Returns the number of dimensions of the measurement.
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
double chi2(TH1 *h0, TH1 *h1)
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
Acts::CalibrationContext getCalibrationContext(const EventContext &ctx)
The Acts::Calibration context is piped through the Acts fitters to (re)calibrate the Acts::SourceLink...
std::unique_ptr< Trk::TrackParameters > rotateParams(const Trk::TrackParameters &inPars, const Trk::Surface &target)
Eigen::Matrix< double, 3, 1 > Vector3D
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
DataVector< const Trk::TrackStateOnSurface > TrackStates
@ qOverP
perigee
Definition ParamDefs.h:67
ParametersBase< TrackParametersDim, Charged > TrackParameters
Definition index.py:1
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
MuonMeasurement_v1 MuonMeasurement
UncalibMeasType
Define the type of the uncalibrated measurement.
CombinedMuonStrip_v1 CombinedMuonStrip
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10