ATLAS Offline Software
Acts/ActsTrackReconstruction/src/GaussianSumFitter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSGEOMETRY_GAUSSIANSUMFITTER_H
6 #define ACTSGEOMETRY_GAUSSIANSUMFITTER_H
7 
8 
9 
10 // ATHENA
12 #include "GaudiKernel/ToolHandle.h"
16 
17 // ACTS
18 #include "Acts/EventData/VectorMultiTrajectory.hpp"
19 #include "Acts/Geometry/GeometryContext.hpp"
20 #include "Acts/Utilities/Result.hpp"
21 #include "Acts/TrackFitting/GaussianSumFitter.hpp"
22 #include "Acts/Propagator/Propagator.hpp"
23 #include "Acts/Propagator/MultiEigenStepperLoop.hpp"
24 #include "Acts/Propagator/Navigator.hpp"
25 #include "Acts/TrackFitting/BetheHeitlerApprox.hpp"
26 #include "Acts/TrackFitting/GsfOptions.hpp"
27 #include "Acts/Utilities/Logger.hpp"
28 
29 // PACKAGE
37 
38 // STL
39 #include <string>
40 #include <memory>
41 
42 namespace ActsTrk {
43 
44 class GaussianSumFitter : public extends<AthAlgTool, Trk::ITrackFitter> {
45 public:
46 
47  GaussianSumFitter(const std::string&, const std::string&, const IInterface*);
48  virtual ~GaussianSumFitter() = default;
49 
50  // standard Athena methods
51  virtual StatusCode initialize() override;
52 
54  virtual std::unique_ptr<Trk::Track> fit(
55  const EventContext& ctx,
56  const Trk::Track&,
57  const Trk::RunOutlierRemoval runOutlier = false,
58  const Trk::ParticleHypothesis matEffects = Trk::nonInteracting) const override;
59 
61  virtual std::unique_ptr<Trk::Track> fit(
62  const EventContext& ctx,
63  const Trk::PrepRawDataSet&,
64  const Trk::TrackParameters&,
65  const Trk::RunOutlierRemoval runOutlier = false,
66  const Trk::ParticleHypothesis matEffects = Trk::nonInteracting) const override;
67 
69  virtual std::unique_ptr<Trk::Track> fit(
70  const EventContext& ctx,
71  const Trk::MeasurementSet&,
72  const Trk::TrackParameters&,
73  const Trk::RunOutlierRemoval runOutlier = false,
74  const Trk::ParticleHypothesis matEffects = Trk::nonInteracting) const override;
75 
77  virtual std::unique_ptr<Trk::Track> fit(
78  const EventContext& ctx,
79  const Trk::Track&,
80  const Trk::PrepRawDataSet&,
81  const Trk::RunOutlierRemoval runOutlier = false,
82  const Trk::ParticleHypothesis matEffects = Trk::nonInteracting) const override;
83 
85  virtual std::unique_ptr<Trk::Track> fit(
86  const EventContext& ctx,
87  const Trk::Track&,
88  const Trk::MeasurementSet&,
89  const Trk::RunOutlierRemoval runOutlier = false,
90  const Trk::ParticleHypothesis matEffects = Trk::nonInteracting) const override;
91 
93  virtual std::unique_ptr<Trk::Track> fit(
94  const EventContext& ctx,
95  const Trk::Track& intrk1,
96  const Trk::Track& intrk2,
97  const Trk::RunOutlierRemoval runOutlier = false,
98  const Trk::ParticleHypothesis matEffects = Trk::nonInteracting) const override;
99 
100 
102  // Private methods:
104 private:
105  Acts::GsfOptions<ActsTrk::MutableTrackStateBackend> prepareOptions(const Acts::GeometryContext& tgContext,
106  const Acts::MagneticFieldContext& mfContext,
107  const Acts::CalibrationContext& calContext,
108  const Acts::PerigeeSurface& surface) const;
109 
110  std::unique_ptr<Trk::Track> performFit(const EventContext& ctx,
111  const Acts::GeometryContext& tgContext,
112  const Acts::GsfOptions<ActsTrk::MutableTrackStateBackend>& gsfOptions,
113  const std::vector<Acts::SourceLink>& trackSourceLinks,
114  const Acts::BoundTrackParameters& initialParams) const;
115 
116  std::unique_ptr<Trk::Track> performDirectFit(const EventContext& ctx,
117  const Acts::GeometryContext& tgContext,
118  const Acts::GsfOptions<ActsTrk::MutableTrackStateBackend>& gsfOptions,
119  const std::vector<Acts::SourceLink>& trackSourceLinks,
120  const Acts::BoundTrackParameters& initialParams,
121  const std::vector<const Acts::Surface*>& surfaces) const;
122 
123  // Create a track from the fitter result
124  std::unique_ptr<Trk::Track> makeTrack(const EventContext& ctx,
125  const Acts::GeometryContext& tgContext,
127  Acts::Result<typename ActsTrk::MutableTrackContainer::TrackProxy, std::error_code>& fitResult) const;
128 
129  const Acts::GsfExtensions<ActsTrk::MutableTrackStateBackend>& getExtensions() const;
130 
132  const Acts::Logger& logger() const;
133 
134  private:
135  ToolHandle<IActsExtrapolationTool> m_extrapolationTool{this, "ExtrapolationTool", ""};
136  ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", ""};
137  ToolHandle<ActsTrk::IActsToTrkConverterTool> m_ATLASConverterTool{this, "ATLASConverterTool", ""};
138  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trkSummaryTool {this, "SummaryTool", "", "ToolHandle for track summary tool"};
139  ToolHandle<Trk::IBoundaryCheckTool> m_boundaryCheckTool {this,
140  "BoundaryCheckTool",
141  "",
142  "Boundary checking tool for detector sensitivities"};
143 
144  // the settable job options
145  Gaudi::Property< double > m_option_outlierChi2Cut {this, "OutlierChi2Cut", 12.5,
146  "Chi2 cut used by the outlier finder" };
147  Gaudi::Property< int > m_option_maxPropagationStep {this, "MaxPropagationStep", 5000,
148  "Maximum number of steps for one propagate call"};
149 
150  Gaudi::Property< int > m_maxComponents {this, "MaxComponents", 12,
151  "Maximum number of components in GSF"};
152 
153  Gaudi::Property<bool> m_useDirectNavigation{this, "UseDirectNavigation", false,
154  "GSF with direct navigation when refitting measurements"};
155 
156  Gaudi::Property<bool> m_refitOnly{this, "RefitOnly", false,
157  "Do refit only. Track summary will not be added"};
158 
159  Gaudi::Property< double > m_weightCutOff {this, "WeightCutOff", 1.e-4,
160  "component weight cut off"};
161 
162  Gaudi::Property<std::string> m_option_componentMergeMethod{this, "ComponentMergeMethod", "eMaxWeight"
163  , "method to merge components {eMean, eMaxWeight}"};
164 
165  Acts::ComponentMergeMethod m_componentMergeMethod;
166 
168  using Fitter = Acts::GaussianSumFitter< Acts::Propagator<Acts::MultiEigenStepperLoop<>, Acts::Navigator>,
169  Acts::AtlasBetheHeitlerApprox<6, 5>,
171 
172  std::unique_ptr<TrkMeasurementCalibrator> m_calibrator;
173  std::unique_ptr<Fitter> m_fitter;
174 
175  using DirectFitter = Acts::GaussianSumFitter< Acts::Propagator<Acts::MultiEigenStepperLoop<>, Acts::DirectNavigator>,
176  Acts::AtlasBetheHeitlerApprox<6, 5>,
178  std::unique_ptr<DirectFitter> m_directFitter;
179 
180 
182  Acts::GsfExtensions<ActsTrk::MutableTrackStateBackend> m_gsfExtensions;
183 
185 
187  std::unique_ptr<const Acts::Logger> m_logger;
188 
189 }; // end of namespace
190 
191 }
192 
193 #endif
194 
ActsTrk::GaussianSumFitter::m_calibrator
std::unique_ptr< TrkMeasurementCalibrator > m_calibrator
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:172
Trk::PrepRawDataSet
std::vector< const PrepRawData * > PrepRawDataSet
vector of clusters and drift circles
Definition: FitterTypes.h:26
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
ActsTrk::GaussianSumFitter::m_surfaceAccessor
ATLASSourceLinkSurfaceAccessor m_surfaceAccessor
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:181
ActsTrk::GaussianSumFitter::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:187
ActsTrk::GaussianSumFitter::m_trkSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:138
ActsTrk::detail::Navigator
Acts::Navigator Navigator
Definition: Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h:31
ActsTrk::GaussianSumFitter::performFit
std::unique_ptr< Trk::Track > performFit(const EventContext &ctx, const Acts::GeometryContext &tgContext, const Acts::GsfOptions< ActsTrk::MutableTrackStateBackend > &gsfOptions, const std::vector< Acts::SourceLink > &trackSourceLinks, const Acts::BoundTrackParameters &initialParams) const
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:581
ActsTrk::GaussianSumFitter::m_option_maxPropagationStep
Gaudi::Property< int > m_option_maxPropagationStep
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:147
ActsTrk::GaussianSumFitter::initialize
virtual StatusCode initialize() override
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:53
ActsTrk::GaussianSumFitter::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:136
ActsTrk::detail::FitterHelperFunctions::ATLASOutlierFinder
Outlier finder using a Chi2 cut.
Definition: FitterHelperFunctions.h:49
ActsTrk::GaussianSumFitter::prepareOptions
Acts::GsfOptions< ActsTrk::MutableTrackStateBackend > prepareOptions(const Acts::GeometryContext &tgContext, const Acts::MagneticFieldContext &mfContext, const Acts::CalibrationContext &calContext, const Acts::PerigeeSurface &surface) const
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:558
ActsTrk::GaussianSumFitter::m_componentMergeMethod
Acts::ComponentMergeMethod m_componentMergeMethod
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:165
Trk::RunOutlierRemoval
bool RunOutlierRemoval
switch to toggle quality processing after fit
Definition: FitterTypes.h:22
ActsTrk::GaussianSumFitter::m_weightCutOff
Gaudi::Property< double > m_weightCutOff
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:159
ActsTrk::GaussianSumFitter::m_option_outlierChi2Cut
Gaudi::Property< double > m_option_outlierChi2Cut
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:145
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
ActsTrk::MutableMultiTrajectory
Athena implementation of ACTS::MultiTrajectory (ReadWrite version) The data is stored in 4 external b...
Definition: MultiTrajectory.h:81
ActsTrk::GaussianSumFitter::GaussianSumFitter
GaussianSumFitter(const std::string &, const std::string &, const IInterface *)
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:47
ActsTrk::GaussianSumFitter::m_maxComponents
Gaudi::Property< int > m_maxComponents
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:150
ActsTrk::GaussianSumFitter::m_useDirectNavigation
Gaudi::Property< bool > m_useDirectNavigation
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:153
ActsTrk::GaussianSumFitter::performDirectFit
std::unique_ptr< Trk::Track > performDirectFit(const EventContext &ctx, const Acts::GeometryContext &tgContext, const Acts::GsfOptions< ActsTrk::MutableTrackStateBackend > &gsfOptions, const std::vector< Acts::SourceLink > &trackSourceLinks, const Acts::BoundTrackParameters &initialParams, const std::vector< const Acts::Surface * > &surfaces) const
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:607
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::GaussianSumFitter::makeTrack
std::unique_ptr< Trk::Track > makeTrack(const EventContext &ctx, const Acts::GeometryContext &tgContext, ActsTrk::MutableTrackContainer &tracks, Acts::Result< typename ActsTrk::MutableTrackContainer::TrackProxy, std::error_code > &fitResult) const
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:393
ActsTrk::GaussianSumFitter::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:552
AthAlgTool.h
ActsTrk::GaussianSumFitter::fit
virtual std::unique_ptr< Trk::Track > fit(const EventContext &ctx, const Trk::Track &, const Trk::RunOutlierRemoval runOutlier=false, const Trk::ParticleHypothesis matEffects=Trk::nonInteracting) const override
refit a track
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:117
ActsTrk::GaussianSumFitter::m_boundaryCheckTool
ToolHandle< Trk::IBoundaryCheckTool > m_boundaryCheckTool
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:139
Trk::ParametersBase
Definition: ParametersBase.h:55
ActsTrk::GaussianSumFitter::m_gsfExtensions
Acts::GsfExtensions< ActsTrk::MutableTrackStateBackend > m_gsfExtensions
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:182
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
ActsTrk::GaussianSumFitter::m_ATLASConverterTool
ToolHandle< ActsTrk::IActsToTrkConverterTool > m_ATLASConverterTool
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:137
ActsTrk::GaussianSumFitter::getExtensions
const Acts::GsfExtensions< ActsTrk::MutableTrackStateBackend > & getExtensions() const
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.cxx:545
MeasurementCalibrator.h
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
ActsTrk::ATLASSourceLinkSurfaceAccessor
Definition: ATLASSourceLinkSurfaceAccessor.h:20
ActsTrk::GaussianSumFitter::m_fitter
std::unique_ptr< Fitter > m_fitter
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:173
FitterHelperFunctions.h
ActsTrk::GaussianSumFitter::DirectFitter
Acts::GaussianSumFitter< Acts::Propagator< Acts::MultiEigenStepperLoop<>, Acts::DirectNavigator >, Acts::AtlasBetheHeitlerApprox< 6, 5 >, ActsTrk::MutableTrackStateBackend > DirectFitter
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:177
ActsTrk::GaussianSumFitter::m_option_componentMergeMethod
Gaudi::Property< std::string > m_option_componentMergeMethod
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:162
IExtendedTrackSummaryTool.h
ActsTrk::GaussianSumFitter::Fitter
Acts::GaussianSumFitter< Acts::Propagator< Acts::MultiEigenStepperLoop<>, Acts::Navigator >, Acts::AtlasBetheHeitlerApprox< 6, 5 >, ActsTrk::MutableTrackStateBackend > Fitter
Type erased track fitter function.
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:170
ActsTrk::GaussianSumFitter::~GaussianSumFitter
virtual ~GaussianSumFitter()=default
ActsTrk::GaussianSumFitter::m_outlierFinder
ActsTrk::detail::FitterHelperFunctions::ATLASOutlierFinder m_outlierFinder
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:184
IBoundaryCheckTool.h
ATLASSourceLinkSurfaceAccessor.h
ActsTrk::GaussianSumFitter
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:44
IActsToTrkConverterTool.h
ActsTrk::GaussianSumFitter::m_extrapolationTool
ToolHandle< IActsExtrapolationTool > m_extrapolationTool
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:135
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:49
ActsTrk::GaussianSumFitter::m_refitOnly
Gaudi::Property< bool > m_refitOnly
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:156
ActsTrk::GaussianSumFitter::m_directFitter
std::unique_ptr< DirectFitter > m_directFitter
Definition: Acts/ActsTrackReconstruction/src/GaussianSumFitter.h:178
ActsTrk::MutableTrackContainer
Definition: TrackContainer.h:122
ITrackFitter.h
TrackContainer.h
IActsTrackingGeometryTool.h
IActsExtrapolationTool.h