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.16 2010/11/23 18:03:21 vnivanch Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-04-ref-00 $ |
---|
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 | |
---|
72 | G4PhotonEvaporation::G4PhotonEvaporation() |
---|
73 | :_verbose(0),_myOwnProbAlgorithm (true), |
---|
74 | _eOccupancy(0), _vShellNumber(-1),_gammaE(0.) |
---|
75 | { |
---|
76 | _probAlgorithm = new G4E1Probability; |
---|
77 | G4DiscreteGammaDeexcitation* p = new G4DiscreteGammaDeexcitation(); |
---|
78 | p->SetICM(false); |
---|
79 | _discrDeexcitation = p; |
---|
80 | _contDeexcitation = new G4ContinuumGammaDeexcitation; |
---|
81 | _nucleus = 0; |
---|
82 | } |
---|
83 | |
---|
84 | G4PhotonEvaporation::~G4PhotonEvaporation() |
---|
85 | { |
---|
86 | if(_myOwnProbAlgorithm) delete _probAlgorithm; |
---|
87 | delete _discrDeexcitation; |
---|
88 | delete _contDeexcitation; |
---|
89 | } |
---|
90 | |
---|
91 | void G4PhotonEvaporation::Initialize(const G4Fragment& fragment) |
---|
92 | { |
---|
93 | _nucleus = const_cast<G4Fragment*>(&fragment); |
---|
94 | } |
---|
95 | |
---|
96 | G4Fragment* 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 | |
---|
140 | G4FragmentVector* 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 | |
---|
185 | G4FragmentVector* 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 | |
---|
242 | G4FragmentVector* 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 | |
---|
290 | G4double G4PhotonEvaporation::GetEmissionProbability() const |
---|
291 | { |
---|
292 | G4double prob = |
---|
293 | _probAlgorithm->EmissionProbability(*_nucleus,_nucleus->GetExcitationEnergy()); |
---|
294 | return prob; |
---|
295 | } |
---|
296 | |
---|
297 | |
---|
298 | void G4PhotonEvaporation::SetEmissionStrategy(G4VEmissionProbability * probAlgorithm) |
---|
299 | { |
---|
300 | |
---|
301 | // CD - not sure about always wanting to delete this pointer.... |
---|
302 | |
---|
303 | if(_myOwnProbAlgorithm) delete _probAlgorithm; |
---|
304 | |
---|
305 | _probAlgorithm = probAlgorithm; |
---|
306 | |
---|
307 | _myOwnProbAlgorithm = false; |
---|
308 | } |
---|
309 | |
---|
310 | |
---|
311 | void G4PhotonEvaporation::SetVerboseLevel(G4int verbose) |
---|
312 | { |
---|
313 | _verbose = verbose; |
---|
314 | _contDeexcitation->SetVerboseLevel(verbose); |
---|
315 | _discrDeexcitation->SetVerboseLevel(verbose); |
---|
316 | } |
---|
317 | |
---|
318 | void G4PhotonEvaporation::SetICM(G4bool ic) |
---|
319 | { |
---|
320 | (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetICM(ic); |
---|
321 | } |
---|
322 | |
---|
323 | void G4PhotonEvaporation::SetMaxHalfLife(G4double hl) |
---|
324 | { |
---|
325 | (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetHL(hl); |
---|
326 | } |
---|
327 | |
---|
328 | void G4PhotonEvaporation::RDMForced(G4bool fromRDM) |
---|
329 | { |
---|
330 | (dynamic_cast <G4DiscreteGammaDeexcitation*> (_discrDeexcitation))->SetRDM(fromRDM); |
---|
331 | } |
---|
332 | |
---|
333 | void G4PhotonEvaporation::SetEOccupancy(G4ElectronOccupancy eo) |
---|
334 | { |
---|
335 | _discrDeexcitation->SetEO(eo); |
---|
336 | } |
---|
337 | |
---|
338 | #ifdef debug |
---|
339 | void G4PhotonEvaporation::CheckConservation(const G4Fragment & theInitialState, |
---|
340 | G4FragmentVector * Result) const |
---|
341 | { |
---|
342 | G4double ProductsEnergy =0; |
---|
343 | G4ThreeVector ProductsMomentum; |
---|
344 | G4int ProductsA = 0; |
---|
345 | G4int ProductsZ = 0; |
---|
346 | G4FragmentVector::iterator h; |
---|
347 | for (h = Result->begin(); h != Result->end(); h++) { |
---|
348 | G4LorentzVector tmp = (*h)->GetMomentum(); |
---|
349 | ProductsEnergy += tmp.e(); |
---|
350 | ProductsMomentum += tmp.vect(); |
---|
351 | ProductsA += static_cast<G4int>((*h)->GetA()); |
---|
352 | ProductsZ += static_cast<G4int>((*h)->GetZ()); |
---|
353 | } |
---|
354 | |
---|
355 | if (ProductsA != theInitialState.GetA()) { |
---|
356 | G4cout << "!!!!!!!!!! Baryonic Number Conservation Violation !!!!!!!!!!" << G4endl; |
---|
357 | G4cout << "G4PhotonEvaporation.cc: Barionic Number Conservation test for evaporation fragments" |
---|
358 | << G4endl; |
---|
359 | G4cout << "Initial A = " << theInitialState.GetA() |
---|
360 | << " Fragments A = " << ProductsA << " Diference --> " |
---|
361 | << theInitialState.GetA() - ProductsA << G4endl; |
---|
362 | } |
---|
363 | if (ProductsZ != theInitialState.GetZ()) { |
---|
364 | G4cout << "!!!!!!!!!! Charge Conservation Violation !!!!!!!!!!" << G4endl; |
---|
365 | G4cout << "G4PhotonEvaporation.cc: Charge Conservation test for evaporation fragments" |
---|
366 | << G4endl; |
---|
367 | G4cout << "Initial Z = " << theInitialState.GetZ() |
---|
368 | << " Fragments Z = " << ProductsZ << " Diference --> " |
---|
369 | << theInitialState.GetZ() - ProductsZ << G4endl; |
---|
370 | } |
---|
371 | if (std::abs(ProductsEnergy-theInitialState.GetMomentum().e()) > 1.0*keV) { |
---|
372 | G4cout << "!!!!!!!!!! Energy Conservation Violation !!!!!!!!!!" << G4endl; |
---|
373 | G4cout << "G4PhotonEvaporation.cc: Energy Conservation test for evaporation fragments" |
---|
374 | << G4endl; |
---|
375 | G4cout << "Initial E = " << theInitialState.GetMomentum().e()/MeV << " MeV" |
---|
376 | << " Fragments E = " << ProductsEnergy/MeV << " MeV Diference --> " |
---|
377 | << (theInitialState.GetMomentum().e() - ProductsEnergy)/MeV << " MeV" << G4endl; |
---|
378 | } |
---|
379 | if (std::abs(ProductsMomentum.x()-theInitialState.GetMomentum().x()) > 1.0*keV || |
---|
380 | std::abs(ProductsMomentum.y()-theInitialState.GetMomentum().y()) > 1.0*keV || |
---|
381 | std::abs(ProductsMomentum.z()-theInitialState.GetMomentum().z()) > 1.0*keV) { |
---|
382 | G4cout << "!!!!!!!!!! Momentum Conservation Violation !!!!!!!!!!" << G4endl; |
---|
383 | G4cout << "G4PhotonEvaporation.cc: Momentum Conservation test for evaporation fragments" |
---|
384 | << G4endl; |
---|
385 | G4cout << "Initial P = " << theInitialState.GetMomentum().vect() << " MeV" |
---|
386 | << " Fragments P = " << ProductsMomentum << " MeV Diference --> " |
---|
387 | << theInitialState.GetMomentum().vect() - ProductsMomentum << " MeV" << G4endl; |
---|
388 | } |
---|
389 | return; |
---|
390 | } |
---|
391 | #endif |
---|
392 | |
---|
393 | |
---|
394 | |
---|