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