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