Message: Re: Creating an Isotope and applying it to the particle gun Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Creating an Isotope and applying it to the particle gun 

Forum: Particles
Re: None Creating an Isotope and applying it to the particle gun (Matthew Gignac)
Re: None Re: Creating an Isotope and applying it to the particle gun (Michael H. Kelsey)
Re: None Re: Creating an Isotope and applying it to the particle gun (Matthew Gignac)
Re: None Re: Creating an Isotope and applying it to the particle gun (michel maire)
Date: 13 Nov, 2010
From: Matthew Gignac <Matthew Gignac>

Hello,

Thank you for your response. I am trying to do exactly what you indicated... 

"G4int Z = 20, A = 40;
    G4double ionCharge = 0.*eplus;
    G4double excitEnergy = 0.*keV;
    G4ParticleDefinition* ion = G4ParticleTable::GetParticleTable()->GetIon(Z,A,excitEnergy);
    particleGun->SetParticleDefinition(ion);
    particleGun->SetParticleCharge(ionCharge);
    particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
    particleGun->SetParticleEnergy(1.5*GeV);"

And I am getting this error message when I try to run the program... but it does compile with no errors...


*** G4Exception : Illegal operation
      issued by : G4IonTable::CreateIon()
Can not create ions in PreInit state
*** This is just a warning message.

*** G4Exception : Event00003
      issued by : G4ParticleGun::SetParticleDefinition()
Null pointer is given.
*** Fatal Exception *** core dump ***

*** G4Exception: Aborting execution ***
Abort trap"


I am not sure what is going wrong? Any clue?

Again, your help is greatly appreciated,

Cheers,
Matthew

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Creating an Isotope and applying it to the particle gun   (michel maire - 14 Nov, 2010)
(_ Idea: Re: Creating an Isotope and applying it to the particle gun   (Vladimir Ivanchenko - 14 Nov, 2010)
(_ None: Re: Creating an Isotope and applying it to the particle gun   (Matthew Gignac - 15 Nov, 2010)
(_ Ok: Re: Creating an Isotope and applying it to the particle gun   (Matthew Gignac - 15 Nov, 2010)
 Add Message Add Message
to: "Re: Creating an Isotope and applying it to the particle gun"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]