Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4NonEquilibriumEvaporator.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: G4NonEquilibriumEvaporator.cc 71942 2013-06-28 19:08:11Z mkelsey $
27 //
28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
29 // 20100309 M. Kelsey -- Use new generateWithRandomAngles for theta,phi stuff;
30 // eliminate some unnecessary std::pow()
31 // 20100412 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide()
32 // 20100413 M. Kelsey -- Pass buffers to paraMaker[Truncated]
33 // 20100517 M. Kelsey -- Inherit from common base class
34 // 20100617 M. Kelsey -- Remove "RUN" preprocessor flag and all "#else" code
35 // 20100622 M. Kelsey -- Use local "bindingEnergy()" function to call through.
36 // 20100701 M. Kelsey -- Don't need to add excitation to nuclear mass; compute
37 // new excitation energies properly (mass differences)
38 // 20100713 M. Kelsey -- Add conservation checking, diagnostic messages.
39 // 20100714 M. Kelsey -- Move conservation checking to base class
40 // 20100719 M. Kelsey -- Simplify EEXS calculations with particle evaporation.
41 // 20100724 M. Kelsey -- Replace std::vector<> D with trivial D[3] array.
42 // 20100914 M. Kelsey -- Migrate to integer A and Z: this involves replacing
43 // a number of G4double terms with G4int, with consequent casts.
44 // 20110214 M. Kelsey -- Follow G4InuclParticle::Model enumerator migration
45 // 20110922 M. Kelsey -- Follow G4InuclParticle::print(ostream&) migration
46 // 20120608 M. Kelsey -- Fix variable-name "shadowing" compiler warnings.
47 // 20121009 M. Kelsey -- Add some high-verbosity debugging output
48 // 20130622 Inherit from G4CascadeDeexciteBase, move to deExcite() interface
49 // with G4Fragment
50 // 20130808 M. Kelsey -- Use new object-version of paraMaker, for thread safety
51 // 20130924 M. Kelsey -- Replace std::pow with G4Pow::powN() for CPU speed
52 // 20150608 M. Kelsey -- Label all while loops as terminating.
53 
54 #include <cmath>
55 
57 #include "G4SystemOfUnits.hh"
58 #include "G4CollisionOutput.hh"
59 #include "G4Fragment.hh"
61 #include "G4InuclNuclei.hh"
63 #include "G4LorentzConvertor.hh"
64 #include "G4Pow.hh"
65 
66 using namespace G4InuclSpecialFunctions;
67 
68 
70  : G4CascadeDeexciteBase("G4NonEquilibriumEvaporator"),
71  theParaMaker(verboseLevel), theG4Pow(G4Pow::GetInstance()) {}
72 
73 
75  G4CollisionOutput& output) {
76  if (verboseLevel) {
77  G4cout << " >>> G4NonEquilibriumEvaporator::deExcite" << G4endl;
78  }
79 
80  if (verboseLevel>1) G4cout << " evaporating target:\n" << target << G4endl;
81 
82  const G4int a_cut = 5;
83  const G4int z_cut = 3;
84 
85  const G4double eexs_cut = 0.1;
86 
87  const G4double coul_coeff = 1.4;
88  const G4int itry_max = 1000;
89  const G4double small_ekin = 1.0e-6;
90  const G4double width_cut = 0.005;
91 
92  getTargetData(target);
93  G4LorentzVector pin = PEX; // Save original four-vector for later
94 
96  G4int QPP = config.protonQuasiParticles;
97  G4int QNP = config.neutronQuasiParticles;
98  G4int QPH = config.protonHoles;
99  G4int QNH = config.neutronHoles;
100 
101  G4int QP = QPP + QNP;
102  G4int QH = QPH + QNH;
103  G4int QEX = QP + QH;
104 
105  G4InuclElementaryParticle dummy(small_ekin, 1);
106  G4LorentzConvertor toTheExitonSystemRestFrame;
107  //*** toTheExitonSystemRestFrame.setVerbose(verboseLevel);
108  toTheExitonSystemRestFrame.setBullet(dummy);
109 
110  G4double EFN = FermiEnergy(A, Z, 0);
111  G4double EFP = FermiEnergy(A, Z, 1);
112 
113  G4int AR = A - QP;
114  G4int ZR = Z - QPP;
115  G4int NEX = QEX;
116  G4LorentzVector ppout;
117  G4bool try_again = (NEX > 0);
118 
119  // Buffer for parameter sets
120  std::pair<G4double, G4double> parms;
121 
122  while (try_again) { /* Loop checking 08.06.2015 MHK */
123  if (A >= a_cut && Z >= z_cut && EEXS > eexs_cut) { // ok
124  // update exiton system (include excitation energy!)
126  PEX.setVectM(PEX.vect(), nuc_mass);
127  toTheExitonSystemRestFrame.setTarget(PEX);
128  toTheExitonSystemRestFrame.toTheTargetRestFrame();
129 
130  if (verboseLevel > 2) {
131  G4cout << " A " << A << " Z " << Z << " mass " << nuc_mass
132  << " EEXS " << EEXS << G4endl;
133  }
134 
135  G4double MEL = getMatrixElement(A);
136  G4double E0 = getE0(A);
137  G4double PL = getParLev(A, Z);
138  G4double parlev = PL / A;
139  G4double EG = PL * EEXS;
140 
141  if (QEX < std::sqrt(2.0 * EG)) { // ok
142  if (verboseLevel > 3)
143  G4cout << " QEX " << QEX << " < sqrt(2*EG) " << std::sqrt(2.*EG)
144  << " NEX " << NEX << G4endl;
145 
146  theParaMaker.getTruncated(Z, parms);
147  const G4double& AK1 = parms.first;
148  const G4double& CPA1 = parms.second;
149 
150  G4double VP = coul_coeff * Z * AK1 / (G4cbrt(A-1) + 1.0) /
151  (1.0 + EEXS / E0);
152  G4double DM1 = bindingEnergy(A,Z);
153  G4double BN = DM1 - bindingEnergy(A-1,Z);
154  G4double BP = DM1 - bindingEnergy(A-1,Z-1);
155  G4double EMN = EEXS - BN;
156  G4double EMP = EEXS - BP - VP * A / (A-1);
157  G4double ESP = 0.0;
158 
159  if (verboseLevel > 3) {
160  G4cout << " AK1 " << AK1 << " CPA1 " << " VP " << VP
161  << "\n bind(A,Z) " << DM1 << " dBind(N) " << BN
162  << " dBind(P) " << BP
163  << "\n EMN " << EMN << " EMP " << EMP << G4endl;
164  }
165 
166  if (EMN > eexs_cut) { // ok
167  G4int icase = 0;
168 
169  if (NEX > 1) {
170  G4double APH = 0.25 * (QP * QP + QH * QH + QP - 3 * QH);
171  G4double APH1 = APH + 0.5 * (QP + QH);
172  ESP = EEXS / QEX;
173  G4double MELE = MEL / ESP / (A*A*A);
174 
175  if (verboseLevel > 3)
176  G4cout << " APH " << APH << " APH1 " << APH1 << " ESP " << ESP
177  << G4endl;
178 
179  if (ESP > 15.0) {
180  MELE *= std::sqrt(15.0 / ESP);
181  } else if(ESP < 7.0) {
182  MELE *= std::sqrt(ESP / 7.0);
183  if (ESP < 2.0) MELE *= std::sqrt(ESP / 2.0);
184  };
185 
186  G4double F1 = EG - APH;
187  G4double F2 = EG - APH1;
188 
189  if (verboseLevel > 3)
190  G4cout << " MELE " << MELE << " F1 " << F1 << " F2 " << F2
191  << G4endl;
192 
193  if (F1 > 0.0 && F2 > 0.0) {
194  G4double F = F2 / F1;
195  G4double M1 = 2.77 * MELE * PL;
196  G4double D[3] = { 0., 0., 0. };
197  D[0] = M1 * F2 * F2 * theG4Pow->powN(F, NEX-1) / (QEX+1);
198  if (verboseLevel > 3) {
199  G4cout << " D[0] " << D[0] << " with F " << F
200  << " powN(F,NEX-1) " << theG4Pow->powN(F, NEX-1)
201  << G4endl;
202  }
203 
204  if (D[0] > 0.0) {
205 
206  if (NEX >= 2) {
207  D[1] = 0.0462 / parlev / G4cbrt(A) * QP * EEXS / QEX;
208 
209  if (EMP > eexs_cut)
210  D[2] = D[1] * theG4Pow->powN(EMP/EEXS, NEX) * (1.0 + CPA1);
211  D[1] *= theG4Pow->powN(EMN/EEXS, NEX) * getAL(A);
212 
213  if (verboseLevel > 3) {
214  G4cout << " D[1] " << D[1] << " with powN(EMN/EEXS, NEX) "
215  << theG4Pow->powN(EMN/EEXS, NEX) << G4endl
216  << " D[2] " << D[2] << " with powN(EMP/EEXS, NEX) "
217  << theG4Pow->powN(EMP/EEXS, NEX) << G4endl;
218  }
219 
220  if (QNP < 1) D[1] = 0.0;
221  if (QPP < 1) D[2] = 0.0;
222 
223  try_again = NEX > 1 && (D[1] > width_cut * D[0] ||
224  D[2] > width_cut * D[0]);
225 
226  if (try_again) {
227  G4double D5 = D[0] + D[1] + D[2];
228  G4double SL = D5 * inuclRndm();
229  G4double S1 = 0.;
230 
231  if (verboseLevel > 3)
232  G4cout << " D5 " << D5 << " SL " << SL << G4endl;
233 
234  for (G4int i = 0; i < 3; i++) {
235  S1 += D[i];
236  if (SL <= S1) {
237  icase = i;
238  break;
239  }
240  }
241 
242  if (verboseLevel > 3)
243  G4cout << " got icase " << icase << G4endl;
244  } // if (try_again)
245  } // if (NEX >= 2)
246  } else try_again = false; // if (D[0] > 0)
247  } else try_again = false; // if (F1>0 && F2>0)
248  } // if (NEX > 1)
249 
250  if (try_again) {
251  if (icase > 0) { // N -> N-1 with particle escape
252  if (verboseLevel > 3)
253  G4cout << " try_again icase " << icase << G4endl;
254 
255  G4double V = 0.0;
256  G4int ptype = 0;
257  G4double B = 0.0;
258 
259  if (A < 3.0) try_again = false;
260 
261  if (try_again) {
262 
263  if (icase == 1) { // neutron escape
264  if (verboseLevel > 3)
265  G4cout << " trying neutron escape" << G4endl;
266 
267  if (QNP < 1) icase = 0;
268  else {
269  B = BN;
270  V = 0.0;
271  ptype = 2;
272  };
273  } else { // proton esape
274  if (verboseLevel > 3)
275  G4cout << " trying proton escape" << G4endl;
276 
277  if (QPP < 1) icase = 0;
278  else {
279  B = BP;
280  V = VP;
281  ptype = 1;
282 
283  if (Z-1 < 1) try_again = false;
284  };
285  };
286 
287  if (try_again && icase != 0) {
288  if (verboseLevel > 3)
289  G4cout << " ptype " << ptype << " B " << B << " V " << V
290  << G4endl;
291 
292  G4double EB = EEXS - B;
293  G4double E = EB - V * A / (A-1);
294 
295  if (E < 0.0) icase = 0;
296  else {
297  G4double E1 = EB - V;
298  G4double EEXS_new = -1.;
299  G4double EPART = 0.0;
300  G4int itry1 = 0;
301  G4bool bad = true;
302 
303  /* Loop checking 08.06.2015 MHK */
304  while (itry1 < itry_max && icase > 0 && bad) {
305  itry1++;
306  G4int itry = 0;
307 
308  /* Loop checking 08.06.2015 MHK */
309  while (EEXS_new < 0.0 && itry < itry_max) {
310  itry++;
311  G4double R = inuclRndm();
312  G4double X;
313 
314  if (NEX == 2) {
315  X = 1.0 - std::sqrt(R);
316 
317  } else {
318  G4double QEX2 = 1.0 / QEX;
319  G4double QEX1 = 1.0 / (QEX-1);
320  X = theG4Pow->powA(0.5*R, QEX2);
321  if (verboseLevel > 3) {
322  G4cout << " R " << R << " QEX2 " << QEX2
323  << " powA(R, QEX2) " << X << G4endl;
324  }
325 
326  for (G4int i = 0; i < 1000; i++) {
327  G4double DX = X * QEX1 *
328  (1.0 + QEX2 * X * (1.0 - R / theG4Pow->powN(X, NEX)) / (1.0 - X));
329  if (verboseLevel > 3) {
330  G4cout << " NEX " << NEX << " powN(X, NEX) "
331  << theG4Pow->powN(X, NEX) << G4endl;
332  }
333 
334  X -= DX;
335 
336  if (std::fabs(DX / X) < 0.01) break;
337 
338  };
339  };
340  EPART = EB - X * E1;
341  EEXS_new = EB - EPART * A / (A-1);
342  } // while (EEXS_new < 0.0...
343 
344  if (itry == itry_max || EEXS_new < 0.0) {
345  icase = 0;
346  continue;
347  }
348 
349  if (verboseLevel > 2)
350  G4cout << " particle " << ptype << " escape " << G4endl;
351 
352  EPART /= GeV; // From MeV to GeV
353 
354  G4InuclElementaryParticle particle(ptype);
356 
357  // generate particle momentum
358  G4double mass = particle.getMass();
359  G4double pmod = std::sqrt(EPART * (2.0 * mass + EPART));
360  G4LorentzVector mom = generateWithRandomAngles(pmod,mass);
361 
362  // Push evaporated paricle into current rest frame
363  mom = toTheExitonSystemRestFrame.backToTheLab(mom);
364 
365  // Adjust quasiparticle and nucleon counts
366  G4int QPP_new = QPP;
367  G4int QNP_new = QNP;
368 
369  G4int A_new = A-1;
370  G4int Z_new = Z;
371 
372  if (ptype == 1) {
373  QPP_new--;
374  Z_new--;
375  };
376 
377  if (ptype == 2) QNP_new--;
378 
379  if (verboseLevel > 3) {
380  G4cout << " nucleus px " << PEX.px() << " py " << PEX.py()
381  << " pz " << PEX.pz() << " E " << PEX.e() << G4endl
382  << " evaporate px " << mom.px() << " py " << mom.py()
383  << " pz " << mom.pz() << " E " << mom.e() << G4endl;
384  }
385 
386  // New excitation energy depends on residual nuclear state
387  G4double mass_new = G4InuclNuclei::getNucleiMass(A_new, Z_new);
388 
389  EEXS_new = ((PEX-mom).m() - mass_new)*GeV;
390  if (EEXS_new < 0.) continue; // Sanity check for new nucleus
391 
392  if (verboseLevel > 3)
393  G4cout << " EEXS_new " << EEXS_new << G4endl;
394 
395  PEX -= mom;
396  EEXS = EEXS_new;
397 
398  A = A_new;
399  Z = Z_new;
400 
401  NEX--;
402  QEX--;
403  QP--;
404  QPP = QPP_new;
405  QNP = QNP_new;
406 
407  particle.setMomentum(mom);
408  output.addOutgoingParticle(particle);
409  ppout += mom;
410  if (verboseLevel > 3) {
411  G4cout << particle << G4endl
412  << " ppout px " << ppout.px() << " py " << ppout.py()
413  << " pz " << ppout.pz() << " E " << ppout.e() << G4endl;
414  }
415 
416  bad = false;
417  } // while (itry1<itry_max && icase>0
418 
419  if (itry1 == itry_max) icase = 0;
420  } // if (E < 0.) [else]
421  } // if (try_again && icase != 0)
422  } // if (try_again)
423  } // if (icase > 0)
424 
425  if (icase == 0 && try_again) { // N -> N + 2
426  if (verboseLevel > 3) G4cout << " adding excitons" << G4endl;
427 
428  G4double TNN = 1.6 * EFN + ESP;
429  G4double TNP = 1.6 * EFP + ESP;
430  G4double XNUN = 1.0 / (1.6 + ESP / EFN);
431  G4double XNUP = 1.0 / (1.6 + ESP / EFP);
432  G4double SNN1 = csNN(TNP) * XNUP;
433  G4double SNN2 = csNN(TNN) * XNUN;
434  G4double SPN1 = csPN(TNP) * XNUP;
435  G4double SPN2 = csPN(TNN) * XNUN;
436  G4double PP = (QPP * SNN1 + QNP * SPN1) * ZR;
437  G4double PN = (QPP * SPN2 + QNP * SNN2) * (AR - ZR);
438  G4double PW = PP + PN;
439  NEX += 2;
440  QEX += 2;
441  QP++;
442  QH++;
443  AR--;
444 
445  if (AR > 1) {
446  G4double SL = PW * inuclRndm();
447 
448  if (SL > PP) {
449  QNP++;
450  QNH++;
451  } else {
452  QPP++;
453  QPH++;
454  ZR--;
455  if (ZR < 2) try_again = false;
456  }
457  } else try_again = false;
458  } // if (icase==0 && try_again)
459  } // if (try_again)
460  } else try_again = false; // if (EMN > eexs_cut)
461  } else try_again = false; // if (QEX < sqrg(2*EG)
462  } else try_again = false; // if (A > a_cut ...
463  } // while (try_again)
464 
465  // everything finished, set output fragment
466 
467  if (output.numberOfOutgoingParticles() == 0) {
468  output.addRecoilFragment(target);
469  } else {
470  G4LorentzVector pnuc = pin - ppout;
471  output.addRecoilFragment(makeFragment(pnuc, A, Z, EEXS));
472 
473  if (verboseLevel>3)
474  G4cout << " remaining nucleus\n" << output.getRecoilFragment() << G4endl;
475  }
476 
477  validateOutput(target, output); // Check energy conservation, etc.
478  return;
479 }
480 
481 G4double G4NonEquilibriumEvaporator::getMatrixElement(G4int a) const {
482  if (verboseLevel > 3) {
483  G4cout << " >>> G4NonEquilibriumEvaporator::getMatrixElement" << G4endl;
484  }
485 
486  G4double me;
487 
488  if (a > 150) me = 100.0;
489  else if (a > 20) me = 140.0;
490  else me = 70.0;
491 
492  return me;
493 }
494 
495 G4double G4NonEquilibriumEvaporator::getE0(G4int ) const {
496  if (verboseLevel > 3) {
497  G4cout << " >>> G4NonEquilibriumEvaporator::getEO" << G4endl;
498  }
499 
500  const G4double e0 = 200.0;
501 
502  return e0;
503 }
504 
505 G4double G4NonEquilibriumEvaporator::getParLev(G4int a, G4int ) const {
506  if (verboseLevel > 3) {
507  G4cout << " >>> G4NonEquilibriumEvaporator::getParLev" << G4endl;
508  }
509 
510  // const G4double par = 0.125;
511  G4double pl = 0.125 * a;
512 
513  return pl;
514 }
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
const XML_Char * target
Definition: expat.h:268
G4double powN(G4double x, G4int n) const
Definition: G4Pow.cc:128
virtual void deExcite(const G4Fragment &target, G4CollisionOutput &output)
Definition: G4Pow.hh:56
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
void addOutgoingParticle(const G4InuclElementaryParticle &particle)
double B(double temperature)
void setBullet(const G4InuclParticle *bullet)
G4LorentzVector backToTheLab(const G4LorentzVector &mom) const
int G4int
Definition: G4Types.hh:78
void setVectM(const Hep3Vector &spatial, double mass)
void getTruncated(G4double Z, std::pair< G4double, G4double > &parms)
Definition: paraMaker.cc:97
void getTargetData(const G4Fragment &target)
tuple pl
Definition: readPY.py:5
Hep3Vector vect() const
G4GLOB_DLL std::ostream G4cout
static constexpr double m
Definition: G4SIunits.hh:129
double py() const
bool G4bool
Definition: G4Types.hh:79
G4double getNucleiMass() const
struct config_s config
G4int numberOfOutgoingParticles() const
double px() const
G4LorentzVector generateWithRandomAngles(G4double p, G4double mass=0.)
const G4Fragment & makeFragment(G4LorentzVector mom, G4int A, G4int Z, G4double EX=0.)
static const G4double * SL[nLA]
static constexpr double GeV
Definition: G4SIunits.hh:217
double D(double temp)
double pz() const
void setModel(Model model)
#define G4endl
Definition: G4ios.hh:61
virtual G4bool validateOutput(const G4Fragment &target, G4CollisionOutput &output)
void addRecoilFragment(const G4Fragment *aFragment)
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
const G4Fragment & getRecoilFragment(G4int index=0) const
void setMomentum(const G4LorentzVector &mom)
double G4double
Definition: G4Types.hh:76
G4double bindingEnergy(G4int A, G4int Z)
G4double FermiEnergy(G4int A, G4int Z, G4int ntype)
G4double getMass() const
void setTarget(const G4InuclParticle *target)