Skip to content
Snippets Groups Projects
Commit bf862d50 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: let the headers could be found via the library name.

parent 38c1e268
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,17 @@ gaudi_subdir(Simulation v0r0)
find_package(Geant4)
include(${Geant4_USE_FILE})
# DetSimInterface (headers only)
set(DetSimInterface_srcs
src/DetSimInterface/*.cpp
)
gaudi_add_library(DetSimInterfaces ${DetSimInterface_srcs}
INCLUDE_DIRS include
PUBLIC_HEADERS include/DetSimInterface
)
# DetSimCore module
set(DetSimCore_srcs
......@@ -11,6 +22,6 @@ set(DetSimCore_srcs
)
gaudi_add_module(DetSimCore ${DetSimCore_srcs}
INCLUDE_DIRS GaudiKernel Geant4
LINK_LIBRARIES GaudiKernel Geant4
INCLUDE_DIRS DetSimInterfaces GaudiKernel Geant4
LINK_LIBRARIES DetSimInterfaces GaudiKernel Geant4
)
#ifndef IDetSimSvc_h
#define IDetSimSvc_h
#include "GaudiKernel/IService.h"
// IDetSimSvc is the interface between Gaudi and Geant4.
// All the initialization of Run Manager (RM) should be done here, including:
// * Detector Construction
// * Physics List
// * Primary Generator Action
// * User Actions
// Then, the real simulation should be also done by this service via Run Manager.
//
// Note, to decouple the Gaudi and Geant4, we keep all these classes still derived from
// the original Geant4's base classes, while using Gaudi tools to manage these objects.
class G4RunManager;
class IDetSimSvc: virtual public IInterface {
public:
DeclareInterfaceID(IDetSimSvc, 0, 1); // major/minor version
virtual ~IDetSimSvc() = 0;
// Get the Run Manager
virtual G4RunManager* getRM() = 0;
// Control the run manager directly.
virtual StatusCode initializeRM() = 0;
virtual StatusCode simulateEvent(int i_event) = 0;
virtual StatusCode finalizeRM() = 0;
};
#endif
......@@ -7,7 +7,7 @@
#include <GaudiKernel/Algorithm.h>
#include <GaudiKernel/Property.h>
#include <DetSimInterface/IDetSimSvc.h>
class DetSimAlg: public Algorithm {
public:
......@@ -17,6 +17,9 @@ public:
StatusCode execute() override;
StatusCode finalize() override;
private:
SmartIF<IDetSimSvc> m_detsimsvc;
private:
Gaudi::Property<std::vector<std::string>> m_run_macs{this, "RunMacs"};
......
#include "DetSimInterface/IDetSimSvc.h"
IDetSimSvc::~IDetSimSvc() {
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment