4#ifndef MUONPATTERNHELPERS_MDTSEGMENTFITTER_H
5#define MUONPATTERNHELPERS_MDTSEGMENTFITTER_H
20#include <Acts/Seeding/CompositeSpacePointLineFitter.hpp>
31 using Fitter_t = Acts::Experimental::CompositeSpacePointLineFitter;
35 using Hit_t = std::unique_ptr<CalibratedSpacePoint>;
41 using Result_t = Fitter_t::FitResult<HitVec_t>;
43 using FitOpts_t = Fitter_t::FitOptions<HitVec_t, ISpacePointCalibrator>;
45 using Selector_t = Fitter_t::Selector_t<CalibratedSpacePoint>;
71 struct Config :
public Fitter_t::Config,
98 std::unique_ptr<Segment>
fitSegment(
const EventContext& ctx,
153 bool plugHoles(
const Acts::CalibrationContext& cctx,
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
State
State flag to distinguish different space point states.
Interface class to refine the space point calibration with an external seed.
void centerAlongWire(Result_t &fitResult) const
Moves the segment to the average x0 position, if the segment does not contain any measurement.
bool plugHoles(const Acts::CalibrationContext &cctx, const SegmentSeed &seed, const Amg::Transform3D &localToGlobal, Result_t &toRecover) const
Recovery of missed hits.
std::unique_ptr< CalibratedSpacePoint > Hit_t
Abrivation of the space point type to use.
Fitter_t::Selector_t< CalibratedSpacePoint > Selector_t
Abrivation of the hit selector to choose valid hits.
void cleanStripLayers(const Amg::Vector3D &linePos, const Amg::Vector3D &lineDir, HitVec_t &hits) const
Marks duplicate hits on a strip layer as outliers to avoid competing contributions from the same laye...
Selector_t m_goodHitSel
Selector to identify the valid hits.
Result_t callLineFit(const Acts::CalibrationContext &cctx, const Parameters &startPars, const Amg::Transform3D &localToGlobal, HitVec_t &&calibHits) const
Calls the underlying line fitter to determine the segment parameters.
ConfigSwitches m_cfg
Configuration switches of the ATLAS fitter implementation.
Fitter_t::FitResult< HitVec_t > Result_t
Abrivation of the fit result.
bool removeOutliers(const Acts::CalibrationContext &cctx, const SegmentSeed &seed, const Amg::Transform3D &localToGlobal, Result_t &fitResult) const
Cleans the fitted segment from the most outlier hit and then attempts to refit the segment.
void eraseWrongHits(Result_t &candidate) const
Removes all hits from the segment which are obvious outliers.
CalibratedSpacePoint::State HitState
Abrivation of the fit state flag.
std::unique_ptr< Segment > convertToSegment(const Amg::Transform3D &locToGlobTrf, const SegmentSeed *parentSeed, Result_t &&toConvert) const
Converts the fit result into a segment object.
Fitter_t::FitOptions< HitVec_t, ISpacePointCalibrator > FitOpts_t
Abrivation of the fit options.
Fitter_t::FitParameters FitPars_t
Abrivation of the fit parameters.
std::unique_ptr< Segment > fitSegment(const EventContext &ctx, const SegmentSeed *parent, const LinePar_t &startPars, const Amg::Transform3D &localToGlobal, HitVec_t &&calibHits) const
Fit a set of measurements to a straight segment line.
Fitter_t m_fitter
Actual implementation of the straight line fit.
Fitter_t::ParamVec_t LinePar_t
Abrivation of the fitted line parameters.
std::vector< Hit_t > HitVec_t
Collection of space points.
SegmentLineFitter(const std::string &name, Config &&config)
Standard constructor.
Acts::Experimental::CompositeSpacePointLineFitter Fitter_t
Abrivation of the actual line fitter.
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
SegmentLineFitter::Result_t Result_t
SegmentLineFitter::HitVec_t HitVec_t
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters
Configuration object of the ATLAS implementation.
const ISpacePointCalibrator * calibrator
Pointer to the calibrator.
bool doBeamSpot
Switch to insert a beamspot constraint if possible.
const Muon::IMuonIdHelperSvc * idHelperSvc
Pointer to the idHelperSvc.
unsigned nPrecHitCut
Minimum number of precision hits.
unsigned nRecoveryLoops
Maximum trials to recover outliers.
double outlierRemovalCut
Cut on the segment chi2 / nDoF to launch the outlier removal.
const MuonValR4::IPatternVisualizationTool * visionTool
Pointer to the visualization tool.
double recoveryPull
Maximum pull on a measurement to add it back on the line.
double beamSpotRadius
Parameters of the beamspot measurement.
Config()
Standard constructor.
static RangeArray defaultRanges()
Function that returns a set of predefined ranges for testing.