diff --git a/Simulation/DetSimCore/CMakeLists.txt b/Simulation/DetSimCore/CMakeLists.txt index 57f82000cd42384b801d52b9f796619610d6ca85..95d56bc0fff525e284be32dc355be27c9207a0c9 100644 --- a/Simulation/DetSimCore/CMakeLists.txt +++ b/Simulation/DetSimCore/CMakeLists.txt @@ -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 ) diff --git a/Simulation/DetSimCore/src/G4PrimaryCnvTool.cpp b/Simulation/DetSimCore/src/G4PrimaryCnvTool.cpp index 4f34751eb03ab8e499972bc7393c41a3b8f04aec..717a447fdfdd31a316f96f0c9f6ef3a8e1b8f0f3 100644 --- a/Simulation/DetSimCore/src/G4PrimaryCnvTool.cpp +++ b/Simulation/DetSimCore/src/G4PrimaryCnvTool.cpp @@ -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; } diff --git a/Simulation/DetSimCore/src/G4PrimaryCnvTool.h b/Simulation/DetSimCore/src/G4PrimaryCnvTool.h index 00c225a52bc85da53f1f9ad8a91864116ed39084..eee528b0763bbe47116dde415e884514a3695094 100644 --- a/Simulation/DetSimCore/src/G4PrimaryCnvTool.h +++ b/Simulation/DetSimCore/src/G4PrimaryCnvTool.h @@ -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