ATLAS Offline Software
Loading...
Searching...
No Matches
TruthEDDecorator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Class header file
6#include "TruthEDDecorator.h"
7
8namespace DerivationFramework {
9
11
12 ATH_CHECK(m_eventInfoKey.initialize());
13 ATH_CHECK(m_eventShapeKeys.initialize());
15
16 return StatusCode::SUCCESS;
17 }
18
19
20 StatusCode TruthEDDecorator::addBranches(const EventContext& ctx) const{
21 ATH_MSG_VERBOSE("addBranches()");
22
23
25 if (!eventInfo.isValid()) {
26 ATH_MSG_ERROR("Couldn't retrieve " << m_eventInfoKey);
27 return StatusCode::FAILURE;
28 }
29
30 for (size_t i=0;i<m_eventShapeKeys.size();++i){
31 // Get the event shapes from which we'll get the densities
33 if (!eventShape.isValid()) {
34 ATH_MSG_ERROR ("Could not retrieve " << m_eventShapeKeys[i]);
35 return StatusCode::FAILURE;
36 }
37
38 // Decorate the densities onto the event info
40 dec_eventDensity(*eventInfo) = eventShape->getDensity(xAOD::EventShape::Density);
41 }
42
43 return StatusCode::SUCCESS;
44 }
45
46}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
virtual StatusCode initialize() override final
SG::WriteDecorHandleKeyArray< xAOD::EventInfo > m_eventDensityDecorKeys
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::ReadHandleKeyArray< xAOD::EventShape > m_eventShapeKeys
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
THE reconstruction tool.