Description for proper beam direction implementation.

This commit is contained in:
salman 2011-01-03 14:17:54 +00:00
parent 651bc448f0
commit 117790a661

View File

@ -274,6 +274,14 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
// works for beam along +-z only for now // works for beam along +-z only for now
pz = zDirection * std::sqrt(p*p - px*px - py*py); pz = zDirection * std::sqrt(p*p - px*px - py*py);
// Proper rotation of beam direction as follows:
// hat{n} is beam direction unit vecrot and vec{p} is momentum vector
// new momentum vector is vec{p'}=R vec{p}
// where R is a rotation matrix around (hat{z} x hat{n}) - cross product
// with an angle of acos(hat{z} dot hat{n}) - dot product
// i.e. R is a rotation around (-n_y, n_x, 0) with angle acos(n_z).
// G4RotationMatrix* R = new G4RotationMatrix(G4ThreeVector(-nx,ny,0),acos(nz)*deg);
// Assign spin // Assign spin
G4double xpolaris=0, ypolaris=0, zpolaris=0; G4double xpolaris=0, ypolaris=0, zpolaris=0;
if (UnpolarisedMuonBeam) { if (UnpolarisedMuonBeam) {