42 class MagneticFieldProvider;
62 using namespace ActsExamples;
66 DirectFitter directFitter;
68 bool multipleScattering =
false;
69 bool energyLoss =
false;
74 GlobalChiSquareFitterFunctionImpl(Fitter&&
f, DirectFitter&&
df,
76 : fitter(std::
move(
f)),
77 directFitter(std::
move(
df)),
78 m_slSurfaceAccessor{trkGeo} {}
80 template <
typename calibrator_t>
81 auto makeGx2fOptions(
const GeneralFitterOptions&
options,
82 const calibrator_t& calibrator)
const {
85 extensions.
calibrator.connect<&calibrator_t::calibrate>(&calibrator);
88 .connect<&IndexSourceLink::SurfaceAccessor::operator()>(
89 &m_slSurfaceAccessor);
92 options.geoContext, options.magFieldContext, options.calibrationContext,
93 extensions, options.propOptions, &(*options.referenceSurface),
94 multipleScattering, energyLoss, freeToBoundCorrection, 5);
99 TrackFitterResult operator()(
const std::vector<Acts::SourceLink>& sourceLinks,
101 const GeneralFitterOptions&
options,
104 const auto gx2fOptions = makeGx2fOptions(options, calibrator);
105 return fitter.fit(sourceLinks.begin(), sourceLinks.end(), initialParameters,
111 TrackFitterResult operator()(
112 const std::vector<Acts::SourceLink>& ,
114 const GeneralFitterOptions& ,
116 const std::vector<const Acts::Surface*>& ,
118 throw std::runtime_error(
119 "direct navigation with GX2 fitter is not implemented");
125 std::shared_ptr<ActsExamples::TrackFitterFunction>
128 std::shared_ptr<const Acts::MagneticFieldProvider>
magneticField,
129 bool multipleScattering,
bool energyLoss,
138 cfg.resolvePassive =
false;
139 cfg.resolveMaterial =
true;
140 cfg.resolveSensitive =
true;
151 DirectFitter directTrackFitter(
std::move(directPropagator),
155 auto fitterFunction = std::make_shared<GlobalChiSquareFitterFunctionImpl>(
157 fitterFunction->multipleScattering = multipleScattering;
158 fitterFunction->energyLoss = energyLoss;
159 fitterFunction->freeToBoundCorrection = freeToBoundCorrection;
161 return fitterFunction;