Fixed bug
This commit is contained in:
parent
3440daafcc
commit
c6aaabcc64
@ -258,27 +258,27 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
// Add the beam tilt, which depends on the distance from the beam centre.
|
||||
// if (ySigma>0) {yangle += - pitch * (y-y0)/ySigma; }
|
||||
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
|
||||
G4double sinXangle, sinYangle, phi;
|
||||
G4double px, py, pz;
|
||||
if (zangleSigma<0) {
|
||||
|
||||
//------- 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);
|
||||
// printf("px, py, pz = %f, %f, %f\n", px, py, pz);
|
||||
}
|
||||
// printf("px, py, pz = %f, %f, %f\n", px, py, pz);
|
||||
}
|
||||
|
||||
// Calculate particle (muon) starting time
|
||||
G4double ParticleTime; //P.B. 13 May 2009
|
||||
|
Loading…
x
Reference in New Issue
Block a user