ATLAS Offline Software
EtaHoughTransformAlg.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_MUONPATTERNRECOGNITIONALGS_ETAHOUGHTRANSFORMALG__H
5 #define MUONR4_MUONPATTERNRECOGNITIONALGS_ETAHOUGHTRANSFORMALG__H
6 
9 
13 
17 
19 
20 // muon includes
21 
22 
23 namespace MuonR4{
24 
32  public:
33  EtaHoughTransformAlg(const std::string& name, ISvcLocator* pSvcLocator);
34  virtual ~EtaHoughTransformAlg() = default;
35  virtual StatusCode initialize() override;
36  virtual StatusCode execute(const EventContext& ctx) const override;
37 
38  private:
39 
43  template <class ContainerType> StatusCode retrieveContainer(const EventContext& ctx,
45  const ContainerType* & contToPush) const;
46 
54  void preProcess(const EventContext& ctx,
55  const ActsGeometryContext& gctx,
56  const SpacePointContainer & spacePoints,
57  HoughEventData & data) const;
58 
61  void prepareHoughPlane(HoughEventData & data) const;
62 
69  void processBucket(const EventContext& ctx,
71  HoughSetupForBucket& currentBucket) const;
72 
77  const MuonR4::HoughHitType & SP) const;
78 
80  bool passSeedQuality (const HoughSetupForBucket& currentBucket, const MuonR4::ActsPeakFinderForMuon::Maximum & maximum) const;
81 
85  void extendWithPhiHits(std::vector<HoughHitType> & hitList, HoughSetupForBucket& bucket) const ;
87  static bool isPrecisionHit(const HoughHitType& hit);
88  // target resolution in the angle
89  DoubleProperty m_targetResoTanTheta{this, "ResolutionTargetTanTheta", 0.05};
90  // target resolution in the y intercept
91  DoubleProperty m_targetResoIntercept{this, "ResolutionTargetIntercept", 10};
92  // minimum search window half width, tan(theta)
93  // - in multiples of the target resolution
94  DoubleProperty m_minSigmasSearchTanTheta{this, "minSigmasSearchTanTheta", 2.0};
95  // minimum search window half width, intercept
96  // - in multiples of the target resolution
97  DoubleProperty m_minSigmasSearchIntercept{this, "minSigmasSearchIntercept", 2.0};
98  // Cut on the number of weighted hits on the maximum
99  DoubleProperty m_peakThreshold{this, "peakThreshold", 2.5};
100  // Minimum distance in tanTheta between two maxima
101  DoubleProperty m_minMaxDistTheta{this, "MaximumSeparationTheta", 0.};
102  // Minimum distance in the intercept between two maxima
103  DoubleProperty m_minMaxDistIntercept{this, "MaximumSeparationIntercept", 15.};
104  // Fraction of weighted counts around the peak to be associated to the maximum
105  DoubleProperty m_peakFractionCutOff{this, "PeakFractionCutOff", 0.6};
106  // How many valid precision hits have to be on the pattern
107  UnsignedIntegerProperty m_nPrecHitCut{this, "nMinPrecHits", 3};
108 
109  // number of accumulator bins for the angle
110  IntegerProperty m_nBinsTanTheta{this, "nBinsTanTheta", 7};
111  // number of accumulator bins for the intercept
112  IntegerProperty m_nBinsIntercept{this, "nBinsIntercept", 15};
113  // Flag to steer whether space points shall be downweighted according to their instance
114  // multiplicity of the phi measurement such that it effectively contributes with weight 1
115  BooleanProperty m_downWeightMultiplePrd{this, "downWeightPrdMultiplicity", false};
116  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
117 
118  // input space points from SG
119  SG::ReadHandleKey<SpacePointContainer> m_spacePointKey{this, "SpacePointContainer", "MuonSpacePoints"};
120  // output maxima for downstram processing
121  SG::WriteHandleKey<EtaHoughMaxContainer> m_maxima{this, "EtaHoughMaxContainer", "MuonHoughStationMaxima"};
122  // ACTS geometry context
123  SG::ReadHandleKey<ActsGeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
125  ToolHandle<MuonValR4::IPatternVisualizationTool> m_visionTool{this, "VisualizationTool", ""};
126 
127  };
128 }
129 
130 
131 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonR4::EtaHoughTransformAlg::m_minMaxDistIntercept
DoubleProperty m_minMaxDistIntercept
Definition: EtaHoughTransformAlg.h:103
MuonR4::EtaHoughTransformAlg::m_downWeightMultiplePrd
BooleanProperty m_downWeightMultiplePrd
Definition: EtaHoughTransformAlg.h:115
IPatternVisualizationTool.h
MuonR4::EtaHoughTransformAlg::m_targetResoIntercept
DoubleProperty m_targetResoIntercept
Definition: EtaHoughTransformAlg.h:91
MuonR4::EtaHoughTransformAlg::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: EtaHoughTransformAlg.h:123
MuonR4::EtaHoughTransformAlg::~EtaHoughTransformAlg
virtual ~EtaHoughTransformAlg()=default
MuonR4::EtaHoughTransformAlg::passSeedQuality
bool passSeedQuality(const HoughSetupForBucket &currentBucket, const MuonR4::ActsPeakFinderForMuon::Maximum &maximum) const
apply quality cuts on a given maximum
Definition: EtaHoughTransformAlg.cxx:154
SG::ReadHandleKey< ContainerType >
MuonR4::EtaHoughTransformAlg
Algorithm to handle the eta hough transform.
Definition: EtaHoughTransformAlg.h:31
MuonR4::EtaHoughTransformAlg::initialize
virtual StatusCode initialize() override
Definition: EtaHoughTransformAlg.cxx:20
MuonR4::EtaHoughTransformAlg::m_minSigmasSearchTanTheta
DoubleProperty m_minSigmasSearchTanTheta
Definition: EtaHoughTransformAlg.h:94
MuonR4::EtaHoughTransformAlg::m_visionTool
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Definition: EtaHoughTransformAlg.h:125
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonR4::EtaHoughTransformAlg::m_minMaxDistTheta
DoubleProperty m_minMaxDistTheta
Definition: EtaHoughTransformAlg.h:101
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
MuonR4::EtaHoughTransformAlg::m_peakThreshold
DoubleProperty m_peakThreshold
Definition: EtaHoughTransformAlg.h:99
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonPatternContainer.h
MuonR4::EtaHoughTransformAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: EtaHoughTransformAlg.cxx:45
MuonR4::EtaHoughTransformAlg::m_nPrecHitCut
UnsignedIntegerProperty m_nPrecHitCut
Definition: EtaHoughTransformAlg.h:107
MuonR4::EtaHoughTransformAlg::processBucket
void processBucket(const EventContext &ctx, HoughEventData &data, HoughSetupForBucket &currentBucket) const
process a bucket.
Definition: EtaHoughTransformAlg.cxx:227
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonR4::SpacePoint
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePoint.h:18
ReadCondHandleKey.h
MuonR4::EtaHoughTransformAlg::m_nBinsIntercept
IntegerProperty m_nBinsIntercept
Definition: EtaHoughTransformAlg.h:112
AthReentrantAlgorithm.h
MuonR4::HoughEventData_impl::HoughSetupForBucket
Hough transform configuration for one bucket of the search space.
Definition: HoughEventData.h:40
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonR4::EtaHoughTransformAlg::EtaHoughTransformAlg
EtaHoughTransformAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EtaHoughTransformAlg.cxx:16
MuonR4::EtaHoughTransformAlg::m_peakFractionCutOff
DoubleProperty m_peakFractionCutOff
Definition: EtaHoughTransformAlg.h:105
MuonR4::EtaHoughTransformAlg::m_maxima
SG::WriteHandleKey< EtaHoughMaxContainer > m_maxima
Definition: EtaHoughTransformAlg.h:121
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::EtaHoughTransformAlg::preProcess
void preProcess(const EventContext &ctx, const ActsGeometryContext &gctx, const SpacePointContainer &spacePoints, HoughEventData &data) const
pre-processing method called once per event.
Definition: EtaHoughTransformAlg.cxx:82
MuonR4::EtaHoughTransformAlg::extendWithPhiHits
void extendWithPhiHits(std::vector< HoughHitType > &hitList, HoughSetupForBucket &bucket) const
extend a maximum with all compatible (pure) phi hits.
Definition: EtaHoughTransformAlg.cxx:396
MuonR4::EtaHoughTransformAlg::m_targetResoTanTheta
DoubleProperty m_targetResoTanTheta
Definition: EtaHoughTransformAlg.h:89
MuonR4::EtaHoughTransformAlg::m_spacePointKey
SG::ReadHandleKey< SpacePointContainer > m_spacePointKey
Definition: EtaHoughTransformAlg.h:119
HoughEventData.h
SpacePointContainer.h
MuonR4::EtaHoughTransformAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: EtaHoughTransformAlg.h:116
MuonR4::EtaHoughTransformAlg::isPrecisionHit
static bool isPrecisionHit(const HoughHitType &hit)
Returns whether the hit is a precision hit or not.
Definition: EtaHoughTransformAlg.cxx:125
MuonR4::EtaHoughTransformAlg::m_nBinsTanTheta
IntegerProperty m_nBinsTanTheta
Definition: EtaHoughTransformAlg.h:110
MuonR4::EtaHoughTransformAlg::prepareHoughPlane
void prepareHoughPlane(HoughEventData &data) const
prepare the accumulator and the peak finder once per event
Definition: EtaHoughTransformAlg.cxx:142
MuonR4::EtaHoughTransformAlg::retrieveContainer
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
Helper method to fetch data from StoreGate.
Definition: EtaHoughTransformAlg.cxx:30
IMuonIdHelperSvc.h
MuonR4::HoughEventData_impl
Templated event data class for the phase-2 muon hough transform.
Definition: HoughEventData.h:22
ServiceHandle< Muon::IMuonIdHelperSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
MuonR4::EtaHoughTransformAlg::fillFromSpacePoint
void fillFromSpacePoint(HoughEventData &data, const MuonR4::HoughHitType &SP) const
fill the accumulator from a given space point.
Definition: EtaHoughTransformAlg.cxx:368
MuonR4::EtaHoughTransformAlg::m_minSigmasSearchIntercept
DoubleProperty m_minSigmasSearchIntercept
Definition: EtaHoughTransformAlg.h:97