From b8471cd05d3e4b228a599d046711d37c6072f47d Mon Sep 17 00:00:00 2001 From: lintao <lintao51@gmail.com> Date: Mon, 5 Aug 2019 23:17:10 +0800 Subject: [PATCH] add a hello world algorithm. --- CMakeLists.txt | 6 ++++++ Examples/CMakeLists.txt | 11 ++++++++++ Examples/src/HelloWorld/HelloAlg.cpp | 31 ++++++++++++++++++++++++++++ Examples/src/HelloWorld/HelloAlg.h | 21 +++++++++++++++++++ Generator/CMakeLists.txt | 2 ++ README.md | 13 +++++++----- 6 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 Examples/CMakeLists.txt create mode 100644 Examples/src/HelloWorld/HelloAlg.cpp create mode 100644 Examples/src/HelloWorld/HelloAlg.h create mode 100644 Generator/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..96496488 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) + +find_package(GaudiProject) + +gaudi_project(cepc-offline HEAD + USE Gaudi v29r2 ) \ No newline at end of file diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt new file mode 100644 index 00000000..5605c6bb --- /dev/null +++ b/Examples/CMakeLists.txt @@ -0,0 +1,11 @@ + +gaudi_subdir(Examples v0r0) + +set(Examples_srcs + src/HelloWorld/*.cpp +) + +gaudi_add_module(Examples ${Examples_srcs} + INCLUDE_DIRS GaudiKernel + LINK_LIBRARIES GaudiKernel +) \ No newline at end of file diff --git a/Examples/src/HelloWorld/HelloAlg.cpp b/Examples/src/HelloWorld/HelloAlg.cpp new file mode 100644 index 00000000..730240c2 --- /dev/null +++ b/Examples/src/HelloWorld/HelloAlg.cpp @@ -0,0 +1,31 @@ +#include "HelloAlg.h" + +DECLARE_COMPONENT(HelloAlg) + +HelloAlg::HelloAlg(const std::string& name, ISvcLocator* pSvcLocator) +: Algorithm(name, pSvcLocator) { + +} + +StatusCode +HelloAlg::initialize() { + StatusCode sc; + + info() << "MyInt: " << m_int.value() << endmsg; + + return sc; +} + +StatusCode +HelloAlg::execute() { + StatusCode sc; + return sc; +} + +StatusCode +HelloAlg::finalize() { + StatusCode sc; + return sc; +} + + diff --git a/Examples/src/HelloWorld/HelloAlg.h b/Examples/src/HelloWorld/HelloAlg.h new file mode 100644 index 00000000..9c689ca9 --- /dev/null +++ b/Examples/src/HelloWorld/HelloAlg.h @@ -0,0 +1,21 @@ +#ifndef HelloAlg_h +#define HelloAlg_h + +#include <GaudiKernel/Algorithm.h> +#include "GaudiKernel/Property.h" + +class HelloAlg: public Algorithm { +public: + HelloAlg(const std::string& name, ISvcLocator* pSvcLocator); + + StatusCode initialize() override; + StatusCode execute() override; + StatusCode finalize() override; + +private: + + Gaudi::Property<int> m_int{this, "MyInt", 42}; +}; + + +#endif diff --git a/Generator/CMakeLists.txt b/Generator/CMakeLists.txt new file mode 100644 index 00000000..ef5f3728 --- /dev/null +++ b/Generator/CMakeLists.txt @@ -0,0 +1,2 @@ + +gaudi_subdir(Generator v0r0) \ No newline at end of file diff --git a/README.md b/README.md index 50c189ad..fbc118c6 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,18 @@ # cepc-offline -CEPC offline software prototype +CEPC offline software prototype based on Gaudi ## Packages * Core: Core Software Based on Gaudi -* Simulation: Physics Generator & Detector Simulation +* Generator: Physics Generator -* Reconstruction +* Simulation: Detector Simulation -* Examples: For new comers +* Reconstruction: Reconstruction + +* Examples: For new comers and users + +* cepcenv: tools to help developers build packages -* cepcenv: tools to help developers build packages \ No newline at end of file -- GitLab