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

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

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.18 2010/06/25 09:46:13 gunter Exp $
27// GEANT4 tag $Name: geant4-09-03-ref-09 $
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
78G4VGammaDeexcitation::~G4VGammaDeexcitation()
79{ 
80  if (_transition != 0) { delete _transition; }
81}
82
83G4FragmentVector* G4VGammaDeexcitation::DoTransition()
84{
85  Initialize();
86  G4FragmentVector* products = new G4FragmentVector();
87 
88  if (CanDoTransition())
89    {
90      G4Fragment* gamma = GenerateGamma();
91      if (gamma != 0) { products->push_back(gamma); }
92    }
93 
94  if (_verbose > 1) {
95    G4cout << "G4VGammaDeexcitation::DoTransition - Transition deleted " << G4endl;
96  }
97 
98  return products;
99}
100
101G4FragmentVector* G4VGammaDeexcitation::DoChain()
102{
103  if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
104  const G4double tolerance = CLHEP::keV;
105
106  Initialize();
107  G4FragmentVector* products = new G4FragmentVector();
108 
109  while (CanDoTransition())
110    {     
111      _transition->SetEnergyFrom(_nucleus->GetExcitationEnergy());
112      G4Fragment* gamma = GenerateGamma();
113      if (gamma != 0) 
114        {
115          products->push_back(gamma);
116          //G4cout << "Eex(keV)= " << _nucleus->GetExcitationEnergy()/keV << G4endl;
117          if(_nucleus->GetExcitationEnergy() <= tolerance) { break; }
118          Update();
119        }
120    } 
121 
122  if (_verbose > 1) {
123    G4cout << "G4VGammaDeexcitation::DoChain - Transition deleted, end of chain " << G4endl;
124  }
125 
126  return products;
127}
128
129G4Fragment* G4VGammaDeexcitation::GenerateGamma()
130{
131  // 23/04/10 V.Ivanchenko rewrite complitely
132  G4double eGamma = 0.;
133 
134  if (_transition != 0) {
135    _transition->SelectGamma();  // it can be conversion electron too
136    eGamma = _transition->GetGammaEnergy(); 
137    if(eGamma <= 0.0) { return 0; }
138  }
139  G4double excitation = _nucleus->GetExcitationEnergy() - eGamma;
140  if(excitation < 0.0) { excitation = 0.0; } 
141  if (_verbose > 1 && _transition != 0 ) 
142    {
143      G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= " << eGamma
144             << " ** left Eexc(MeV)= " << excitation
145             << G4endl;
146    }
147 
148  // Do complete Lorentz computation
149
150  G4LorentzVector lv = _nucleus->GetMomentum();
151  G4double Mass = _nucleus->GetGroundStateMass() + excitation;
152
153  // select secondary
154  G4ParticleDefinition* gamma = G4Gamma::Gamma();
155
156  G4DiscreteGammaTransition* dtransition = 0; 
157  dtransition = dynamic_cast <G4DiscreteGammaTransition*> (_transition);
158  if ( dtransition && !( dtransition->IsAGamma()) ) { 
159    gamma = G4Electron::Electron(); 
160    _vSN = dtransition->GetOrbitNumber();   
161    _electronO.RemoveElectron(_vSN);
162    lv += G4LorentzVector(0.0,0.0,0.0,CLHEP::electron_mass_c2 - dtransition->GetBondEnergy());
163  }
164
165  // check consistency 
166  G4double eMass = gamma->GetPDGMass();
167
168  G4double Ecm       = lv.mag();
169  G4ThreeVector bst  = lv.boostVector();
170
171  G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
172  if(GammaEnergy <= eMass) { return 0; }
173
174  G4double cosTheta = 1. - 2. * G4UniformRand(); 
175  G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
176  G4double phi = twopi * G4UniformRand();
177  G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
178  G4LorentzVector Gamma4P(mom * sinTheta * std::cos(phi),
179                          mom * sinTheta * std::sin(phi),
180                          mom * cosTheta,
181                          GammaEnergy);
182  Gamma4P.boost(bst); 
183  G4Fragment * thePhoton = new G4Fragment(Gamma4P,gamma);
184
185  G4double gammaTime = _nucleus->GetCreationTime() + _transition->GetGammaCreationTime();
186  thePhoton->SetCreationTime(gammaTime);
187
188  lv -= Gamma4P;
189  _nucleus->SetMomentum(lv);
190  _nucleus->SetCreationTime(gammaTime);
191
192  //G4cout << "G4VGammaDeexcitation::GenerateGamma left nucleus: " << _nucleus << G4endl;
193  return thePhoton;
194}
195
196void G4VGammaDeexcitation::Update()
197{
198  if (_transition !=  0) 
199    { 
200      delete _transition;
201      _transition = 0;
202      if (_verbose > 1) {
203        G4cout << "G4VGammaDeexcitation::Update - Transition deleted " << G4endl;
204      }
205    }
206 
207  _transition = CreateTransition();
208  if (_transition != 0) 
209    {
210      _transition->SetEnergyFrom(_nucleus->GetExcitationEnergy());
211      // if ( _vSN != -1) (dynamic_cast <G4DiscreteGammaTransition*> (_transition))->SetICM(false);
212      // the above line is commented out for bug fix #952. It was intruduced for reason that
213      // the k-shell electron is most likely one to be kicked out and there is no time for
214      // the atom to deexcite before the next IC. But this limitation is causing other problems as
215      // reported in #952
216    }
217 
218  return;
219}
Note: See TracBrowser for help on using the repository browser.