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

Last change on this file since 1201 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 9.3 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//
27// -------------------------------------------------------------------
28//      GEANT 4 class file
29//
30//      CERN, Geneva, Switzerland
31//
32//      File name:     G4VGammaDeexcitation
33//
34//      Author:        Maria Grazia Pia (pia@genova.infn.it)
35//
36//      Creation date: 23 October 1998
37//
38//      Modifications:
39//
40//        21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
41//           Modified GenerateGamma() and UpdateUncleus() for implementation
42//           of Internal Conversion processs
43//     
44//        15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
45//              Added creation time evaluation for products of evaporation
46//
47//
48// -------------------------------------------------------------------
49
50#include "G4VGammaDeexcitation.hh"
51
52#include "globals.hh"
53#include "Randomize.hh"
54#include "G4Gamma.hh"
55#include "G4Electron.hh"
56#include "G4LorentzVector.hh"
57#include "G4VGammaTransition.hh"
58#include "G4Fragment.hh"
59#include "G4FragmentVector.hh"
60
61#include "G4ParticleTable.hh"
62#include "G4IonTable.hh"
63
64#include "G4DiscreteGammaTransition.hh"
65
66G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
67                                              _electronO (0), _vSN(-1)
68{ }
69
70
71G4VGammaDeexcitation::~G4VGammaDeexcitation()
72{ 
73  //  if (_transition != 0) delete _transition;
74}
75
76
77G4FragmentVector* G4VGammaDeexcitation::DoTransition()
78{
79  // Template method
80
81 Initialize();
82 G4FragmentVector* products = new G4FragmentVector;
83 
84  if (CanDoTransition())
85    {
86     G4Fragment* gamma = GenerateGamma();
87     if (gamma != 0)
88       {
89         products->push_back(gamma);
90         UpdateNucleus(gamma);
91         Update();
92       }
93    }
94
95  if (_verbose > 1)
96    G4cout << "G4VGammaDeexcitation::DoTransition - Transition deleted " << G4endl;
97
98  if (_transition != 0) delete _transition;
99
100  return products;
101}
102
103G4FragmentVector* G4VGammaDeexcitation::DoChain()
104{
105  Initialize();
106  G4FragmentVector* products = new G4FragmentVector;
107
108  while (CanDoTransition())
109    {
110      if (_verbose > 5) G4cout << "G4VGammaDeexcitation::DoChain -  Looping" << G4endl;
111
112      G4Fragment* gamma = GenerateGamma();
113      if (gamma != 0) 
114        {
115          products->push_back(gamma);
116          UpdateNucleus(gamma);
117          UpdateElectrons ();
118        }
119     Update();
120    } 
121
122  if (_verbose > 1)
123      G4cout << "G4VGammaDeexcitation::DoChain - Transition deleted, end of chain " << G4endl;
124
125  if (_transition != 0) delete _transition;
126 
127  return products;
128}
129
130
131const G4Fragment& G4VGammaDeexcitation::GetNucleus() const
132{
133  return _nucleus; 
134}
135
136
137void G4VGammaDeexcitation::SetNucleus(const G4Fragment& nucleus)
138{
139  _nucleus = G4Fragment(nucleus);
140}
141
142
143G4Fragment* G4VGammaDeexcitation::GenerateGamma()
144{
145  G4double eGamma = 0.;
146
147  if (_transition != 0) {
148    _transition->SelectGamma();  // it can be conversion electron too
149    eGamma = _transition->GetGammaEnergy(); 
150  }
151  if (_verbose > 1 && _transition != 0 ) 
152    {
153      G4cout << "G4VGammaDeexcitation::GenerateGamma - Gamma energy " << eGamma
154             << " ** New excitation " << _nucleus.GetExcitationEnergy() - eGamma
155             << G4endl;
156    }
157 
158  // Photon momentum isotropically generated
159  // the same for electron
160 
161  if (eGamma > 0.) 
162    {
163      G4double cosTheta = 1. - 2. * G4UniformRand();
164      G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
165      G4double phi = twopi * G4UniformRand();
166      G4double pM = eGamma;
167      G4DiscreteGammaTransition* dtransition = 0; 
168      dtransition = dynamic_cast <G4DiscreteGammaTransition*> (_transition);
169      if ( dtransition && !( dtransition->IsAGamma()) ) {
170        G4double eMass = G4Electron::ElectronDefinition()->GetPDGMass();
171        pM =std::sqrt(eGamma*(eGamma + 2.0*eMass));
172        eGamma = eGamma + eMass;
173      }
174      G4ThreeVector pGamma( pM * sinTheta * std::cos(phi),
175                            pM * sinTheta * std::sin(phi),
176                            pM * cosTheta );
177      G4LorentzVector gamma(pGamma, eGamma);
178      //        gamma.boost(_nucleus.GetMomentum().boostVector() );
179      G4Fragment* gammaFragment ;
180      if ( dtransition && !(dtransition->IsAGamma()) ){
181        gammaFragment = new G4Fragment(gamma,G4Electron::ElectronDefinition());
182      } else {
183        gammaFragment = new G4Fragment(gamma,G4Gamma::GammaDefinition()); 
184      }
185      G4double gammaTime = _transition->GetGammaCreationTime();
186      gammaTime += _nucleus.GetCreationTime();
187      gammaFragment->SetCreationTime(gammaTime);
188     
189      if (_verbose > 1 && dtransition )
190        G4cout << "G4VGammaDeexcitation::GenerateGamma -  Gamma fragment generated:  " 
191               << (dtransition->IsAGamma() ? " Gamma" : " Electron" ) << G4endl;
192      return gammaFragment;
193    }
194  else
195    {
196      return 0;
197    }
198}
199
200void G4VGammaDeexcitation::UpdateNucleus(const G4Fragment*  gamma)
201{
202  G4LorentzVector p4Gamma = gamma->GetMomentum();
203  G4ThreeVector pGamma(p4Gamma.vect());
204 
205  G4double eGamma = 0.;
206  if (_transition != 0)
207    eGamma = _transition->GetGammaEnergy();
208  G4DiscreteGammaTransition* dtransition = 0; 
209  dtransition = dynamic_cast <G4DiscreteGammaTransition*> (_transition);
210  if (dtransition && !(dtransition->IsAGamma()) )     
211    eGamma += dtransition->GetBondEnergy(); 
212
213  G4LorentzVector p4Nucleus(_nucleus.GetMomentum() );
214
215// New tetravector calculation:
216
217//  G4double Mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(_nucleus.GetZ(),_nucleus.GetA());
218  G4double m1 = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(static_cast<G4int>(_nucleus.GetZ()),
219                                                                               static_cast<G4int>(_nucleus.GetA()));
220  G4double m2 = _nucleus.GetZ() *  G4Proton::Proton()->GetPDGMass() + 
221    (_nucleus.GetA()- _nucleus.GetZ())*G4Neutron::Neutron()->GetPDGMass();
222
223  G4double Mass = std::min(m1,m2);
224
225
226  G4double newExcitation = p4Nucleus.mag() - Mass - eGamma;
227  if(newExcitation < 0)
228    newExcitation = 0;
229 
230  G4ThreeVector p3Residual(p4Nucleus.vect() - pGamma);
231  G4double newEnergy = std::sqrt(p3Residual * p3Residual +
232                            (Mass + newExcitation) * (Mass + newExcitation));
233  G4LorentzVector p4Residual(p3Residual, newEnergy);
234 
235  //  G4LorentzVector p4Residual(-pGamma, p4Nucleus.e() - eGamma);
236  //  p4Residual.boost( _nucleus.GetMomentum().boostVector() );
237 
238  // Update excited nucleus parameters
239
240  _nucleus.SetMomentum(p4Residual);
241  _nucleus.SetCreationTime(gamma->GetCreationTime());
242
243//  if (_transition != 0)
244//  {
245//    G4double excitation =_transition->GetEnergyTo();
246//    if (excitation < 0.) excitation = 0.0;
247//    _nucleus.SetExcitationEnergy(excitation);
248//  }
249
250  return;
251}
252
253void G4VGammaDeexcitation::UpdateElectrons( )
254{
255  G4DiscreteGammaTransition* dtransition = 0; 
256  dtransition = dynamic_cast <G4DiscreteGammaTransition*> (_transition);
257  if (dtransition && !(dtransition->IsAGamma()) ) {   
258   
259    _vSN = dtransition->GetOrbitNumber();   
260    _electronO.RemoveElectron(_vSN);
261  }
262  return;
263}
264
265void G4VGammaDeexcitation::Update()
266{
267  if (_transition !=  0) 
268    { 
269      delete _transition;
270      _transition = 0;
271      if (_verbose > 1)
272        G4cout << "G4VGammaDeexcitation::Update - Transition deleted " << G4endl;
273    }
274
275  _transition = CreateTransition();
276  if (_transition != 0) 
277    {
278      _transition->SetEnergyFrom(_nucleus.GetExcitationEnergy());
279      //      if ( _vSN != -1) (dynamic_cast <G4DiscreteGammaTransition*> (_transition))->SetICM(false);
280      // the above line is commented out for bug fix #952. It was intruduced for reason that
281      // the k-shell electron is most likely one to be kicked out and there is no time for
282      // the atom to deexcite before the next IC. But this limitation is causing other problems as
283      // reported in #952
284    }
285
286  return;
287}
288
289
290void G4VGammaDeexcitation::Initialize()
291{
292  _transition = CreateTransition();
293  if (_transition != 0) {
294    _transition->SetEnergyFrom(_nucleus.GetExcitationEnergy());
295  }
296  return;
297}
298
299
300void G4VGammaDeexcitation::SetVerboseLevel(G4int verbose)
301{
302  _verbose = verbose;
303  return;
304}
305
306
307
308
309
310
Note: See TracBrowser for help on using the repository browser.