// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4DNAElectronElasticScatteringInWater.icc,v 1.4 2006/06/29 19:34:02 gunter Exp $ // GEANT4 tag $Name: geant4-08-02 $ // #ifdef G4DNAELECTRONELASTICSCATTERINGINWATER_HH template G4VParticleChange * G4DNAElectronElasticScatteringInWater :: PostStepDoIt(const G4Track & aTrack, const G4Step & aStep) { this->aParticleChange.Initialize(aTrack); G4double k; k=aTrack.GetDynamicParticle()->GetKineticEnergy(); G4double cosTheta; const G4int z(10); // H2O number of electrons cosTheta=FinalStatesPolicy::RandomizeCosTheta(k, z); G4double phi; phi=2*pi*G4UniformRand(); G4ThreeVector zVers(aTrack.GetDynamicParticle()->GetMomentumDirection()); G4ThreeVector xVers(zVers.orthogonal()); G4ThreeVector yVers(zVers.cross(xVers)); G4double xDir; G4double yDir; xDir=std::sqrt(1-cosTheta*cosTheta); yDir=xDir; xDir*=std::cos(phi); yDir*=std::sin(phi); G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers).unit()); this->aParticleChange.ProposeEnergy(k); this->aParticleChange.ProposeMomentumDirection(zPrimeVers); this->aParticleChange.SetNumberOfSecondaries(0); return G4VDNAProcessInWater::PostStepDoIt(aTrack, aStep); } #endif /* G4DNAELECTRONELASTICSCATTERINGINWATER_HH */