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