diff --git a/Reconstruction/VKalVrt/GNNVertexConstructor/CMakeLists.txt b/Reconstruction/VKalVrt/GNNVertexConstructor/CMakeLists.txt index 9e3f877a4ba804f99e0c48d10ed66cceaf7eae8a..c6bea0c2ef86a9d7117ce5ae77588d460d05ee43 100644 --- a/Reconstruction/VKalVrt/GNNVertexConstructor/CMakeLists.txt +++ b/Reconstruction/VKalVrt/GNNVertexConstructor/CMakeLists.txt @@ -11,7 +11,7 @@ atlas_add_component( GNNVertexConstructor atlas_add_library( GNNVertexConstructorLib src/*.cxx PUBLIC_HEADERS GNNVertexConstructor - LINK_LIBRARIES AthenaBaseComps ) + LINK_LIBRARIES AthenaBaseComps xAODTracking ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorAlg.h b/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorAlg.h index 68fa7e917bfa5cb679d1d7f3450ced396327384d..bf6dcc56f04ab1e32a45f9c4fbcc494be561dcc0 100644 --- a/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorAlg.h +++ b/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorAlg.h @@ -6,6 +6,7 @@ #include "GNNVertexConstructor/IGNNVertexConstructorInterface.h" #include "GaudiKernel/ToolHandle.h" +#include "xAODTracking/TrackParticleContainer.h" namespace Rec { @@ -20,10 +21,10 @@ namespace Rec { private: ToolHandle<Rec::IGNNVertexConstructorInterface> m_testTool; - + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_inTrackKey{this, "InputTrackContainer", "InDetTrackParticles", "Input track particle container"}; }; } -#endif \ No newline at end of file +#endif diff --git a/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorTool.h b/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorTool.h index 9c4a8618b8c1961c4730078111a49f4831f7e59c..7b5e417faed9d3f500192ae49aa822b0c63eaa18 100644 --- a/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorTool.h +++ b/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/GNNVertexConstructorTool.h @@ -4,6 +4,8 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GNNVertexConstructor/IGNNVertexConstructorInterface.h" +#include "xAODTracking/TrackParticleContainer.h" + namespace Rec { class GNNVertexConstructorTool : public AthAlgTool, virtual public IGNNVertexConstructorInterface { @@ -19,11 +21,11 @@ namespace Rec { - unsigned int addTwoNumbers( const unsigned int & NoOne, - const unsigned int & NoTwo) const final; + unsigned int addTwoNumbers( const unsigned int & NoOne, const unsigned int & NoTwo) const final; + virtual StatusCode decorateTracks( const xAOD::TrackParticleContainer& trkCont ) const; private: }; } -#endif \ No newline at end of file +#endif diff --git a/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/IGNNVertexConstructorInterface.h b/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/IGNNVertexConstructorInterface.h index 01de7fb3f41f69266c1020e76c9125fb1ad5775b..051aaa2884de2423435f25e3c2706f09d818fb0e 100644 --- a/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/IGNNVertexConstructorInterface.h +++ b/Reconstruction/VKalVrt/GNNVertexConstructor/GNNVertexConstructor/IGNNVertexConstructorInterface.h @@ -4,6 +4,7 @@ // Gaudi includes #include "AthenaBaseComps/AthAlgTool.h" +#include "xAODTracking/TrackParticleContainer.h" //------------------------------------------------------------------------ namespace Rec { @@ -22,11 +23,11 @@ namespace Rec { */ - virtual unsigned int addTwoNumbers( const unsigned int & NoOne, - const unsigned int & NoTwo) const =0; + virtual unsigned int addTwoNumbers( const unsigned int & NoOne, const unsigned int & NoTwo) const =0; + virtual StatusCode decorateTracks( const xAOD::TrackParticleContainer& trkCont ) const = 0; }; } //end namespace -#endif \ No newline at end of file +#endif diff --git a/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorAlg.cxx b/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorAlg.cxx index fc753a3c1de0ebc67ff184330191c85685564cb3..0afeac47060da5a8242f76050ed2fef810929708 100644 --- a/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorAlg.cxx +++ b/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorAlg.cxx @@ -2,36 +2,53 @@ namespace Rec { -GNNVertexConstructorAlg::GNNVertexConstructorAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm( name, pSvcLocator ), -m_testTool("Rec::GNNVertexConstructorTool/testTool", this) -{ -declareProperty("TestTool",m_testTool, "The test Tool"); -} + GNNVertexConstructorAlg::GNNVertexConstructorAlg(const std::string& name, ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm( name, pSvcLocator ), + m_testTool("Rec::GNNVertexConstructorTool/testTool", this){ + + declareProperty("TestTool",m_testTool, "The test Tool"); + + } -StatusCode GNNVertexConstructorAlg::initialize() -{ + StatusCode GNNVertexConstructorAlg::initialize(){ - ATH_MSG_DEBUG("devAlg: In devAlg::initialize()"); - ATH_CHECK( m_testTool.retrieve() ); - return StatusCode::SUCCESS; -} + ATH_MSG_DEBUG("devAlg: In devAlg::initialize()"); + ATH_CHECK( m_testTool.retrieve() ); + + ATH_CHECK(m_inTrackKey.initialize()); + + return StatusCode::SUCCESS; -StatusCode GNNVertexConstructorAlg::finalize() -{ - ATH_MSG_DEBUG("devAlg: In devAlg::finalize()"); + } + + StatusCode GNNVertexConstructorAlg::finalize(){ + + ATH_MSG_DEBUG("devAlg: In devAlg::finalize()"); - return StatusCode::SUCCESS; -} + return StatusCode::SUCCESS; + } + + StatusCode GNNVertexConstructorAlg::execute(const EventContext &ctx) const{ -StatusCode GNNVertexConstructorAlg::execute(const EventContext &ctx) const -{ - ATH_MSG_DEBUG("devAlg: In devAlg::execute()"); + ATH_MSG_DEBUG("devAlg: In devAlg::execute()"); - unsigned int sum = m_testTool -> addTwoNumbers(4, 9); + unsigned int sum = m_testTool -> addTwoNumbers(4, 9); - ATH_MSG_DEBUG("SUM is = " << sum ); - return StatusCode::SUCCESS; -} + ATH_MSG_DEBUG("SUM is = " << sum ); + + + SG::ReadHandle<xAOD::TrackParticleContainer> inTracks(m_inTrackKey, ctx); + if (!inTracks.isValid()) { + if (!inTracks.isValid()) ATH_MSG_ERROR("TrackParticle container not found: " << m_inTrackKey.key()); + return StatusCode::FAILURE; + } + -} \ No newline at end of file + ATH_CHECK(m_testTool->decorateTracks(*inTracks)); + + return StatusCode::SUCCESS; + + } + +} diff --git a/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorTool.cxx b/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorTool.cxx index eb220d8a61aa77d9e101aa931b8c1f9bb808b79f..c8ca3ad74ece6425f030d7f8ea04897eb4085860 100644 --- a/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorTool.cxx +++ b/Reconstruction/VKalVrt/GNNVertexConstructor/src/GNNVertexConstructorTool.cxx @@ -5,47 +5,49 @@ namespace Rec { - GNNVertexConstructorTool::GNNVertexConstructorTool(const std::string& type, const std::string& name, const IInterface* parent): - AthAlgTool(type,name,parent) - { -// -// Declare additional interface -// - declareInterface< IGNNVertexConstructorInterface >(this); - ATH_MSG_DEBUG("GNNVertexConstructorTool constructor called"); + GNNVertexConstructorTool::GNNVertexConstructorTool(const std::string& type, const std::string& name, const IInterface* parent) + : AthAlgTool(type,name,parent){ + + declareInterface< IGNNVertexConstructorInterface >(this); + ATH_MSG_DEBUG("GNNVertexConstructorTool constructor called"); } /* Destructor */ - GNNVertexConstructorTool::~GNNVertexConstructorTool() - { - ATH_MSG_DEBUG("GNNVertexConstructorTool destructor called"); + + GNNVertexConstructorTool::~GNNVertexConstructorTool(){ + + ATH_MSG_DEBUG("GNNVertexConstructorTool destructor called"); } - StatusCode GNNVertexConstructorTool::initialize() - { + StatusCode GNNVertexConstructorTool::initialize(){ - ATH_MSG_DEBUG("GNNVertexConstructor Tool in initialize()"); + ATH_MSG_DEBUG("GNNVertexConstructor Tool in initialize()"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } - StatusCode GNNVertexConstructorTool::finalize() - { + StatusCode GNNVertexConstructorTool::finalize(){ - ATH_MSG_DEBUG("GNNVertexConstructor Tool in finalize()"); + ATH_MSG_DEBUG("GNNVertexConstructor Tool in finalize()"); - return StatusCode::SUCCESS; + return StatusCode::SUCCESS; } - unsigned int GNNVertexConstructorTool::addTwoNumbers( const unsigned int & NoOne, - const unsigned int & NoTwo) const - - { - unsigned int sum=NoOne+NoTwo; - return sum; + unsigned int GNNVertexConstructorTool::addTwoNumbers( const unsigned int & NoOne, const unsigned int & NoTwo) const { + unsigned int sum=NoOne+NoTwo; + return sum; } + StatusCode GNNVertexConstructorTool::decorateTracks( const xAOD::TrackParticleContainer& trkCont ) const { + + ATH_MSG_DEBUG("GNNVertexConstructor Tool decorating tracks"); + + int sum = trkCont.size(); + ATH_MSG_DEBUG("Size is = " << sum ); + + return StatusCode::SUCCESS; + } } // end Rec namespace