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
16
24
25namespace Muon {
26
28 public:
29
30 // Constructor with parameters:
31 using AthReentrantAlgorithm::AthReentrantAlgorithm;
32
33 // Basic algorithm methods:
34 virtual StatusCode initialize() override;
35 virtual StatusCode execute(const EventContext& ctx) const override;
36
37 private:
46 template <typename dType> using DecorHandlePtrVec_t = std::vector<xAOD::ContainerDecorator<xAOD::TruthParticleContainer, dType>>;
50
68
79 StatusCode addTrackRecords(const EventContext& ctx,
80 const xAOD::TruthParticle& truthParticle,
81 SummaryDecors& myDecors) const;
82
89 template <typename T>
90 StatusCode fillWriteDecorator(SG::WriteDecorHandleKeyArray<xAOD::TruthParticleContainer, T>& writeKey, const std::string& keyName) const;
91
94 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_muonTruth{this, "muonTruth", "MuonTruthParticles"};
95
99 this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}};
100
109 DecorKey_t m_muonSnapShotX{this, "SnapShotX", { }, "Position decoration..."};
110 DecorKey_t m_muonSnapShotY{this, "SnapShotY", { }, "Position decoration..."};
111 DecorKey_t m_muonSnapShotZ{this, "SnapShotZ", { }, "Position decoration..."};
112 DecorKey_t m_muonSnapShotPx{this, "SnapShotPx", { }, "Momentum decoration..."};
113 DecorKey_t m_muonSnapShotPy{this, "SnapShotPy", { }, "Momentum decoration..."};
114 DecorKey_t m_muonSnapShotPz{this, "SnapShotPz", { }, "Momentum decoration..."};
115 DecorKey_t m_muonSnapShotMtc{this, "SnapShotMtc", { }, "is matched decoration..."};
116 DecorKey_t m_muonSnapShotEX{this, "SnapShotEX", { }, "Position decoration..."};
117 DecorKey_t m_muonSnapShotEY{this, "SnapShotEY", { }, "Position decoration..."};
118 DecorKey_t m_muonSnapShotEZ{this, "SnapShotEZ", { }, "Position decoration..."};
119 DecorKey_t m_muonSnapShotEPx{this, "SnapShotEPx", { }, "Momentum decoration..."};
120 DecorKey_t m_muonSnapShotEPy{this, "SnapShotEPy", { }, "Momentum decoration..."};
121 DecorKey_t m_muonSnapShotEPz{this, "SnapShotEPz", { }, "Momentum decoration..."};
122 DecorKey_t m_muonSnapShotEcov{this, "SnapShotEcov", { }, "Covariance decoration"};
123 DecorKey_t m_muonSnapShotEis{this, "SnapShotEis", { }, "Flag decoration whether the extrapolation worked"};
124
126 ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
127
128 };
129
130} // namespace Muon
131#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
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< char > WriteDecorArray_b
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_muonTruth
Key of the container of truth muons that will be decorated.
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.
DecorHandlePtrVec_t< std::vector< float > > WriteDecorArray_fvec
StatusCode addTrackRecords(const EventContext &ctx, const xAOD::TruthParticle &truthParticle, SummaryDecors &myDecors) const
addTrackRecords is the actual function that decorates muons with track records.
std::vector< xAOD::ContainerDecorator< xAOD::TruthParticleContainer, dType > > DecorHandlePtrVec_t
Struct object encapsulating all write-decorators.
virtual StatusCode execute(const EventContext &ctx) const override
DecorHandlePtrVec_t< float > WriteDecorArray_f
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.
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.