fix: create ions

This commit is contained in:
liuyihui 2022-05-19 16:27:50 +08:00
parent c7c96ac270
commit 508859d214
2 changed files with 1 additions and 3 deletions

View File

@ -19,7 +19,7 @@ public:
const G4ParticleGun* GetParticleGun() const { return fParticleGun; }; const G4ParticleGun* GetParticleGun() const { return fParticleGun; };
private: private:
G4String particleType; G4String particleType = "NULL";
G4ParticleGun* fParticleGun = nullptr; G4ParticleGun* fParticleGun = nullptr;
}; };

View File

@ -18,8 +18,6 @@ PrimaryGeneratorAction::PrimaryGeneratorAction() {
(DetectorConstruction*)(G4RunManager::GetRunManager()->GetUserDetectorConstruction()); (DetectorConstruction*)(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
fParticleGun = new G4ParticleGun(); fParticleGun = new G4ParticleGun();
particleType = detConstruction->GetParticleType();
DefineParticle(particleType);
} }
PrimaryGeneratorAction::~PrimaryGeneratorAction() { delete fParticleGun; } PrimaryGeneratorAction::~PrimaryGeneratorAction() { delete fParticleGun; }