ATLAS Offline Software
PhiHoughTransformAlg.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_PHIHOUGHTRANSFORMALG__H
5 #define MUONR4_MUONPATTERNRECOGNITIONALGS_PHIHOUGHTRANSFORMALG__H
6 
9 
13 
17 
20 
21 // muon includes
22 
23 
24 namespace MuonR4{
25 
35  public:
36  PhiHoughTransformAlg(const std::string& name, ISvcLocator* pSvcLocator);
37  virtual ~PhiHoughTransformAlg() = default;
38  virtual StatusCode initialize() override;
39  virtual StatusCode execute(const EventContext& ctx) const override;
40 
41  private:
42 
45  template <class ContainerType> StatusCode retrieveContainer(const EventContext& ctx,
47  const ContainerType* & contToPush) const;
48 
53  void prepareHoughPlane(HoughEventData & data) const;
54 
61  void preProcessMaximum(const ActsGeometryContext& gctx,
62  const MuonR4::HoughMaximum & maximum,
63  HoughEventData & data) const;
64 
70  std::unique_ptr<SegmentSeed> recoverSinglePhiMax(HoughEventData & data, const MuonR4::HoughMaximum & maximum) const;
71 
79  std::vector<MuonR4::ActsPeakFinderForMuon::Maximum> findRankedSegmentSeeds(const EventContext& ctx,
81  const MuonR4::HoughMaximum & maximum) const;
82 
87  int countIncompatibleEtaHits(const MuonR4::ActsPeakFinderForMuon::Maximum & phiMaximum, const MuonR4::HoughMaximum & etaMaximum) const;
88 
95  std::unique_ptr<SegmentSeed> buildSegmentSeed(const HoughMaximum & etaMax,
96  const MuonR4::ActsPeakFinderForMuon::Maximum & phiMax) const;
97 
98  // read handle key for the input maxima (from a previous eta-transform)
99  SG::ReadHandleKey<EtaHoughMaxContainer> m_maxima{this, "ReadKey", "MuonHoughStationMaxima"};
100  // write handle key for the output segment seeds
101  SG::WriteHandleKey<SegmentSeedContainer> m_segmentSeeds{this, "WriteKey", "MuonHoughStationSegmentSeeds"};
102 
103  // access to the ACTS geometry context
104  SG::ReadHandleKey<ActsGeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
106  ToolHandle<MuonValR4::IPatternVisualizationTool> m_visionTool{this, "VisualizationTool", ""};
107  // steers the target resolution in tan(phi)
108  DoubleProperty m_targetResoTanPhi{this, "ResolutionTargetTanAngle", 0.04};
109  // steers the target resolution in the x-axis intercept
110  DoubleProperty m_targetResoIntercept{this, "ResolutionTargetIntercept", 30.};
111  // minimum search window half width, tan(phi)
112  // - in multiples of the target resolution
113  DoubleProperty m_minSigmasSearchTanPhi{this, "minSigmasSearchTanPhi", 1.};
114  // minimum search window half width, intercept
115  // - in multiples of the target resolution
116  DoubleProperty m_minSigmasSearchIntercept{this, "minSigmasSearchIntercept", 1.};
117 
118  // number of accumulator bins in tan(phi)
119  // target resolution in the angle
120  IntegerProperty m_nBinsTanPhi{this, "nBinsTanAngle", 5};
121  // number of accumulator bins in the x-axis intercept
122  IntegerProperty m_nBinsIntercept{this, "nBinsIntercept", 10};
123  // maximum number of eta measurements allowed to be discarded by
124  // a valid phi-extension
125  IntegerProperty m_maxEtaHolesOnMax{this, "maxEtaHoles", 1};
126  // flag to steer whether to recover maxima with a single phi measurement
127  // using a beam spot projection. Should not be used in splashes or cosmics.
128  BooleanProperty m_recoverSinglePhiWithBS{this, "recoverSinglePhiHitsWithBS", true};
129  // Flag to steer whether space points shall be downweighted according to their instance
130  // multiplicity of the phi measurement such that it effectively contributes with weight 1
131  BooleanProperty m_downWeightMultiplePrd{this, "downWeightPrdMultiplicity", false};
132  };
133 }
134 
135 
136 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonR4::PhiHoughTransformAlg::m_segmentSeeds
SG::WriteHandleKey< SegmentSeedContainer > m_segmentSeeds
Definition: PhiHoughTransformAlg.h:101
MuonR4::PhiHoughTransformAlg::buildSegmentSeed
std::unique_ptr< SegmentSeed > buildSegmentSeed(const HoughMaximum &etaMax, const MuonR4::ActsPeakFinderForMuon::Maximum &phiMax) const
constructs a segment seed from an eta maximum and a phi-extension.
Definition: PhiHoughTransformAlg.cxx:85
MuonR4::PhiHoughTransformAlg::prepareHoughPlane
void prepareHoughPlane(HoughEventData &data) const
prepare the hough plane once per event.
Definition: PhiHoughTransformAlg.cxx:51
MuonR4::PhiHoughTransformAlg::PhiHoughTransformAlg
PhiHoughTransformAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PhiHoughTransformAlg.cxx:23
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonR4::PhiHoughTransformAlg::initialize
virtual StatusCode initialize() override
Definition: PhiHoughTransformAlg.cxx:27
MuonR4::PhiHoughTransformAlg::m_targetResoIntercept
DoubleProperty m_targetResoIntercept
Definition: PhiHoughTransformAlg.h:110
IPatternVisualizationTool.h
MuonR4::PhiHoughTransformAlg::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: PhiHoughTransformAlg.h:104
MuonR4::PhiHoughTransformAlg::m_targetResoTanPhi
DoubleProperty m_targetResoTanPhi
Definition: PhiHoughTransformAlg.h:108
MuonR4::PhiHoughTransformAlg::m_nBinsTanPhi
IntegerProperty m_nBinsTanPhi
Definition: PhiHoughTransformAlg.h:120
MuonR4::PhiHoughTransformAlg::m_minSigmasSearchIntercept
DoubleProperty m_minSigmasSearchIntercept
Definition: PhiHoughTransformAlg.h:116
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
SG::ReadHandleKey< ContainerType >
MuonR4::PhiHoughTransformAlg::m_nBinsIntercept
IntegerProperty m_nBinsIntercept
Definition: PhiHoughTransformAlg.h:122
MuonR4::PhiHoughTransformAlg::m_visionTool
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Definition: PhiHoughTransformAlg.h:106
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonR4::PhiHoughTransformAlg::countIncompatibleEtaHits
int countIncompatibleEtaHits(const MuonR4::ActsPeakFinderForMuon::Maximum &phiMaximum, const MuonR4::HoughMaximum &etaMaximum) const
helper to count the number of eta measurements that would be discarded for a given phi extension cand...
Definition: PhiHoughTransformAlg.cxx:65
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonPatternContainer.h
MuonR4::PhiHoughTransformAlg
Algorithm to handle the phi hough transform.
Definition: PhiHoughTransformAlg.h:34
MuonR4::PhiHoughTransformAlg::m_minSigmasSearchTanPhi
DoubleProperty m_minSigmasSearchTanPhi
Definition: PhiHoughTransformAlg.h:113
MuonR4::PhiHoughTransformAlg::findRankedSegmentSeeds
std::vector< MuonR4::ActsPeakFinderForMuon::Maximum > findRankedSegmentSeeds(const EventContext &ctx, HoughEventData &data, const MuonR4::HoughMaximum &maximum) const
perform a hough search for the most promising phi extension of an eta-maximum Performs a local hough ...
Definition: PhiHoughTransformAlg.cxx:150
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
ReadCondHandleKey.h
AthReentrantAlgorithm.h
MuonR4::PhiHoughTransformAlg::m_maxEtaHolesOnMax
IntegerProperty m_maxEtaHolesOnMax
Definition: PhiHoughTransformAlg.h:125
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
MuonHoughDefs.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonR4::PhiHoughTransformAlg::m_recoverSinglePhiWithBS
BooleanProperty m_recoverSinglePhiWithBS
Definition: PhiHoughTransformAlg.h:128
MuonR4::PhiHoughTransformAlg::preProcessMaximum
void preProcessMaximum(const ActsGeometryContext &gctx, const MuonR4::HoughMaximum &maximum, HoughEventData &data) const
pre-processing for a given input eta-maximum Counts potential phi-hits and defines the search space
Definition: PhiHoughTransformAlg.cxx:100
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::PhiHoughTransformAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: PhiHoughTransformAlg.cxx:207
MuonR4::HoughMaximum
Data class to represent an eta maximum in hough space.
Definition: HoughMaximum.h:14
MuonR4::PhiHoughTransformAlg::m_maxima
SG::ReadHandleKey< EtaHoughMaxContainer > m_maxima
Definition: PhiHoughTransformAlg.h:99
HoughEventData.h
SpacePointContainer.h
MuonR4::PhiHoughTransformAlg::~PhiHoughTransformAlg
virtual ~PhiHoughTransformAlg()=default
MuonR4::PhiHoughTransformAlg::m_downWeightMultiplePrd
BooleanProperty m_downWeightMultiplePrd
Definition: PhiHoughTransformAlg.h:131
MuonR4::PhiHoughTransformAlg::retrieveContainer
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
Helper method to fetch data from StoreGate.
Definition: PhiHoughTransformAlg.cxx:36
MuonR4::PhiHoughTransformAlg::recoverSinglePhiMax
std::unique_ptr< SegmentSeed > recoverSinglePhiMax(HoughEventData &data, const MuonR4::HoughMaximum &maximum) const
extend an eta maximum with just a single attached phi measurement.
Definition: PhiHoughTransformAlg.cxx:193
IMuonIdHelperSvc.h
MuonR4::HoughEventData_impl
Templated event data class for the phase-2 muon hough transform.
Definition: HoughEventData.h:22
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37