1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // Implementation of the HETC88 code into Geant4. |
---|
28 | // Evaporation and De-excitation parts |
---|
29 | // T. Lampen, Helsinki Institute of Physics, May-2000 |
---|
30 | |
---|
31 | #include "globals.hh" |
---|
32 | #include "G4ios.hh" |
---|
33 | #include "Randomize.hh" |
---|
34 | #include "G4Neutron.hh" |
---|
35 | #include "G4Proton.hh" |
---|
36 | #include "G4Deuteron.hh" |
---|
37 | #include "G4Triton.hh" |
---|
38 | #include "G4Alpha.hh" |
---|
39 | #include "G4Nucleus.hh" |
---|
40 | #include "G4BEGammaDeexcitation.hh" |
---|
41 | |
---|
42 | |
---|
43 | G4BEGammaDeexcitation::G4BEGammaDeexcitation() |
---|
44 | { |
---|
45 | } |
---|
46 | |
---|
47 | |
---|
48 | G4BEGammaDeexcitation::~G4BEGammaDeexcitation() |
---|
49 | { |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | void G4BEGammaDeexcitation::setVerboseLevel( G4int level ) |
---|
54 | { |
---|
55 | verboseLevel = level ; |
---|
56 | } |
---|
57 | |
---|
58 | |
---|
59 | void G4BEGammaDeexcitation::setNucleusA( G4int a ) |
---|
60 | { |
---|
61 | nucleusA = a; |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | void G4BEGammaDeexcitation::setNucleusZ( G4int z ) |
---|
66 | { |
---|
67 | nucleusZ = z; |
---|
68 | } |
---|
69 | |
---|
70 | |
---|
71 | void G4BEGammaDeexcitation::setExcitationEnergy( G4double energy ) |
---|
72 | { |
---|
73 | excitationEnergy = energy; |
---|
74 | } |
---|
75 | |
---|
76 | |
---|
77 | G4double G4BEGammaDeexcitation::sampleKineticEnergy() |
---|
78 | { |
---|
79 | return excitationEnergy * G4UniformRand(); |
---|
80 | } |
---|
81 | |
---|
82 | |
---|
83 | G4DynamicParticle * G4BEGammaDeexcitation::emit() |
---|
84 | { |
---|
85 | // Isotropic distribution assumed to gammas |
---|
86 | G4double u, v, w; |
---|
87 | G4DynamicParticle * pParticle = new G4DynamicParticle; |
---|
88 | pParticle -> SetDefinition( G4Gamma::Gamma() ); |
---|
89 | pParticle -> SetKineticEnergy( sampleKineticEnergy() ); |
---|
90 | isotropicCosines( u, v, w ); |
---|
91 | pParticle -> SetMomentumDirection( u, v, w ); |
---|
92 | return pParticle; |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | void G4BEGammaDeexcitation::isotropicCosines( G4double & u, |
---|
97 | G4double & v, |
---|
98 | G4double & w ) |
---|
99 | { |
---|
100 | // Samples isotropic random direction cosines. |
---|
101 | G4double CosTheta = 1.0 - 2.0 * G4UniformRand(); |
---|
102 | G4double SinTheta = std::sqrt( 1.0 - CosTheta * CosTheta ); |
---|
103 | G4double Phi = twopi * G4UniformRand(); |
---|
104 | |
---|
105 | u = std::cos( Phi ) * SinTheta; |
---|
106 | v = std::cos( Phi ) * CosTheta, |
---|
107 | w = std::sin( Phi ); |
---|
108 | |
---|
109 | return; |
---|
110 | } |
---|