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 | // $Id: G4ContinuumGammaDeexcitation.cc,v 1.7 2010/04/30 16:08:03 vnivanch Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
28 | // |
---|
29 | // ------------------------------------------------------------------- |
---|
30 | // GEANT 4 class file |
---|
31 | // |
---|
32 | // CERN, Geneva, Switzerland |
---|
33 | // |
---|
34 | // File name: G4ContinuumGammaDeexcitation |
---|
35 | // |
---|
36 | // Authors: Carlo Dallapiccola (dallapiccola@umdhep.umd.edu) |
---|
37 | // Maria Grazia Pia (pia@genova.infn.it) |
---|
38 | // |
---|
39 | // Creation date: 23 October 1998 |
---|
40 | // |
---|
41 | // Modifications: |
---|
42 | // |
---|
43 | // 02 May 2003, Vladimir Ivanchenko change interface to G4NuclearlevelManager |
---|
44 | // |
---|
45 | // 19 April 2010 J. M. Quesada: smaller value of tolerance parameter |
---|
46 | // |
---|
47 | // ------------------------------------------------------------------- |
---|
48 | // |
---|
49 | // Class G4ContinuumGammaDeexcitation.cc |
---|
50 | // |
---|
51 | // Concrete class derived from G4VGammaDeexcitation |
---|
52 | // |
---|
53 | // |
---|
54 | #include "G4ContinuumGammaDeexcitation.hh" |
---|
55 | |
---|
56 | #include "G4Gamma.hh" |
---|
57 | #include "G4ContinuumGammaTransition.hh" |
---|
58 | #include "G4NuclearLevelManager.hh" |
---|
59 | #include "G4NuclearLevelStore.hh" |
---|
60 | #include "G4Fragment.hh" |
---|
61 | #include "G4ConstantLevelDensityParameter.hh" |
---|
62 | |
---|
63 | // |
---|
64 | // Constructor |
---|
65 | // |
---|
66 | |
---|
67 | G4ContinuumGammaDeexcitation::G4ContinuumGammaDeexcitation() |
---|
68 | : _nucleusZ(0), _nucleusA(0), _levelManager(0) |
---|
69 | { } |
---|
70 | |
---|
71 | |
---|
72 | G4ContinuumGammaDeexcitation::~G4ContinuumGammaDeexcitation() |
---|
73 | { } |
---|
74 | |
---|
75 | |
---|
76 | G4VGammaTransition* G4ContinuumGammaDeexcitation::CreateTransition() |
---|
77 | { |
---|
78 | G4Fragment* nucleus = GetNucleus(); |
---|
79 | G4int Z = static_cast<G4int>(nucleus->GetZ()); |
---|
80 | G4int A = static_cast<G4int>(nucleus->GetA()); |
---|
81 | G4double excitation = nucleus->GetExcitationEnergy(); |
---|
82 | |
---|
83 | if (_nucleusA != A || _nucleusZ != Z) |
---|
84 | { |
---|
85 | _levelManager = G4NuclearLevelStore::GetInstance()->GetManager(Z,A); |
---|
86 | _nucleusA = A; |
---|
87 | _nucleusZ = Z; |
---|
88 | } |
---|
89 | |
---|
90 | if (_verbose > 1) { |
---|
91 | G4cout << "G4ContinuumGammaDeexcitation::CreateTransition - Created" << G4endl; |
---|
92 | } |
---|
93 | G4VGammaTransition* gt = new G4ContinuumGammaTransition(_levelManager,Z,A,excitation,_verbose ); |
---|
94 | |
---|
95 | return gt; |
---|
96 | } |
---|
97 | |
---|
98 | |
---|
99 | G4bool G4ContinuumGammaDeexcitation::CanDoTransition() |
---|
100 | { |
---|
101 | //JMQ: far too small, creating sometimes continuum gammas instead of the right discrete ones |
---|
102 | // (when excitation energy is slightly over maximum discrete energy): changed |
---|
103 | // G4double tolerance = 10*eV; |
---|
104 | const G4double tolerance = CLHEP::keV; |
---|
105 | |
---|
106 | if (_transition == 0) |
---|
107 | { |
---|
108 | if (_verbose > 0) { |
---|
109 | G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Null transition " |
---|
110 | << G4endl; |
---|
111 | } |
---|
112 | return false; |
---|
113 | } |
---|
114 | |
---|
115 | G4Fragment* nucleus = GetNucleus(); |
---|
116 | G4double excitation = nucleus->GetExcitationEnergy(); |
---|
117 | |
---|
118 | // G4int A = (G4int)nucleus->GetA(); |
---|
119 | // G4int Z = (G4int)nucleus->GetZ(); |
---|
120 | if (_nucleusA<2 || _nucleusZ<3) |
---|
121 | { |
---|
122 | if (_verbose > 1) { |
---|
123 | G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - n/p/H" |
---|
124 | << G4endl; |
---|
125 | } |
---|
126 | return false; |
---|
127 | } |
---|
128 | |
---|
129 | if (excitation <= tolerance) |
---|
130 | { |
---|
131 | if (_verbose > 1) { |
---|
132 | G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Excitation " |
---|
133 | << excitation/CLHEP::keV << " keV is too small" |
---|
134 | << G4endl; |
---|
135 | } |
---|
136 | return false; |
---|
137 | } |
---|
138 | if (excitation <= (_levelManager->MaxLevelEnergy() + tolerance)) |
---|
139 | { |
---|
140 | if (_verbose > 0) { |
---|
141 | G4cout << "G4ContinuumGammaDeexcitation::CanDoTransition - Excitation " |
---|
142 | << excitation << " below max discrete level " |
---|
143 | << _levelManager->MaxLevelEnergy() << G4endl; |
---|
144 | } |
---|
145 | return false; |
---|
146 | } |
---|
147 | |
---|
148 | if (_verbose > 1) { |
---|
149 | G4cout <<"G4ContinuumGammaDeexcitation::CanDoTransition - CanDo" |
---|
150 | << " Eex(keV)= " << excitation/CLHEP::keV |
---|
151 | << " Emax(keV)= " << _levelManager->MaxLevelEnergy()/CLHEP::keV |
---|
152 | << " Z= " << _nucleusZ << " A= " << _nucleusA |
---|
153 | << G4endl; |
---|
154 | } |
---|
155 | return true; |
---|
156 | } |
---|
157 | |
---|
158 | |
---|
159 | |
---|