46 G4String processName = aStep->GetPostStepPoint()->
47 GetProcessDefinedStep()->GetProcessName();
49 if(processName !=
"DecayWithSpin" ){
51 G4Track* aTrack= aStep->GetTrack();
53 G4String particleName = aStep->GetTrack()->
54 GetDefinition()->GetParticleName();
56 G4ThreeVector polDir = aTrack->GetPolarization();
57 G4ThreeVector momDir = aTrack->GetMomentumDirection();
59 if (particleName ==
"mu+") {
60 if (momDir * polDir < (1.-1.E-7)) {
62 G4double cos_theta = momDir * polDir;
63 G4double gTime = aTrack->GetGlobalTime();
65 G4cout <<
" *** ERROR - WARNING *** " << G4endl;
66 G4cout <<
"processName: " << processName << G4endl;
67 G4cout <<
"particleName " << particleName << G4endl;
68 G4cout <<
"Global Time: " << gTime/ns <<
"nsec" << G4endl;
69 G4cout <<
"Angle between spin and momentum:" << cos_theta << G4endl;
70 G4Exception(
"SteppingAction::UserSteppingAction",
"Error",
72 "Angle between spin and momentum too large");