00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // Implementation of the HETC88 code into Geant4. 00028 // Evaporation and De-excitation parts 00029 // T. Lampen, Helsinki Institute of Physics, May-2000 00030 00031 #include "globals.hh" 00032 #include "G4ios.hh" 00033 #include "Randomize.hh" 00034 #include "G4PhysicalConstants.hh" 00035 #include "G4Neutron.hh" 00036 #include "G4Proton.hh" 00037 #include "G4Deuteron.hh" 00038 #include "G4Triton.hh" 00039 #include "G4Alpha.hh" 00040 #include "G4Nucleus.hh" 00041 #include "G4BEGammaDeexcitation.hh" 00042 00043 00044 G4BEGammaDeexcitation::G4BEGammaDeexcitation() 00045 { 00046 } 00047 00048 00049 G4BEGammaDeexcitation::~G4BEGammaDeexcitation() 00050 { 00051 } 00052 00053 00054 void G4BEGammaDeexcitation::setVerboseLevel( G4int level ) 00055 { 00056 verboseLevel = level ; 00057 } 00058 00059 00060 void G4BEGammaDeexcitation::setNucleusA( G4int a ) 00061 { 00062 nucleusA = a; 00063 } 00064 00065 00066 void G4BEGammaDeexcitation::setNucleusZ( G4int z ) 00067 { 00068 nucleusZ = z; 00069 } 00070 00071 00072 void G4BEGammaDeexcitation::setExcitationEnergy( G4double energy ) 00073 { 00074 excitationEnergy = energy; 00075 } 00076 00077 00078 G4double G4BEGammaDeexcitation::sampleKineticEnergy() 00079 { 00080 return excitationEnergy * G4UniformRand(); 00081 } 00082 00083 00084 G4DynamicParticle * G4BEGammaDeexcitation::emit() 00085 { 00086 // Isotropic distribution assumed to gammas 00087 G4double u, v, w; 00088 G4DynamicParticle * pParticle = new G4DynamicParticle; 00089 pParticle -> SetDefinition( G4Gamma::Gamma() ); 00090 pParticle -> SetKineticEnergy( sampleKineticEnergy() ); 00091 isotropicCosines( u, v, w ); 00092 pParticle -> SetMomentumDirection( u, v, w ); 00093 return pParticle; 00094 } 00095 00096 00097 void G4BEGammaDeexcitation::isotropicCosines( G4double & u, 00098 G4double & v, 00099 G4double & w ) 00100 { 00101 // Samples isotropic random direction cosines. 00102 G4double CosTheta = 1.0 - 2.0 * G4UniformRand(); 00103 G4double SinTheta = std::sqrt( 1.0 - CosTheta * CosTheta ); 00104 G4double Phi = twopi * G4UniformRand(); 00105 00106 u = std::cos( Phi ) * SinTheta; 00107 v = std::cos( Phi ) * CosTheta, 00108 w = std::sin( Phi ); 00109 00110 return; 00111 }