Fixed bug
This commit is contained in:
parent
3440daafcc
commit
c6aaabcc64
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user