Message: SetMomentum from Geant 4.9.4 to 4.9.6 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None SetMomentum from Geant 4.9.4 to 4.9.6 

Forum: Particles
Date: 09 Sep, 2013
From: Beatrice Panico <Beatrice Panico>

Hello, in my code I have the following lines :

  G4PrimaryParticle* particle = new G4PrimaryParticle();

  FDsimG4StoreHit* G4Particle = theFDSimulator->GetG4Particle(); 

  G4ThreeVector momentum = G4ThreeVector(G4Particle->GetDirX(),
		                         G4Particle->GetDirY(),
		                         G4Particle->GetDirZ());
  momentum = momentum*(G4Particle->GetEnergy()*eV);

  particle->SetMomentum(momentum.x(),momentum.y(),momentum.z());
  cout<<particle->GetPx()<<" "<<particle->GetPy()<<" "<<particle->GetPz()<<endl;

and the print message reports exactly the momentum components.

When I pass this code to the Geant version 4.9.6 particle->GetPx(), particle->GetPy() and particle->GetPz() return different values and a different total momentum. How can I set the different components to obtain the right energy for the simulated particles?

There are changes in this method? Thanks

Beatrice

 Add Message Add Message
to: "SetMomentum from Geant 4.9.4 to 4.9.6"

 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 ]