File indexing completed on 2025-01-18 09:11:07
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 double weight = 0;
0033 BoundVector boundPars = BoundVector::Zero();
0034 BoundSquareMatrix boundCov = BoundSquareMatrix::Identity();
0035 };
0036
0037 namespace GsfConstants {
0038 constexpr std::string_view kFinalMultiComponentStateColumn =
0039 "gsf-final-multi-component-state";
0040 using FinalMultiComponentState =
0041 std::optional<Acts::MultiComponentBoundTrackParameters>;
0042 constexpr std::string_view kFwdSumMaterialXOverX0 =
0043 "gsf-fwd-sum-material-x-over-x0";
0044 constexpr std::string_view kFwdMaxMaterialXOverX0 =
0045 "gsf-fwd-max-material-x-over-x0";
0046 }
0047
0048
0049 template <typename traj_t>
0050 struct GsfExtensions {
0051 using TrackStateProxy = typename traj_t::TrackStateProxy;
0052 using ConstTrackStateProxy = typename traj_t::ConstTrackStateProxy;
0053
0054 using Calibrator =
0055 Delegate<void(const GeometryContext &, const CalibrationContext &,
0056 const SourceLink &, TrackStateProxy)>;
0057
0058 using Updater = Delegate<Result<void>(const GeometryContext &,
0059 TrackStateProxy, const Logger &)>;
0060
0061 using OutlierFinder = Delegate<bool(ConstTrackStateProxy)>;
0062
0063 using ComponentReducer =
0064 Delegate<void(std::vector<GsfComponent> &, std::size_t, const Surface &)>;
0065
0066
0067
0068
0069 Calibrator calibrator;
0070
0071
0072 Updater updater;
0073
0074
0075
0076 OutlierFinder outlierFinder;
0077
0078
0079 SourceLinkSurfaceAccessor surfaceAccessor;
0080
0081
0082 ComponentReducer mixtureReducer;
0083
0084
0085 GsfExtensions() {
0086 calibrator.template connect<&detail::voidFitterCalibrator<traj_t>>();
0087 updater.template connect<&detail::voidFitterUpdater<traj_t>>();
0088 outlierFinder.template connect<&detail::voidOutlierFinder<traj_t>>();
0089 surfaceAccessor.connect<&detail::voidSurfaceAccessor>();
0090 mixtureReducer
0091 .template connect<&detail::voidComponentReducer<GsfComponent>>();
0092 }
0093 };
0094
0095 template <typename traj_t>
0096 struct GsfOptions {
0097 std::reference_wrapper<const GeometryContext> geoContext;
0098 std::reference_wrapper<const MagneticFieldContext> magFieldContext;
0099 std::reference_wrapper<const CalibrationContext> calibrationContext;
0100
0101 GsfExtensions<traj_t> extensions;
0102
0103 PropagatorPlainOptions propagatorPlainOptions;
0104
0105 const Surface *referenceSurface = nullptr;
0106
0107 std::size_t maxComponents = 4;
0108
0109 double weightCutoff = 1.e-4;
0110
0111 bool abortOnError = false;
0112
0113 bool disableAllMaterialHandling = false;
0114
0115 std::string_view finalMultiComponentStateColumn = "";
0116
0117 ComponentMergeMethod componentMergeMethod = ComponentMergeMethod::eMaxWeight;
0118
0119 GsfOptions(const GeometryContext &geoCtxt,
0120 const MagneticFieldContext &magFieldCtxt,
0121 const CalibrationContext &calibCtxt)
0122 : geoContext(geoCtxt),
0123 magFieldContext(magFieldCtxt),
0124 calibrationContext(calibCtxt),
0125 propagatorPlainOptions(geoCtxt, magFieldCtxt) {}
0126 };
0127
0128 }