Fixed bug

This commit is contained in:
nemu 2014-10-21 17:59:41 +02:00
parent 3440daafcc
commit c6aaabcc64

View File

@ -260,20 +260,20 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
if (pitch!=0) {yangle += - pitch * (y-y0); }
} // end of the part specific for the muons generated by random rather then from TURTLE
//------- Add new intial angle
//------- generate cos(Theta) distribution if zangleSigma < 0 and calculate final momentum
G4double sinXangle, sinYangle, phi;
G4double px, py, pz;
if (zangleSigma<0) {
sinXangle=sqrt(G4UniformRand());
phi=2*CLHEP::pi*G4UniformRand();
// Calculate the final momentum
px = p*sinXangle*cos(phi);
py = p*sinXangle*sin(phi);
pz = std::sqrt(p*p - px*px - py*py);
}
if (zangleSigma> 0) {sinXangle=sin(xangle); sinYangle=sin(yangle);
else {
sinXangle=sin(xangle);
sinYangle=sin(yangle);
px = p*sinXangle;
py = p*sinYangle;
pz = std::sqrt(p*p - px*px - py*py);