From c4c7e9318ab35843d1e45bf20d2125aed15fa889 Mon Sep 17 00:00:00 2001 From: lintao <lintao51@gmail.com> Date: Sat, 13 Jun 2020 09:06:46 +0800 Subject: [PATCH] WIP: in DDG4, the collection type is still G4THitsCollection<dd4hep::sim::Geant4Hit> for calo hit collection. --- Simulation/DetSimSD/DetSimSD/CaloSensitiveDetector.h | 2 +- Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h | 1 + Simulation/DetSimSD/src/CaloSensitiveDetector.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Simulation/DetSimSD/DetSimSD/CaloSensitiveDetector.h b/Simulation/DetSimSD/DetSimSD/CaloSensitiveDetector.h index f9cbda02..28b3ab3b 100644 --- a/Simulation/DetSimSD/DetSimSD/CaloSensitiveDetector.h +++ b/Simulation/DetSimSD/DetSimSD/CaloSensitiveDetector.h @@ -12,7 +12,7 @@ class CaloSensitiveDetector: public DDG4SensitiveDetector { public: typedef dd4hep::sim::Geant4CalorimeterHit CalorimeterHit; - typedef G4THitsCollection<CalorimeterHit> HitCollection; + typedef G4THitsCollection<CalorimeterHit> CaloHitCollection; public: CaloSensitiveDetector(const std::string& name, dd4hep::Detector& description); diff --git a/Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h b/Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h index 94d9525b..f7806f7d 100644 --- a/Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h +++ b/Simulation/DetSimSD/DetSimSD/DDG4SensitiveDetector.h @@ -26,6 +26,7 @@ class DDG4SensitiveDetector: public G4VSensitiveDetector { public: + typedef dd4hep::sim::Geant4Hit Geant4Hit; typedef G4THitsCollection<dd4hep::sim::Geant4Hit> HitCollection; typedef dd4hep::sim::Geant4Hit::Contribution HitContribution; diff --git a/Simulation/DetSimSD/src/CaloSensitiveDetector.cpp b/Simulation/DetSimSD/src/CaloSensitiveDetector.cpp index ba740941..1547f9fe 100644 --- a/Simulation/DetSimSD/src/CaloSensitiveDetector.cpp +++ b/Simulation/DetSimSD/src/CaloSensitiveDetector.cpp @@ -16,7 +16,8 @@ CaloSensitiveDetector::Initialize(G4HCofThisEvent* HCE) { // the collection name is provided by DD4hep const std::string& coll_name = collectionName[0]; - m_hc = new G4THitsCollection<CalorimeterHit>(GetName(), coll_name); + // m_hc = new G4THitsCollection<CalorimeterHit>(GetName(), coll_name); + m_hc = new HitCollection(GetName(), coll_name); int HCID = -1; if(HCID<0) HCID = G4SDManager::GetSDMpointer()->GetCollectionID(m_hc); -- GitLab