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 #include <GaudiKernel/SystemOfUnits.h>
10 
11 #include <vector>
12 #include <unordered_map>
13 #include <array>
14 
15 namespace MuonR4{
17  public:
18  struct Config{
21  double selectByNDoFChi2{5.};
23  unsigned int sharedPrecHits{3};
25  bool remLeftRightAmbi{false};
26  };
27 
28  SegmentAmbiSolver(const std::string&name,
29  Config&& config);
30 
31 
32  using SegmentVec = std::vector<std::unique_ptr<Segment>>;
34  SegmentVec&& toResolve) const;
35 
36 
37  enum class Resolution{
38  noOverlap,
39  superSet,
40  subSet
41  };
42  private:
43  const Config m_cfg{};
44 
45  std::vector<int> driftSigns(const ActsGeometryContext& gctx,
46  const Segment& segment,
47  const Segment::MeasVec& measurements) const;
48 
49  using MeasurementSet = std::unordered_set<const xAOD::UncalibratedMeasurement*>;
50 
53 
55  unsigned int countShared(const MeasurementSet& measSet1,
56  const MeasurementSet& measSet2) const;
57 
59  double redChi2(const Segment& segment) const;
60 
61 
62 
63 
64  };
65 }
66 
67 
68 #endif
MuonR4::SegmentAmbiSolver::Config::remLeftRightAmbi
bool remLeftRightAmbi
Allow for left-right ambiguities.
Definition: SegmentAmbiSolver.h:25
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
MuonR4::SegmentAmbiSolver::Config
Definition: SegmentAmbiSolver.h:18
MuonR4::SegmentAmbiSolver::m_cfg
const Config m_cfg
Definition: SegmentAmbiSolver.h:43
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
MuonR4::SegmentAmbiSolver::MeasurementSet
std::unordered_set< const xAOD::UncalibratedMeasurement * > MeasurementSet
Definition: SegmentAmbiSolver.h:49
MuonR4::SegmentAmbiSolver::redChi2
double redChi2(const Segment &segment) const
Returns the reduced chi2 of the segment.
Definition: SegmentAmbiSolver.cxx:16
MuonR4::SegmentAmbiSolver::Resolution::noOverlap
@ noOverlap
MuonR4::SegmentAmbiSolver::driftSigns
std::vector< int > driftSigns(const ActsGeometryContext &gctx, const Segment &segment, const Segment::MeasVec &measurements) const
Definition: SegmentAmbiSolver.cxx:96
MuonR4::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:119
MuonR4::Segment::MeasVec
std::vector< MeasType > MeasVec
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:23
MuonR4::SegmentAmbiSolver::resolveAmbiguity
SegmentVec resolveAmbiguity(const ActsGeometryContext &gctx, SegmentVec &&toResolve) const
Definition: SegmentAmbiSolver.cxx:19
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonR4::SegmentAmbiSolver::extractPrds
MeasurementSet extractPrds(const Segment &segment) const
Extract the Uncalibrated measurements used to build the segment.
Definition: SegmentAmbiSolver.cxx:105
MuonR4::SegmentAmbiSolver::SegmentAmbiSolver
SegmentAmbiSolver(const std::string &name, Config &&config)
Definition: SegmentAmbiSolver.cxx:12
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
Config
Definition: dumpNPs.cxx:47
MuonR4::SegmentAmbiSolver::Resolution::subSet
@ subSet
MuonR4::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:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonR4::SegmentAmbiSolver::SegmentVec
std::vector< std::unique_ptr< Segment > > SegmentVec
Definition: SegmentAmbiSolver.h:32
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
AthMessaging.h
MuonR4::SegmentAmbiSolver
Definition: SegmentAmbiSolver.h:16
MuonR4::SegmentAmbiSolver::Config::sharedPrecHits
unsigned int sharedPrecHits
Cut on the number of shared precision hits.
Definition: SegmentAmbiSolver.h:23
MuonR4::SegmentAmbiSolver::Resolution
Resolution
Definition: SegmentAmbiSolver.h:37
MuonR4::SegmentAmbiSolver::Resolution::superSet
@ superSet
Segment.h
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5