Description for proper beam direction implementation.
This commit is contained in:
parent
651bc448f0
commit
117790a661
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user