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); }
|
if (pitch!=0) {yangle += - pitch * (y-y0); }
|
||||||
|
|
||||||
} // end of the part specific for the muons generated by random rather then from TURTLE
|
} // 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 sinXangle, sinYangle, phi;
|
||||||
G4double px, py, pz;
|
G4double px, py, pz;
|
||||||
if (zangleSigma<0) {
|
if (zangleSigma<0) {
|
||||||
sinXangle=sqrt(G4UniformRand());
|
sinXangle=sqrt(G4UniformRand());
|
||||||
phi=2*CLHEP::pi*G4UniformRand();
|
phi=2*CLHEP::pi*G4UniformRand();
|
||||||
|
|
||||||
// Calculate the final momentum
|
|
||||||
px = p*sinXangle*cos(phi);
|
px = p*sinXangle*cos(phi);
|
||||||
py = p*sinXangle*sin(phi);
|
py = p*sinXangle*sin(phi);
|
||||||
pz = std::sqrt(p*p - px*px - py*py);
|
pz = std::sqrt(p*p - px*px - py*py);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (zangleSigma> 0) {sinXangle=sin(xangle); sinYangle=sin(yangle);
|
sinXangle=sin(xangle);
|
||||||
|
sinYangle=sin(yangle);
|
||||||
px = p*sinXangle;
|
px = p*sinXangle;
|
||||||
py = p*sinYangle;
|
py = p*sinYangle;
|
||||||
pz = std::sqrt(p*p - px*px - py*py);
|
pz = std::sqrt(p*p - px*px - py*py);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user