ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
8
9#include <cmath>
10
11
13
15 const std::string& name, ISvcLocator* loc)
16 : AthReentrantAlgorithm(name, loc) {}
17
19 ATH_MSG_INFO("Initializing " << name() << "...");
20
21 ATH_CHECK(m_trackContainerKey.initialize());
22 ATH_CHECK(m_dec_phiUncertainty.initialize());
25
26 return StatusCode::SUCCESS;
27 }
28
30 const EventContext& ctx) const
31 {
34 ATH_CHECK(tracks.isValid());
35
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
TrackCovarianceDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &) const override
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_thetaUncertainty
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_phiUncertainty
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_dec_qOverPUncertainty
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainerKey
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".