From 117790a661d6a6001d69aa7d90c9f336269ca7c1 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Mon, 3 Jan 2011 14:17:54 +0000 Subject: [PATCH] Description for proper beam direction implementation. --- src/musrPrimaryGeneratorAction.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/musrPrimaryGeneratorAction.cc b/src/musrPrimaryGeneratorAction.cc index 6d79c57..a144e6a 100644 --- a/src/musrPrimaryGeneratorAction.cc +++ b/src/musrPrimaryGeneratorAction.cc @@ -274,6 +274,14 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) // works for beam along +-z only for now 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 G4double xpolaris=0, ypolaris=0, zpolaris=0; if (UnpolarisedMuonBeam) {