Changeset 1315 for trunk/source/processes/hadronic/models/cascade/cascade/src/G4NonEquilibriumEvaporator.cc
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/cascade/cascade/src/G4NonEquilibriumEvaporator.cc
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4NonEquilibriumEvaporator.cc,v 1.29 2010/05/21 17:56:34 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 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 26 35 #define RUN 27 36 28 37 #include <cmath> 29 38 #include "G4NonEquilibriumEvaporator.hh" 39 #include "G4CollisionOutput.hh" 30 40 #include "G4InuclElementaryParticle.hh" 31 41 #include "G4InuclNuclei.hh" 42 #include "G4InuclSpecialFunctions.hh" 32 43 #include "G4LorentzConvertor.hh" 44 #include "G4NucleiProperties.hh" 45 #include "G4HadTmpUtil.hh" 46 47 using namespace G4InuclSpecialFunctions; 48 33 49 34 50 G4NonEquilibriumEvaporator::G4NonEquilibriumEvaporator() 35 : verboseLevel(1) { 36 37 if (verboseLevel > 3) { 38 G4cout << " >>> G4NonEquilibriumEvaporator::G4NonEquilibriumEvaporator" << G4endl; 39 } 40 } 41 42 G4CollisionOutput G4NonEquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/, 43 G4InuclParticle* target) { 51 : G4VCascadeCollider("G4NonEquilibriumEvaporator") {} 52 53 54 void G4NonEquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/, 55 G4InuclParticle* target, 56 G4CollisionOutput& output) { 44 57 45 58 if (verboseLevel > 3) { … … 47 60 } 48 61 49 const G4double one_third = 1.0/3.0; 62 // Sanity check 63 G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target); 64 if (!nuclei_target) { 65 G4cerr << " NonEquilibriumEvaporator -> target is not nuclei " << G4endl; 66 return; 67 } 68 50 69 const G4double a_cut = 5.0; 51 70 const G4double z_cut = 3.0; … … 61 80 const G4double small_ekin = 1.0e-6; 62 81 const G4double width_cut = 0.005; 63 G4CollisionOutput output; 64 65 if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) { 66 // initialization 82 67 83 G4double A = nuclei_target->getA(); 68 84 G4double Z = nuclei_target->getZ(); 69 G4 CascadeMomentumPEX = nuclei_target->getMomentum();70 G4 CascadeMomentumpin = PEX;85 G4LorentzVector PEX = nuclei_target->getMomentum(); 86 G4LorentzVector pin = PEX; 71 87 G4double EEXS = nuclei_target->getExitationEnergy(); 72 pin [0] += 0.001 * EEXS;88 pin.setE(pin.e() + 0.001 * EEXS); 73 89 G4InuclNuclei dummy_nuc; 74 90 G4ExitonConfiguration config = nuclei_target->getExitonConfiguration(); … … 88 104 G4LorentzConvertor toTheExitonSystemRestFrame; 89 105 90 toTheExitonSystemRestFrame.setBullet(dummy .getMomentum(), dummy.getMass());106 toTheExitonSystemRestFrame.setBullet(dummy); 91 107 92 108 G4double EFN = FermiEnergy(A, Z, 0); … … 96 112 G4double ZR = Z - QPP; 97 113 G4int NEX = G4int(QEX + 0.5); 98 G4 CascadeMomentumppout;99 G4bool try_again = NEX > 0 ? true : false;114 G4LorentzVector ppout; 115 G4bool try_again = (NEX > 0); 100 116 117 // Buffer for parameter sets 118 std::pair<G4double, G4double> parms; 119 101 120 while (try_again) { 102 121 … … 109 128 // update exiton system 110 129 G4double nuc_mass = dummy_nuc.getNucleiMass(A, Z); 111 PEX[0] = std::sqrt(PEX[1] * PEX[1] + PEX[2] * PEX[2] + PEX[3] * PEX[3] + 112 nuc_mass * nuc_mass); 130 PEX.setVectM(PEX.vect(), nuc_mass); 113 131 toTheExitonSystemRestFrame.setTarget(PEX, nuc_mass); 114 132 toTheExitonSystemRestFrame.toTheTargetRestFrame(); … … 121 139 if (QEX < std::sqrt(2.0 * EG)) { // ok 122 140 123 std::pair<G4double, G4double> parms = paraMakerTruncated(Z);124 125 G4double AK1 = parms.first;126 G4double CPA1 = parms.second; 127 G4double VP = coul_coeff * Z * AK1 / ( std::pow(A - 1.0, one_third) + 1.0) /141 paraMakerTruncated(Z, parms); 142 const G4double& AK1 = parms.first; 143 const G4double& CPA1 = parms.second; 144 145 G4double VP = coul_coeff * Z * AK1 / (G4cbrt(A - 1.0) + 1.0) / 128 146 (1.0 + EEXS / E0); 129 G4double DM1 = bindingEnergy(A, Z); 130 G4double BN = DM1 - bindingEnergy(A - 1.0, Z); 131 G4double BP = DM1 - bindingEnergy(A - 1.0, Z - 1.0); 147 // G4double DM1 = bindingEnergy(A, Z); 148 // G4double BN = DM1 - bindingEnergy(A - 1.0, Z); 149 // G4double BP = DM1 - bindingEnergy(A - 1.0, Z - 1.0); 150 G4double DM1 = G4NucleiProperties::GetBindingEnergy(G4lrint(A), G4lrint(Z)); 151 G4double BN = DM1 - G4NucleiProperties::GetBindingEnergy(G4lrint(A-1.0), G4lrint(Z)); 152 G4double BP = DM1 - G4NucleiProperties::GetBindingEnergy(G4lrint(A-1.0), G4lrint(Z-1.0)); 132 153 G4double EMN = EEXS - BN; 133 154 G4double EMP = EEXS - BP - VP * A / (A - 1.0); … … 141 162 G4double APH1 = APH + 0.5 * (QP + QH); 142 163 ESP = EEXS / QEX; 143 G4double MELE = MEL / ESP / std::pow(A, 3);164 G4double MELE = MEL / ESP / (A*A*A); 144 165 145 166 if (ESP > 15.0) { … … 164 185 165 186 if (NEX >= 2) { 166 D[1] = 0.0462 / parlev / std::pow(A, one_third) * QP * EEXS / QEX;187 D[1] = 0.0462 / parlev / G4cbrt(A) * QP * EEXS / QEX; 167 188 168 189 if (EMP > eexs_cut) … … 293 314 // generate particle momentum 294 315 G4double pmod = std::sqrt(EPART * (2.0 * mass + EPART)); 295 G4CascadeMomentum mom; 296 std::pair<G4double, G4double> COS_SIN = randomCOS_SIN(); 297 G4double FI = randomPHI(); 298 G4double P1 = pmod * COS_SIN.second; 299 mom[1] = P1 * std::cos(FI); 300 mom[2] = P1 * std::sin(FI); 301 mom[3] = pmod * COS_SIN.first; 302 G4CascadeMomentum mom_at_rest; 303 304 for (G4int i = 1; i < 4; i++) mom_at_rest[i] = -mom[i]; 316 G4LorentzVector mom = generateWithRandomAngles(pmod,mass); 317 G4LorentzVector mom_at_rest; 305 318 306 319 G4double QPP_new = QPP; … … 319 332 G4double new_exiton_mass = 320 333 dummy_nuc.getNucleiMass(A_new, Z_new); 321 mom_at_rest[0] = std::sqrt(mom_at_rest[1] * mom_at_rest[1] + 322 mom_at_rest[2] * mom_at_rest[2] + 323 mom_at_rest[3] * mom_at_rest[3] + 324 new_exiton_mass * new_exiton_mass); 325 mom[0] = std::sqrt(mom[1] * mom[1] + mom[2] * mom[2] + 326 mom[3] * mom[3] + mass * mass); 327 328 G4CascadeMomentum part_mom = 334 mom_at_rest.setVectM(-mom.vect(), new_exiton_mass); 335 336 G4LorentzVector part_mom = 329 337 toTheExitonSystemRestFrame.backToTheLab(mom); 330 331 part_mom[0] = std::sqrt(part_mom[1] * part_mom[1] + 332 part_mom[2] * part_mom[2] + part_mom[3] * part_mom[3] + 333 mass * mass); 334 335 G4CascadeMomentum ex_mom = 338 part_mom.setVectM(part_mom.vect(), mass); 339 340 G4LorentzVector ex_mom = 336 341 toTheExitonSystemRestFrame.backToTheLab(mom_at_rest); 337 338 ex_mom[0] = std::sqrt(ex_mom[1] * ex_mom[1] + ex_mom[2] * ex_mom[2] 339 + ex_mom[3] * ex_mom[3] + new_exiton_mass * new_exiton_mass); 342 ex_mom.setVectM(ex_mom.vect(), new_exiton_mass); 343 340 344 // check energy conservation and set new exitation energy 341 EEXS_new = 1000.0 * (PEX [0]+ 0.001 * EEXS -342 part_mom [0] - ex_mom[0]);345 EEXS_new = 1000.0 * (PEX.e() + 0.001 * EEXS - 346 part_mom.e() - ex_mom.e()); 343 347 344 348 if (EEXS_new > 0.0) { // everything ok 345 349 particle.setMomentum(part_mom); 346 350 output.addOutgoingParticle(particle); 347 348 for (G4int i = 0; i < 4; i++) ppout[i] += part_mom[i]; 351 ppout += part_mom; 352 349 353 A = A_new; 350 354 Z = Z_new; … … 423 427 // conservation 424 428 425 G4CascadeMomentum pnuc; 426 427 for (G4int i = 1; i < 4; i++) pnuc[i] = pin[i] - ppout[i]; 429 G4LorentzVector pnuc = pin - ppout; 428 430 G4InuclNuclei nuclei(pnuc, A, Z); 429 431 … … 432 434 433 435 pnuc = nuclei.getMomentum(); 434 G4double eout = pnuc [0] + ppout[0];435 G4double eex_real = 1000.0 * (pin [0]- eout);436 G4double eout = pnuc.e() + ppout.e(); 437 G4double eex_real = 1000.0 * (pin.e() - eout); 436 438 437 439 nuclei.setExitationEnergy(eex_real); 438 440 output.addTargetFragment(nuclei); 439 441 440 } else { 441 G4cout << " NonEquilibriumEvaporator -> target is not nuclei " << G4endl; 442 443 }; 444 445 return output; 442 return; 446 443 } 447 444
Note: See TracChangeset
for help on using the changeset viewer.