File indexing completed on 2025-10-22 07:51:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/EventData/MultiTrajectory.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/MagneticField/MagneticFieldContext.hpp"
0014 #include "Acts/Propagator/MultiEigenStepperLoop.hpp"
0015 #include "Acts/Propagator/Propagator.hpp"
0016 #include "Acts/TrackFitting/detail/VoidFitterComponents.hpp"
0017 #include "Acts/Utilities/CalibrationContext.hpp"
0018 #include "Acts/Utilities/Delegate.hpp"
0019 #include "Acts/Utilities/Logger.hpp"
0020
0021 namespace Acts {
0022
0023
0024
0025
0026 enum class ComponentMergeMethod { eMean, eMaxWeight };
0027
0028
0029
0030
0031 struct GsfComponent {
0032
0033 double weight = 0;
0034
0035 BoundVector boundPars = BoundVector::Zero();
0036
0037 BoundSquareMatrix boundCov = BoundSquareMatrix::Identity();
0038 };
0039
0040 namespace GsfConstants {
0041 constexpr std::string_view kFinalMultiComponentStateColumn =
0042 "gsf-final-multi-component-state";
0043 using FinalMultiComponentState =
0044 std::optional<Acts::MultiComponentBoundTrackParameters>;
0045 constexpr std::string_view kFwdSumMaterialXOverX0 =
0046 "gsf-fwd-sum-material-x-over-x0";
0047 constexpr std::string_view kFwdMaxMaterialXOverX0 =
0048 "gsf-fwd-max-material-x-over-x0";
0049 }
0050
0051
0052 template <typename traj_t>
0053 struct GsfExtensions {
0054
0055 using TrackStateProxy = typename traj_t::TrackStateProxy;
0056
0057 using ConstTrackStateProxy = typename traj_t::ConstTrackStateProxy;
0058
0059
0060 using Calibrator =
0061 Delegate<void(const GeometryContext &, const CalibrationContext &,
0062 const SourceLink &, TrackStateProxy)>;
0063
0064
0065 using Updater = Delegate<Result<void>(const GeometryContext &,
0066 TrackStateProxy, const Logger &)>;
0067
0068
0069 using OutlierFinder = Delegate<bool(ConstTrackStateProxy)>;
0070
0071
0072 using ComponentReducer =
0073 Delegate<void(std::vector<GsfComponent> &, std::size_t, const Surface &)>;
0074
0075
0076
0077
0078 Calibrator calibrator;
0079
0080
0081 Updater updater;
0082
0083
0084
0085 OutlierFinder outlierFinder;
0086
0087
0088 SourceLinkSurfaceAccessor surfaceAccessor;
0089
0090
0091 ComponentReducer mixtureReducer;
0092
0093
0094 GsfExtensions() {
0095 calibrator.template connect<&detail::voidFitterCalibrator<traj_t>>();
0096 updater.template connect<&detail::voidFitterUpdater<traj_t>>();
0097 outlierFinder.template connect<&detail::voidOutlierFinder<traj_t>>();
0098 surfaceAccessor.connect<&detail::voidSurfaceAccessor>();
0099 mixtureReducer
0100 .template connect<&detail::voidComponentReducer<GsfComponent>>();
0101 }
0102 };
0103
0104 template <typename traj_t>
0105 struct GsfOptions {
0106 std::reference_wrapper<const GeometryContext> geoContext;
0107 std::reference_wrapper<const MagneticFieldContext> magFieldContext;
0108 std::reference_wrapper<const CalibrationContext> calibrationContext;
0109
0110 GsfExtensions<traj_t> extensions;
0111
0112 PropagatorPlainOptions propagatorPlainOptions;
0113
0114 const Surface *referenceSurface = nullptr;
0115
0116 std::size_t maxComponents = 4;
0117
0118 double weightCutoff = 1.e-4;
0119
0120 bool abortOnError = false;
0121
0122 bool disableAllMaterialHandling = false;
0123
0124 double reverseFilteringCovarianceScaling = 1.0;
0125
0126
0127
0128 bool useExternalSurfaces = true;
0129
0130 std::string_view finalMultiComponentStateColumn = "";
0131
0132 ComponentMergeMethod componentMergeMethod = ComponentMergeMethod::eMaxWeight;
0133
0134 GsfOptions(const GeometryContext &geoCtxt,
0135 const MagneticFieldContext &magFieldCtxt,
0136 const CalibrationContext &calibCtxt)
0137 : geoContext(geoCtxt),
0138 magFieldContext(magFieldCtxt),
0139 calibrationContext(calibCtxt),
0140 propagatorPlainOptions(geoCtxt, magFieldCtxt) {}
0141 };
0142
0143 }