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

WIP: in DDG4, the collection type is still...

WIP: in DDG4, the collection type is still G4THitsCollection<dd4hep::sim::Geant4Hit> for calo hit collection.
parent 83d21a85
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
class CaloSensitiveDetector: public DDG4SensitiveDetector { class CaloSensitiveDetector: public DDG4SensitiveDetector {
public: public:
typedef dd4hep::sim::Geant4CalorimeterHit CalorimeterHit; typedef dd4hep::sim::Geant4CalorimeterHit CalorimeterHit;
typedef G4THitsCollection<CalorimeterHit> HitCollection; typedef G4THitsCollection<CalorimeterHit> CaloHitCollection;
public: public:
CaloSensitiveDetector(const std::string& name, dd4hep::Detector& description); CaloSensitiveDetector(const std::string& name, dd4hep::Detector& description);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
class DDG4SensitiveDetector: public G4VSensitiveDetector { class DDG4SensitiveDetector: public G4VSensitiveDetector {
public: public:
typedef dd4hep::sim::Geant4Hit Geant4Hit;
typedef G4THitsCollection<dd4hep::sim::Geant4Hit> HitCollection; typedef G4THitsCollection<dd4hep::sim::Geant4Hit> HitCollection;
typedef dd4hep::sim::Geant4Hit::Contribution HitContribution; typedef dd4hep::sim::Geant4Hit::Contribution HitContribution;
......
...@@ -16,7 +16,8 @@ CaloSensitiveDetector::Initialize(G4HCofThisEvent* HCE) { ...@@ -16,7 +16,8 @@ CaloSensitiveDetector::Initialize(G4HCofThisEvent* HCE) {
// the collection name is provided by DD4hep // the collection name is provided by DD4hep
const std::string& coll_name = collectionName[0]; 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; int HCID = -1;
if(HCID<0) HCID = G4SDManager::GetSDMpointer()->GetCollectionID(m_hc); if(HCID<0) HCID = G4SDManager::GetSDMpointer()->GetCollectionID(m_hc);
......
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