4#ifndef MUONR4_FASTRECONSTRUCTIONALGS_GLOBALPATTERNFINDER__H
5#define MUONR4_FASTRECONSTRUCTIONALGS_GLOBALPATTERNFINDER__H
13#include "Acts/Utilities/KDTree.hpp"
42 std::vector<LayerIndex>
layerSeedings{LayerIndex::Middle, LayerIndex::Outer};
86 std::unique_ptr<const Acts::Logger>
logger = Acts::getDefaultLogger(
87 "GlobalPatternFinder", Acts::Logging::Level::INFO));
95 std::span<const SpacePointContainer*> spacepoints)
const;
99 static const int s_nStations{Acts::toUnderlying(StIndex::StIndexMax)};
113 using SearchTree_t = Acts::KDTree<2, const HitPayload*, double, std::array, 50>;
122 struct SearchTreeData;
133 std::span<const SpacePointContainer*> spacepoints)
const;
141 std::vector<PatHitVisual>* visualInfo =
nullptr)
const;
153 const CandidateHit& testHit,
155 std::vector<PatHitVisual>* visualInfo =
nullptr)
const;
164 static bool isBetter(
const PatternState&
a,
165 const PatternState& b);
171 std::vector<PatHitVisual>* visualInfo =
nullptr)
const;
197 const HitPayload& hit2);
204 std::vector<PatHitVisual>* visualInfo)
const;
207 struct PatternPrintView;
209 static PatternPrintView
brief(
const PatternState& p);
211 static PatternPrintView
detailed(
const PatternState& p);
MuonValR4::IFastRecoVisualizationTool::PatternHitVisualInfo PatHitVisual
Type alias for the visual information of a pattern.
static LayerOrdering checkLayerOrdering(const HitPayload &hit1, const HitPayload &hit2)
Method to check the logical layer ordering of two hits.
const Acts::Logger & logger() const
Acts::KDTree< 2, const HitPayload *, double, std::array, 50 > SearchTree_t
Definition of the search tree class.
Config m_cfg
Global Pattern Recognition configuration.
static PatternPrintView brief(const PatternState &p)
Print the pattern state with brief information.
PatternStateVec resolveOverlaps(PatternStateVec &toResolve, std::vector< PatHitVisual > *visualInfo=nullptr) const
Method to remove overlapping patterns.
static bool isBetter(const PatternState &a, const PatternState &b)
Method to compare two patterns and define which one is better.
std::unique_ptr< const Acts::Logger > m_logger
Logger for the Global Pattern Finder.
void addVisualInfo(const PatternState &candidate, PatHitVisual::PatternStatus status, std::vector< PatHitVisual > *visualInfo) const
Helper function to add visual information of a given pattern (which is usually going to be destroyed)...
bool passPatternCuts(const PatternState &pat) const
Method to check if a pattern passes the quality cuts.
SearchTreeData constructTree(const ActsTrk::GeometryContext &gctx, std::span< const SpacePointContainer * > spacepoints) const
Construct the search tree from the given spacepoint containers.
GlobalPatternFinder(Config &&config, std::unique_ptr< const Acts::Logger > logger=Acts::getDefaultLogger("GlobalPatternFinder", Acts::Logging::Level::INFO))
Standard constructor.
Muon::MuonStationIndex::StIndex StIndex
Type alias for the station index.
LayerOrdering
Enum to express the logical measurement layer ordering given two hits.
void addPhiOnlyHits(const ActsTrk::GeometryContext &gctx, PatternStateVec &patterns) const
Method to add phi-only measurements to existing PatternStates.
std::vector< PatternState > PatternStateVec
Type alias for a vector of pattern states.
PatternStateVec findPatternsInEta(const Acts::GeometryContext &gctx, const SearchTree_t &orderedSpacepoints, std::vector< PatHitVisual > *visualInfo=nullptr) const
Method steering the global pattern building in the bending plane.
static const int s_nStations
Number of stations.
SeedCoords
Abrivation of the seed coordinates.
@ eSector
Expanded sector coordinate of the associated spectrometer sector
SpacePointPerLayerSorter m_spSorter
Spacepoint sorter per logical measurement layer.
void extendPatterns(const Acts::GeometryContext &gctx, PatternStateVec &startPatterns, PatternStateVec &endPatterns, const CandidateHit &testHit, const Amg::Vector3D &beamSpot, std::vector< PatHitVisual > *visualInfo=nullptr) const
Main function controlling the development of patterns, including pattern branching when necessary.
GlobalPattern convertToPattern(const PatternState &candidate) const
Method to convert a PatternState into a GlobalPattern object.
std::vector< GlobalPattern > findPatterns(const ActsTrk::GeometryContext &gctx, std::span< const SpacePointContainer * > spacepoints) const
Main methods steering the pattern finding.
static PatternPrintView detailed(const PatternState &p)
Print the pattern state with detailed information.
Muon::MuonStationIndex::LayerIndex LayerIndex
Type alias for the station layer index.
Data class to represent an eta maximum in hough space.
The SpacePointPerLayerSorter sort two given space points by their layer Identifier.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
static Root::TMsgLogger logger("iLumiCalc")
std::vector< std::string > patterns
Eigen::Matrix< double, 3, 1 > Vector3D
MsTrackSeederTool::SearchTree_t SearchTree_t
StIndex
enum to classify the different station layers in the muon spectrometer
LayerIndex
enum to classify the different layers in the muon spectrometer
Configuration object for the patter finder.
bool useMdtHits
Toggle the utilization of MDT hits to build patterns.
double lowConfidenceResSigma
Residual uncertainty to consider the hit as low confidence.
double nResidualSigma
Number of standard deviations to consider for residual acceptance.
double thetaSearchWindow
Size of theta window in radians to search for comapatible hits with a pattern, tailored to the target...
bool seedFromMdt
Toggle the seeding from MDT hits.
unsigned int minPhiLayers
Minimum number of phi layers required to accept a pattern.
const Muon::IMuonIdHelperSvc * idHelperSvc
Pointer to the idHelperSvc.
std::vector< LayerIndex > layerSeedings
Vector configuring the seeding layers.
double beamSpotRadius
Beamspot radius.
double beamSpotLength
Beamspot length.
double nPhiSigma
Number of standard deviations to consider for phi acceptance.
unsigned int minTriggerLayers
Minimum number of trigger layers in the bending direction required to accept a pattern.
const MuonValR4::IFastRecoVisualizationTool * visionTool
Pointer to the visualization tool.
unsigned int minStationLayers
Minimum number of layers in a station to be considered a good station.
unsigned int maxSeedAttempts
Maximum number of attempts to build a pattern from hits already used in existing patterns.
double minHitDistance4Line
Minimum distance (in mm) between two hits for being used to compute a reliable pattern line.
unsigned int minPrecisionLayers
Minimum number of precision layers in the bending direction required to accept a pattern.
double meanNormRes2Cut
Quality cut on pattern'mean squared normalized residual.
unsigned int maxMissLayersInStation
Maximum number of missed candidate hits in different measurement layers in a station.