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 
13 
18 
19 namespace MuonR4{
23  public:
24  using AthReentrantAlgorithm::AthReentrantAlgorithm;
25  virtual StatusCode initialize() override final;
26  virtual StatusCode execute(const EventContext& ctx) const override final;
27  private:
31  const xAOD::MuonSegment* segment{nullptr};
33  std::unordered_set<const xAOD::MuonSimHit*> hits{};
34  };
35  using SegWithTruthVec_t = std::vector<SegmentWithTruth>;
37  std::vector<SegmentWithTruth> matchSimHits(const xAOD::MuonSegmentContainer& segments) const;
39  SG::ReadHandleKey<xAOD::MuonSegmentContainer> m_truthSegKey{this, "TruthSegKey", "MuonTruthSegments"};
51  Gaudi::Property<std::string> m_simLink{this, "SimHitLink", "simHitLink"};
56  };
57 }
58 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer >
MuonR4::RecoSegToTruthAssocAlg::m_measKeys
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_measKeys
Key to the prd containers in the event.
Definition: RecoSegToTruthAssocAlg.h:53
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
MuonR4::RecoSegToTruthAssocAlg::m_prdLinkKeys
SG::ReadDecorHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_prdLinkKeys
Dependency on the sim hit decoration.
Definition: RecoSegToTruthAssocAlg.h:55
MuonR4::RecoSegToTruthAssocAlg::m_truthSegLinkKey
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_truthSegLinkKey
Key to the truth segment -> truth particle association.
Definition: RecoSegToTruthAssocAlg.h:41
MuonR4::RecoSegToTruthAssocAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: RecoSegToTruthAssocAlg.cxx:46
MuonR4::RecoSegToTruthAssocAlg::m_segTruthSegLinkKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_segTruthSegLinkKey
Output key to the associated truth segment link decoration.
Definition: RecoSegToTruthAssocAlg.h:47
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonR4::RecoSegToTruthAssocAlg::initialize
virtual StatusCode initialize() override final
Definition: RecoSegToTruthAssocAlg.cxx:27
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
MuonR4::RecoSegToTruthAssocAlg::SegmentWithTruth
Helper struct of segments with simHits & associated spectrometer sector.
Definition: RecoSegToTruthAssocAlg.h:29
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:49
MuonSimHit.h
MuonR4::RecoSegToTruthAssocAlg::m_simLink
Gaudi::Property< std::string > m_simLink
Decoration key of the prd -> simHit association.
Definition: RecoSegToTruthAssocAlg.h:51
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:87
MuonR4::RecoSegToTruthAssocAlg::SegWithTruthVec_t
std::vector< SegmentWithTruth > SegWithTruthVec_t
Definition: RecoSegToTruthAssocAlg.h:35
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:33
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:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
UncalibratedMeasurementContainer.h
MuonR4::RecoSegToTruthAssocAlg::SegmentWithTruth::segment
const xAOD::MuonSegment * segment
segment pointer of interest
Definition: RecoSegToTruthAssocAlg.h:31
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
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:43
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:39
MuonR4::RecoSegToTruthAssocAlg
Algorithm to match the reconstructed muon segment with the truth segment & with the truth particle.
Definition: RecoSegToTruthAssocAlg.h:22
ReadDecorHandleKeyArray.h
IMuonIdHelperSvc.h