From 198a94a7b4c4b76bf65e7b48eaf91ea3c63164bd Mon Sep 17 00:00:00 2001 From: Valentin Volkl Date: Tue, 29 Sep 2020 15:12:13 +0200 Subject: [PATCH] add EmptyAlg --- {TestFWCore => K4TestFWCore}/CMakeLists.txt | 8 +++--- .../options/createExampleEventData.py | 0 K4TestFWCore/options/eventcounter.py | 18 ++++++++++++ .../options/readExampleEventData.py | 0 .../src/components/CreateExampleEventData.cpp | 0 .../src/components/CreateExampleEventData.h | 0 K4TestFWCore/src/components/EmptyAlg.cpp | 20 +++++++++++++ K4TestFWCore/src/components/EmptyAlg.h | 28 +++++++++++++++++++ 8 files changed, 70 insertions(+), 4 deletions(-) rename {TestFWCore => K4TestFWCore}/CMakeLists.txt (75%) rename {TestFWCore => K4TestFWCore}/options/createExampleEventData.py (100%) create mode 100644 K4TestFWCore/options/eventcounter.py rename {TestFWCore => K4TestFWCore}/options/readExampleEventData.py (100%) rename {TestFWCore => K4TestFWCore}/src/components/CreateExampleEventData.cpp (100%) rename {TestFWCore => K4TestFWCore}/src/components/CreateExampleEventData.h (100%) create mode 100644 K4TestFWCore/src/components/EmptyAlg.cpp create mode 100644 K4TestFWCore/src/components/EmptyAlg.h diff --git a/TestFWCore/CMakeLists.txt b/K4TestFWCore/CMakeLists.txt similarity index 75% rename from TestFWCore/CMakeLists.txt rename to K4TestFWCore/CMakeLists.txt index e6c4b4e..cb23e54 100644 --- a/TestFWCore/CMakeLists.txt +++ b/K4TestFWCore/CMakeLists.txt @@ -6,12 +6,12 @@ find_package(EDM4HEP) find_package(podio) -gaudi_subdir(TestFWCore v1r0) +gaudi_subdir(K4TestFWCore v1r0) gaudi_depends_on_subdirs(GaudiAlg GaudiKernel FWCore) -gaudi_add_module(TestFWCorePlugins +gaudi_add_module(K4TestFWCorePlugins src/components/*.cpp INCLUDE_DIRS FWCore EDM4HEP::edm4hep LINK_LIBRARIES GaudiKernel FWCore EDM4HEP::edm4hep) @@ -21,9 +21,9 @@ include(CTest) gaudi_add_test(CreateExampleEventData WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMAND gaudirun.py TestFWCore/options/createExampleEventData.py) + COMMAND gaudirun.py K4TestFWCore/options/createExampleEventData.py) gaudi_add_test(ReadExampleEventData WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - COMMAND gaudirun.py TestFWCore/options/readExampleEventData.py) + COMMAND gaudirun.py K4TestFWCore/options/readExampleEventData.py) diff --git a/TestFWCore/options/createExampleEventData.py b/K4TestFWCore/options/createExampleEventData.py similarity index 100% rename from TestFWCore/options/createExampleEventData.py rename to K4TestFWCore/options/createExampleEventData.py diff --git a/K4TestFWCore/options/eventcounter.py b/K4TestFWCore/options/eventcounter.py new file mode 100644 index 0000000..0d586c0 --- /dev/null +++ b/K4TestFWCore/options/eventcounter.py @@ -0,0 +1,18 @@ +from Gaudi.Configuration import * + +from Configurables import K4DataSvc +podioevent = K4DataSvc("EventDataSvc") + +from Configurables import EventCounterExample +eventcounter = EventCounterExample() + + +from Configurables import ApplicationMgr +ApplicationMgr( TopAlg=[eventcounter], + EvtSel="NONE", + EvtMax=100, + ExtSvc=[podioevent], + OutputLevel=DEBUG, + ) + + diff --git a/TestFWCore/options/readExampleEventData.py b/K4TestFWCore/options/readExampleEventData.py similarity index 100% rename from TestFWCore/options/readExampleEventData.py rename to K4TestFWCore/options/readExampleEventData.py diff --git a/TestFWCore/src/components/CreateExampleEventData.cpp b/K4TestFWCore/src/components/CreateExampleEventData.cpp similarity index 100% rename from TestFWCore/src/components/CreateExampleEventData.cpp rename to K4TestFWCore/src/components/CreateExampleEventData.cpp diff --git a/TestFWCore/src/components/CreateExampleEventData.h b/K4TestFWCore/src/components/CreateExampleEventData.h similarity index 100% rename from TestFWCore/src/components/CreateExampleEventData.h rename to K4TestFWCore/src/components/CreateExampleEventData.h diff --git a/K4TestFWCore/src/components/EmptyAlg.cpp b/K4TestFWCore/src/components/EmptyAlg.cpp new file mode 100644 index 0000000..5cf4e1b --- /dev/null +++ b/K4TestFWCore/src/components/EmptyAlg.cpp @@ -0,0 +1,20 @@ +#include "EmptyAlg.h" + +DECLARE_COMPONENT(EmptyAlg) + +EmptyAlg::EmptyAlg(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) { +} + +EmptyAlg::~EmptyAlg() {} + +StatusCode EmptyAlg::initialize() { + return StatusCode::SUCCESS; +} + +StatusCode EmptyAlg::execute() { + return StatusCode::SUCCESS; +} + +StatusCode EmptyAlg::finalize() { + return StatusCode::SUCCESS; +} diff --git a/K4TestFWCore/src/components/EmptyAlg.h b/K4TestFWCore/src/components/EmptyAlg.h new file mode 100644 index 0000000..e504f00 --- /dev/null +++ b/K4TestFWCore/src/components/EmptyAlg.h @@ -0,0 +1,28 @@ +#pragma once + +// GAUDI +#include "GaudiAlg/GaudiAlgorithm.h" +#include "GaudiKernel/Property.h" + + +class EmptyAlg : public GaudiAlgorithm { +public: + explicit EmptyAlg(const std::string&, ISvcLocator*); + virtual ~EmptyAlg(); + /** Initialize. + * @return status code + */ + virtual StatusCode initialize() final; + /** Execute. + * @return status code + */ + virtual StatusCode execute() final; + /** Finalize. + * @return status code + */ + virtual StatusCode finalize() final; + +private: + // member variable + int m_member = 0; +};