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

add edm4cepc

parent 044bd3ff
No related branches found
No related tags found
No related merge requests found
...@@ -8,12 +8,14 @@ gaudi_add_module(Examples ...@@ -8,12 +8,14 @@ gaudi_add_module(Examples
src/Edm4hepTest/Edm4hepReadAlg.cpp src/Edm4hepTest/Edm4hepReadAlg.cpp
src/Edm4hepTest/Edm4hepReadDCAlg.cpp src/Edm4hepTest/Edm4hepReadDCAlg.cpp
src/Edm4hepTest/Edm4hepWriteAlg.cpp src/Edm4hepTest/Edm4hepWriteAlg.cpp
src/Edm4hepTest/Edm4cepcWriteAlg.cpp
src/DumpIDAlg/DumpIDAlg.cpp src/DumpIDAlg/DumpIDAlg.cpp
LINK DetInterface LINK DetInterface
k4FWCore::k4FWCore k4FWCore::k4FWCore
Gaudi::GaudiAlgLib Gaudi::GaudiKernel Gaudi::GaudiAlgLib Gaudi::GaudiKernel
${LCIO_LIBRARIES} ${LCIO_LIBRARIES}
${DD4hep_COMPONENT_LIBRARIES} ${DD4hep_COMPONENT_LIBRARIES}
EDM4CEPC::edm4cepc EDM4CEPC::edm4cepcDict
EDM4HEP::edm4hep EDM4HEP::edm4hepDict EDM4HEP::edm4hep EDM4HEP::edm4hepDict
${podio_LIBRARIES} podio::podioRootIO ${podio_LIBRARIES} podio::podioRootIO
) )
......
#!/usr/bin/env python
from Gaudi.Configuration import *
from Configurables import k4DataSvc
dsvc = k4DataSvc("EventDataSvc")
from Configurables import Edm4cepcWriteAlg
alg = Edm4cepcWriteAlg("Edm4cepcWriteAlg")
from Configurables import PodioOutput
out = PodioOutput("out")
out.filename = "test.root"
out.outputCommands = ["keep *"]
# ApplicationMgr
from Configurables import ApplicationMgr
ApplicationMgr( TopAlg = [alg, out],
EvtSel = 'NONE',
EvtMax = 10,
ExtSvc=[dsvc],
OutputLevel=DEBUG
)
/*
* Description:
* This algorithm is used to test the EDM4hep extension for cepc.
*
* In the extension, we keep the same namespace as edm4hep.
* The header file path is different.
*
* Author:
* Tao Lin <lintao AT ihep.ac.cn>
*/
#include "k4FWCore/DataHandle.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "edm4cepc/RecTofCollection.h"
class Edm4cepcWriteAlg: public GaudiAlgorithm {
public:
Edm4cepcWriteAlg(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc) {
}
StatusCode initialized() {
return GaudiAlgorithm::initialize();
}
StatusCode execute() {
auto rectofCol = m_rectofCol.createAndPut();
for (size_t i = 0; i < 3; ++i) {
auto rectof = rectofCol->create();
rectof.setTime(100.);
rectof.setTimeExp({99.,99.5,100,100.5,101});
rectof.setSigma(1.);
rectof.setPathLength({50,50.5,51,51.5,52});
rectof.setPosition({100,100,10});
}
return StatusCode::SUCCESS;
}
StatusCode finalize() {
return GaudiAlgorithm::finalize();
}
private:
DataHandle<edm4hep::RecTofCollection> m_rectofCol{"RecTofCollection", Gaudi::DataHandle::Writer, this};
};
DECLARE_COMPONENT(Edm4cepcWriteAlg)
...@@ -44,3 +44,12 @@ else() ...@@ -44,3 +44,12 @@ else()
message("Try to use an internal installation of CKF BELLE") message("Try to use an internal installation of CKF BELLE")
include("${CMAKE_CURRENT_LIST_DIR}/internal_ckf.cmake") include("${CMAKE_CURRENT_LIST_DIR}/internal_ckf.cmake")
endif() endif()
if (CEPCSW_USE_SYSTEM_EDM4CEPC)
message("Try to use an existing installation of EDM4CEPC")
find_package(EDM4CEPC)
else()
message("Try to use an internal installation of EDM4CEPC")
include("${CMAKE_CURRENT_LIST_DIR}/internal_edm4cepc.cmake")
endif()
...@@ -8,3 +8,6 @@ option(CEPCSW_USE_SYSTEM_CKF_BELLE ...@@ -8,3 +8,6 @@ option(CEPCSW_USE_SYSTEM_CKF_BELLE
"Use the existing installation of CKF BELLE. Otherwise the internal version will be used." "Use the existing installation of CKF BELLE. Otherwise the internal version will be used."
FALSE) FALSE)
option(CEPCSW_USER_SYSTEM_EDM4CEPC
"Use the existing installation of EDM4CEPC. Otherwise the internal version will be used."
FALSE)
include(FetchContent)
FetchContent_Declare(
EDM4CEPC
GIT_REPOSITORY https://code.ihep.ac.cn/cepc/externals/EDM4cepc.git
GIT_TAG 8eb38894b7b055bf6fe99d4b156e97f7e9466a26
)
FetchContent_MakeAvailable(EDM4CEPC)
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