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 "TrkTrack/Track.h"
11
12// ATHENA
16#include "TrkSurfaces/Surface.h"
17
20
23// PACKAGE
27
30
31// ACTS
32#include "Acts/Definitions/Units.hpp"
33#include "Acts/EventData/BoundTrackParameters.hpp"
34#include "Acts/EventData/VectorTrackContainer.hpp"
35#include "Acts/EventData/TransformationHelpers.hpp"
36#include "Acts/Geometry/TrackingGeometry.hpp"
37#include "Acts/Surfaces/detail/PlanarHelper.hpp"
38
40#include "Acts/EventData/TrackStatePropMask.hpp"
41#include "Acts/EventData/SourceLink.hpp"
42
44
45namespace ActsTrk {
46
47using namespace Acts::UnitLiterals;
48
49std::unique_ptr<Trk::TrackParameters> rotateParams(const Trk::TrackParameters& inPars,
50 const Trk::Surface& target) {
51 const Amg::Vector3D& pos = inPars.position();
52 const Amg::Vector3D& mom = inPars.momentum();
53 using namespace Acts::PlanarHelper;
54
55 const auto isect = intersectPlane(pos, mom.normalized(), target.normal(), target.center());
56 std::optional<AmgSymMatrix(5)> cov{};
57 if (inPars.covariance()) {
58 AmgSymMatrix(5) rot {AmgSymMatrix(5)::Identity()};
59 rot.block<2,2>(0,0) = AmgSymMatrix(2){Eigen::Rotation2D{90._degree}};
60 cov = rot.transpose() * (*inPars.covariance()) * rot;
61 }
62 return target.createUniqueTrackParameters(isect.position(), mom,
63 std::copysign(1., inPars.parameters()[Trk::qOverP]),
64 std::move(cov));
65}
66
67
69 ATH_MSG_DEBUG("Initializing ACTS to ATLAS converter tool");
70
71 ATH_CHECK(m_trkSummaryTool.retrieve());
72 ATH_CHECK(m_ROTcreator.retrieve());
73 ATH_CHECK(m_geometryConvTool.retrieve());
74 ATH_CHECK(m_ctxProvider.initialize());
79 ATH_CHECK(m_keyMm.initialize(SG::AllowEmpty));
83
84 if (!m_keyMdt.empty() || !m_keyRpc.empty() || !m_keyTgc.empty() ||
85 !m_keyMm.empty() || !m_keyStgc.empty()) {
86 ATH_CHECK(m_idHelperSvc.retrieve());
87 }
88 ATH_CHECK(m_compRotCreator.retrieve(EnableTool{!m_keyRpc.empty() || !m_keyTgc.empty()}));
89 return StatusCode::SUCCESS;
90}
91
92std::vector<Acts::SourceLink>
94 std::vector<Acts::SourceLink> sourceLinks{};
95 sourceLinks.reserve(track.measurementsOnTrack()->size() +
96 track.outliersOnTrack()->size());
97 detail::MeasurementCalibratorBase::pack(track.measurementsOnTrack()->stdcont(), sourceLinks);
98 detail::MeasurementCalibratorBase::pack(track.outliersOnTrack()->stdcont(), sourceLinks);
99 return sourceLinks;
100}
102 const TrackCollection& trackColl,
103 ActsTrk::MutableTrackContainer& outTrackcoll) const {
104 const Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(ctx);
105 ATH_MSG_VERBOSE("Calling trkTrackCollectionToActsTrackContainer with "
106 << trackColl.size() << " tracks.");
107 unsigned int trkCount = 0;
108 std::vector<Identifier> failedIds; // Keep track of Identifiers of failed conversions
109 for (const Trk::Track* trk : trackColl) {
110 // Do conversions!
111 const Trk::TrackStates *trackStates = trk->trackStateOnSurfaces();
112
113 auto actsTrack = outTrackcoll.getTrack(outTrackcoll.addTrack());
114 auto& trackStateContainer = outTrackcoll.trackStateContainer();
115
116 ATH_MSG_VERBOSE("Track "<<trkCount++<<" has " << trackStates->size()
117 << " track states on surfaces.");
118 // basic quantities copy
119 actsTrack.chi2() = trk->fitQuality()->chiSquared();
120 actsTrack.nDoF() = trk->fitQuality()->numberDoF();
121
122 // loop over track states on surfaces, convert and add them to the ACTS
123 // container
124 bool first_tsos = true; // We need to handle the first one differently
125 int measurementsCount = 0;
126 for (const Trk::TrackStateOnSurface* tsos : *trackStates) {
127
128 // Setup the mask
129 Acts::TrackStatePropMask mask = Acts::TrackStatePropMask::None;
130 if (tsos->measurementOnTrack()) {
131 mask |= Acts::TrackStatePropMask::Calibrated;
132 }
133 if (tsos->trackParameters()) {
134 mask |= Acts::TrackStatePropMask::Smoothed;
135 }
136
137 // Setup the index of the trackstate
138 auto index = Acts::kTrackIndexInvalid;
139 if (!first_tsos) {
140 index = actsTrack.tipIndex();
141 }
142 auto actsTSOS = trackStateContainer.getTrackState(trackStateContainer.addTrackState(mask, index));
143 ATH_MSG_VERBOSE("TipIndex: " << actsTrack.tipIndex() << " TSOS index within trajectory: "<< actsTSOS.index());
144 actsTrack.tipIndex() = actsTSOS.index();
145
146 if (tsos->trackParameters()) {
147 // TODO This try/catch is temporary and should be removed once the sTGC problem is fixed.
148 try {
149 ATH_MSG_VERBOSE("Converting track parameters.");
150 // TODO - work out whether we should set predicted, filtered, smoothed
151 const Acts::BoundTrackParameters parameters = m_geometryConvTool->convertTrackParametersToActs(ctx, *tsos->trackParameters());
152 ATH_MSG_VERBOSE("Track parameters: " << parameters.parameters());
153 // Sanity check on positions
154 if (!actsTrackParameterPositionCheck(parameters, *(tsos->trackParameters()), tgContext)) {
155 failedIds.push_back(tsos->trackParameters()->associatedSurface().associatedDetectorElementIdentifier());
156 }
157
158 if (first_tsos) {
159 // This is the first track state, so we need to set the track
160 // parameters
161 actsTrack.parameters() = parameters.parameters();
162 actsTrack.covariance() = *parameters.covariance();
163 actsTrack.setReferenceSurface(parameters.referenceSurface().getSharedPtr());
164 first_tsos = false;
165 } else {
166 actsTSOS.setReferenceSurface(parameters.referenceSurface().getSharedPtr());
167 // Since we're converting final Trk::Tracks, let's assume they're smoothed
168 actsTSOS.smoothed() = parameters.parameters();
169 if (parameters.covariance().has_value()) {
170 actsTSOS.smoothedCovariance() = *parameters.covariance();
171 }
172 else {
173 actsTSOS.smoothedCovariance() = Acts::BoundMatrix::Zero();
174 }
175 // Not yet implemented in MultiTrajectory.icc
176 // actsTSOS.typeFlags().setHasParameters();
177 if (!(actsTSOS.hasSmoothed() && actsTSOS.hasReferenceSurface())) {
178 ATH_MSG_WARNING("TrackState does not have smoothed state ["
179 << actsTSOS.hasSmoothed()
180 << "] or reference surface ["
181 << actsTSOS.hasReferenceSurface() << "].");
182 } else {
183 ATH_MSG_VERBOSE("TrackState has smoothed state and reference surface.");
184 }
185 }
186 } catch (const std::exception& e){
187 ATH_MSG_ERROR("Unable to convert TrackParameter with exception ["<<e.what()<<"]. Will be missing from ACTS track."
188 <<(*tsos->trackParameters()));
189 }
190 }
191 if (tsos->measurementOnTrack()) {
192 auto &measurement = *(tsos->measurementOnTrack());
193 actsTSOS.typeFlags().setIsMeasurement();
194
195 measurementsCount++;
196 // const Acts::Surface &surface =
197 // convertSurfaceToActs(measurement.associatedSurface());
198 // Commented for the moment because Surfaces not yet implemented in
199 // MultiTrajectory.icc
200
201 int dim = measurement.localParameters().dimension();
202 actsTSOS.allocateCalibrated(dim);
203 if (dim == 1) {
204 actsTSOS.calibrated<1>() = measurement.localParameters();
205 actsTSOS.calibratedCovariance<1>() = measurement.localCovariance();
206 } else if (dim == 2) {
207 actsTSOS.calibrated<2>() = measurement.localParameters();
208 actsTSOS.calibratedCovariance<2>() = measurement.localCovariance();
209 } else {
210 throw std::domain_error("Cannot handle measurement dim>2");
211 }
212 actsTSOS.setUncalibratedSourceLink(detail::TrkMeasurementCalibrator::pack(tsos->measurementOnTrack()));
213
214 } // end if measurement
215 } // end loop over track states
216 actsTrack.nMeasurements() = measurementsCount;
217 ATH_MSG_VERBOSE("TrackProxy has " << actsTrack.nTrackStates()
218 << " track states on surfaces.");
219 }
220 ATH_MSG_VERBOSE("Finished converting " << trackColl.size() << " tracks.");
221
222 if (!failedIds.empty()){
223 ATH_MSG_WARNING("Failed to convert "<<failedIds.size()<<" track parameters.");
224 for (auto id : failedIds){
225 ATH_MSG_WARNING("-> Failed for Identifier "<<m_idHelperSvc->toString(id));
226 }
227 }
228 ATH_MSG_VERBOSE("ACTS Track container has " << outTrackcoll.size() << " tracks.");
229}
231 const Acts::BoundTrackParameters &parameters,
232 const Trk::TrackParameters &trkparameters,
233 const Acts::GeometryContext &gctx) const {
234 auto actsPos = parameters.position(gctx);
235
236 if ( (actsPos - trkparameters.position()).mag() > 0.1) {
237 ATH_MSG_WARNING("Parameter position mismatch. Acts \n"
238 << actsPos << " vs Trk \n"
239 << trkparameters.position());
240 ATH_MSG_WARNING("Acts surface:");
241 ATH_MSG_WARNING(parameters.referenceSurface().toString(gctx));
242 ATH_MSG_WARNING("Trk surface:");
243 ATH_MSG_WARNING(trkparameters.associatedSurface());
244 return false;
245 }
246 return true;
247}
248
249std::unique_ptr<Trk::Track> ActsToTrkConverterTool::convertActsToTrk(const EventContext& ctx,
250 const ActsTrack_t& actsTrack,
251 const Trk::TrackInfo::TrackFitter fitAuthor) const {
252 return convertActsTrack<ActsTrack_t>(ctx, actsTrack, fitAuthor);
253}
254std::unique_ptr<Trk::Track> ActsToTrkConverterTool::convertTrack(const EventContext& ctx,
255 const ConstTrack_t& trackProxy) const {
256 return convertActsTrack(ctx, trackProxy, m_fitAuthor);
257}
258template <typename Proxy_t>
259 std::unique_ptr<Trk::Track>
261 const Proxy_t& acts_track,
262 const Trk::TrackInfo::TrackFitter fitAuthor) const{
263
264 ATH_MSG_DEBUG(__func__<<"() "<<__LINE__<<" - Check track "<<acts_track.tipIndex());
265 const Acts::CalibrationContext cctx{getCalibrationContext(ctx)};
266 const Acts::GeometryContext tgContext{m_ctxProvider.getGeometryContext(ctx)};
267
268 auto finalTrajectory = std::make_unique<Trk::TrackStates>();
269
270
271 // Loop over all the output state to create track state
272 acts_track.container().trackStateContainer().visitBackwards(acts_track.tipIndex(),
273 [&] (const auto &state) -> void {
274 if (!state.hasReferenceSurface()) {
275 return;
276 }
277 // First only consider state with an associated detector element
278 if (!m_convertMaterial && !state.referenceSurface().isSensitive()) {
279 return;
280 }
281 int nDoF{0};
282 double chi2{0};
283
284 if (!state.hasSmoothed() && !state.hasFiltered() && !state.hasPredicted()) {
285 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - State has no valid parameters (smoothed/filtered/predicted)");
286 return;
287 }
288
289 if (const auto* associatedDetEl = dynamic_cast<const ISurfacePlacement*>(
290 state.referenceSurface().surfacePlacement());
291 associatedDetEl != nullptr) {
292 ATH_MSG_VERBOSE("Associated det: "<<associatedDetEl->detectorType());
293 }
294
295 auto flag = state.typeFlags();
296
297 auto boundPars = acts_track.createParametersFromState(state);
298
299 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - "<<" hole: "<<flag.isHole()
300 <<", outlier: "<<flag.isOutlier()<<", measurement: "<<flag.isMeasurement()<<"/"
301 <<flag.hasMeasurement()<<", "<<m_convertOutliers<<", "<<m_convertHoles
302 <<", has SL: "<<state.hasUncalibratedSourceLink()
303 <<", parameters: "<<boundPars);
304
305 // We need to determine the type of state
306 TrkTSOSMask typePattern;
307
308 std::unique_ptr<Trk::TrackParameters> trkPars = m_geometryConvTool->convertTrackParametersToTrk(ctx, boundPars);
309 std::unique_ptr<Trk::MeasurementBase> trkMeasurement{};
310
311
312 // State is a hole (no associated measurement), use predicted parameters
313 if (flag.isHole()) {
314 if (!m_convertHoles) { return; }
315 typePattern.set(Trk::TrackStateOnSurface::Hole);
316 } if (flag.isOutlier()) {
317 if (!m_convertOutliers) { return; }
318 typePattern.set(Trk::TrackStateOnSurface::Outlier);
319 }
320 if (flag.hasMeasurement()) {
321 typePattern.set(Trk::TrackStateOnSurface::Measurement);
322 nDoF = state.calibratedSize();
323 chi2 = state.chi2();
324 const auto slType = detail::MeasurementCalibratorBase::getType(state.getUncalibratedSourceLink());
325 switch (slType) {
326 using enum detail::SourceLinkType;
327 case TrkMeasurement:
328 trkMeasurement = m_measCalib.unpack(state.getUncalibratedSourceLink())->uniqueClone();
329 break;
330 case TrkPrepRawData:
331 trkMeasurement = m_prdCalib.createROT(tgContext, cctx, state.getUncalibratedSourceLink(), state);
332 break;
333 case xAODUnCalibMeas:
334 appendMeasTSOS(ctx, detail::xAODUncalibMeasCalibrator::unpack(state.getUncalibratedSourceLink()),
335 typePattern, Trk::FitQualityOnSurface{chi2, nDoF},
336 std::move(trkPars), *finalTrajectory);
337 return;
338 default:
339 THROW_EXCEPTION("Invalid "<<slType<<" type parsed.");
340 }
341 }
342 auto perState = std::make_unique<Trk::TrackStateOnSurface>(Trk::FitQualityOnSurface{chi2, nDoF},
343 std::move(trkMeasurement),
344 std::move(trkPars), nullptr, typePattern);
345 // If a state was succesfully created add it to the trajectory
346 ATH_MSG_VERBOSE("State succesfully created, adding it to the trajectory");
347 finalTrajectory->insert(finalTrajectory->begin(), std::move(perState));
348 });
349
350 if (finalTrajectory->empty()) {
351 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" No measurements added to the track");
352 return nullptr;
353 }
354 // Convert the perigee state and add it to the trajectory
355 std::unique_ptr<Trk::TrackParameters> per = m_geometryConvTool->convertTrackParametersToTrk(ctx, acts_track.createParametersAtReference());
356 TrkTSOSMask typePattern;
357 typePattern.set(Trk::TrackStateOnSurface::Perigee);
358 finalTrajectory->insert(finalTrajectory->begin(),
359 std::make_unique<Trk::TrackStateOnSurface>(nullptr, std::move(per), nullptr, typePattern));
360 // Create the track using the states
361 Trk::TrackInfo newInfo{fitAuthor, ParticleHypothesis::convertTrk(acts_track.particleHypothesis())};
362 auto newtrack = std::make_unique<Trk::Track>(newInfo, std::move(finalTrajectory),
363 std::make_unique<Trk::FitQuality>(static_cast<double>(acts_track.chi2()),
364 static_cast<int>(acts_track.nDoF())));
365 constexpr bool suppressHoleSearch = false;
366 m_trkSummaryTool->updateTrackSummary(ctx, *newtrack, suppressHoleSearch);
367 ATH_MSG_VERBOSE("Created new track "<<(*newtrack->trackSummary()));
368 return newtrack;
369 }
370
371 std::unique_ptr<TrackCollection>
373 const ActsTrk::TrackContainer& trackCont) const {
374 auto outColl = std::make_unique<TrackCollection>();
375 for (const ActsTrk::TrackContainer::ConstTrackProxy trk : trackCont) {
376 outColl->push_back(convertActsTrack(ctx, trk, m_fitAuthor));
377 }
378 return outColl;
379 }
380 void ActsToTrkConverterTool::appendMeasTSOS(const EventContext& ctx,
382 const TrkTSOSMask typePattern,
383 Trk::FitQualityOnSurface&& quality,
384 std::unique_ptr<Trk::TrackParameters> trkPars,
385 Trk::TrackStates& states) const {
386 std::unique_ptr<Trk::MeasurementBase> rot{};
387 switch (meas->type()) {
388 using enum xAOD::UncalibMeasType;
389 case PixelClusterType: {
390 static const SG::AuxElement::ConstAccessor<ElementLink<InDet::PixelClusterCollection>> acc_prdLink("pixelClusterLink");
391 if (acc_prdLink.isAvailable(*meas) && acc_prdLink(*meas).isValid()) {
392 rot.reset(m_ROTcreator->correct(**acc_prdLink(*meas), *trkPars, ctx));
393 } else {
394 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - The pixel xAOD -> prd accessor is invalid");
395 }
396 break;
397 } case StripClusterType: {
398 static const SG::AuxElement::ConstAccessor<ElementLink<InDet::SCT_ClusterCollection>> acc_prdLink("sctClusterLink");
399 if (acc_prdLink.isAvailable(*meas) && acc_prdLink(*meas).isValid()) {
400 rot.reset(m_ROTcreator->correct(**acc_prdLink(*meas), *trkPars, ctx));
401 } else {
402 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - The strip xAOD -> prd accessor is invalid");
403 }
404 break;
405 } case MdtDriftCircleType:
406 case MMClusterType: {
407 const Identifier& id = static_cast<const xAOD::MuonMeasurement*>(meas)->identify();
408 const IdentifierHash modHash = m_idHelperSvc->moduleHash(id);
409 const auto* prd = meas->type() == MdtDriftCircleType ? fetchPrd(ctx, m_keyMdt, id, modHash)
410 : fetchPrd(ctx, m_keyMm, id, modHash);
411 assert(prd != nullptr);
412 rot.reset(m_ROTcreator->correct(*prd, *trkPars, ctx));
413 break;
414 } case TgcStripType:
415 case RpcStripType:
416 case sTgcStripType: {
417 const Identifier& id = static_cast<const xAOD::MuonMeasurement*>(meas)->identify();
418 const IdentifierHash modHash = m_idHelperSvc->moduleHash(id);
420 const Trk::PrepRawData* prd{nullptr}, *prd1{nullptr};
421
422 if (meas->numDimensions() == 0) {
423 const auto* muonMeas = static_cast<const xAOD::CombinedMuonStrip*>(meas);
424 if (meas->type() == RpcStripType) {
425 prd = fetchPrd(ctx, m_keyRpc, id, modHash);
426 prd1 = fetchPrd(ctx, m_keyRpc, muonMeas->secondaryStrip()->identify(), modHash);
427 } else if (meas->type() == TgcStripType) {
428 prd = fetchPrd(ctx, m_keyTgc, id, modHash);
429 prd1 = fetchPrd(ctx, m_keyTgc, muonMeas->secondaryStrip()->identify(), modHash);
430 } else {
431 prd = fetchPrd(ctx, m_keyStgc, id, modHash);
432 prd1 = fetchPrd(ctx, m_keyStgc, muonMeas->secondaryStrip()->identify(), modHash);
433 }
434 assert(prd != nullptr);
435 assert(prd1 != nullptr);
436
438 const Trk::Surface& phiSurface = prd1->detectorElement()->surface(prd1->identify());
439 auto phiPars = rotateParams(*trkPars, phiSurface);
440 assert(phiPars != nullptr);
441 std::unique_ptr<Trk::MeasurementBase> phiRot{};
442 if (meas->type() != sTgcStripType) {
443 phiRot = m_compRotCreator->createBroadCluster(std::list{prd1}, 1.);
444 rot = m_compRotCreator->createBroadCluster(std::list{prd}, 1.);
445 } else {
446 phiRot.reset(m_ROTcreator->correct(*prd1, *phiPars, ctx));
447 rot.reset(m_ROTcreator->correct(*prd, *trkPars, ctx));
448 }
449 assert(phiRot != nullptr);
450 states.insert(states.begin(),
451 std::make_unique<Trk::TrackStateOnSurface>(quality,
452 std::move(phiRot),
453 std::move(phiPars), nullptr, typePattern));
454 } else {
455 const auto* prd = meas->type() == RpcStripType ? fetchPrd(ctx, m_keyRpc, id, modHash)
456 :
457 meas->type() == TgcStripType ? fetchPrd(ctx, m_keyTgc, id, modHash)
458 : fetchPrd(ctx, m_keyStgc, id, modHash);
459 assert(prd != nullptr);
460 // Track parameter representation needs to change towards a phi surface
461 if (m_idHelperSvc->measuresPhi(id)) {
462 ATH_MSG_VERBOSE(__func__<<"() "<<__LINE__<<" - Convert the track parameters "<<m_idHelperSvc->toString(id)
463 <<", "<<m_idHelperSvc->toStringDetEl(prd->detectorElement()->identify()));
464 const Trk::Surface& target = prd->detectorElement()->surface(id);
465 trkPars = rotateParams(*trkPars, target);
466 }
468 rot.reset(m_ROTcreator->correct(*prd, *trkPars, ctx));
469 }
470 break;
471 } default:
472 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - Measurement type "<<meas->type()<<" is not implemented");
473 return;
474 }
475 if (!rot) {
476 ATH_MSG_WARNING(__func__<<"() "<<__LINE__<<" - ROT creation failed.");
477 return;
478 }
479 assert(rot != nullptr);
480 assert(trkPars != nullptr);
481 states.insert(states.begin(),
482 std::make_unique<Trk::TrackStateOnSurface>(std::move(quality), std::move(rot),
483 std::move(trkPars), nullptr, typePattern));
484
485 }
486 template <typename PrdType_t>
489 const Identifier& prdId,
490 const IdentifierHash& hash) const{
491 const PrdType_t* container{nullptr};
492 if (key.empty() || !SG::get(container, key, ctx).isSuccess()) {
493 THROW_EXCEPTION("Failed to retrieve container "<<key.fullKey());
494 }
495 const auto* coll = container->indexFindPtr(hash);
496 if (coll == nullptr){
497 ATH_MSG_WARNING("fetchPrd() - Failed to find a valid collection for "<<prdId.getString()<<", key: "<<key.fullKey());
498 return nullptr;
499 }
500 for (const Trk::PrepRawData* prd : *coll) {
501 if (prd->identify() == prdId) {
502 return prd;
503 }
504 }
505 ATH_MSG_WARNING("fetchPrd() - Prep data object "<<prdId.getString()<<" is not in "<<key.fullKey());
506 return nullptr;
507 }
508} // 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
ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Tools needed to create Trk::Tracks from the ACts fit result.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
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
ToolHandle< Muon::IMuonCompetingClustersOnTrackCreator > m_compRotCreator
detail::TrkPrepRawDataCalibrator m_prdCalib
virtual std::unique_ptr< Trk::Track > convertTrack(const EventContext &ctx, const ConstTrack_t &trackProxy) const override final
Converts a const Acts::Track into.
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.
virtual std::unique_ptr< Trk::Track > convertActsToTrk(const EventContext &ctx, const ActsTrack_t &actsTrack, const Trk::TrackInfo::TrackFitter fitAuthor) const override final
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
SG::ReadHandleKey< InDet::PixelClusterContainer > m_pixelKey
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.
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_sctKey
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 Trk::Track in the passed TrackCollection into Acts tracks and appends the result to the p...
Extension of the interface of the Acts::SurfacePlacementBase for ATLAS.
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