| Message: Lithium ion definiton in particlegun ? | Not Logged In (login) |
|
Geant4 version Name: geant4-09-02-beta-01
I am trying to shoot Lithium ion in the particlegun, but I can not find Li in G4ParticleTable.On the other hand, even if I see the Li ion in G4IonTable by GetIonName(Z,A,E), I can not use it in the particlegun. Am I missing something? Can anybody help me ?
#include "G4Event.hh" #include "G4ParticleGun.hh" #include "G4ParticleTable.hh" #include "G4IonTable.hh" #include "G4ParticleDefinition.hh" #include "globals.hh"
void ExN01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
// There is no Li in G4ParticleTable
particleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
particleGun->SetParticleDefinition(particleTable->FindIon(3,7,0));
// Neither I can use the Li in G4IonTable G4IonTable* ionTable ; G4cout<<ionTable->GetIonName(3, 7, 0.84*MeV)<<G4endl;; // Seems to work G4cout<<ionTable->GetNucleusEncoding(3, 7, 0.84*MeV)<<G4endl; // Seems to work G4ParticleDefinition* ion = ionTable->GetIon(3,7,0.84*MeV); particleGun->SetParticleDefinition(ion);
particleGun->SetParticleEnergy(0.84*MeV); particleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, 0.0)); G4ThreeVector v(1.0,0.0,0.0); particleGun->SetParticleMomentumDirection(v); particleGun->GeneratePrimaryVertex(anEvent); }
|
| Inline Depth: | Outline Depth: | Add message: |
|
to: |