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};
24  };
25 
26  SegmentAmbiSolver(const std::string&name,
27  Config&& config);
28 
29 
30  using SegmentVec = std::vector<std::unique_ptr<Segment>>;
32  SegmentVec&& toResolve) const;
33 
34 
35  enum class Resolution{
36  noOverlap,
37  superSet,
38  subSet
39  };
40  private:
41  const Config m_cfg{};
42 
43  std::vector<int> driftSigns(const ActsGeometryContext& gctx,
44  const Segment& segment,
45  const Segment::MeasVec& measurements) const;
46 
47  using MeasurementSet = std::unordered_set<const xAOD::UncalibratedMeasurement*>;
48 
51 
53  unsigned int countShared(const MeasurementSet& measSet1,
54  const MeasurementSet& measSet2) const;
55 
57  double redChi2(const Segment& segment) const;
58 
59 
60 
61 
62  };
63 }
64 
65 
66 #endif
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:41
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
MuonR4::SegmentAmbiSolver::MeasurementSet
std::unordered_set< const xAOD::UncalibratedMeasurement * > MeasurementSet
Definition: SegmentAmbiSolver.h:47
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:91
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:122
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:108
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:221
MuonR4::SegmentAmbiSolver::SegmentVec
std::vector< std::unique_ptr< Segment > > SegmentVec
Definition: SegmentAmbiSolver.h:30
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:35
MuonR4::SegmentAmbiSolver::Resolution::superSet
@ superSet
Segment.h
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5