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

WIP: try to load event in a tool.

parent 4a7c3ea2
No related branches found
No related tags found
No related merge requests found
......@@ -2,12 +2,14 @@
gaudi_subdir(DetSimCore v0r0)
gaudi_depends_on_subdirs(
FWCore
Simulation/DetSimInterface
)
find_package(Geant4 REQUIRED ui_all vis_all)
include(${Geant4_USE_FILE})
find_package(plcio)
find_package(podio REQUIRED)
find_package(plcio REQUIRED)
set(DetSimCore_srcs
src/DetSimAlg.cpp
......@@ -23,6 +25,6 @@ set(DetSimCore_srcs
)
gaudi_add_module(DetSimCore ${DetSimCore_srcs}
INCLUDE_DIRS DetSimInterface GaudiKernel Geant4 plcio
LINK_LIBRARIES DetSimInterface GaudiKernel Geant4 plcio
INCLUDE_DIRS DetSimInterface GaudiKernel Geant4 plcio ${plcio_INCLUDE_DIRS} ${podio_INCLUDE_DIRS}
LINK_LIBRARIES DetSimInterface GaudiKernel Geant4 plcio podio
)
......@@ -6,6 +6,15 @@ DECLARE_COMPONENT(G4PrimaryCnvTool)
bool G4PrimaryCnvTool::mutate(G4Event* anEvent) {
auto mcCol = m_mcParCol.get();
info() << "Start a new event: " << endmsg;
for ( auto p : *mcCol ) {
info() << p.getObjectID().index << " : [";
for ( auto it = p.daughters_begin(), end = p.daughters_end(); it != end; ++it ) {
info() << " " << it->getObjectID().index;
}
info() << " ]; " << endmsg;
}
return true;
}
......@@ -3,6 +3,10 @@
#include "GaudiKernel/AlgTool.h"
#include "DetSimInterface/IG4PrimaryCnvTool.h"
#include "FWCore/DataHandle.h"
#include "plcio/EventHeaderCollection.h"
#include "plcio/MCParticleCollection.h"
class G4PrimaryCnvTool: public extends<AlgTool, IG4PrimaryCnvTool> {
public:
......@@ -11,6 +15,9 @@ public:
bool mutate(G4Event* anEvent) override;
private:
DataHandle<plcio::MCParticleCollection> m_mcParCol{"MCParticleCol", Gaudi::DataHandle::Reader, this};
};
#endif
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