13#include "GaudiKernel/EventContext.h"
21 ISvcLocator* pSvcLocator)
34 return StatusCode::SUCCESS;
40 std::size_t idx_trk = 0;
41 float idx_decor = 0.0f;
43 auto elecCont = std::make_unique<xAOD::ExampleElectronContainer>();
44 auto elecStore = std::make_unique<xAOD::ExampleElectronAuxContainer>();
45 elecCont->setStore(elecStore.get());
53 elecCont->push_back(std::make_unique<xAOD::ExampleElectron>());
56 ATH_MSG_INFO(name() <<
": track # " << idx_trk <<
" pT = " << track->getPT()
60 elecCont->back()->setPt(track->getPT());
64 <<
"is an electron with pT = " << elecCont->back()->pt()
72 ATH_CHECK(objs.record(std::move(elecCont), std::move(elecStore)));
89 hdl1(*obj) = 115.9 + 12.34 * idx_decor;
90 hdl2(*obj) = 114.9 + idx_decor;
93 ATH_MSG_INFO(name() <<
": DecorationWriter: decor1 = " << hdl1(*obj)
94 <<
", decor2 = " << hdl2(*obj) <<
". ");
102 return StatusCode::SUCCESS;
108 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
This file contains the class definition for the ExampleHitContainer class.
This file contains the class definition for the ExampleTrackContainer class.
Handle class for adding a decoration to an object.
Handle class for recording to StoreGate.
This file contains the class definition for the WriteExampleElectron class.
WriteExampleElectron(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteDecorHandleKey< xAOD::ExampleElectronContainer > m_decor1Key
SG::WriteDecorHandleKey< xAOD::ExampleElectronContainer > m_decor2Key
SG::ReadHandleKey< ExampleHitContainer > m_exampleHitKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadHandleKey< ExampleTrackContainer > m_exampleTrackKey
virtual StatusCode finalize() override final
virtual StatusCode initialize() override final
Gaudi Service Interface method implementations:
SG::WriteHandleKey< xAOD::ExampleElectronContainer > m_exampleElectronContainerKey
An algorithm that can be simultaneously executed in multiple threads.
This class provides a dummy track data object for AthenaPool.
Handle class for adding a decoration to an object.
ExampleElectron_v1 ExampleElectron