1 #pragma GCC diagnostic push
2 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
4 #pragma GCC diagnostic pop
8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
10 #pragma GCC diagnostic ignored "-Wunused-value"
12 #pragma GCC diagnostic pop
33 struct SimpleReverseFilteringLogic
35 SimpleReverseFilteringLogic() =
default;
36 double momentumThreshold = 0.0;
38 bool doBackwardFiltering(
42 return (
momentum <= momentumThreshold);
46 template <
typename TrackFitterFunction>
47 auto makeKfOptions(
const TrackFitterFunction&
f,
56 .connect<&SimpleReverseFilteringLogic::doBackwardFiltering>(
57 &f.reverseFilteringLogic);
64 kfOptions.multipleScattering = f.multipleScattering;
65 kfOptions.energyLoss = f.energyLoss;
66 kfOptions.freeToBoundCorrection = f.freeToBoundCorrection;
71 struct TrackFitterFunctionImpl
79 SimpleReverseFilteringLogic reverseFilteringLogic;
81 bool multipleScattering;
85 TrackFitterFunctionImpl(Fitter&&
f,
87 : trackFitter(std::
move(
f))
88 , m_slSurfaceAccessor{trkGeo}
89 , multipleScattering(
true)
96 const std::vector<Acts::SourceLink>& sourceLinks,
102 auto kfOptions = makeKfOptions(*
this, options);
103 kfOptions.extensions.surfaceAccessor
104 .connect<&ActsSourceLink::SurfaceAccessor::operator()>(
105 &m_slSurfaceAccessor);
106 kfOptions.extensions.calibrator
109 return trackFitter.fit(sourceLinks.begin(), sourceLinks.end(),
110 initialParameters, kfOptions,
tracks);
114 struct DirectedFitterFunctionImpl
122 SimpleReverseFilteringLogic reverseFilteringLogic;
124 bool multipleScattering;
128 DirectedFitterFunctionImpl(DirectFitter&&
f,
130 : fitter(std::
move(
f))
131 , m_slSurfaceAccessor{trkGeo}
132 , multipleScattering(
true)
139 const std::vector<Acts::SourceLink>& sourceLinks,
142 const std::vector<const Acts::Surface*>& sSequence,
146 auto kfOptions = makeKfOptions(*
this, options);
147 kfOptions.extensions.calibrator
150 kfOptions.extensions.surfaceAccessor
151 .connect<&ActsSourceLink::SurfaceAccessor::operator()>(
152 &m_slSurfaceAccessor);
153 return fitter.fit(sourceLinks.begin(), sourceLinks.end(), initialParameters,
154 kfOptions, sSequence,
tracks);
174 : TrackFitterFunctionImpl(std::
move(
f), trkGeo)
179 const std::vector<Acts::SourceLink>& sourceLinks,
186 auto kfOptions = makeKfOptions(*
this, options);
189 kfOptions.extensions.surfaceAccessor
190 .connect<&ActsSourceLink::SurfaceAccessor::operator()>(
191 &m_slSurfaceAccessor);
194 kfOptions.extensions.outlierFinder.connect<&ResidualOutlierFinder::operator()>(&
m_oFinder);
197 return trackFitter.fit(sourceLinks.begin(), sourceLinks.end(),
198 initialParameters, kfOptions,
tracks);
202 std::shared_ptr<ActsTrackFittingAlgorithm::TrackFitterFunction>
205 std::shared_ptr<const Acts::MagneticFieldProvider>
magneticField,
206 bool multipleScattering,
bool energyLoss,
207 double reverseFilteringMomThreshold,
215 cfg.resolvePassive =
false;
216 cfg.resolveMaterial =
true;
217 cfg.resolveSensitive =
true;
224 auto fitterFunction =
225 std::make_shared<sPHENIXTrackFitterFunctionImpl>(
std::move(trackFitter), geo);
226 fitterFunction->multipleScattering = multipleScattering;
227 fitterFunction->energyLoss = energyLoss;
228 fitterFunction->reverseFilteringLogic.momentumThreshold =
229 reverseFilteringMomThreshold;
230 fitterFunction->freeToBoundCorrection = freeToBoundCorrection;
232 return fitterFunction;
239 std::shared_ptr<const Acts::MagneticFieldProvider>
magneticField,
240 bool multipleScattering,
bool energyLoss,
241 double reverseFilteringMomThreshold,
253 DirectFitter fitter(
std::move(propagator),
257 auto fitterFunction =
258 std::make_shared<DirectedFitterFunctionImpl>(
std::move(fitter), geo);
259 fitterFunction->multipleScattering = multipleScattering;
260 fitterFunction->energyLoss = energyLoss;
261 fitterFunction->reverseFilteringLogic.momentumThreshold =
262 reverseFilteringMomThreshold;
263 fitterFunction->freeToBoundCorrection = freeToBoundCorrection;
265 return fitterFunction;