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

Last change on this file since 1197 was 962, checked in by garnier, 15 years ago

update processes

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