ATLAS Offline Software
Loading...
Searching...
No Matches
SegmentAmbiSolver.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONR4_MUONPATTERNHELPERS_SEGMENTAMBISOLVER_H
5#define MUONR4_MUONPATTERNHELPERS_SEGMENTAMBISOLVER_H
6
9
10#include <vector>
11#include <unordered_map>
12#include <array>
13
14namespace MuonR4::SegmentFit {
28 public:
30 struct Config{
33 double selectByNDoFChi2{5.};
35 unsigned int sharedPrecHits{3};
38 bool remLeftRightAmbi{false};
39 };
40
43 SegmentAmbiSolver(const std::string&name,
44 Config&& config);
45
47 using SegmentVec = std::vector<std::unique_ptr<Segment>>;
53 SegmentVec&& toResolve) const;
54 private:
56 const Config m_cfg{};
58 enum class Resolution: std::uint8_t{
62 };
63
68 std::vector<int> driftSigns(const ActsTrk::GeometryContext& gctx,
69 const Segment& segment,
70 const Segment::MeasVec& measurements) const;
72 using MeasurementSet = std::unordered_set<const xAOD::UncalibratedMeasurement*>;
75 MeasurementSet extractPrds(const Segment& segment) const;
76
80 unsigned int countShared(const MeasurementSet& measSet1,
81 const MeasurementSet& measSet2) const;
82
85 double redChi2(const Segment& segment) const;
86
87
88
89
90 };
91}
92
93
94#endif
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
const Config m_cfg
Configuration object.
std::unordered_set< const xAOD::UncalibratedMeasurement * > MeasurementSet
List of measurements out of which the segment is made of.
Resolution
Auxiliary enum to indicate the ambiguity status of the segment candidates.
@ superSet
No ambiguity with other candidates detected.
@ subSet
Ambiguity detected and the candidate is of better quality.
SegmentVec resolveAmbiguity(const ActsTrk::GeometryContext &gctx, SegmentVec &&toResolve) const
Launches the ambiguity resoltuion and returns a new temporary contained containing the good candidate...
unsigned int countShared(const MeasurementSet &measSet1, const MeasurementSet &measSet2) const
Counts the number of measurements that're in both sets.
MeasurementSet extractPrds(const Segment &segment) const
Extract the Uncalibrated measurements used to build the segment.
double redChi2(const Segment &segment) const
Returns the reduced chi2 of the segment.
std::vector< std::unique_ptr< Segment > > SegmentVec
Abrivation of the temporary segment container.
std::vector< int > driftSigns(const ActsTrk::GeometryContext &gctx, const Segment &segment, const Segment::MeasVec &measurements) const
Calculates the left-right ambiguities of the segment w.r.t each measurement.
SegmentAmbiSolver(const std::string &name, Config &&config)
Constructor.
Placeholder for what will later be the muon segment EDM representation.
Configuration object to stree the ambiguties.
unsigned int sharedPrecHits
Cut on the number of shared precision hits.
double selectByNDoFChi2
If two overlapping segments have both the chi2 below the threshold, the one with more degrees of free...
bool remLeftRightAmbi
Two candidates with the sam number of precision hits but with different left / right ambiguities are ...