ATLAS Offline Software
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 
24 namespace 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 
49  struct SummaryDecors{
65  };
77  StatusCode addTrackRecords(const EventContext& ctx,
78  const xAOD::TruthParticle& truthParticle,
79  SummaryDecors& myDecors) const;
80 
87  template <typename T>
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
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Muon::TruthTrackRecordsAlg
Definition: TruthTrackRecordsAlg.h:26
Muon::TruthTrackRecordsAlg::initialize
virtual StatusCode initialize() override
Definition: TruthTrackRecordsAlg.cxx:51
Muon::TruthTrackRecordsAlg::SummaryDecors::eyDecor
WriteDecorArray_f eyDecor
Definition: TruthTrackRecordsAlg.h:58
Muon::TruthTrackRecordsAlg::m_muonSnapShotEis
DecorKey_t m_muonSnapShotEis
Definition: TruthTrackRecordsAlg.h:121
Muon::TruthTrackRecordsAlg::WriteDecorArray_f
DecorHandlePtrVec_t< xAOD::TruthParticleContainer, float > WriteDecorArray_f
Struct object encapsulating all write-decorators.
Definition: TruthTrackRecordsAlg.h:45
Muon::TruthTrackRecordsAlg::m_muonSnapShotMtc
DecorKey_t m_muonSnapShotMtc
Definition: TruthTrackRecordsAlg.h:113
Muon::TruthTrackRecordsAlg::m_muonSnapShotEX
DecorKey_t m_muonSnapShotEX
Definition: TruthTrackRecordsAlg.h:114
Muon::TruthTrackRecordsAlg::WriteDecorArray_fvec
DecorHandlePtrVec_t< xAOD::TruthParticleContainer, std::vector< float > > WriteDecorArray_fvec
Definition: TruthTrackRecordsAlg.h:47
Muon::TruthTrackRecordsAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TruthTrackRecordsAlg.cxx:76
Muon::TruthTrackRecordsAlg::SummaryDecors::epzDecor
WriteDecorArray_f epzDecor
Definition: TruthTrackRecordsAlg.h:62
Muon::TruthTrackRecordsAlg::m_trackRecords
SG::ReadHandleKeyArray< TrackRecordCollection > m_trackRecords
Keys of the containers of track records in different detector positions.
Definition: TruthTrackRecordsAlg.h:96
TruthParticleContainer.h
Muon::TruthTrackRecordsAlg::addTrackRecords
StatusCode addTrackRecords(const EventContext &ctx, const xAOD::TruthParticle &truthParticle, SummaryDecors &myDecors) const
addTrackRecords is the actual function that decorates muons with track records.
Definition: TruthTrackRecordsAlg.cxx:105
Muon::TruthTrackRecordsAlg::SummaryDecors::epxDecor
WriteDecorArray_f epxDecor
Definition: TruthTrackRecordsAlg.h:60
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
IExtrapolator.h
SG::ReadHandleKey< xAOD::TruthParticleContainer >
Muon::TruthTrackRecordsAlg::m_muonSnapShotEcov
DecorKey_t m_muonSnapShotEcov
Definition: TruthTrackRecordsAlg.h:120
Muon::TruthTrackRecordsAlg::m_muonSnapShotPz
DecorKey_t m_muonSnapShotPz
Definition: TruthTrackRecordsAlg.h:112
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::TruthTrackRecordsAlg::m_muonSnapShotEPx
DecorKey_t m_muonSnapShotEPx
Definition: TruthTrackRecordsAlg.h:117
Muon::TruthTrackRecordsAlg::m_muonSnapShotZ
DecorKey_t m_muonSnapShotZ
Definition: TruthTrackRecordsAlg.h:109
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
Muon::TruthTrackRecordsAlg::m_muonSnapShotPx
DecorKey_t m_muonSnapShotPx
Definition: TruthTrackRecordsAlg.h:110
Muon::TruthTrackRecordsAlg::m_muonSnapShotX
DecorKey_t m_muonSnapShotX
Definition: TruthTrackRecordsAlg.h:107
Muon::TruthTrackRecordsAlg::m_muonSnapShotEPy
DecorKey_t m_muonSnapShotEPy
Definition: TruthTrackRecordsAlg.h:118
DecorUtils.h
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Muon::TruthTrackRecordsAlg::fillWriteDecorator
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.
Definition: TruthTrackRecordsAlg.cxx:41
Muon::TruthTrackRecordsAlg::SummaryDecors::exDecor
WriteDecorArray_f exDecor
Definition: TruthTrackRecordsAlg.h:57
Muon::TruthTrackRecordsAlg::SummaryDecors::eisDecor
WriteDecorArray_b eisDecor
Definition: TruthTrackRecordsAlg.h:64
Muon::TruthTrackRecordsAlg::SummaryDecors::ezDecor
WriteDecorArray_f ezDecor
Definition: TruthTrackRecordsAlg.h:59
Muon::TruthTrackRecordsAlg::m_muonTruth
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_muonTruth
Key of the container of truth muons that will be decorated.
Definition: TruthTrackRecordsAlg.h:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::TruthTrackRecordsAlg::SummaryDecors::zDecor
WriteDecorArray_f zDecor
Definition: TruthTrackRecordsAlg.h:52
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
Muon::TruthTrackRecordsAlg::SummaryDecors::pxDecor
WriteDecorArray_f pxDecor
Definition: TruthTrackRecordsAlg.h:53
Muon::TruthTrackRecordsAlg::m_muonSnapShotEZ
DecorKey_t m_muonSnapShotEZ
Definition: TruthTrackRecordsAlg.h:116
plotmaker.keyName
keyName
Definition: plotmaker.py:145
Muon::TruthTrackRecordsAlg::SummaryDecors::matchedDecor
WriteDecorArray_b matchedDecor
Definition: TruthTrackRecordsAlg.h:56
Muon::TruthTrackRecordsAlg::m_muonSnapShotEY
DecorKey_t m_muonSnapShotEY
Definition: TruthTrackRecordsAlg.h:115
AthReentrantAlgorithm.h
Muon::TruthTrackRecordsAlg::m_muonSnapShotPy
DecorKey_t m_muonSnapShotPy
Definition: TruthTrackRecordsAlg.h:111
Muon::TruthTrackRecordsAlg::m_muonSnapShotY
DecorKey_t m_muonSnapShotY
Definition: TruthTrackRecordsAlg.h:108
Muon::TruthTrackRecordsAlg::SummaryDecors::pzDecor
WriteDecorArray_f pzDecor
Definition: TruthTrackRecordsAlg.h:55
TrackRecordCollection.h
Muon::TruthTrackRecordsAlg::SummaryDecors::yDecor
WriteDecorArray_f yDecor
Definition: TruthTrackRecordsAlg.h:51
Muon::TruthTrackRecordsAlg::SummaryDecors::ecovDecor
WriteDecorArray_fvec ecovDecor
Definition: TruthTrackRecordsAlg.h:63
Muon::TruthTrackRecordsAlg::SummaryDecors::epyDecor
WriteDecorArray_f epyDecor
Definition: TruthTrackRecordsAlg.h:61
WriteDecorHandleKeyArray.h
Muon::TruthTrackRecordsAlg::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Extrapolation tool handle.
Definition: TruthTrackRecordsAlg.h:124
Muon::TruthTrackRecordsAlg::m_muonSnapShotEPz
DecorKey_t m_muonSnapShotEPz
Definition: TruthTrackRecordsAlg.h:119
Muon::TruthTrackRecordsAlg::SummaryDecors::xDecor
WriteDecorArray_f xDecor
Definition: TruthTrackRecordsAlg.h:50
Muon::TruthTrackRecordsAlg::WriteDecorArray_b
DecorHandlePtrVec_t< xAOD::TruthParticleContainer, char > WriteDecorArray_b
Definition: TruthTrackRecordsAlg.h:46
Muon::TruthTrackRecordsAlg::SummaryDecors
Definition: TruthTrackRecordsAlg.h:49
Muon::TruthTrackRecordsAlg::SummaryDecors::pyDecor
WriteDecorArray_f pyDecor
Definition: TruthTrackRecordsAlg.h:54
Muon::DecorHandlePtrVec_t
std::vector< DecorHandlePtr_wt< ContType, DataType > > DecorHandlePtrVec_t
Definition: DecorUtils.h:15