4#ifndef MUONR4_MUONPATTERNRECOGNTIONALGS_SEGMENTFITTINGALG__H
5#define MUONR4_MUONPATTERNRECOGNTIONALGS_SEGMENTFITTINGALG__H
37 using AthReentrantAlgorithm::AthReentrantAlgorithm;
40 virtual StatusCode
execute(
const EventContext& ctx)
const override;
82 ToolHandle<ISpacePointCalibrator>
m_calibTool{
this,
"Calibrator",
"" };
84 ToolHandle<MuonValR4::IPatternVisualizationTool>
m_visionTool{
this,
"VisualizationTool",
""};
86 Gaudi::Property<bool>
m_doT0Fit{
this,
"fitSegmentT0",
true};
95 Gaudi::Property<double>
m_beamSpotR{
this,
"BeamSpotRadius", 30.* Gaudi::Units::cm};
97 Gaudi::Property<double>
m_beamSpotL{
this,
"BeamSpotLength", 2. * Gaudi::Units::m};
98 static constexpr auto s_stIdxMax = Acts::toUnderlying(Muon::MuonStationIndex::StIndex::StIndexMax);
102 Gaudi::Property<std::vector<double>>
m_seedMaxBsR{
this,
"SeedMaxDistanceBsRadius",
104 Gaudi::Property<std::vector<double>>
m_seedMaxBsL{
this,
"SeedMaxDistanceBsLength",
124 Gaudi::Property<unsigned>
m_maxIter{
this,
"maxIterations", 50};
130 std::unique_ptr<SegmentFit::SegmentLineFitter>
m_fitter{};
132 std::unique_ptr<SegmentFit::MdtSegmentSeedGenerator>
m_seeder{};
138 Gaudi::Property<double>
m_singleMlEdgeTolerance{
this,
"SingleMlEdgeTolerance", 50. * Gaudi::Units::mm,
"For Single-ML fallback to not trigger, the trajectory has to penetrate at least this much into the second multilayer (from either side) in local precision coordinate"};
141 Gaudi::Property<double>
m_singleMlPhiEdgeTolerance{
this,
"SingleMlPhiEdgeTolerance", 0. * Gaudi::Units::mm,
"For Single-ML fallback to not trigger, the trajectory has to penetrate at least this much into the second multilayer (from either side) in local phi coordinate"};
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
The SegmentFittingAlg fits straight lines to the Mdt/Rpc/Tgc hits associated with the SegmentSeedPatt...
std::unique_ptr< SegmentFit::SegmentAmbiSolver > m_ambiSolver
Pointer to the ambiguity reosolution.
Gaudi::Property< unsigned > m_precHitCut
Minimum number of precision hits to accept the segment.
Gaudi::Property< bool > m_hessianResidual
Use the expliciit Hessian in the residual calculation.
virtual StatusCode initialize() override
Gaudi::Property< bool > m_recalibSeed
Toggle seed recalibration.
Gaudi::Property< double > m_seedHitChi2
Two mdt seeds are the same if their defining parameters match wihin.
Gaudi::Property< bool > m_useFastFitter
Use the fast Mdt fitter where possible.
std::optional< SpacePointPerLayerSplitter::HitVec > makeBimBirRecoveryHits(const SegmentSeed &seed) const
BIM/BIR chambers are treated as the same sector, however, they don't overlap in many instances.
int m_birStation
Cached BIR station index for quick access.
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Gaudi::Property< double > m_beamSpotL
Longitudinal covariance on the beam spo measurement.
Gaudi::Property< bool > m_recalibInFit
SG::WriteHandleKey< SegmentContainer > m_outSegments
SegmentVec_t fitSegmentSeed(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const SegmentSeed *seed) const
Fit the hits from the pattern seed to segment candidates.
virtual ~SegmentFittingAlg()
int m_bimStation
Cached BIM station index for quick access.
int m_bilStation
Cached BIL station index for quick access.
Gaudi::Property< bool > m_allowSegmentSeedingFallback
Allow single multilayer fallback when standard segment reconstruction fails.
Gaudi::Property< bool > m_fastPreFitter
The fast fitter is treated as a pre fitter.
void resolveAmbiguities(const ActsTrk::GeometryContext &gctx, SegmentVec_t &segmentCandidates) const
Resolve the ambiguity amongst the segment candidates within a spectrometer sector.
std::unique_ptr< SegmentFit::MdtSegmentSeedGenerator > m_seeder
Pointer to the L-R segment seeder.
Gaudi::Property< double > m_singleMlEdgeTolerance
Tolerance for the single multilayer edge crossing test, if the trajectory only slighty nicks the seco...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc.
Gaudi::Property< bool > m_doBeamspotConstraint
Add beamline constraint.
Gaudi::Property< double > m_singleMlPhiEdgeTolerance
Tolerance for the single multilayer edge crossing test in the phi projection in case the trajectory o...
ToolHandle< ISpacePointCalibrator > m_calibTool
Handle to the space point calibrator.
std::unique_ptr< SegmentFit::SegmentLineFitter > m_fitter
Pointer to the actual segment fitter.
std::vector< std::unique_ptr< Segment > > SegmentVec_t
std::optional< SpacePointPerLayerSplitter::HitVec > makeBilRecoveryHits(const SegmentSeed &seed) const
For BIL (specifically around eta3 chambers), there are cases where only a single multilayer is crosse...
Gaudi::Property< std::vector< double > > m_seedMaxBsL
Gaudi::Property< bool > m_ignoreFailedPreFit
Switch to try the full fit when the fast pre-fitter fails.
SegmentFit::Parameters Parameters
Gaudi::Property< bool > m_doT0Fit
static constexpr auto s_stIdxMax
SG::ReadHandleKey< SegmentSeedContainer > m_seedKey
ReadHandle of the seeds.
Gaudi::Property< std::vector< double > > m_seedMaxBsR
Maximum allowed distance of the segment seed line to the beam spot measurement expressed in relative ...
Gaudi::Property< double > m_recoveryPull
Gaudi::Property< double > m_beamSpotR
Radial covariance on th beam spot measurment.
Gaudi::Property< unsigned > m_maxIter
Tune the number of iterations.
virtual StatusCode execute(const EventContext &ctx) const override
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Gaudi::Property< unsigned > m_busyLayerLimit
Cut on the number of hits per layer to use the layer for seeding.
Gaudi::Property< double > m_outlierRemovalCut
Cut on the segment chi2 / nDoF to launch the outlier removal.
Gaudi::Property< bool > m_tryPatternPars
Try first to fit the pattern parameters. Then proceed with the straw line tangents.
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::ReadHandleKey< GeometryContext > GeoContextReadKey_t
Abrivate the ReadHandleKey to declare the data dependency on the Geometry context.
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters
This header ties the generic definitions in this package.