5#ifndef MUONR4_MUONPATTERNRECOGNITIONALGS_NSWSEGMENTFINDERALG_H
6#define MUONR4_MUONPATTERNRECOGNITIONALGS_NSWSEGMENTFINDERALG_H
36 using AthReentrantAlgorithm::AthReentrantAlgorithm;
39 virtual StatusCode
execute(
const EventContext& ctx)
const override;
40 virtual StatusCode
finalize()
override;
66 unsigned int nExtSeeds,
67 unsigned int nSegments);
89 if(
chIdx != o.chIdx) {
90 return chIdx < o.chIdx;
112 using HitLaySpan_t = std::vector<std::reference_wrapper<const HitVec>>;
116 using UsedHitSpan_t = std::vector<std::reference_wrapper<std::vector<unsigned int>>>;
186 bool useOnlyMM)
const;
230 unsigned int increase,
231 bool markNeighborHits)
const;
250 std::pair<SegmentSeedVec_t, SegmentVec_t>
253 const EventContext& ctx)
const;
271 ToolHandle<MuonValR4::IPatternVisualizationTool>
m_visionTool{
this,
"VisualizationTool",
""};
274 ToolHandle<ISpacePointCalibrator>
m_calibTool{
this,
"Calibrator",
"" };
280 DoubleProperty
m_windowTheta {
this,
"thetaWindow", 2.5 * Gaudi::Units::deg};
298 UnsignedIntegerProperty
m_maxUsed{
this,
"maxHitIsUsed", 8};
#define AmgSymMatrix(dim)
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Data class to represent an eta maximum in hough space.
SeedStatistic_T m_seedStat
void printTableSeedStats(MsgStream &msg) const
void addToStat(const MuonGMR4::SpectrometerSector *msSector, unsigned int nSeeds, unsigned int nExtSeeds, unsigned int nSegments)
Muon::MuonStationIndex::ChIndex chIdx_t
std::map< SectorField, SeedField > SeedStatistic_T
const MuonGMR4::MuonDetectorManager * m_detMgr
UnsignedIntegerProperty m_maxUsed
std::pair< SegmentSeedVec_t, SegmentVec_t > findSegmentsFromMaximum(const HoughMaximum &max, const ActsTrk::GeometryContext &gctx, const EventContext &ctx) const
Find seed and segment from an eta hough maximum.
virtual ~NswSegmentFinderAlg()=default
std::unique_ptr< SegmentSeed > constructCombinatorialSeed(const InitialSeed_t &initialSeed, const AmgSymMatrix(2)&bMatrix, const HoughMaximum &max, const HitLaySpan_t &extensionLayers, const UsedHitSpan_t &usedHits) const
Construct a combinatorial seed from the initial 4-layer seed hits.
UnsignedIntegerProperty m_minClusSize
std::unique_ptr< SegmentFit::SegmentLineFitter > m_lineFitter
std::pair< SegmentSeedVec_t, SegmentVec_t > buildSegmentsFromMM(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const HitLayVec &hitLayers, const HoughMaximum &max, const Amg::Vector3D &beamSpotPos, UsedHitMarker_t &usedHits, bool useOnlyMM) const
Build the final segment seed from strip like measurements using the combinatorial seeding for MicroMe...
UnsignedIntegerProperty m_maxClustersInLayer
DoubleProperty m_minPullThreshold
virtual StatusCode initialize() override
UnsignedIntegerProperty m_maxInvalidClusters
virtual StatusCode execute(const EventContext &ctx) const override
std::pair< SegmentSeedVec_t, SegmentVec_t > buildSegmentsFromSTGC(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const HitLayVec &hitLayers, const HoughMaximum &max, const Amg::Vector3D &beamSpotPos, UsedHitMarker_t &usedHits) const
Build the segment for a seed from STGC 2D measurement layers directly and then attempt to append hits...
HitWindow
To fastly check whether a hit is roughly compatible with a muon trajectory a narrow corridor is opene...
@ inside
The hit is below the predefined corridor.
@ tooHigh
The hit is inside the defined window and hence an initial candidate.
DoubleProperty m_maxdYWindow
std::unique_ptr< Segment > fitSegmentSeed(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const SegmentSeed *patternSeed) const
Fit the segment seeds.
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
std::vector< std::reference_wrapper< const HitVec > > HitLaySpan_t
Abbrivation of the space comprising multiple hit vectors without copy.
std::array< const SpacePoint *, 4 > InitialSeed_t
Abbrivation of the initial seed.
SG::WriteHandleKey< SegmentSeedContainer > m_writeSegmentSeedKey
HitWindow hitFromIPCorridor(const SpacePoint &testHit, const Amg::Vector3D &beamSpotPos, const Amg::Vector3D &dirEstUp, const Amg::Vector3D &dirEstDn) const
The hit is above the predefined corridor.
std::vector< std::unique_ptr< SegmentSeed > > SegmentSeedVec_t
Abbrivation of the seed vector.
void constructPreliminarySeeds(const Amg::Vector3D &beamSpot, const HitLaySpan_t &combinatoricLayers, const UsedHitSpan_t &usedHits, InitialSeedVec_t &outVec) const
Construct a set of prelimnary seeds from the selected combinatoric layers.
void processSegment(std::unique_ptr< Segment > segment, const HitVec &seedHits, const HitLayVec &hitLayers, UsedHitMarker_t &usedHits, SegmentVec_t &segments) const
Process the segment and mark the hits if it is successfully built or not by differently mark the hits...
void markHitsAsUsed(const HitVec &spacePoints, const HitLayVec &allSortHits, UsedHitMarker_t &usedHitMarker, unsigned int increase, bool markNeighborHits) const
Hits that are used in a good seed/segment built should be flagged as used and not contribute to other...
UsedHitMarker_t emptyBookKeeper(const HitLayVec &sortedSp) const
Constructs an empty HitMarker from the split space points.
virtual StatusCode finalize() override
DoubleProperty m_windowTheta
BooleanProperty m_dumpSeedStatistics
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SpacePointPerLayerSplitter::HitLayVec HitLayVec
SpacePointPerLayerSplitter::HitVec HitVec
std::vector< InitialSeed_t > InitialSeedVec_t
Vector of initial seeds.
BooleanProperty m_doOnlyMMCombinatorics
StripOrient classifyStrip(const SpacePoint &spacePoint) const
Determines the orientation of the strip space point.
StripOrient
Enumeration to classify the orientation of a NSW strip.
@ X
Stereo strips with negative angle.
@ C
Single phi measurements.
@ V
Stereo strips with positive angle.
@ Unknown
Combined 2D space point (sTGC wire + strip / sTgc pad)
std::vector< std::unique_ptr< Segment > > SegmentVec_t
Abbrivation of the final segment vector.
SG::WriteHandleKey< SegmentContainer > m_writeSegmentKey
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
std::vector< std::vector< unsigned int > > UsedHitMarker_t
Abbrivation of the container book keeping whether a hit is used or not.
ToolHandle< ISpacePointCalibrator > m_calibTool
HitVec extendHits(const Amg::Vector3D &startPos, const Amg::Vector3D &direction, const HitLaySpan_t &extensionLayers, const UsedHitSpan_t &usedHits) const
Extend the seed with the hits from the other layers.
UnsignedIntegerProperty m_minSeedHits
SG::ReadHandleKey< EtaHoughMaxContainer > m_etaKey
std::vector< std::reference_wrapper< std::vector< unsigned int > > > UsedHitSpan_t
Abbrivation of the container to pass a subset of markers wtihout copy.
BooleanProperty m_markHitsFromSeed
std::unique_ptr< SeedStatistics > m_seedCounter ATLAS_THREAD_SAFE
Representation of a segment seed (a fully processed hough maximum) produced by the hough transform.
std::vector< HitVec > HitLayVec
std::vector< const SpacePoint * > HitVec
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
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.
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
SpacePointPerLayerSplitter::HitVec HitVec
ChIndex
enum to classify the different chamber layers in the muon spectrometer
sector's field to dump the seed statistics
bool operator<(SectorField const &o) const noexcept
unsigned int nExtSeeds
number of successfully extended seeds
unsigned int nSeeds
number of total seeds constructed
unsigned int nSegments
number of segments constucted