58 using namespace G4InuclSpecialFunctions;
74 G4cerr <<
" BigBanger -> try to bang not nuclei " <<
G4endl;
88 if (etot < 0.0) etot = 0.0;
91 G4cout <<
" BigBanger: target\n" << *nuclei_target
92 <<
"\n etot " << etot <<
G4endl;
97 PEXrest.
boost(-toTheLabFrame);
98 G4cout <<
" target rest frame: px " << PEXrest.
px() <<
" py "
99 << PEXrest.
py() <<
" pz " << PEXrest.
pz() <<
" E " << PEXrest.
e()
103 generateBangInSCM(etot, A, Z);
107 for(
G4int i = 0; i <
G4int(particles.size()); i++)
108 G4cout << particles[i] << G4endl;
111 if (particles.empty()) {
112 G4cerr <<
" >>> G4BigBanger unable to process fragment "
126 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
130 mom.
boost(toTheLabFrame);
133 ipart->setMomentum(mom);
142 G4cout <<
" In SCM: total outgoing momentum " << G4endl
143 <<
" E " << totscm.
e() <<
" px " << totscm.
x()
144 <<
" py " << totscm.
y() <<
" pz " << totscm.
z() <<
G4endl;
145 G4cout <<
" In Lab: mom cons " << G4endl
146 <<
" E " << PEX.
e() - totlab.
e()
147 <<
" px " << PEX.
x() - totlab.
x()
148 <<
" py " << PEX.
y() - totlab.
y()
149 <<
" pz " << PEX.
z() - totlab.
z() <<
G4endl;
157 G4cout <<
" >>> G4BigBanger::generateBangInSCM" <<
G4endl;
161 const G4int itry_max = 1000;
170 G4int knd = (z>0) ? 1 : 2;
178 scm_momentums.reserve(a);
183 while(bad && itry < itry_max) {
185 scm_momentums.clear();
187 generateMomentumModules(etot, a, z);
191 scm_momentums.push_back(mom);
192 scm_momentums.push_back(-mom);
197 for(
G4int i = 0; i < a-2; i++) {
200 scm_momentums.push_back(mom);
206 G4double ct = -0.5*(tot_mod*tot_mod + momModules[a-2]*momModules[a-2]
207 - momModules[a-1]*momModules[a-1]) / tot_mod
212 if(std::fabs(ct) < ang_cut) {
218 G4double a_tr = std::sqrt(apr.
x()*apr.
x() + apr.
y()*apr.
y());
220 mom.
setX(mom2.
z()*apr.
x() + ( mom2.
x()*apr.
y() + mom2.
y()*apr.
z()*apr.
x())/a_tr);
221 mom.setY(mom2.
z()*apr.
y() + (-mom2.
x()*apr.
x() + mom2.
y()*apr.
z()*apr.
y())/a_tr);
222 mom.setZ(mom2.
z()*apr.
z() - mom2.
y()*a_tr);
224 scm_momentums.push_back(mom);
229 scm_momentums.push_back(mom1);
237 for(
G4int i = 0; i <
a; i++) {
238 G4int knd = i < z ? 1 : 2;
244 if (itry == itry_max)
G4cout <<
" BigBanger -> can not generate bang " <<
G4endl;
252 G4cout <<
" >>> G4BigBanger::generateMomentumModules" <<
G4endl;
264 G4double promax = maxProbability(a);
266 momModules.resize(a, 0.);
267 for(
G4int i = 0; i <
a; i++) {
268 momModules[i] = generateX(a, promax);
269 xtot += momModules[i];
272 G4cout <<
" i " << i <<
" x " << momModules[i] <<
G4endl;
277 momModules.push_back(0.5);
278 momModules.push_back(0.5);
281 for(
G4int i = 0; i <
a; i++) {
284 momModules[i] *= etot/xtot;
285 momModules[i] = std::sqrt(momModules[i] * (momModules[i] + 2.0 * mass));
288 G4cout <<
" i " << i <<
" pmod " << momModules[i] <<
G4endl;
300 if(x < 1.0 || x > 0.0) {
304 ekpr *= std::sqrt(1.0 - x) * std::pow((1.0 - x), (3*a-6)/2);
307 ekpr *= std::pow((1.0 - x), (3*a-5)/2);
319 return xProbability(2./3./(a-1.0), a);
325 const G4int itry_max = 1000;
329 while(itry < itry_max) {
333 if(xProbability(x, a) >= promax *
inuclRndm())
return x;
336 G4cout <<
" BigBanger -> can not generate x " <<
G4endl;
339 return maxProbability(a);