Message: G4DynamicParticle Heavy Ion Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question G4DynamicParticle Heavy Ion 

Forum: Particles
Date: 02 Apr, 2017
From: Simon Albright <Simon Albright>

I'm trying to return a heavy ion from a custom physics process. I need to convert the G4Nucleus into a G4DynamicParticle with some momentum and add it to theParticleChange as a secondary.

I'm currently using:

G4HadFinalState* Test::ApplyYourself(const G4HadProjectile& theTrack, G4Nucleus& theTarget) {

    G4DynamicParticle* recoilNucleus = new G4DynamicParticle();
    recoilNucleus -> SetDefinition(G4IonTable::GetIonTable()->GetIon(theTarget.GetZ_asInt(), theTarget.GetA_asInt(), 0));

    G4DynamicParticle* returnDeut = new G4DynamicParticle();
    returnDeut -> SetDefinition(G4Deuteron::Definition());
    returnDeut -> SetMomentum(theTrack.Get4Momentum());


    return &theParticleChange;

But the inclusion of the G4IonTable command somehow overrides the mass of the deuteron and I can't find anyway of having it be correct. When I print the mass of both the ion is correct, but the deuteron is being set to 2.47033e-323. If I don't use the G4IonTable the deuteron mass is set correctly, but I can't set the ion correctly.

Thanks in advance for any help.

 Add Message Add Message
to: "G4DynamicParticle Heavy Ion"

 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 ]