source: trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4PhotonEvaporation.cc @ 1315

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

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 13.1 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: G4PhotonEvaporation.cc,v 1.13 2010/05/17 11:47:43 flei Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
28//
29// -------------------------------------------------------------------
30//      GEANT 4 class file
31//
32//      CERN, Geneva, Switzerland
33//
34//      File name:     G4PhotonEvaporation
35//
36//      Author:        Maria Grazia Pia (pia@genova.infn.it)
37//
38//      Creation date: 23 October 1998
39//
40// Modifications:
41//     
42// 8 March 2002, Fan Lei (flei@space.qinetiq.com)
43//   
44//        Implementation of Internal Convertion process in discrete deexcitation
45//        The following public methods have been added.
46//
47//       void SetICM (G4bool);
48//       void CallFromRDM(G4bool);
49//       void SetMaxHalfLife(G4double) ;
50//       void SetEOccupancy( G4ElectronOccupancy  eOccupancy) ;
51//       G4ElectronOccupancy GetEOccupancy () ;
52//
53// 11 May 2010, V.Ivanchenko add implementation of EmittedFragment and
54//                           BreakUpFragment methods; cleanup logic
55//
56// -------------------------------------------------------------------
57//
58
59#include "G4PhotonEvaporation.hh"
60
61#include "globals.hh"
62#include "Randomize.hh"
63#include "G4Gamma.hh"
64#include "G4LorentzVector.hh"
65#include "G4VGammaTransition.hh"
66#include "G4Fragment.hh"
67#include "G4FragmentVector.hh"
68#include "G4ContinuumGammaDeexcitation.hh"
69#include "G4DiscreteGammaDeexcitation.hh"
70#include "G4E1Probability.hh"
71
72G4PhotonEvaporation::G4PhotonEvaporation()
73  :_verbose(0),_myOwnProbAlgorithm (true),
74   _eOccupancy(0), _vShellNumber(-1),_gammaE(0.)
75{ 
76  _probAlgorithm = new G4E1Probability;
77  _discrDeexcitation = new G4DiscreteGammaDeexcitation;
78  _contDeexcitation = new G4ContinuumGammaDeexcitation;
79  (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetICM(false);
80}
81
82
83G4PhotonEvaporation::~G4PhotonEvaporation()
84{ 
85  if(_myOwnProbAlgorithm) delete _probAlgorithm;
86  delete _discrDeexcitation;
87  delete _contDeexcitation;
88}
89
90
91void G4PhotonEvaporation::Initialize(const G4Fragment& fragment)
92{
93  _nucleus = const_cast<G4Fragment*>(&fragment);
94}
95
96G4Fragment* G4PhotonEvaporation::EmittedFragment(G4Fragment* nucleus)
97{
98  //G4cout << "G4PhotonEvaporation::EmittedFragment" << G4endl;
99  _nucleus = nucleus;
100 
101  // Do one photon emission by the continues deexcitation 
102  _contDeexcitation->SetNucleus(_nucleus);
103  _contDeexcitation->Initialize();
104
105  if(_contDeexcitation->CanDoTransition()) { 
106    G4Fragment* gamma = _contDeexcitation->GenerateGamma();
107    if(gamma) { 
108      if (_verbose > 0) {
109        G4cout << "G4PhotonEvaporation::EmittedFragment continium deex: "   
110               << gamma << G4endl;
111        G4cout << "   Residual: " << nucleus << G4endl;
112      }
113      return gamma; 
114    }
115  }
116
117  // Do one photon emission by the discrete deexcitation
118  _discrDeexcitation->SetNucleus(_nucleus);
119  _discrDeexcitation->Initialize();
120
121  if(_discrDeexcitation->CanDoTransition()) { 
122    G4Fragment* gamma = _discrDeexcitation->GenerateGamma();
123    if(gamma) { 
124      if (_verbose > 0) {
125        G4cout << "G4PhotonEvaporation::EmittedFragment discrete deex: "   
126               << gamma << G4endl;
127        G4cout << "   Residual: " << nucleus << G4endl;
128      }
129      return gamma; 
130    }
131  }
132
133  if (_verbose > 0) {
134    G4cout << "G4PhotonEvaporation unable emit gamma: " 
135           << nucleus << G4endl;
136  }
137  return 0;
138}
139
140G4FragmentVector* G4PhotonEvaporation::BreakUpFragment(G4Fragment* nucleus)
141{
142  //G4cout << "G4PhotonEvaporation::BreakUpFragment" << G4endl;
143  // The same pointer of primary nucleus
144  _nucleus = nucleus;
145  _contDeexcitation->SetNucleus(_nucleus);
146  _discrDeexcitation->SetNucleus(_nucleus);
147
148  // Do the whole gamma chain
149  G4FragmentVector* products = _contDeexcitation->DoChain(); 
150  if( !products ) { products = new G4FragmentVector(); }
151
152  if (_verbose > 0) {
153    G4cout << "G4PhotonEvaporation::BreakUpFragment " << products->size() 
154           << " gammas from ContinuumDeexcitation " << G4endl;
155    G4cout << "   Residual: " << nucleus << G4endl;
156  }
157  // Products from discrete gamma transitions
158  G4FragmentVector* discrProducts = _discrDeexcitation->DoChain();
159  if(discrProducts) {
160    _eOccupancy = _discrDeexcitation->GetEO();
161    _vShellNumber = _discrDeexcitation->GetVacantSN();
162
163    // not sure if the following line is needed!
164    _discrDeexcitation->SetVaccantSN(-1);
165
166    if (_verbose > 0) {
167      G4cout << "G4PhotonEvaporation::BreakUpFragment " << discrProducts->size() 
168             << " gammas from DiscreteDeexcitation " << G4endl;
169      G4cout << "   Residual: " << nucleus << G4endl;
170    }
171    G4FragmentVector::iterator i;
172    for (i = discrProducts->begin(); i != discrProducts->end(); ++i)
173      {
174        products->push_back(*i);
175      }
176    delete discrProducts;
177  }
178
179  if (_verbose > 0) {
180    G4cout << "*-*-* Photon evaporation: " << products->size() << G4endl;
181  }
182  return products;
183}
184
185G4FragmentVector* G4PhotonEvaporation::BreakUp(const G4Fragment& nucleus)
186{
187  //G4cout << "G4PhotonEvaporation::BreakUp" << G4endl;
188  _nucleus = new G4Fragment(nucleus);
189
190  _contDeexcitation->SetNucleus(_nucleus);
191  _discrDeexcitation->SetNucleus(_nucleus);
192 
193  // Do one photon emission
194
195  // Products from continuum gamma transitions
196
197  G4FragmentVector* products = _contDeexcitation->DoTransition(); 
198  if( !products ) { products = new G4FragmentVector(); }
199  else if(_verbose > 0) {
200    G4cout << "G4PhotonEvaporation::BreakUp " << products->size() 
201           << " gammas from ContinuesDeexcitation " << G4endl;
202    G4cout << "   Residual: " << nucleus << G4endl;
203  }
204
205  if (0 == products->size())
206    {
207      // Products from discrete gamma transitions
208      G4FragmentVector* discrProducts = _discrDeexcitation->DoTransition();
209
210      if (discrProducts) {
211        _eOccupancy = _discrDeexcitation->GetEO();
212        _vShellNumber = _discrDeexcitation->GetVacantSN();
213
214        // not sure if the following line is needed!
215        _discrDeexcitation->SetVaccantSN(-1);
216        //
217        if (_verbose > 0) {
218          G4cout << " = BreakUp = " << discrProducts->size() 
219                 << " gammas from DiscreteDeexcitation " 
220                 << G4endl;
221          G4cout << "   Residual: " << nucleus << G4endl;
222        }
223        G4FragmentVector::iterator i;
224        for (i = discrProducts->begin(); i != discrProducts->end(); ++i)
225          {
226            products->push_back(*i);
227          }
228        delete discrProducts;
229      }
230    }
231 
232  // Add deexcited nucleus to products
233  products->push_back(_nucleus);
234
235  if (_verbose > 0) {
236    G4cout << "*-*-*-* Photon evaporation: " << products->size() << G4endl;
237  }
238
239  return products;
240}
241
242G4FragmentVector* G4PhotonEvaporation::BreakItUp(const G4Fragment& nucleus)
243{
244  // The same pointer of primary nucleus
245  _nucleus = new G4Fragment(nucleus);
246  _contDeexcitation->SetNucleus(_nucleus);
247  _discrDeexcitation->SetNucleus(_nucleus);
248
249  //G4cout << "G4PhotonEvaporation::BreakItUp:  " << nucleus << G4endl;
250
251  // Do the whole gamma chain
252  G4FragmentVector* products = _contDeexcitation->DoChain(); 
253  if( !products ) { products = new G4FragmentVector; }
254
255  // Products from continuum gamma transitions
256  if (_verbose > 0) {
257    G4cout << " = BreakItUp = " << products->size()
258           << " gammas from ContinuumDeexcitation " << G4endl;
259  }
260
261  // Products from discrete gamma transitions
262  G4FragmentVector* discrProducts = _discrDeexcitation->DoChain();
263  if(discrProducts) {
264    _eOccupancy = _discrDeexcitation->GetEO();
265    _vShellNumber = _discrDeexcitation->GetVacantSN();
266
267    // not sure if the following line is needed!
268    _discrDeexcitation->SetVaccantSN(-1);
269
270    if (_verbose > 0) {
271      G4cout << " = BreakItUp = " << discrProducts->size() 
272             << " gammas from DiscreteDeexcitation " << G4endl;
273    }
274    G4FragmentVector::iterator i;
275    for (i = discrProducts->begin(); i != discrProducts->end(); ++i)
276      {
277        products->push_back(*i);
278      }
279    delete discrProducts;
280  }
281  // Add deexcited nucleus to products
282  products->push_back(_nucleus);
283
284  if (_verbose > 0) {
285    G4cout << "*-*-* Photon evaporation: " << products->size() << G4endl;
286  }
287  return products;
288}
289
290G4double G4PhotonEvaporation::GetEmissionProbability() const
291{
292  G4double prob = 0.;
293  if (_probAlgorithm != 0) {
294    prob = _probAlgorithm->EmissionProbability(*_nucleus,_gammaE);
295  }
296  return prob;
297}
298
299
300void G4PhotonEvaporation::SetEmissionStrategy(G4VEmissionProbability * probAlgorithm)
301{
302
303  // CD - not sure about always wanting to delete this pointer....
304
305  if(_myOwnProbAlgorithm) delete _probAlgorithm;
306
307  _probAlgorithm = probAlgorithm;
308
309  _myOwnProbAlgorithm = false;
310
311  return;
312}
313
314
315void G4PhotonEvaporation::SetVerboseLevel(G4int verbose)
316{
317  _verbose = verbose;
318  _contDeexcitation->SetVerboseLevel(verbose);
319  _discrDeexcitation->SetVerboseLevel(verbose);
320
321  return;
322}
323
324void G4PhotonEvaporation::SetICM(G4bool ic)
325{
326 (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetICM(ic);
327 return;
328}
329
330void G4PhotonEvaporation::SetMaxHalfLife(G4double hl)
331{
332 (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetHL(hl);
333 return;
334}
335
336void G4PhotonEvaporation::RDMForced(G4bool fromRDM)
337{
338 (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetRDM(fromRDM);
339 return;
340}
341
342void G4PhotonEvaporation::SetEOccupancy(G4ElectronOccupancy eo)
343{
344  _discrDeexcitation->SetEO(eo);
345  return;
346}
347
348#ifdef debug
349void G4PhotonEvaporation::CheckConservation(const G4Fragment & theInitialState,
350                                            G4FragmentVector * Result) const
351{
352  G4double ProductsEnergy =0;
353  G4ThreeVector ProductsMomentum;
354  G4int ProductsA = 0;
355  G4int ProductsZ = 0;
356  G4FragmentVector::iterator h;
357  for (h = Result->begin(); h != Result->end(); h++) {
358    G4LorentzVector tmp = (*h)->GetMomentum();
359    ProductsEnergy += tmp.e();
360    ProductsMomentum += tmp.vect();
361    ProductsA += static_cast<G4int>((*h)->GetA());
362    ProductsZ += static_cast<G4int>((*h)->GetZ());
363  }
364
365  if (ProductsA != theInitialState.GetA()) {
366    G4cout << "!!!!!!!!!! Baryonic Number Conservation Violation !!!!!!!!!!" << G4endl;
367    G4cout << "G4PhotonEvaporation.cc: Barionic Number Conservation test for evaporation fragments" 
368           << G4endl; 
369    G4cout << "Initial A = " << theInitialState.GetA() 
370           << "   Fragments A = " << ProductsA << "   Diference --> " 
371           << theInitialState.GetA() - ProductsA << G4endl;
372  }
373  if (ProductsZ != theInitialState.GetZ()) {
374    G4cout << "!!!!!!!!!! Charge Conservation Violation !!!!!!!!!!" << G4endl;
375    G4cout << "G4PhotonEvaporation.cc: Charge Conservation test for evaporation fragments" 
376           << G4endl; 
377    G4cout << "Initial Z = " << theInitialState.GetZ() 
378           << "   Fragments Z = " << ProductsZ << "   Diference --> " 
379           << theInitialState.GetZ() - ProductsZ << G4endl;
380  }
381  if (std::abs(ProductsEnergy-theInitialState.GetMomentum().e()) > 1.0*keV) {
382    G4cout << "!!!!!!!!!! Energy Conservation Violation !!!!!!!!!!" << G4endl;
383    G4cout << "G4PhotonEvaporation.cc: Energy Conservation test for evaporation fragments" 
384           << G4endl; 
385    G4cout << "Initial E = " << theInitialState.GetMomentum().e()/MeV << " MeV"
386           << "   Fragments E = " << ProductsEnergy/MeV  << " MeV   Diference --> " 
387           << (theInitialState.GetMomentum().e() - ProductsEnergy)/MeV << " MeV" << G4endl;
388  } 
389  if (std::abs(ProductsMomentum.x()-theInitialState.GetMomentum().x()) > 1.0*keV || 
390      std::abs(ProductsMomentum.y()-theInitialState.GetMomentum().y()) > 1.0*keV ||
391      std::abs(ProductsMomentum.z()-theInitialState.GetMomentum().z()) > 1.0*keV) {
392    G4cout << "!!!!!!!!!! Momentum Conservation Violation !!!!!!!!!!" << G4endl;
393    G4cout << "G4PhotonEvaporation.cc: Momentum Conservation test for evaporation fragments" 
394           << G4endl; 
395    G4cout << "Initial P = " << theInitialState.GetMomentum().vect() << " MeV"
396           << "   Fragments P = " << ProductsMomentum  << " MeV   Diference --> " 
397           << theInitialState.GetMomentum().vect() - ProductsMomentum << " MeV" << G4endl;
398  }
399  return;
400}
401#endif
402
403
404
Note: See TracBrowser for help on using the repository browser.