Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ActsTrackFittingAlgorithm.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ActsTrackFittingAlgorithm.h
1 
2 #ifndef TRACKBASE_ACTSTRACKFITTINGALGORITHM_H
3 #define TRACKBASE_ACTSTRACKFITTINGALGORITHM_H
4 
5 #include "Calibrator.h"
7 
10 
11 #pragma GCC diagnostic push
12 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
13 #pragma GCC diagnostic ignored "-Wunused-value"
15 #pragma GCC diagnostic pop
16 
17 #pragma GCC diagnostic push
18 #pragma GCC diagnostic ignored "-Wshadow"
20 #pragma GCC diagnostic pop
21 #pragma GCC diagnostic push
22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
24 #pragma GCC diagnostic pop
25 
29 
30 #include <functional>
31 #include <memory>
32 #include <vector>
33 
34 namespace Acts
35 {
36  class TrackingGeometry;
37 }
38 
40 {
41  public:
44  using MeasurementContainer = std::vector<Measurement>;
45 
46  using TrackContainer =
48  Acts::VectorMultiTrajectory, std::shared_ptr>;
49 
51 
55  {
56  std::reference_wrapper<const Acts::GeometryContext> geoContext;
57  std::reference_wrapper<const Acts::MagneticFieldContext> magFieldContext;
58  std::reference_wrapper<const Acts::CalibrationContext> calibrationContext;
59  const Acts::Surface* referenceSurface = nullptr;
61  };
62 
67  {
68  public:
69  virtual ~TrackFitterFunction() = default;
71  const std::vector<Acts::SourceLink>&,
73  const CalibratorAdapter&,
74  TrackContainer&) const = 0;
75 
76  virtual void outlierFinder(const ResidualOutlierFinder&) {}
77  };
78 
84  {
85  public:
86  virtual ~DirectedTrackFitterFunction() = default;
87 
89  const std::vector<Acts::SourceLink>&,
91  const std::vector<const Acts::Surface*>&,
92  const CalibratorAdapter&,
93  TrackContainer&) const = 0;
94  };
95 
96  struct Config
97  {
100  std::shared_ptr<TrackFitterFunction> fit;
102  std::shared_ptr<DirectedTrackFitterFunction> dFit;
103  };
104 
110 
112  const Config& config() const { return m_cfg; }
113 
123  static std::shared_ptr<TrackFitterFunction> makeKalmanFitterFunction(
124  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
125  std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
126  bool multipleScattering = true, bool energyLoss = true,
127  double reverseFilteringMomThreshold = 0.0,
128  Acts::FreeToBoundCorrection freeToBoundCorrection =
130  const Acts::Logger& logger = *Acts::getDefaultLogger("Kalman",
132 
133  static std::shared_ptr<DirectedTrackFitterFunction> makeDirectedKalmanFitterFunction(
134  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
135  std::shared_ptr<const Acts::MagneticFieldProvider> magneticField,
136  bool multipleScattering = true, bool energyLoss = true,
137  double reverseFilteringMomThreshold = 0.0,
138  Acts::FreeToBoundCorrection freeToBoundCorrection =
140  const Acts::Logger& logger = *Acts::getDefaultLogger("Kalman",
142 
143  private:
146  const std::vector<Acts::SourceLink>& sourceLinks,
147  const TrackParameters& initialParameters,
148  const GeneralFitterOptions& options,
149  const std::vector<const Acts::Surface*>& surfSequence,
150  const CalibratorAdapter& calibrator,
151  TrackContainer& tracks) const;
152 
154 };
155 
158  const std::vector<Acts::SourceLink>& sourceLinks,
159  const TrackParameters& initialParameters,
161  const std::vector<const Acts::Surface*>& surfSequence,
162  const CalibratorAdapter& calibrator,
163  TrackContainer& tracks) const
164 {
166  {
167  return (*m_cfg.dFit)(sourceLinks, initialParameters, options, surfSequence, calibrator, tracks);
168  }
169 
170  return (*m_cfg.fit)(sourceLinks, initialParameters, options, calibrator, tracks);
171 }
172 
173 #endif