Fixed problems with negative energies

This commit is contained in:
Thomas Prokscha 2016-08-12 11:04:57 +02:00
parent ba04c8dc77
commit c4bb2bb74e

View File

@ -99,9 +99,11 @@ void musrMuEnergyLossLandau::GetFinalEnergy(const G4Step* aStep)
if(p_name=="mu+"){
do{
Eloss = random->Landau(landauMPV,landauSigma);
} while (Eloss < 0.);
if (Eloss > 0.) break;
} while (1);
Efinal = E - Eloss;
if (Efinal < 0. ) Efinal = 0.;
// cout << "E, Eloss, Efinal = " << E << ", " << Eloss << ", " << Efinal << endl;
particle = particleTable->FindParticle(p_name) ;