ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TrackingID
TrackingDecorAlgorithms
src
TrackCovarianceDecoratorAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrackingDecorAlgorithms/TrackCovarianceDecoratorAlg.h
"
6
7
#include "
StoreGate/WriteDecorHandle.h
"
8
9
#include <cmath>
10
11
12
namespace
TrackingDecorAlgorithms
{
13
14
TrackCovarianceDecoratorAlg::TrackCovarianceDecoratorAlg
(
15
const
std::string& name, ISvcLocator* loc)
16
:
AthReentrantAlgorithm
(name, loc) {}
17
18
StatusCode
TrackCovarianceDecoratorAlg::initialize
() {
19
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
20
21
ATH_CHECK
(
m_trackContainerKey
.initialize());
22
ATH_CHECK
(
m_dec_phiUncertainty
.initialize());
23
ATH_CHECK
(
m_dec_thetaUncertainty
.initialize());
24
ATH_CHECK
(
m_dec_qOverPUncertainty
.initialize());
25
26
return
StatusCode::SUCCESS;
27
}
28
29
StatusCode
TrackCovarianceDecoratorAlg::execute
(
30
const
EventContext& ctx)
const
31
{
32
SG::ReadHandle<xAOD::TrackParticleContainer>
tracks(
33
m_trackContainerKey
, ctx);
34
ATH_CHECK
(tracks.
isValid
());
35
36
using
TPC =
xAOD::TrackParticleContainer
;
37
SG::WriteDecorHandle<TPC, float>
dec_phi(
m_dec_phiUncertainty
, ctx);
38
SG::WriteDecorHandle<TPC, float>
dec_theta(
m_dec_thetaUncertainty
, ctx);
39
SG::WriteDecorHandle<TPC, float>
dec_qOverP(
m_dec_qOverPUncertainty
, ctx);
40
41
for
(
const
xAOD::TrackParticle
* trk : *tracks) {
42
const
auto
& diag = trk->definingParametersCovMatrixDiagVec();
43
dec_phi(*trk) = std::sqrt(diag.at(2));
44
dec_theta(*trk) = std::sqrt(diag.at(3));
45
dec_qOverP(*trk) = std::sqrt(diag.at(4));
46
}
47
48
return
StatusCode::SUCCESS;
49
}
50
51
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
WriteDecorHandle.h
Handle class for adding a decoration to an object.
TrackCovarianceDecoratorAlg.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::TrackCovarianceDecoratorAlg
TrackCovarianceDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TrackCovarianceDecoratorAlg.cxx:14
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition
TrackCovarianceDecoratorAlg.cxx:29
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::m_dec_thetaUncertainty
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_thetaUncertainty
Definition
TrackCovarianceDecoratorAlg.h:36
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::m_dec_phiUncertainty
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_phiUncertainty
Definition
TrackCovarianceDecoratorAlg.h:33
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::m_dec_qOverPUncertainty
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_qOverPUncertainty
Definition
TrackCovarianceDecoratorAlg.h:39
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition
TrackCovarianceDecoratorAlg.cxx:18
TrackingDecorAlgorithms::TrackCovarianceDecoratorAlg::m_trackContainerKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainerKey
Definition
TrackCovarianceDecoratorAlg.h:28
TrackingDecorAlgorithms
Definition
TrackCovarianceDecoratorAlg.cxx:12
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::TrackParticleContainer
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticleContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0