From fa8d27ce50720337ee299c8c99ce8265d665191a Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sun, 9 Jul 2023 15:28:10 +0200 Subject: [PATCH] Add an example producer --- .../src/components/ExampleProducer.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 k4ProjectTemplate/src/components/ExampleProducer.cpp diff --git a/k4ProjectTemplate/src/components/ExampleProducer.cpp b/k4ProjectTemplate/src/components/ExampleProducer.cpp new file mode 100644 index 0000000..d2cf5b1 --- /dev/null +++ b/k4ProjectTemplate/src/components/ExampleProducer.cpp @@ -0,0 +1,23 @@ +#include "Gaudi/Property.h" +#include "GaudiAlg/GaudiAlgorithm.h" +#include "GaudiAlg/Producer.h" + +#include + +using BaseClass_t = Gaudi::Functional::Traits::BaseClass_t; + +struct ExampleProducer final : Gaudi::Functional::Producer { + + ExampleProducer( const std::string& name, ISvcLocator* svcLoc ) + : Producer( name, svcLoc, KeyValue( "OutputLocation", m_outputLocation ) ) {} + + int operator()() const override { + return m_exampleInt; + } + + Gaudi::Property m_outputLocation{this, "OutputLocation", "/ExampleInt"}; + Gaudi::Property m_exampleInt{this, "ExampleInt", 3}; + +}; + +DECLARE_COMPONENT(ExampleProducer)