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
RevLine 
[819]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//
[1337]26// $Id: G4VGammaDeexcitation.cc,v 1.18 2010/06/25 09:46:13 gunter Exp $
[1340]27// GEANT4 tag $Name: geant4-09-03-ref-09 $
[819]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//
[1315]49//        19 April 2010, J. M. Quesada calculations in CM system
50//              pending final boost to lab system  (not critical)
[819]51//
[1315]52//        23 April 2010, V.Ivanchenko rewite kinematic part using PDG formula
53//                                    for 2-body decay
54//
[819]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
[1315]73
[819]74G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
75                                              _electronO (0), _vSN(-1)
76{ }
77
78G4VGammaDeexcitation::~G4VGammaDeexcitation()
79{ 
[1315]80  if (_transition != 0) { delete _transition; }
[819]81}
82
83G4FragmentVector* G4VGammaDeexcitation::DoTransition()
84{
[1315]85  Initialize();
86  G4FragmentVector* products = new G4FragmentVector();
87 
[819]88  if (CanDoTransition())
89    {
[1315]90      G4Fragment* gamma = GenerateGamma();
91      if (gamma != 0) { products->push_back(gamma); }
[819]92    }
[1315]93 
94  if (_verbose > 1) {
[819]95    G4cout << "G4VGammaDeexcitation::DoTransition - Transition deleted " << G4endl;
[1315]96  }
97 
[819]98  return products;
99}
100
101G4FragmentVector* G4VGammaDeexcitation::DoChain()
102{
[1315]103  if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
104  const G4double tolerance = CLHEP::keV;
105
[819]106  Initialize();
[1315]107  G4FragmentVector* products = new G4FragmentVector();
108 
[819]109  while (CanDoTransition())
[1315]110    {     
111      _transition->SetEnergyFrom(_nucleus->GetExcitationEnergy());
[819]112      G4Fragment* gamma = GenerateGamma();
113      if (gamma != 0) 
114        {
115          products->push_back(gamma);
[1315]116          //G4cout << "Eex(keV)= " << _nucleus->GetExcitationEnergy()/keV << G4endl;
117          if(_nucleus->GetExcitationEnergy() <= tolerance) { break; }
118          Update();
[819]119        }
120    } 
121 
[1315]122  if (_verbose > 1) {
123    G4cout << "G4VGammaDeexcitation::DoChain - Transition deleted, end of chain " << G4endl;
124  }
125 
[819]126  return products;
127}
128
129G4Fragment* G4VGammaDeexcitation::GenerateGamma()
130{
[1315]131  // 23/04/10 V.Ivanchenko rewrite complitely
[819]132  G4double eGamma = 0.;
[1315]133 
[819]134  if (_transition != 0) {
135    _transition->SelectGamma();  // it can be conversion electron too
136    eGamma = _transition->GetGammaEnergy(); 
[1315]137    if(eGamma <= 0.0) { return 0; }
[819]138  }
[1315]139  G4double excitation = _nucleus->GetExcitationEnergy() - eGamma;
140  if(excitation < 0.0) { excitation = 0.0; } 
[819]141  if (_verbose > 1 && _transition != 0 ) 
142    {
[1315]143      G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= " << eGamma
144             << " ** left Eexc(MeV)= " << excitation
[819]145             << G4endl;
146    }
147 
[1315]148  // Do complete Lorentz computation
[819]149
[1315]150  G4LorentzVector lv = _nucleus->GetMomentum();
151  G4double Mass = _nucleus->GetGroundStateMass() + excitation;
152
153  // select secondary
154  G4ParticleDefinition* gamma = G4Gamma::Gamma();
155
[819]156  G4DiscreteGammaTransition* dtransition = 0; 
157  dtransition = dynamic_cast <G4DiscreteGammaTransition*> (_transition);
[1315]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  }
[819]164
[1315]165  // check consistency 
166  G4double eMass = gamma->GetPDGMass();
[819]167
[1315]168  G4double Ecm       = lv.mag();
169  G4ThreeVector bst  = lv.boostVector();
[819]170
[1315]171  G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
172  if(GammaEnergy <= eMass) { return 0; }
[819]173
[1315]174  G4double cosTheta = 1. - 2. * G4UniformRand(); 
175  G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
176  G4double phi = twopi * G4UniformRand();
[1337]177  G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
[1315]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);
[819]184
[1315]185  G4double gammaTime = _nucleus->GetCreationTime() + _transition->GetGammaCreationTime();
186  thePhoton->SetCreationTime(gammaTime);
[819]187
[1315]188  lv -= Gamma4P;
189  _nucleus->SetMomentum(lv);
190  _nucleus->SetCreationTime(gammaTime);
[819]191
[1315]192  //G4cout << "G4VGammaDeexcitation::GenerateGamma left nucleus: " << _nucleus << G4endl;
193  return thePhoton;
[819]194}
195
196void G4VGammaDeexcitation::Update()
197{
198  if (_transition !=  0) 
199    { 
200      delete _transition;
201      _transition = 0;
[1315]202      if (_verbose > 1) {
[819]203        G4cout << "G4VGammaDeexcitation::Update - Transition deleted " << G4endl;
[1315]204      }
[819]205    }
[1315]206 
[819]207  _transition = CreateTransition();
208  if (_transition != 0) 
209    {
[1315]210      _transition->SetEnergyFrom(_nucleus->GetExcitationEnergy());
211      // if ( _vSN != -1) (dynamic_cast <G4DiscreteGammaTransition*> (_transition))->SetICM(false);
[819]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    }
[1315]217 
[819]218  return;
219}
Note: See TracBrowser for help on using the repository browser.