ATLAS Offline Software
RecoSegToTruthAssocAlg.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 MUONTRUTHALGSR4_RECOSEGTOTRUTHASSOCALG_H
5 #define MUONTRUTHALGSR4_RECOSEGTOTRUTHASSOCALG_H
6 
8 
12 
16 
17 namespace MuonR4{
21  public:
22  using AthReentrantAlgorithm::AthReentrantAlgorithm;
23  virtual StatusCode initialize() override final;
24  virtual StatusCode execute(const EventContext& ctx) const override final;
25  private:
29  const xAOD::MuonSegment* segment{nullptr};
31  std::unordered_set<const xAOD::MuonSimHit*> hits{};
32  };
33  using SegWithTruthVec_t = std::vector<SegmentWithTruth>;
35  std::vector<SegmentWithTruth> matchSimHits(const xAOD::MuonSegmentContainer& segments) const;
37  SG::ReadHandleKey<xAOD::MuonSegmentContainer> m_truthSegKey{this, "TruthSegKey", "TruthSegmentsR4"};
48  };
49 }
50 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer >
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
MuonR4::RecoSegToTruthAssocAlg::m_truthSegLinkKey
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_truthSegLinkKey
Key to the truth segment -> truth particle association.
Definition: RecoSegToTruthAssocAlg.h:39
MuonR4::RecoSegToTruthAssocAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: RecoSegToTruthAssocAlg.cxx:36
MuonR4::RecoSegToTruthAssocAlg::m_segTruthSegLinkKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_segTruthSegLinkKey
Output key to the associated truth segment link decoration.
Definition: RecoSegToTruthAssocAlg.h:45
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonR4::RecoSegToTruthAssocAlg::initialize
virtual StatusCode initialize() override final
Definition: RecoSegToTruthAssocAlg.cxx:27
MuonR4::RecoSegToTruthAssocAlg::SegmentWithTruth
Helper struct of segments with simHits & associated spectrometer sector.
Definition: RecoSegToTruthAssocAlg.h:27
SG::ReadHandleKey< xAOD::MuonSegmentContainer >
MuonR4::RecoSegToTruthAssocAlg::m_segTruthLinkKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_segTruthLinkKey
Output key to the associated truth particle decoration.
Definition: RecoSegToTruthAssocAlg.h:47
MuonSimHit.h
MuonR4::RecoSegToTruthAssocAlg::matchSimHits
std::vector< SegmentWithTruth > matchSimHits(const xAOD::MuonSegmentContainer &segments) const
Loops over the segment container and fetches the segments with truth matched hits.
Definition: RecoSegToTruthAssocAlg.cxx:77
MuonR4::RecoSegToTruthAssocAlg::SegWithTruthVec_t
std::vector< SegmentWithTruth > SegWithTruthVec_t
Definition: RecoSegToTruthAssocAlg.h:33
MuonSegmentContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
MuonR4::RecoSegToTruthAssocAlg::SegmentWithTruth::hits
std::unordered_set< const xAOD::MuonSimHit * > hits
list of associated sim hits
Definition: RecoSegToTruthAssocAlg.h:31
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
MuonR4::RecoSegToTruthAssocAlg::m_segPrdLinkKey
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_segPrdLinkKey
Key to the associated uncalibrated measurement decoration.
Definition: RecoSegToTruthAssocAlg.h:43
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonR4::RecoSegToTruthAssocAlg::SegmentWithTruth::segment
const xAOD::MuonSegment * segment
segment pointer of interest
Definition: RecoSegToTruthAssocAlg.h:29
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
AthReentrantAlgorithm.h
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::RecoSegToTruthAssocAlg::m_segmentKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Key to the reconstructed segment container to truth match.
Definition: RecoSegToTruthAssocAlg.h:41
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
MuonR4::RecoSegToTruthAssocAlg::m_truthSegKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_truthSegKey
Key to the truth segment container.
Definition: RecoSegToTruthAssocAlg.h:37
MuonR4::RecoSegToTruthAssocAlg
Algorithm to match the reconstructed muon segment with the truth segment & with the truth particle.
Definition: RecoSegToTruthAssocAlg.h:20
IMuonIdHelperSvc.h