8#include "Acts/EventData/VectorTrackContainer.hpp"
9#include "Acts/Propagator/Navigator.hpp"
10#include "Acts/Propagator/Propagator.hpp"
11#include "Acts/Surfaces/Surface.hpp"
12#include "Acts/TrackFitting/GlobalChiSquareFitter.hpp"
13#include "Acts/Utilities/CalibrationContext.hpp"
14#include "Acts/Utilities/Helpers.hpp"
15#include "Acts/Utilities/Logger.hpp"
36 CurvedPropagator_t::Stepper stepper{std::make_shared<ATLASMagneticFieldWrapper>()};
38 Acts::Navigator navigator(std::move(navConfig),
logger().cloneWithSuffix(
"Navigator"));
41 m_fitter = std::make_unique<CurvedFitter_t>(std::move(propagator),
42 logger().cloneWithSuffix(
"GlobalChiSquareFitter"));
44 Acts::StraightLineStepper stepper{};
46 Acts::Navigator navigator(std::move(navConfig),
logger().cloneWithSuffix(
"Navigator"));
49 m_slFitter = std::make_unique<StraightFitter_t>(std::move(propagator),
50 logger().cloneWithSuffix(
"GlobalChiSquareFitter"));
57 extensionTemplate.outlierFinder.connect<&detail::FitterHelperFunctions::ATLASOutlierFinder::operator()
66 configureMe = extensionTemplate;
68 configureMe.surfaceAccessor.connect<&detail::TrkMeasSurfaceAccessor::operator()>(&
m_trkMeasSurfAcc);
76 configureMe = extensionTemplate;
78 configureMe.surfaceAccessor.connect<&detail::TrkPrepRawDataSurfaceAcc::operator()>(&
m_prdSurfaceAcc);
85 configureMe = extensionTemplate;
86 configureMe.surfaceAccessor.connect<&detail::xAODUncalibMeasSurfAcc::operator()>(&
m_unalibMeasSurfAcc);
93 for (
const auto muonType : {MdtDriftCircleType, RpcStripType, TgcStripType, MMClusterType, sTgcStripType}) {
97 for (
const auto idType: {PixelClusterType, StripClusterType, HGTDClusterType}) {
102 return StatusCode::SUCCESS;
107 const Acts::MagneticFieldContext& mfContext,
108 const Acts::CalibrationContext& calContext,
109 const Acts::Surface* surface,
111 Acts::PropagatorPlainOptions propagationOption{tgContext, mfContext};
117 std::move(propagationOption),
127 const std::vector<const xAOD::UncalibratedMeasurement*>& measList,
128 const Acts::BoundTrackParameters& initialParams,
129 const Acts::GeometryContext& tgContext,
130 const Acts::MagneticFieldContext& mfContext,
131 const Acts::CalibrationContext& calContext,
132 const Acts::Surface* targetSurface)
const {
134 std::vector<Acts::SourceLink> sourceLinks{};
137 return fit(sourceLinks, initialParams, tgContext, mfContext, calContext, targetSurface);
142 const Acts::BoundTrackParameters& initialParams,
143 const Acts::GeometryContext& tgContext,
144 const Acts::MagneticFieldContext& mfContext,
145 const Acts::CalibrationContext& calContext,
146 const Acts::Surface& targetSurface)
const {
148 std::vector<const xAOD::UncalibratedMeasurement*> sourceLinks;
149 sourceLinks.reserve(6);
152 sourceLinks.insert(sourceLinks.end(),
sp->measurements().begin(),
sp->measurements().end());
154 return fit(sourceLinks, initialParams, tgContext, mfContext, calContext, &targetSurface);
159 const EventContext& ,
160 const TrackContainer::ConstTrackProxy& ,
162 const Acts::PerigeeSurface& )
const
164 ATH_MSG_ERROR(
"Track refit method not implemented in GlobalChiSquareFitterTool yet");
165 return StatusCode::FAILURE;
168std::unique_ptr<MutableTrackContainer>
170 const Acts::BoundTrackParameters& initialParams,
171 const Acts::GeometryContext& tgContext,
172 const Acts::MagneticFieldContext& mfContext,
173 const Acts::CalibrationContext& calContext,
174 const Acts::Surface* targetSurface)
const {
175 if (sourceLinks.empty()) {
180 std::shared_ptr<Acts::Surface> pSurface{};
181 if (!targetSurface) {
182 pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3::Zero());
183 targetSurface = pSurface.get();
189 targetSurface, slType);
193 auto tracks = std::make_unique<MutableTrackContainer>(std::move(trackContainerBackEnd),
194 std::move(multiTrajBackEnd));
198 ?
m_fitter->fit(sourceLinks.begin(), sourceLinks.end(), initialParams, kfOptions, *tracks)
199 :
m_slFitter->fit(sourceLinks.begin(), sourceLinks.end(), initialParams, kfOptions, *tracks);
201 if (not result.ok()) {
207 for (
auto trkProxy : *tracks) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
static Acts::SourceLink pack(const Ptr_t &measurement)
Pack the measurement type pointer to an Acts::SourceLink including the intermediate conversion into a...
static SourceLinkType getType(const Acts::SourceLink &sl)
Returns the enumeration corresponding to the object type cached within the Acts::SourceLink.
void calibrate(const Acts::GeometryContext &geoctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &link, TrackStateProxy state) const
static OnTrackCalibrator NoCalibration(const ActsTrk::ITrackingGeometrySvc *trackGeoSvc)
Helper class to access the Acts::Surface for a given Acts::SourceLink which is poiniting to a Trk::Me...
Calibrator class that links the legacy Trk::MeasurementBase objects with the Acts MultiTrajectory tra...
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, proxy_t trackState) const
Calibrator delegate implementation to calibrate the ActsTrk fit from Trk::MeasurementBase objects.
Class to calibrate the Acts track states with uncalibrated Trk::PrepRaw data objects.
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, proxy_t trackState) const
Calibrator delegate implementation to calibrate the ActsTrk fit from Trk::PrepRawData objects.
Helper class to access the Acts::surface associated with a Trk::PrepRawData measurement.
void calibrate(const Acts::GeometryContext &gctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &sl, const MutableTrackStateBackend::TrackStateProxy trackState) const
: Interface method for the Acts fitter to calibrate the trajectory track states from the source link ...
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
virtual void calibrateSourceLink(const Acts::GeometryContext &geoctx, const Acts::CalibrationContext &cctx, const Acts::SourceLink &link, ActsTrk::MutableTrackStateBackend::TrackStateProxy state) const =0
Function that's hooked to the calibration delegate of the implemented Acts fitters.
SourceLinkType
Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.
@ xAODUnCalibMeas
UnCalibrated Trk::PrepRawData objects.
@ TrkPrepRawData
Calibrated Trk::MeasurementBase objects.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Acts::VectorMultiTrajectory MutableTrackStateBackend
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
Acts::VectorTrackContainer MutableTrackBackend
@ GlobalChi2Fitter
Track's from Thijs' global chi^2 fitter or the ACTS implementation.
UncalibMeasType
Define the type of the uncalibrated measurement.
static void addFitterTypeProperty(track_container_t &tracksContainer)
add fitter column to the track container
static void setFitterType(trackproxy_t &trackProxy, xAOD::TrackFitter fitterType)
set fitter type of a track