ATLAS Offline Software
MuonHoughTransformTester.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONVALR4_MuonHoughTransformTester_H
6 #define MUONVALR4_MuonHoughTransformTester_H
7 
8 // Framework includes
14 
15 // EDM includes
18 
21 
22 // muon includes
24 
31 
32 #include "TCanvas.h"
33 #include "TEllipse.h"
34 #include "TBox.h"
35 #include "TLatex.h"
36 
38 
42 
43 
44 namespace MuonValR4{
45 
47  public:
49  virtual ~MuonHoughTransformTester() = default;
50 
51  virtual StatusCode initialize() override;
52  virtual StatusCode execute() override;
53  virtual StatusCode finalize() override;
54 
55  using TruthHitCol = std::unordered_set<const xAOD::MuonSimHit*>;
56  private:
57 
58 
61  template <class ContainerType> StatusCode retrieveContainer(const EventContext& ctx,
63  const ContainerType* & contToPush) const;
64 
65 
66 
67  std::vector<ObjectMatching> matchWithTruth(const ActsGeometryContext& gctx,
68  const xAOD::MuonSegmentContainer* truthSegments,
69  const MuonR4::SegmentSeedContainer* seedContainer,
70  const MuonR4::SegmentContainer* segmentContainer) const;
76  unsigned int countOnSameSide(const ActsGeometryContext& gctx,
77  const xAOD::MuonSegment& truthSeg,
78  const MuonR4::Segment& recoSeg) const;
79 
80 
81  // MDT sim hits in xAOD format
82  SG::ReadHandleKey<xAOD::MuonSegmentContainer> m_truthSegmentKey {this, "TruthSegmentKey","TruthSegmentsR4", "truth segment container"};
83 
84  SG::ReadHandleKey<MuonR4::SegmentSeedContainer> m_inHoughSegmentSeedKey{this, "SegmentSeedKey", "MuonHoughStationSegmentSeeds"};
85  SG::ReadHandleKey<MuonR4::SegmentContainer> m_inSegmentKey{this, "SegmentKey", "R4MuonSegments"};
86 
87  SG::ReadHandleKey<ActsGeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
88 
89  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
90 
92  ToolHandle<MuonValR4::IPatternVisualizationTool> m_visionTool{this, "VisualizationTool", ""};
93 
95 
96  // // output tree - allows to compare the sim and fast-digitised hits
97  MuonValR4::MuonPatternRecognitionTestTree m_tree{"MuonEtaHoughTest","MuonEtaHoughTransformTest"};
98  };
99 }
100 
101 #endif // MUONFASTDIGITEST_MUONVALR4_MuonHoughTransformTester_H
ReadHandleKeyArray.h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonValR4::MuonPatternRecognitionTestTree
Definition: MuonPatternRecognitionTestTree.h:40
AthHistogramAlgorithm::AthHistogramAlgorithm
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: AthHistogramAlgorithm.cxx:31
MuonValR4::MuonHoughTransformTester::finalize
virtual StatusCode finalize() override
Definition: MuonHoughTransformTester.cxx:202
IPatternVisualizationTool.h
MuonPatternRecognitionTestTree.h
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
MuonR4::Segment
Placeholder for what will later be the muon segment EDM representation.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:19
MuonValR4::MuonHoughTransformTester::m_visionTool
ToolHandle< MuonValR4::IPatternVisualizationTool > m_visionTool
Pattern visualization tool.
Definition: MuonHoughTransformTester.h:92
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonValR4::MuonHoughTransformTester::m_tree
MuonValR4::MuonPatternRecognitionTestTree m_tree
Definition: MuonHoughTransformTester.h:97
MuonTesterTree.h
ThreeVectorBranch.h
SG::ReadHandleKey< ContainerType >
MuonValR4::MuonHoughTransformTester::m_truthSegmentKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_truthSegmentKey
Definition: MuonHoughTransformTester.h:82
MuonValR4::MuonHoughTransformTester
Definition: MuonHoughTransformTester.h:46
MuonSegmentContainer.h
AthHistogramAlgorithm.h
MuonValR4::MuonHoughTransformTester::matchWithTruth
std::vector< ObjectMatching > matchWithTruth(const ActsGeometryContext &gctx, const xAOD::MuonSegmentContainer *truthSegments, const MuonR4::SegmentSeedContainer *seedContainer, const MuonR4::SegmentContainer *segmentContainer) const
Definition: MuonHoughTransformTester.cxx:57
MuonValR4::MuonHoughTransformTester::countOnSameSide
unsigned int countOnSameSide(const ActsGeometryContext &gctx, const xAOD::MuonSegment &truthSeg, const MuonR4::Segment &recoSeg) const
Calculates how many measurements from the segment fit have the same drift sign as when evaluated with...
Definition: MuonHoughTransformTester.cxx:43
IdentifierBranch.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonPatternContainer.h
MuonDetectorManager.h
MuonSimHitContainer.h
MuonValR4::MuonHoughTransformTester::m_r4DetMgr
const MuonGMR4::MuonDetectorManager * m_r4DetMgr
Definition: MuonHoughTransformTester.h:94
AthHistogramAlgorithm
Definition: AthHistogramAlgorithm.h:32
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
ReadCondHandleKey.h
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition: IPatternVisualizationTool.h:23
MuonValR4::MuonHoughTransformTester::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: MuonHoughTransformTester.h:87
MuonValR4::MuonHoughTransformTester::~MuonHoughTransformTester
virtual ~MuonHoughTransformTester()=default
MuonValR4::MuonHoughTransformTester::initialize
virtual StatusCode initialize() override
Definition: MuonHoughTransformTester.cxx:29
SpacePointTesterModule.h
SimHitTester.h
MuonValR4::MuonHoughTransformTester::execute
virtual StatusCode execute() override
Definition: MuonHoughTransformTester.cxx:206
MuonValR4::MuonHoughTransformTester::m_inHoughSegmentSeedKey
SG::ReadHandleKey< MuonR4::SegmentSeedContainer > m_inHoughSegmentSeedKey
Definition: MuonHoughTransformTester.h:84
MuonValR4::MuonHoughTransformTester::TruthHitCol
std::unordered_set< const xAOD::MuonSimHit * > TruthHitCol
Definition: MuonHoughTransformTester.h:55
ReadDecorHandle.h
Handle class for reading a decoration on an object.
MuonValR4::MuonHoughTransformTester::m_inSegmentKey
SG::ReadHandleKey< MuonR4::SegmentContainer > m_inSegmentKey
Definition: MuonHoughTransformTester.h:85
MuonValR4::MuonHoughTransformTester::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonHoughTransformTester.h:89
IMuonIdHelperSvc.h
MuonValR4::MuonHoughTransformTester::retrieveContainer
StatusCode retrieveContainer(const EventContext &ctx, const SG::ReadHandleKey< ContainerType > &key, const ContainerType *&contToPush) const
Helper method to fetch data from StoreGate.
Definition: MuonHoughTransformTester.cxx:188
ServiceHandle< Muon::IMuonIdHelperSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37