source: trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4VGammaDeexcitation.cc @ 1347

Last change on this file since 1347 was 1347, checked in by garnier, 13 years ago

geant4 tag 9.4

File size: 7.4 KB
Line 
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: G4VGammaDeexcitation.cc,v 1.20 2010/11/17 19:17:17 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-04-ref-00 $
28//
29// -------------------------------------------------------------------
30//      GEANT 4 class file
31//
32//      CERN, Geneva, Switzerland
33//
34//      File name:     G4VGammaDeexcitation
35//
36//      Author:        Maria Grazia Pia (pia@genova.infn.it)
37//
38//      Creation date: 23 October 1998
39//
40//      Modifications:
41//
42//        21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
43//           Modified GenerateGamma() and UpdateUncleus() for implementation
44//           of Internal Conversion processs
45//     
46//        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
47//              Added creation time evaluation for products of evaporation
48//
49//        19 April 2010, J. M. Quesada calculations in CM system
50//              pending final boost to lab system  (not critical)
51//
52//        23 April 2010, V.Ivanchenko rewite kinematic part using PDG formula
53//                                    for 2-body decay
54//
55// -------------------------------------------------------------------
56
57#include "G4VGammaDeexcitation.hh"
58
59#include "globals.hh"
60#include "Randomize.hh"
61#include "G4Gamma.hh"
62#include "G4Electron.hh"
63#include "G4LorentzVector.hh"
64#include "G4VGammaTransition.hh"
65#include "G4Fragment.hh"
66#include "G4FragmentVector.hh"
67
68#include "G4ParticleTable.hh"
69#include "G4IonTable.hh"
70
71#include "G4DiscreteGammaTransition.hh"
72
73
74G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
75                                              _electronO (0), _vSN(-1)
76{ 
77  _nucleus = 0;
78}
79
80G4VGammaDeexcitation::~G4VGammaDeexcitation()
81{ 
82  if (_transition != 0) { delete _transition; }
83}
84
85G4FragmentVector* G4VGammaDeexcitation::DoTransition()
86{
87  Initialize();
88  G4FragmentVector* products = new G4FragmentVector();
89 
90  if (CanDoTransition())
91    {
92      G4Fragment* gamma = GenerateGamma();
93      if (gamma != 0) { products->push_back(gamma); }
94    }
95 
96  if (_verbose > 1) {
97    G4cout << "G4VGammaDeexcitation::DoTransition - Transition deleted " << G4endl;
98  }
99 
100  return products;
101}
102
103G4FragmentVector* G4VGammaDeexcitation::DoChain()
104{
105  if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
106  const G4double tolerance = CLHEP::keV;
107
108  Initialize();
109  G4FragmentVector* products = new G4FragmentVector();
110 
111  while (CanDoTransition())
112    {     
113      _transition->SetEnergyFrom(_nucleus->GetExcitationEnergy());
114      G4Fragment* gamma = GenerateGamma();
115      if (gamma != 0) 
116        {
117          products->push_back(gamma);
118          //G4cout << "Eex(keV)= " << _nucleus->GetExcitationEnergy()/keV << G4endl;
119          if(_nucleus->GetExcitationEnergy() <= tolerance) { break; }
120          Update();
121        }
122    } 
123 
124  if (_verbose > 1) {
125    G4cout << "G4VGammaDeexcitation::DoChain - Transition deleted, end of chain " << G4endl;
126  }
127 
128  return products;
129}
130
131G4Fragment* G4VGammaDeexcitation::GenerateGamma()
132{
133  // 23/04/10 V.Ivanchenko rewrite complitely
134  G4double eGamma = 0.;
135 
136  if (_transition != 0) {
137    _transition->SelectGamma();  // it can be conversion electron too
138    eGamma = _transition->GetGammaEnergy(); 
139    if(eGamma <= 0.0) { return 0; }
140  }
141  G4double excitation = _nucleus->GetExcitationEnergy() - eGamma;
142  if(excitation < 0.0) { excitation = 0.0; } 
143  if (_verbose > 1 && _transition != 0 ) 
144    {
145      G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= " << eGamma
146             << " ** left Eexc(MeV)= " << excitation
147             << G4endl;
148    }
149 
150  // Do complete Lorentz computation
151
152  G4LorentzVector lv = _nucleus->GetMomentum();
153  G4double Mass = _nucleus->GetGroundStateMass() + excitation;
154
155  // select secondary
156  G4ParticleDefinition* gamma = G4Gamma::Gamma();
157
158  G4DiscreteGammaTransition* dtransition = 
159    dynamic_cast <G4DiscreteGammaTransition*> (_transition);
160  if ( dtransition && !( dtransition->IsAGamma()) ) { 
161    gamma = G4Electron::Electron(); 
162    _vSN = dtransition->GetOrbitNumber();   
163    _electronO.RemoveElectron(_vSN);
164    lv += G4LorentzVector(0.0,0.0,0.0,CLHEP::electron_mass_c2 - dtransition->GetBondEnergy());
165  }
166
167  // check consistency 
168  G4double eMass = gamma->GetPDGMass();
169
170  G4double Ecm       = lv.mag();
171  G4ThreeVector bst  = lv.boostVector();
172
173  G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
174  if(GammaEnergy <= eMass) { return 0; }
175
176  G4double cosTheta = 1. - 2. * G4UniformRand(); 
177  G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
178  G4double phi = twopi * G4UniformRand();
179  G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
180  G4LorentzVector Gamma4P(mom * sinTheta * std::cos(phi),
181                          mom * sinTheta * std::sin(phi),
182                          mom * cosTheta,
183                          GammaEnergy);
184  Gamma4P.boost(bst); 
185  G4Fragment * thePhoton = new G4Fragment(Gamma4P,gamma);
186
187  G4double gammaTime = _nucleus->GetCreationTime() + _transition->GetGammaCreationTime();
188  thePhoton->SetCreationTime(gammaTime);
189
190  lv -= Gamma4P;
191  _nucleus->SetMomentum(lv);
192  _nucleus->SetCreationTime(gammaTime);
193
194  //G4cout << "G4VGammaDeexcitation::GenerateGamma left nucleus: " << _nucleus << G4endl;
195  return thePhoton;
196}
197
198void G4VGammaDeexcitation::Update()
199{
200  if (_transition !=  0) 
201    { 
202      delete _transition;
203      _transition = 0;
204      if (_verbose > 1) {
205        G4cout << "G4VGammaDeexcitation::Update - Transition deleted " << G4endl;
206      }
207    }
208 
209  _transition = CreateTransition();
210  if (_transition != 0) 
211    {
212      _transition->SetEnergyFrom(_nucleus->GetExcitationEnergy());
213      // if ( _vSN != -1) (dynamic_cast <G4DiscreteGammaTransition*> (_transition))->SetICM(false);
214      // the above line is commented out for bug fix #952. It was intruduced for reason that
215      // the k-shell electron is most likely one to be kicked out and there is no time for
216      // the atom to deexcite before the next IC. But this limitation is causing other problems as
217      // reported in #952
218    }
219 
220  return;
221}
Note: See TracBrowser for help on using the repository browser.