ATLAS Offline Software
Loading...
Searching...
No Matches
MsTrackTester.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONTRACKFINDINGTEST_MSTRACKTESTER_H
5#define MUONTRACKFINDINGTEST_MSTRACKTESTER_H
6
9
12
13
16
27
30
31namespace MuonValR4{
33 public:
35
36 StatusCode initialize() override final;
37 StatusCode execute() override final;
38 StatusCode finalize() override final;
39 private:
46 std::optional<MuonR4::MsTrackSeed> makeSeedFromTruth(const ActsTrk::GeometryContext& gctx,
47 const xAOD::TruthParticle& truthMuon) const;
49 std::pair<double, double> calcSeedLength(const ActsTrk::GeometryContext& gctx,
50 const MuonR4::MsTrackSeed& seed) const;
51
53 MuonVal::MuonTesterTree m_tree{"MsTrackValidTest", "MuonTrackTester"};
56
57 Gaudi::Property<bool> m_isMC{this, "isMC", false};
58
59
60 using TruthHitCol = std::unordered_set<const xAOD::MuonSimHit*>;
61
64 SegmentKey_t m_truthSegmentKey{this, "TruthSegmentKey", "MuonTruthSegments"};
66 SegmentKey_t m_recoSegmentKey{this, "SegmentKey", "MuonSegmentsFromR4"};
68 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthKey{this, "TruthKey", "MuonTruthParticles"};
74 SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
76 SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheKey{this, "MagFieldKey", "fieldCondObj", "Name of the Magnetic Field conditions object key"};
78 ToolHandle<MuonR4::ISegmentSelectionTool> m_segSelector{this, "SegmentSelectionTool" , "" };
81
83 ToolHandle<MuonR4::ITrackSummaryTool> m_summaryTool{this, "SummaryTool" ,""};
85 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_legacyTrackKey{this,"LegacyTrackKey", "MuonSpectrometerTrackParticles"};
86
87 std::unique_ptr<MuonR4::MsTrackSeeder> m_seeder{};
88 using ParticleBranchPtr_t = std::shared_ptr<MuonVal::IParticleFourMomBranch>;
90
91 using SegmentBranchPtr_t = std::shared_ptr<MuonPRDTest::SegmentVariables>;
94
98 MuonVal::VectorBranch<char>& m_seedType{m_tree.newVector<char>("MstTrkSeed_type")};
100 MuonVal::VectorBranch<float>& m_seedLength{m_tree.newVector<float>("MsTrkSeed_length")};
102 MuonVal::VectorBranch<float>& m_seedThetaCone{m_tree.newVector<float>("MsTrkSeed_thetaCone")};
104 MuonVal::VectorBranch<float>& m_seedQP{m_tree.newVector<float>("MsTrkSeed_qTimesP")};
106 std::shared_ptr<TrackSummaryModule> m_seedSummary{};
108 std::shared_ptr<TrackSummaryModule> m_trackSummary{};
110 MuonVal::MatrixBranch<unsigned short>& m_seedRecoSegMatch{m_tree.newMatrix<unsigned short>("MsTrkSeed_segmentLinks")};
112 MuonVal::MatrixBranch<unsigned short>& m_truthSegToRecoLink{m_tree.newMatrix<unsigned short>("TruthSegments_recoSegLinks",-1)};
114 MuonVal::MatrixBranch<unsigned short>& m_truthMuToSeedIdx{m_tree.newMatrix<unsigned short>("TruthMuons_seedLinks", -1)};
116 MuonVal::MatrixBranch<unsigned short>& m_truthMuToSeedCounter{m_tree.newMatrix<unsigned short>("TruthMuons_seedNSeg")};
118 MuonVal::MatrixBranch<unsigned short>& m_truthMuTruthSegLinks{m_tree.newMatrix<unsigned short>("TruthMuons_truthSegLinks")};
120 MuonVal::VectorBranch<unsigned short>& m_truthMuTruthNSegs{m_tree.newVector<unsigned short>("TruthMuons_nTruthSegments")};
122 MuonVal::MatrixBranch<unsigned short>& m_truthMuRecoSegLinks{m_tree.newMatrix<unsigned short>("TruthMuons_recoSegLinks")};
123 /*** @brief Length of the true segment seed */
124 MuonVal::VectorBranch<float>& m_truthMuonsSeedLength{m_tree.newVector<float>("TruthMuons_seedLength")};
126 MuonVal::VectorBranch<float>& m_truthMuonsSeedCone{m_tree.newVector<float>("TruthMuons_seedThetaCone")};
128 MuonVal::VectorBranch<float>& m_truthMuonQP{m_tree.newVector<float>("TruthMuons_qTimesP")};
131 };
132}
133
134
135#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition MsTrackSeed.h:21
SectorProjector
Enumeration to select the sector projection.
const MuonGMR4::MuonDetectorManager * m_detMgr
std::shared_ptr< MuonPRDTest::SegmentVariables > SegmentBranchPtr_t
std::optional< MuonR4::MsTrackSeed > makeSeedFromTruth(const ActsTrk::GeometryContext &gctx, const xAOD::TruthParticle &truthMuon) const
Construct MS track seed from the truth associated segments.
ToolHandle< MuonR4::ITrackSummaryTool > m_summaryTool
Hit summary tool.
MuonR4::MsTrackSeed::Location Location
ParticleBranchPtr_t m_truthTrks
std::unique_ptr< MuonR4::MsTrackSeeder > m_seeder
MuonVal::VectorBranch< float > & m_seedThetaCone
Maximum angular difference between the segments part of the seed.
ParticleBranchPtr_t m_legacyTrks
Output branches of the legacy MS tracks.
SegmentBranchPtr_t m_truthSegs
std::unordered_set< const xAOD::MuonSimHit * > TruthHitCol
MuonVal::MatrixBranch< unsigned short > & m_truthMuRecoSegLinks
Links from the truth muon to the segments.
MuonVal::MatrixBranch< unsigned short > & m_truthMuToSeedIdx
Links to all MsTrkSeeds that could be matched to the truthMuon, i.e.
StatusCode execute() override final
MuonVal::VectorBranch< float > & m_truthMuonQP
Estimated Q x P from the seeder algorithm class.
MuonVal::VectorBranch< float > & m_truthMuonsSeedLength
std::shared_ptr< MuonVal::IParticleFourMomBranch > ParticleBranchPtr_t
MuonVal::VectorBranch< char > & m_seedType
Is the seed in the encap or in the barrel chambers.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_legacyTrackKey
Legacy track reconstruction chain.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthKey
Key to the truth particle collection.
Gaudi::Property< bool > m_isMC
MuonVal::MatrixBranch< unsigned short > & m_truthSegToRecoLink
Link of the truth segments to the matchin reco segments.
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheKey
Dependency on the magnetic field.
SegmentBranchPtr_t m_recoSegs
SG::ReadHandleKey< MuonR4::MsTrackSeedContainer > m_msTrkSeedKey
Temporary container write handle to push the seeds to store gate for later efficiency analysis.
SG::ReadDecorHandleKeyArray< SG::AuxVectorBase > m_trkTruthLinks
Decoration dependency to the MS truth track links.
MuonVal::MatrixBranch< unsigned short > & m_truthMuTruthSegLinks
Links from the truth muon to the segments.
MuonVal::VectorBranch< float > & m_truthMuonsSeedCone
Angular deviation of the true segment seed.
StatusCode initialize() override final
MuonVal::MatrixBranch< unsigned short > & m_seedRecoSegMatch
Link of the track seed to the building segment.
MuonVal::VectorBranch< float > & m_seedQP
Estimated momentum times charge from the track seed.
MuonVal::MatrixBranch< unsigned short > & m_truthMuToSeedCounter
Corresponding matching counter of reconstructed segments.
MuonVal::VectorBranch< unsigned short > & m_truthMuTruthNSegs
Number of associated truth muon segments.
MuonVal::ThreeVectorBranch m_seedPos
Simple seed information.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > SegmentKey_t
MuonVal::VectorBranch< float > & m_seedLength
Maximum separation between the segments on the reference plane.
SG::ReadHandleKey< ActsTrk::TrackContainer > m_trackKey
Dependency on the R4 MS track container.
ToolHandle< MuonR4::ISegmentSelectionTool > m_segSelector
Segment selection tool to pick the good quality segments.
SegmentKey_t m_recoSegmentKey
Primary segment container.
MuonVal::MuonTesterTree m_tree
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Dependency on the geometry alignment.
SegmentKey_t m_truthSegmentKey
Segment from the truth hits.
std::shared_ptr< TrackSummaryModule > m_trackSummary
Hit summary on the reconstructed track.
StatusCode finalize() override final
std::shared_ptr< TrackSummaryModule > m_seedSummary
Hit summary on the track seed.
std::pair< double, double > calcSeedLength(const ActsTrk::GeometryContext &gctx, const MuonR4::MsTrackSeed &seed) const
MuonR4::MsTrackSeeder::SectorProjector SectorProjector
Property holding a SG store/key/clid from which a ReadHandle is made.
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
TruthParticle_v1 TruthParticle
Typedef to implementation.