1417 G4cout <<
" >>> G4NucleiModel::initializeCascad(bullet,target,output)"
1421 const G4double max_a_for_cascad = 5.0;
1423 const G4double small_ekin = 1.0e-6;
1424 const G4double r_large2for3 = 62.0;
1427 const G4double r_large2for4 = 69.14;
1430 const G4int itry_max = 100;
1433 std::vector<G4CascadParticle>& casparticles = output.first;
1434 std::vector<G4InuclElementaryParticle>& particles = output.second;
1436 casparticles.clear();
1447 if (ab < max_a_for_cascad) {
1451 G4double ben = benb < bent ? bent : benb;
1457 while (casparticles.size() == 0 && itryg < itry_max) {
1462 coordinates.clear();
1468 coordinates.push_back(coord1);
1469 coordinates.push_back(-coord1);
1475 while (bad && itry < itry_max) {
1479 if (p * p / (p * p + 2079.36) / (p * p + 2079.36) > 1.2023e-4 *
inuclRndm() &&
1480 p * r > 312.0) bad =
false;
1483 if (itry == itry_max)
1484 if (verboseLevel > 2){
1485 G4cout <<
" deutron bullet generation-> itry = " << itry_max <<
G4endl;
1490 if (verboseLevel > 2){
1496 momentums.push_back(mom);
1498 momentums.push_back(-mom);
1507 while (badco && itry < itry_max) {
1508 if (itry > 0) coordinates.clear();
1512 for (i = 0; i < 2; i++) {
1517 while (itry1 < itry_max) {
1521 rho = std::sqrt(ss) *
G4Exp(-ss);
1523 if (rho > u && ss < s3max) {
1524 ss = r0forAeq3 * std::sqrt(ss);
1526 coordinates.push_back(coord1);
1528 if (verboseLevel > 2){
1535 if (itry1 == itry_max) {
1536 coord1.
set(10000.,10000.,10000.);
1537 coordinates.push_back(coord1);
1542 coord1 = -coordinates[0] - coordinates[1];
1543 if (verboseLevel > 2) {
1547 coordinates.push_back(coord1);
1549 G4bool large_dist =
false;
1551 for (i = 0; i < 2; i++) {
1552 for (
G4int j = i+1; j < 3; j++) {
1553 G4double r2 = (coordinates[i]-coordinates[j]).mag2();
1555 if (verboseLevel > 2) {
1556 G4cout <<
" i " << i <<
" j " << j <<
" r2 " << r2 <<
G4endl;
1559 if (r2 > r_large2for3) {
1566 if (large_dist)
break;
1569 if(!large_dist) badco =
false;
1576 G4double u = b1 + std::sqrt(b1 * b1 + b);
1579 while (badco && itry < itry_max) {
1581 if (itry > 0) coordinates.clear();
1585 for (i = 0; i < ab-1; i++) {
1589 while (itry1 < itry_max) {
1594 if (std::sqrt(ss) *
G4Exp(-ss) * (1.0 + ss/b) > u
1596 ss = r0forAeq4 * std::sqrt(ss);
1598 coordinates.push_back(coord1);
1600 if (verboseLevel > 2) {
1608 if (itry1 == itry_max) {
1609 coord1.
set(10000.,10000.,10000.);
1610 coordinates.push_back(coord1);
1616 for(
G4int j = 0; j < ab -1; j++) coord1 -= coordinates[j];
1618 coordinates.push_back(coord1);
1620 if (verboseLevel > 2){
1624 G4bool large_dist =
false;
1626 for (i = 0; i < ab-1; i++) {
1627 for (
G4int j = i+1; j <
ab; j++) {
1629 G4double r2 = (coordinates[i]-coordinates[j]).mag2();
1631 if (verboseLevel > 2){
1632 G4cout <<
" i " << i <<
" j " << j <<
" r2 " << r2 <<
G4endl;
1635 if (r2 > r_large2for4) {
1642 if (large_dist)
break;
1645 if (!large_dist) badco =
false;
1650 G4cout <<
" can not generate the nucleons coordinates for a "
1653 casparticles.clear();
1662 for (
G4int i = 0; i < ab - 1; i++) {
1665 while(itry2 < itry_max) {
1671 p = std::sqrt(0.01953 * u);
1673 momentums.push_back(mom);
1679 if(itry2 == itry_max) {
1680 G4cout <<
" can not generate proper momentum for a "
1683 casparticles.clear();
1693 for(
G4int j=0; j< ab-1; j++) mom -= momentums[j];
1695 momentums.push_back(mom);
1703 for(i = 0; i <
G4int(coordinates.size()); i++) {
1704 G4double rp = coordinates[i].mag2();
1706 if(rp > rb) rb = rp;
1712 G4double rz = (nuclei_radius + rb) * s1;
1713 G4ThreeVector global_pos(rz*std::cos(phi), rz*std::sin(phi),
1714 -(nuclei_radius+rb)*std::sqrt(1.0-s1*s1));
1716 for (i = 0; i <
G4int(coordinates.size()); i++) {
1717 coordinates[i] += global_pos;
1721 raw_particles.clear();
1723 for (
G4int ipa = 0; ipa <
ab; ipa++) {
1724 G4int knd = ipa < zb ? 1 : 2;
1730 toTheBulletRestFrame.toTheTargetRestFrame();
1734 for (ipart = raw_particles.begin(); ipart != raw_particles.end(); ipart++) {
1735 ipart->setMomentum(toTheBulletRestFrame.backToTheLab(ipart->getMomentum()));
1740 for(
G4int ip = 0; ip <
G4int(raw_particles.size()); ip++) {
1744 G4double det = t0 * t0 + nuclei_radius * nuclei_radius
1745 - coordinates[ip].mag2();
1752 if(std::fabs(t1) <= std::fabs(t2)) {
1754 if(coordinates[ip].
z() + mom.
z() * t1 / pmod <= 0.0) tr =
t1;
1757 if(tr < 0.0 && t2 > 0.0) {
1759 if(coordinates[ip].
z() + mom.
z() * t2 / pmod <= 0.0) tr = t2;
1765 if(coordinates[ip].
z() + mom.
z() * t2 / pmod <= 0.0) tr = t2;
1768 if(tr < 0.0 && t1 > 0.0) {
1769 if(coordinates[ip].
z() + mom.
z() * t1 / pmod <= 0.0) tr =
t1;
1776 coordinates[ip] += mom.
vect()*tr / pmod;
1779 number_of_zones, large, 0));
1782 particles.push_back(raw_particles[ip]);
1787 if(casparticles.size() == 0) {
1790 G4cout <<
" can not generate proper distribution for " << itry_max
1796 if(verboseLevel > 2){
1799 G4cout <<
" cascad particles: " << casparticles.size() <<
G4endl;
1800 for(ip = 0; ip <
G4int(casparticles.size()); ip++)
1801 G4cout << casparticles[ip] << G4endl;
1803 G4cout <<
" outgoing particles: " << particles.size() <<
G4endl;
1804 for(ip = 0; ip <
G4int(particles.size()); ip++)
1805 G4cout << particles[ip] << G4endl;
void set(double x, double y, double z)
double dot(const Hep3Vector &) const
G4double getEnergy() const
G4double getKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4LorentzVector generateWithRandomAngles(G4double p, G4double mass=0.)
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static constexpr double GeV
std::vector< G4InuclElementaryParticle >::iterator particleIterator
void setVect(const Hep3Vector &)
G4double bindingEnergy(G4int A, G4int Z)