ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTruthSegmentCreationAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
4 ** @brief This alg receives the container of truth muons, selects good muons according to
5 * their origin, creates segments, and store them into a new container. Segments are
6 * decorated with number and type of hits available, link to the
7 * corresponding truth muon, position and direction of the truth segment, and
8 * sector, chamber layer, station eta, and technology of the chamber where the
9 * segment has been recorded.
10*/
11
12#pragma once
13
14#include <map>
15#include <string>
16#include <vector>
17
19#include "GaudiKernel/ServiceHandle.h"
20#include "Identifier/Identifier.h"
28
31
32namespace MuonGM {
34}
35
36namespace Muon {
37
39 public:
40
41 // Constructor with parameters:
42 using AthReentrantAlgorithm::AthReentrantAlgorithm;
43
44 // Basic algorithm methods:
45 virtual StatusCode initialize() override;
46 virtual StatusCode execute(const EventContext& ctx) const override;
47
52 using ChamberIdMap = std::map<Muon::MuonStationIndex::ChIndex, std::vector<Identifier>>;
53
54 private:
55
63 StatusCode fillChamberIdMap(const EventContext& ctx, const xAOD::TruthParticle& truthParticle, ChamberIdMap& ids) const;
64
84 StatusCode createSegments(const EventContext& ctx,
86 const ChamberIdMap& ids,
87 xAOD::MuonSegmentContainer& segmentContainer) const;
88
90 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_muonTruth{this, "muonTruth", "MuonTruthParticles"};
92
96
98 SG::WriteHandleKey<xAOD::MuonSegmentContainer> m_muonTruthSegmentContainerName{this, "MuonTruthSegmentName", "MuonTruthSegments"};
99
102 this, "SDOs", {"RPC_SDO", "TGC_SDO", "MDT_SDO" }, "remove NSW by default for now, can always be changed in the configuration"};
104
106 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
107
109 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_detMgrKey{this, "DetectorManagerKey", "MuonDetectorManager",
110 "Key of input MuonDetectorManager condition data"};
111
112 };
113
114} // namespace Muon
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_truthOriginKey
virtual StatusCode execute(const EventContext &ctx) const override
StatusCode fillChamberIdMap(const EventContext &ctx, const xAOD::TruthParticle &truthParticle, ChamberIdMap &ids) const
This function uses the 6 vectors, contained in.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Handle for the muonIdHelper service.
SG::ReadDecorHandleKeyArray< xAOD::TruthParticleContainer, std::vector< unsigned long long > > m_truthHitsKeyArray
Keys of the truth muon decorations that we need to read to (re-)fill the chamberIdMap.
std::map< Muon::MuonStationIndex::ChIndex, std::vector< Identifier > > ChamberIdMap
This map contains all the hits corresponding to truth muons classified by chamber layer that recorded...
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_muonTruthSegmentContainerName
Key for segment container that will be populated with segments.
SG::ReadHandleKey< CscSimDataCollection > m_CSC_SDO_TruthNames
StatusCode createSegments(const EventContext &ctx, const ElementLink< xAOD::TruthParticleContainer > &truthLink, const ChamberIdMap &ids, xAOD::MuonSegmentContainer &segmentContainer) const
This function performs, for each truth muon, the actual segment creation and stores segments into a n...
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_muonTruth
Key for the truth muon container and muon origin decoration.
SG::ReadHandleKeyArray< MuonSimDataCollection > m_SDO_TruthNames
Keys for all çontainers of muon hit simulation data, classified by detector technology.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
TruthParticle_v1 TruthParticle
Typedef to implementation.