ATLAS Offline Software
Loading...
Searching...
No Matches
MdtSegmentSeedGenerator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONR4_MUONPATTERNHELPERS_MDTSEGMENTSEEDGENERATOR_H
5#define MUONR4_MUONPATTERNHELPERS_MDTSEGMENTSEEDGENERATOR_H
6
11
12#include <vector>
13#include <array>
14
15#include "Acts/Seeding/CompositeSpacePointLineSeeder.hpp"
16namespace MuonR4{
19}
20
21namespace MuonR4::SegmentFit {
28 public:
29 using LineSeeder_t = Acts::Experimental::CompositeSpacePointLineSeeder;
32 struct Config{
34 std::array<double, 2> thetaRange{0, 180.*Gaudi::Units::deg};
36 std::array<double, 2> interceptRange{-20.*Gaudi::Units::m, 20.*Gaudi::Units::m};
38 double hitPullCut{5.};
40 bool startWithPattern{false};
42 unsigned int busyLayerLimit{2};
44 unsigned int nMdtHitCut{3};
47 double nMdtLayHitCut{2./3.};
50 bool tightenHitCut{true};
53 bool overlapCorridor{true};
55 bool recalibSeedCircles{false};
59 unsigned int nMaxIter{100};
61 double precCutOff{1.e-6};
62 };
63
68 std::vector<std::unique_ptr<CalibratedSpacePoint>> measurements{};
70 unsigned int nIter{0};
72 double chi2{0.};
76 unsigned int nMdt{0};
77 };
78
84 MdtSegmentSeedGenerator(const std::string& name,
85 const SegmentSeed* segmentSeed,
86 const Config& configuration);
87
90 std::optional<DriftCircleSeed> nextSeed(const EventContext& ctx);
92 unsigned int numGenerated() const;
94 const Config& config() const;
95 private:
96 using TangentLine = LineSeeder_t::TwoCircleTangentPars;
97 using TangentAmbi = LineSeeder_t::TangentAmbi;
98 static constexpr std::array<TangentAmbi, 4> s_signCombos{TangentAmbi::LL, TangentAmbi::RR,
99 TangentAmbi::LR, TangentAmbi::RL};
100
101 struct SeedSolution : public TangentLine {
105 std::vector<int> solutionSigns{};
107 bool isValid{true};
109 friend std::ostream& operator<<(std::ostream& ostr, const SeedSolution& sol) {
110 return sol.print(ostr);
111 }
112 std::ostream& print(std::ostream& ostr) const;
113 };
114
116 bool isValidLine(const TangentLine& solution) const;
120 Line_t::ParamVector constructLinePars(const double theta, const double y0) const;
126 std::optional<DriftCircleSeed> buildSeed(const EventContext& ctx,
127 const HoughHitType& topHit,
128 const HoughHitType& bottomHit,
129 const TangentAmbi ambi);
131 void moveToNextCandidate();
133 static SeedingAux::Config translate(const Config& cfg);
135
138 const SegmentSeed* m_segmentSeed{nullptr};
140
142 std::size_t m_upperLayer{0};
144 std::size_t m_lowerLayer{0};
146 std::size_t m_lowerHitIndex{0};
148 std::size_t m_upperHitIndex{0};
150 std::size_t m_signComboIndex{0};
152 std::vector<SeedSolution> m_seenSolutions{};
154 unsigned int m_nGenSeeds{0};
155
156 };
157}
158#endif
Scalar theta() const
theta method
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
The calibrated Space point is created during the calibration process.
Interface class to refine the space point calibration with an external seed.
std::size_t m_signComboIndex
Index of the left-right ambiguity between the circles.
Line_t m_line
Line to instantiate the seed parameters.
bool isValidLine(const TangentLine &solution) const
Checks whether the intercept and the angle are witihn the allowed ranges.
LineSeeder_t::TwoCircleTangentPars TangentLine
static SeedingAux::Config translate(const Config &cfg)
Translate the SeedGenerator config to a Seed auxillary config.
unsigned int numGenerated() const
Returns how many seeds have been generated.
std::size_t m_upperLayer
Considered layer to pick the top drift circle from.
std::size_t m_lowerHitIndex
Explicit hit to pick in the selected bottom layer.
std::size_t m_lowerLayer
Considered layer to pick the bottom drift circle from.
std::vector< SeedSolution > m_seenSolutions
Vector caching equivalent solutions to avoid double seeding.
Acts::Experimental::CompositeSpacePointLineSeeder LineSeeder_t
static constexpr std::array< TangentAmbi, 4 > s_signCombos
std::optional< DriftCircleSeed > buildSeed(const EventContext &ctx, const HoughHitType &topHit, const HoughHitType &bottomHit, const TangentAmbi ambi)
Tries to build the seed from the two hits.
const Config & config() const
Returns the current seed configuration.
MdtSegmentSeedGenerator(const std::string &name, const SegmentSeed *segmentSeed, const Config &configuration)
Standard constructor taking the segmentSeed to start with and then few configuration tunes.
Line_t::ParamVector constructLinePars(const double theta, const double y0) const
Construct the 3D-Line parameters from the estimates theta & y0 from the tangent line.
void moveToNextCandidate()
Prepares the generator to generate the seed from the next pair of drift circles.
unsigned int m_nGenSeeds
Counter on how many seeds have been generated.
std::size_t m_upperHitIndex
Explicit hit to pick in the selected top layer.
std::optional< DriftCircleSeed > nextSeed(const EventContext &ctx)
returns the next seed in the row
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
Definition SegmentSeed.h:14
: The muon space point bucket represents a collection of points that will bre processed together in t...
The SpacePointPerLayerSplitter takes a set of spacepoints already sorted by layer Identifier (see Muo...
std::vector< const SpacePoint * > HitVec
SeedingAux::Line_t Line_t
Abrivation of the line with partial derivatives.
Acts::Experimental::CompositeSpacePointLineFitter::ParamVec_t Parameters
This header ties the generic definitions in this package.
const SpacePoint * HoughHitType
double precCutOff
Precision cut off in the fast segment fit.
double nMdtLayHitCut
Hit cut based on the fraction of collected tube layers.
bool tightenHitCut
Once a seed with even more than initially required hits is found, reject all following seeds with les...
bool startWithPattern
Try at the first time the pattern seed as candidate.
bool recalibSeedCircles
Recalibrate the seed drift circles from the initial estimate.
unsigned int nMaxIter
Maximum number of iterations in the fast segment fit.
const MuonR4::ISpacePointCalibrator * calibrator
Pointer to the space point calibrator.
unsigned int busyLayerLimit
How many drift circles may be on a layer to be used for seeding.
unsigned int nMdtHitCut
How many drift circle hits needs the seed to contain in order to be valid.
std::array< double, 2 > thetaRange
Cut on the theta angle.
std::array< double, 2 > interceptRange
Cut on the intercept range.
bool overlapCorridor
Check whether a new seed candidate shares the same left-right solution with already accepted ones Rej...
std::vector< std::unique_ptr< CalibratedSpacePoint > > measurements
List of calibrated measurements.
const SpacePointBucket * parentBucket
Pointer to the parent bucket.
std::vector< int > solutionSigns
Vector of radial signs of the valid hits.
friend std::ostream & operator<<(std::ostream &ostr, const SeedSolution &sol)
Outstream operator.