Fixed problems with negative energies
This commit is contained in:
parent
ba04c8dc77
commit
c4bb2bb74e
@ -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) ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user