ATLAS Offline Software
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 
14 namespace MuonR4::SegmentFit {
16  public:
17  struct Config{
20  double selectByNDoFChi2{5.};
22  unsigned int sharedPrecHits{3};
24  bool remLeftRightAmbi{false};
25  };
26 
27  SegmentAmbiSolver(const std::string&name,
28  Config&& config);
29 
30 
31  using SegmentVec = std::vector<std::unique_ptr<Segment>>;
33  SegmentVec&& toResolve) const;
34 
35 
36  enum class Resolution{
37  noOverlap,
38  superSet,
39  subSet
40  };
41  private:
42  const Config m_cfg{};
43 
44  std::vector<int> driftSigns(const ActsGeometryContext& gctx,
45  const Segment& segment,
46  const Segment::MeasVec& measurements) const;
47 
48  using MeasurementSet = std::unordered_set<const xAOD::UncalibratedMeasurement*>;
49 
52 
54  unsigned int countShared(const MeasurementSet& measSet1,
55  const MeasurementSet& measSet2) const;
56 
58  double redChi2(const Segment& segment) const;
59 
60 
61 
62 
63  };
64 }
65 
66 
67 #endif
MuonR4::SegmentFit::SegmentAmbiSolver::SegmentAmbiSolver
SegmentAmbiSolver(const std::string &name, Config &&config)
Definition: SegmentAmbiSolver.cxx:11
MuonR4::SegmentFit
Definition: MuonHoughDefs.h:33
MuonR4::SegmentFit::SegmentAmbiSolver::driftSigns
std::vector< int > driftSigns(const ActsGeometryContext &gctx, const Segment &segment, const Segment::MeasVec &measurements) const
Definition: SegmentAmbiSolver.cxx:96
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
MuonR4::SegmentFit::SegmentAmbiSolver::Config
Definition: SegmentAmbiSolver.h:17
MuonR4::SegmentFit::SegmentAmbiSolver::Resolution
Resolution
Definition: SegmentAmbiSolver.h:36
MuonR4::SegmentFit::SegmentAmbiSolver::m_cfg
const Config m_cfg
Definition: SegmentAmbiSolver.h:42
MuonR4::SegmentFit::SegmentAmbiSolver::MeasurementSet
std::unordered_set< const xAOD::UncalibratedMeasurement * > MeasurementSet
Definition: SegmentAmbiSolver.h:48
MuonR4::SegmentFit::SegmentAmbiSolver::resolveAmbiguity
SegmentVec resolveAmbiguity(const ActsGeometryContext &gctx, SegmentVec &&toResolve) const
Definition: SegmentAmbiSolver.cxx:18
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
MuonR4::SegmentFit::SegmentAmbiSolver::Resolution::noOverlap
@ noOverlap
MuonR4::Segment::MeasVec
std::vector< MeasType > MeasVec
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:24
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
Config
Definition: dumpNPs.cxx:47
MuonR4::SegmentFit::SegmentAmbiSolver::Resolution::subSet
@ subSet
MuonR4::SegmentFit::SegmentAmbiSolver::extractPrds
MeasurementSet extractPrds(const Segment &segment) const
Extract the Uncalibrated measurements used to build the segment.
Definition: SegmentAmbiSolver.cxx:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonR4::SegmentFit::SegmentAmbiSolver::SegmentVec
std::vector< std::unique_ptr< Segment > > SegmentVec
Definition: SegmentAmbiSolver.h:31
MuonR4::SegmentFit::SegmentAmbiSolver::countShared
unsigned int countShared(const MeasurementSet &measSet1, const MeasurementSet &measSet2) const
counts the number of measurements that're in both sets
Definition: SegmentAmbiSolver.cxx:121
MuonR4::SegmentFit::SegmentAmbiSolver::redChi2
double redChi2(const Segment &segment) const
Returns the reduced chi2 of the segment.
Definition: SegmentAmbiSolver.cxx:15
MuonR4::SegmentFit::SegmentAmbiSolver::Resolution::superSet
@ superSet
MuonR4::SegmentFit::SegmentAmbiSolver::Config::remLeftRightAmbi
bool remLeftRightAmbi
Allow for left-right ambiguities.
Definition: SegmentAmbiSolver.h:24
AthMessaging.h
MuonR4::SegmentFit::SegmentAmbiSolver
Definition: SegmentAmbiSolver.h:15
MuonR4::SegmentFit::SegmentAmbiSolver::Config::sharedPrecHits
unsigned int sharedPrecHits
Cut on the number of shared precision hits.
Definition: SegmentAmbiSolver.h:22
Segment.h
MuonR4::SegmentFit::SegmentAmbiSolver::Config::selectByNDoFChi2
double selectByNDoFChi2
If two overlapping segments have both the chi2 below the threshold, the one with more degrees of free...
Definition: SegmentAmbiSolver.h:20
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5