Geant4  10.01
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 87257 2014-11-28 08:02:05Z 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
46 // conversion e-
47 // iii) added #include G4AtomicShells.hh
48 //
49 // 09 Sep. 2002, Fan Lei (flei@space.qinetiq.com)
50 // Added renormalization to determine whether transition leads to
51 // electron or gamma in SelectGamma()
52 //
53 // 19 April 2010, J. M. Quesada.
54 // Corrections added for taking into account mismatch between
55 // tabulated gamma energies and level energy differences
56 // (fake photons eliminated)
57 //
58 // 9 May 2010, V.Ivanchenko
59 // Removed unphysical corretions of gamma energy; fixed default
60 // particle as gamma; do not subtract bounding energy in case of
61 // electron emmision
62 //
63 // 3 November 2011, L. Desorgher
64 // Extend the use of the code for Z>100 by not calling
65 // G4AtomicShells::GetBindingEnergy for Z>100
66 // For Z>100 the binding energy is set to 0 and atomic
67 // relaxation is not simulated in G4RadDecay
68 //
69 // -------------------------------------------------------------------
70 
72 #include "G4SystemOfUnits.hh"
73 #include "Randomize.hh"
74 #include "G4AtomicShells.hh"
75 #include "G4NuclearLevel.hh"
76 #include "G4NuclearLevelStore.hh"
77 #include "G4Pow.hh"
78 #include "G4Log.hh"
79 
80 static const G4double tolerance = 10*CLHEP::keV;
81 
83  const G4NuclearLevel* level, G4int Z, G4int verb)
84  : orbitE(-1), bondE(0.), gammaEnergy(0.), excitation(0.),
85  gammaCreationTime(0.), aGamma(true), icm(false)
86 {
87  verbose = verb;
88  Update(level, Z);
89 }
90 
92 {}
93 
95 {
96  // default gamma
97  aGamma = true;
98  gammaEnergy = 0.;
99 
100  G4int nGammas = aLevel->NumberOfGammas();
101  if (nGammas > 0) {
102  G4int iGamma = 0;
103  if(1 < nGammas) {
104  G4double random = G4UniformRand();
105 
106  //G4cout << "G4DiscreteGammaTransition::SelectGamma N= "
107  // << nGammas << " rand= " << random << G4endl;
108  for(iGamma=0; iGamma<nGammas; ++iGamma) {
109  //G4cout << iGamma << " prob= "
110  // << (aLevel->GammaCumulativeProbabilities())[iGamma] << G4endl;
111  if(random <= (aLevel->GammaCumulativeProbabilities())[iGamma])
112  { break; }
113  }
114  }
115  /*
116  G4cout << "Elevel(MeV)= " << aLevel->Energy()
117  << " Etran(MeV)= " << (aLevel->GammaEnergies())[iGamma]
118  << " Eexc(MeV)= " << excitation << G4endl;
119  */
120  // VI 2014: initial excitation energy may be not exactly energy of the level
121  // final excitation energy is always energy of some level or zero
122  // transition to the ground state should be always equal to
123  // the excitation energy
124  gammaEnergy = (aLevel->GammaEnergies())[iGamma]
125  + excitation - aLevel->Energy();
126 
127  // this check is needed to remove cases when nucleaus is left in
128  // slightly excited state which will require very low energy
129  // gamma emission
131  //JMQ:
132  //1)If chosen gamma energy is close enough to excitation energy,
133  // the later is used instead for gamma dacey to gs (it guarantees
134  // energy conservation)
135  //2)For energy conservation, level energy differences instead of
136  // tabulated gamma energies must be used (origin of final fake photons)
137 
138  // VI: remove fake photons - applied only for the last transition
139  // do not applied on each transition
140  //if(std::fabs(excitation - gammaEnergy) < tolerance) {
141  // gammaEnergy = excitation;
142  //}
143 
144  // JMQ: Warning: the following check is needed to avoid loops:
145  // Due essentially to missing nuclear levels in data files, it is
146  // possible that gammaEnergy is so low as the nucleus doesn't change
147  // its level after the transition.
148  // When such case is found, force the full deexcitation of the nucleus.
149  //
150  // NOTE: you should force the transition to the next lower level,
151  // but this change needs a more complex revision of actual
152  // design.
153  // I leave this for a later revision.
154 
155  // VI: the check is needed to remove very low-energy gamma
157  /*
158  G4cout << "G4DiscreteGammaTransition::SelectGamma: " << gammaEnergy
159  << " Eexc= " << excitation
160  << " icm: " << icm << G4endl;
161  */
162  // now decide whether Internal Coversion electron should be emitted instead
163  if (icm) {
164  G4double random = G4UniformRand();
165  if ( random <= (aLevel->TotalConvertionProbabilities())[iGamma]
166  *(aLevel->GammaWeights())[iGamma]
167  /((aLevel->TotalConvertionProbabilities())[iGamma]
168  *(aLevel->GammaWeights())[iGamma]
169  +(aLevel->GammaWeights())[iGamma]))
170  {
171  G4int iShell = 9;
172  random = G4UniformRand() ;
173  if ( random <= (aLevel->KConvertionProbabilities())[iGamma])
174  { iShell = 0;}
175  else if ( random <= (aLevel->L1ConvertionProbabilities())[iGamma])
176  { iShell = 1;}
177  else if ( random <= (aLevel->L2ConvertionProbabilities())[iGamma])
178  { iShell = 2;}
179  else if ( random <= (aLevel->L3ConvertionProbabilities())[iGamma])
180  { iShell = 3;}
181  else if ( random <= (aLevel->M1ConvertionProbabilities())[iGamma])
182  { iShell = 4;}
183  else if ( random <= (aLevel->M2ConvertionProbabilities())[iGamma])
184  { iShell = 5;}
185  else if ( random <= (aLevel->M3ConvertionProbabilities())[iGamma])
186  { iShell = 6;}
187  else if ( random <= (aLevel->M4ConvertionProbabilities())[iGamma])
188  { iShell = 7;}
189  else if ( random <= (aLevel->M5ConvertionProbabilities())[iGamma])
190  { iShell = 8;}
191  // the following is needed to match the ishell to that used in
192  // G4AtomicShells
193  /*
194  if ( iShell == 9) {
195  if ( (nucleusZ < 28) && (nucleusZ > 20)) {
196  iShell--;
197  } else if ( nucleusZ == 20 || nucleusZ == 19 ) {
198  iShell = iShell -2;
199  }
200  }
201  */
202  //L.Desorgher 02/11/2011
203  //Atomic shell information is available in Geant4 only up top Z=100
204  //To extend the photo evaporation code to Z>100 the call
205  // to G4AtomicShells::GetBindingEnergy should be forbidden for Z>100
206  bondE = 0.;
207  if (nucleusZ <=100) {
209  }
210  if (verbose > 1) {
211  G4cout << "G4DiscreteGammaTransition: nucleusZ = " <<nucleusZ
212  << " , iShell = " << iShell
213  << " , Shell binding energy = " << bondE/keV
214  << " keV " << G4endl;
215  }
216 
217  // last check on energy
218  if(gammaEnergy > bondE + tolerance) {
219  orbitE = iShell;
220  aGamma = false ; // emitted is not a gamma now
221  gammaEnergy -= bondE;
222  }
223  //G4cout << "gammaEnergy = " << gammaEnergy << G4endl;
224  }
225  }
226 
228 
229  //09.05.2010 VI rewrite samling of decay time
230  // assuming ordinary exponential low
231  gammaCreationTime = 0.;
232  if(tau > 0.0) { gammaCreationTime = -tau*G4Log(G4UniformRand()); }
233  }
234  //G4cout << "G4DiscreteGammaTransition end nGamma= " << nGammas
235  // << " Egamma= " << gammaEnergy << G4endl;
236 }
237 
239 {
240  return gammaEnergy;
241 }
242 
244 {
245  return gammaCreationTime;
246 }
247 
249 {
250  excitation = energy;
251 }
252 
253 
254 
255 
256 
257 
const std::vector< G4double > & L2ConvertionProbabilities() const
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
const std::vector< G4double > & M1ConvertionProbabilities() const
G4DiscreteGammaTransition(const G4NuclearLevel *level, G4int Z, G4int ver)
G4double HalfLife() const
const std::vector< G4double > & M4ConvertionProbabilities() const
G4int NumberOfGammas() const
G4double Energy() const
const std::vector< G4double > & M2ConvertionProbabilities() const
static const G4double tolerance
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:163
#define G4UniformRand()
Definition: Randomize.hh:95
G4GLOB_DLL std::ostream G4cout
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:230
G4double energy(const ThreeVector &p, const G4double m)
const std::vector< G4double > & GammaWeights() const
#define G4endl
Definition: G4ios.hh:61
const std::vector< G4double > & TotalConvertionProbabilities() const
static const double keV
Definition: G4SIunits.hh:195
double G4double
Definition: G4Types.hh:76
const std::vector< G4double > & GammaCumulativeProbabilities() const
void Update(const G4NuclearLevel *level, G4int Z)
virtual void SetEnergyFrom(G4double energy)