From 508859d214426beadfa09a8ffc12a5bfaf0ca515 Mon Sep 17 00:00:00 2001 From: YiHui Liu Date: Thu, 19 May 2022 16:27:50 +0800 Subject: [PATCH] fix: create ions --- include/PrimaryGeneratorAction.h | 2 +- src/PrimaryGeneratorAction.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/PrimaryGeneratorAction.h b/include/PrimaryGeneratorAction.h index 797a396..f184f7f 100644 --- a/include/PrimaryGeneratorAction.h +++ b/include/PrimaryGeneratorAction.h @@ -19,7 +19,7 @@ public: const G4ParticleGun* GetParticleGun() const { return fParticleGun; }; private: - G4String particleType; + G4String particleType = "NULL"; G4ParticleGun* fParticleGun = nullptr; }; diff --git a/src/PrimaryGeneratorAction.cpp b/src/PrimaryGeneratorAction.cpp index 913e4d5..9f34174 100644 --- a/src/PrimaryGeneratorAction.cpp +++ b/src/PrimaryGeneratorAction.cpp @@ -18,8 +18,6 @@ PrimaryGeneratorAction::PrimaryGeneratorAction() { (DetectorConstruction*)(G4RunManager::GetRunManager()->GetUserDetectorConstruction()); fParticleGun = new G4ParticleGun(); - particleType = detConstruction->GetParticleType(); - DefineParticle(particleType); } PrimaryGeneratorAction::~PrimaryGeneratorAction() { delete fParticleGun; }