ATLAS Offline Software
Loading...
Searching...
No Matches
TruthTrackRecordsAlg.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 and decorates them
5 * with track records (snapshot) of the same in different positions
6 * within the detector. Decorations (for each detector position)
7 * include: muon records in that layer; a flag saying if a record has
8 * been recorded in that layer; muon extrapolation from the
9 * previous layer; extrapolation's covariance matrix; and a flag
10 * representing the exrapolation outcome.
11*/
12#ifndef MUONTRUTHALGS_TruthTrackRecordsAlg_H
13#define MUONTRUTHALGS_TruthTrackRecordsAlg_H
14
23
24namespace Muon {
25
27 public:
28
29 // Constructor with parameters:
30 using AthReentrantAlgorithm::AthReentrantAlgorithm;
31
32 // Basic algorithm methods:
33 virtual StatusCode initialize() override;
34 virtual StatusCode execute(const EventContext& ctx) const override;
35
36 private:
48
66
77 StatusCode addTrackRecords(const EventContext& ctx,
78 const xAOD::TruthParticle& truthParticle,
79 SummaryDecors& myDecors) const;
80
87 template <typename T>
88 StatusCode fillWriteDecorator(SG::WriteDecorHandleKeyArray<xAOD::TruthParticleContainer, T>& writeKey, const std::string& keyName) const;
89
92 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_muonTruth{this, "muonTruth", "MuonTruthParticles"};
93
97 this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}};
98
107 DecorKey_t m_muonSnapShotX{this, "SnapShotX", { }, "Position decoration..."};
108 DecorKey_t m_muonSnapShotY{this, "SnapShotY", { }, "Position decoration..."};
109 DecorKey_t m_muonSnapShotZ{this, "SnapShotZ", { }, "Position decoration..."};
110 DecorKey_t m_muonSnapShotPx{this, "SnapShotPx", { }, "Momentum decoration..."};
111 DecorKey_t m_muonSnapShotPy{this, "SnapShotPy", { }, "Momentum decoration..."};
112 DecorKey_t m_muonSnapShotPz{this, "SnapShotPz", { }, "Momentum decoration..."};
113 DecorKey_t m_muonSnapShotMtc{this, "SnapShotMtc", { }, "is matched decoration..."};
114 DecorKey_t m_muonSnapShotEX{this, "SnapShotEX", { }, "Position decoration..."};
115 DecorKey_t m_muonSnapShotEY{this, "SnapShotEY", { }, "Position decoration..."};
116 DecorKey_t m_muonSnapShotEZ{this, "SnapShotEZ", { }, "Position decoration..."};
117 DecorKey_t m_muonSnapShotEPx{this, "SnapShotEPx", { }, "Momentum decoration..."};
118 DecorKey_t m_muonSnapShotEPy{this, "SnapShotEPy", { }, "Momentum decoration..."};
119 DecorKey_t m_muonSnapShotEPz{this, "SnapShotEPz", { }, "Momentum decoration..."};
120 DecorKey_t m_muonSnapShotEcov{this, "SnapShotEcov", { }, "Covariance decoration"};
121 DecorKey_t m_muonSnapShotEis{this, "SnapShotEis", { }, "Flag decoration whether the extrapolation worked"};
122
124 ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
125
126 };
127
128} // namespace Muon
129#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode initialize() override
DecorHandlePtrVec_t< xAOD::TruthParticleContainer, float > WriteDecorArray_f
Struct object encapsulating all write-decorators.
SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer > DecorKey_t
Declaration of the key arrays, which are all initialized as empty (they will be filled up by @fillWri...
DecorHandlePtrVec_t< xAOD::TruthParticleContainer, std::vector< float > > WriteDecorArray_fvec
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_muonTruth
Key of the container of truth muons that will be decorated.
DecorHandlePtrVec_t< xAOD::TruthParticleContainer, char > WriteDecorArray_b
StatusCode fillWriteDecorator(SG::WriteDecorHandleKeyArray< xAOD::TruthParticleContainer, T > &writeKey, const std::string &keyName) const
This function fills the arrays of write-decorator keys and initializes them.
StatusCode addTrackRecords(const EventContext &ctx, const xAOD::TruthParticle &truthParticle, SummaryDecors &myDecors) const
addTrackRecords is the actual function that decorates muons with track records.
virtual StatusCode execute(const EventContext &ctx) const override
ToolHandle< Trk::IExtrapolator > m_extrapolator
Extrapolation tool handle.
SG::ReadHandleKeyArray< TrackRecordCollection > m_trackRecords
Keys of the containers of track records in different detector positions.
Property holding a SG store/key/clid from which a ReadHandle is made.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::vector< DecorHandlePtr_wt< ContType, DataType > > DecorHandlePtrVec_t
Definition DecorUtils.h:15
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
TruthParticle_v1 TruthParticle
Typedef to implementation.