diff --git a/Analysis/CMakeLists.txt b/Analysis/CMakeLists.txt index 7e666e5bb77e848d9218a4ee66b5018fcd871a94..58590ac4f319bc8f4bc40f2fd0f093d97927a4a4 100644 --- a/Analysis/CMakeLists.txt +++ b/Analysis/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory(TotalInvMass) add_subdirectory(TrackInspect) +add_subdirectory(DumpEvent) diff --git a/Analysis/DumpEvent/CMakeLists.txt b/Analysis/DumpEvent/CMakeLists.txt index 3c5f697d2e4355b72a6ee88c16e271edba076353..2c27a0e0b739a087a7d85d61ce22d07744fbb2af 100644 --- a/Analysis/DumpEvent/CMakeLists.txt +++ b/Analysis/DumpEvent/CMakeLists.txt @@ -1,5 +1,6 @@ gaudi_add_module(DumpEvent SOURCES src/DumpMCParticleAlg.cpp + src/DumpSimHitAlg.cpp #src/DumpHitAlg.cpp src/DumpTrackAlg.cpp #src/DumpCalorimeterAlg.cpp diff --git a/Analysis/DumpEvent/src/DumpSimHitAlg.cpp b/Analysis/DumpEvent/src/DumpSimHitAlg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1a1500fa4693b0a62cf6178f89b49db60beede03 --- /dev/null +++ b/Analysis/DumpEvent/src/DumpSimHitAlg.cpp @@ -0,0 +1,65 @@ +/* + * Description: + * Dump the simulated information. + * + * Author: + * Tao Lin <lintao AT ihep.ac.cn> + */ + +#include "k4FWCore/DataHandle.h" +#include "GaudiKernel/Algorithm.h" + +#include "edm4hep/MCParticleCollection.h" +#include "edm4hep/SimTrackerHitCollection.h" +#include "edm4hep/SimCalorimeterHitCollection.h" +#include "edm4hep/CaloHitContributionCollection.h" + +#include "GaudiKernel/NTuple.h" + +class DumpSimHitAlg: public Algorithm { +public: + + DumpSimHitAlg(const std::string& name, ISvcLocator* pSvcLocator); + + // Three mandatory member functions of any algorithm + StatusCode initialize() override; + StatusCode execute() override; + StatusCode finalize() override; + +private: + // - collection MCParticleG4: the simulated particles in Geant4 + DataHandle<edm4hep::MCParticleCollection> m_mcParCol{"MCParticle", + Gaudi::DataHandle::Reader, this}; + + // Dedicated collections for CEPC + DataHandle<edm4hep::SimTrackerHitCollection> m_VXDCol{"VXDCollection", + Gaudi::DataHandle::Reader, this}; + +}; + +DECLARE_COMPONENT( DumpSimHitAlg ) + +DumpSimHitAlg::DumpSimHitAlg(const std::string& name, ISvcLocator* pSvcLocator) +: Algorithm(name, pSvcLocator) { + +} + +StatusCode DumpSimHitAlg::initialize() { + return StatusCode::SUCCESS; +} + +StatusCode DumpSimHitAlg::execute() { + auto mcCol = m_mcParCol.get(); + + auto vxdCol = m_VXDCol.get(); + + for (auto hit: *vxdCol) { + + } + + return StatusCode::SUCCESS; +} + +StatusCode DumpSimHitAlg::finalize() { + return StatusCode::SUCCESS; +}