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"
37 CurvedPropagator_t::Stepper stepper{std::make_shared<ATLASMagneticFieldWrapper>()};
39 Acts::Navigator navigator(std::move(navConfig),
logger().cloneWithSuffix(
"Navigator"));
42 m_fitter = std::make_unique<CurvedFitter_t>(std::move(propagator),
43 logger().cloneWithSuffix(
"GlobalChiSquareFitter"));
45 Acts::StraightLineStepper stepper{};
47 Acts::Navigator navigator(std::move(navConfig),
logger().cloneWithSuffix(
"Navigator"));
50 m_slFitter = std::make_unique<StraightFitter_t>(std::move(propagator),
51 logger().cloneWithSuffix(
"GlobalChiSquareFitter"));
58 extensionTemplate.outlierFinder.connect<&detail::FitterHelperFunctions::ATLASOutlierFinder::operator()
68 configureMe = extensionTemplate;
70 configureMe.surfaceAccessor.connect<&detail::TrkMeasSurfaceAccessor::operator()>(&
m_trkMeasSurfAcc);
78 configureMe = extensionTemplate;
80 configureMe.surfaceAccessor.connect<&detail::TrkPrepRawDataSurfaceAcc::operator()>(&
m_prdSurfaceAcc);
87 configureMe = extensionTemplate;
88 configureMe.surfaceAccessor.connect<&detail::xAODUncalibMeasSurfAcc::operator()>(&
m_unalibMeasSurfAcc);
95 for (
const auto muonType : {MdtDriftCircleType, RpcStripType, TgcStripType, MMClusterType, sTgcStripType}) {
99 for (
const auto idType: {PixelClusterType, StripClusterType,
Other, HGTDClusterType}) {
104 return StatusCode::SUCCESS;
109 const Acts::MagneticFieldContext& mfContext,
110 const Acts::CalibrationContext& calContext,
111 const Acts::Surface* surface,
113 Acts::PropagatorPlainOptions propagationOption{tgContext, mfContext};
119 std::move(propagationOption),
129 const std::vector<const xAOD::UncalibratedMeasurement*>& measList,
130 const Acts::BoundTrackParameters& initialParams,
131 const Acts::GeometryContext& tgContext,
132 const Acts::MagneticFieldContext& mfContext,
133 const Acts::CalibrationContext& calContext,
134 const Acts::Surface* targetSurface)
const {
136 std::vector<Acts::SourceLink> sourceLinks{};
139 return fit(sourceLinks, initialParams, tgContext, mfContext, calContext, targetSurface);
144 const Acts::BoundTrackParameters& initialParams,
145 const Acts::GeometryContext& tgContext,
146 const Acts::MagneticFieldContext& mfContext,
147 const Acts::CalibrationContext& calContext,
148 const Acts::Surface& targetSurface)
const {
150 std::vector<const xAOD::UncalibratedMeasurement*> sourceLinks;
151 sourceLinks.reserve(6);
154 sourceLinks.insert(sourceLinks.end(),
sp->measurements().begin(),
sp->measurements().end());
156 return fit(sourceLinks, initialParams, tgContext, mfContext, calContext, &targetSurface);
161 const EventContext& ,
162 const TrackContainer::ConstTrackProxy& ,
164 const Acts::PerigeeSurface& )
const
166 ATH_MSG_ERROR(
"Track refit method not implemented in GlobalChiSquareFitterTool yet");
167 return StatusCode::FAILURE;
170std::unique_ptr<MutableTrackContainer>
172 const Acts::BoundTrackParameters& initialParams,
173 const Acts::GeometryContext& tgContext,
174 const Acts::MagneticFieldContext& mfContext,
175 const Acts::CalibrationContext& calContext,
176 const Acts::Surface* targetSurface)
const {
177 if (sourceLinks.empty()) {
182 std::shared_ptr<Acts::Surface> pSurface{};
183 if (!targetSurface) {
184 pSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3::Zero());
185 targetSurface = pSurface.get();
191 targetSurface, slType);
195 auto tracks = std::make_unique<MutableTrackContainer>(std::move(trackContainerBackEnd),
196 std::move(multiTrajBackEnd));
200 ?
m_fitter->fit(sourceLinks.begin(), sourceLinks.end(), initialParams, kfOptions, *tracks)
201 :
m_slFitter->fit(sourceLinks.begin(), sourceLinks.end(), initialParams, kfOptions, *tracks);
203 if (not result.ok()) {
209 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::ITrackingGeometryTool *trackGeoTool)
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.
Acts::Result< void > gainMatrixUpdate(const Acts::GeometryContext &gctx, typename trajectory_t::TrackStateProxy trackState, const Acts::Logger &logger)
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