Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DiscreteGammaTransition.cc
Go to the documentation of this file.
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$
27//
28// -------------------------------------------------------------------
29// GEANT 4 class file
30//
31// CERN, Geneva, Switzerland
32//
33// File name: G4DiscreteGammaTransition
34//
35// Author: Maria Grazia Pia ([email protected])
36//
37// Creation date: 23 October 1998
38//
39// Modifications:
40// 15 April 1999, Alessandro Brunengo ([email protected])
41// Added creation time evaluation for products of evaporation
42//
43// 21 Nov. 2001, Fan Lei ([email protected])
44// i) added G4int _nucleusZ initialise it through the constructor
45// ii) modified SelectGamma() to allow the generation of conversion electrons
46// iii) added #include G4AtomicShells.hh
47//
48// 09 Sep. 2002, Fan Lei ([email protected])
49// Added renormalization to determine whether transition leads to
50// electron or gamma in SelectGamma()
51//
52// 19 April 2010, J. M. Quesada.
53// Corrections added for taking into account mismatch between tabulated
54// gamma energies and level energy differences (fake photons eliminated)
55//
56// 9 May 2010, V.Ivanchenko
57// Removed unphysical corretions of gamma energy; fixed default particle
58// as gamma; do not subtract bounding energy in case of electron emmision
59//
60// 03 November 2011, L. Desorgher
61// Extend the use of the code for Z>100 by not calling G4AtomicShells::GetBindingEnergy for Z>100
62// For Z>100 the binding energy is set to 0, the atomic relaxation is not simulated in G4RadDecay
63//
64// -------------------------------------------------------------------
65
67#include "G4SystemOfUnits.hh"
68#include "Randomize.hh"
69#include "G4RandGeneralTmp.hh"
70#include "G4AtomicShells.hh"
71#include "G4NuclearLevel.hh"
73#include "G4Pow.hh"
74
76 _nucleusZ(Z), _orbitE(-1), _bondE(0.), _aGamma(true), _icm(false), _gammaEnergy(0.),
77 _level(level), _excitation(0.), _gammaCreationTime(0.),_A(A),_Z(Z)
78{
79 _levelManager = 0;
80 _verbose = 0;
81 //JMQ: added tolerence in the mismatch
82 //VI: increased tolerence
83 _tolerance = 10*CLHEP::keV;
84}
85
87{}
88
90{
91 // default gamma
92 _aGamma = true;
93 _gammaEnergy = 0.;
94
95 G4int nGammas = _level.NumberOfGammas();
96 if (nGammas > 0)
97 {
98 G4int iGamma = 0;
99 if(1 < nGammas) {
100 G4double random = G4UniformRand();
101
102 //G4cout << "G4DiscreteGammaTransition::SelectGamma N= "
103 // << nGammas << " rand= " << random << G4endl;
104 for(iGamma=0; iGamma<nGammas; ++iGamma)
105 {
106 //G4cout << iGamma << " prob= "
107 // << (_level.GammaCumulativeProbabilities())[iGamma] << G4endl;
108 if(random <= (_level.GammaCumulativeProbabilities())[iGamma])
109 { break; }
110 }
111 }
112 /*
113 G4cout << "Elevel(MeV)= " << _level.Energy()/MeV
114 << " Etran(MeV)= " << (_level.GammaEnergies())[iGamma]/MeV
115 << " Eexc(MeV)= " << _excitation/MeV << G4endl;
116 */
117
118 // VI: do not apply correction here in order do not make
119 // double correction
120 //G4double eCorrection = _level.Energy() - _excitation;
121 //_gammaEnergy = (_level.GammaEnergies())[iGamma] - eCorrection;
122 _gammaEnergy = (_level.GammaEnergies())[iGamma];
123
124 //JMQ:
125 //1)If chosen gamma energy is close enough to excitation energy,
126 // the later is used instead for gamma dacey to gs (it guarantees
127 // energy conservation)
128 //2)For energy conservation, level energy differences instead of
129 // tabulated gamma energies must be used (origin of final fake photons)
130
131 // VI: remove fake photons - applied only for the last transition
132 // do not applied on each transition
133 if(std::fabs(_excitation - _gammaEnergy) < _tolerance) {
134 _gammaEnergy =_excitation;
135 }
136
137 // JMQ: Warning: the following check is needed to avoid loops:
138 // Due essentially to missing nuclear levels in data files, it is
139 // possible that _gammaEnergy is so low as the nucleus doesn't change
140 // its level after the transition.
141 // When such case is found, force the full deexcitation of the nucleus.
142 //
143 // NOTE: you should force the transition to the next lower level,
144 // but this change needs a more complex revision of actual
145 // design.
146 // I leave this for a later revision.
147
148 // VI: the check has no sence and we make this very simple
149 if (_gammaEnergy < _tolerance) {
150 _gammaEnergy = _excitation;
151 }
152
153 //G4cout << "G4DiscreteGammaTransition::SelectGamma: " << _gammaEnergy
154 // << " _icm: " << _icm << G4endl;
155
156 // now decide whether Internal Coversion electron should be emitted instead
157 if (_icm) {
158 G4double random = G4UniformRand();
159 if ( random <= (_level.TotalConvertionProbabilities())[iGamma]
160 *(_level.GammaWeights())[iGamma]
161 /((_level.TotalConvertionProbabilities())[iGamma]*(_level.GammaWeights())[iGamma]
162 +(_level.GammaWeights())[iGamma]))
163 {
164 G4int iShell = 9;
165 random = G4UniformRand() ;
166 if ( random <= (_level.KConvertionProbabilities())[iGamma])
167 { iShell = 0;}
168 else if ( random <= (_level.L1ConvertionProbabilities())[iGamma])
169 { iShell = 1;}
170 else if ( random <= (_level.L2ConvertionProbabilities())[iGamma])
171 { iShell = 2;}
172 else if ( random <= (_level.L3ConvertionProbabilities())[iGamma])
173 { iShell = 3;}
174 else if ( random <= (_level.M1ConvertionProbabilities())[iGamma])
175 { iShell = 4;}
176 else if ( random <= (_level.M2ConvertionProbabilities())[iGamma])
177 { iShell = 5;}
178 else if ( random <= (_level.M3ConvertionProbabilities())[iGamma])
179 { iShell = 6;}
180 else if ( random <= (_level.M4ConvertionProbabilities())[iGamma])
181 { iShell = 7;}
182 else if ( random <= (_level.M5ConvertionProbabilities())[iGamma])
183 { iShell = 8;}
184 // the following is needed to match the ishell to that used in G4AtomicShells
185 if ( iShell == 9) {
186 if ( (_nucleusZ < 28) && (_nucleusZ > 20)) {
187 iShell--;
188 } else if ( _nucleusZ == 20 || _nucleusZ == 19 ) {
189 iShell = iShell -2;
190 }
191 }
192 //L.Desorgher 02/11/2011
193 //Atomic shell information is available in Geant4 only up top Z=100
194 //To extend the photo evaporation code to Z>100 the call
195 // to G4AtomicShells::GetBindingEnergy should be forbidden for Z>100
196 _bondE = 0.;
197 if (_nucleusZ <=100)
198 _bondE = G4AtomicShells::GetBindingEnergy(_nucleusZ, iShell);
199 if (_verbose > 0) {
200 G4cout << "G4DiscreteGammaTransition: _nucleusZ = " <<_nucleusZ
201 << " , iShell = " << iShell
202 << " , Shell binding energy = " << _bondE/keV
203 << " keV " << G4endl;
204 }
205
206 // 09.05.2010 VI : it is an error - cannot subtract bond energy from
207 // transition energy here
208 //_gammaEnergy = _gammaEnergy - _bondE;
209 //G4cout << "_gammaEnergy = " << _gammaEnergy << G4endl;
210
211 _orbitE = iShell;
212 _aGamma = false ; // emitted is not a gamma now
213 }
214 }
215
216 G4double tau = _level.HalfLife() / G4Pow::GetInstance()->logZ(2);
217
218 //09.05.2010 VI rewrite samling of decay time
219 // assuming ordinary exponential low
220 _gammaCreationTime = 0.;
221 if(tau > 0.0) { _gammaCreationTime = -tau*std::log(G4UniformRand()); }
222
223 }
224 return;
225}
226
228{
229 return _gammaEnergy;
230}
231
233{
234 return _gammaCreationTime;
235}
236
238{
239 _excitation = energy;
240}
241
242
243
244
245
246
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
G4DiscreteGammaTransition(const G4NuclearLevel &level, G4int Z, G4int A)
virtual void SetEnergyFrom(G4double energy)
const std::vector< G4double > & M4ConvertionProbabilities() const
const std::vector< G4double > & GammaEnergies() const
G4double HalfLife() const
const std::vector< G4double > & M1ConvertionProbabilities() const
const std::vector< G4double > & L3ConvertionProbabilities() const
const std::vector< G4double > & L1ConvertionProbabilities() const
const std::vector< G4double > & M5ConvertionProbabilities() const
const std::vector< G4double > & GammaWeights() const
const std::vector< G4double > & L2ConvertionProbabilities() const
const std::vector< G4double > & GammaCumulativeProbabilities() const
const std::vector< G4double > & TotalConvertionProbabilities() const
G4int NumberOfGammas() const
const std::vector< G4double > & KConvertionProbabilities() const
const std::vector< G4double > & M3ConvertionProbabilities() const
const std::vector< G4double > & M2ConvertionProbabilities() const
static G4Pow * GetInstance()
Definition: G4Pow.cc:50
G4double logZ(G4int Z)
Definition: G4Pow.hh:146