63 using namespace G4InuclSpecialFunctions;
78 if (etot < 0.0) etot = 0.0;
81 G4cout <<
" BigBanger: target\n" << target
82 <<
"\n etot " << etot <<
G4endl;
87 PEXrest.
boost(-toTheLabFrame);
88 G4cout <<
" target rest frame: px " << PEXrest.
px() <<
" py "
89 << PEXrest.
py() <<
" pz " << PEXrest.
pz() <<
" E " << PEXrest.
e()
93 generateBangInSCM(etot,
A,
Z);
97 for(
G4int i = 0; i <
G4int(particles.size()); i++)
98 G4cout << particles[i] << G4endl;
101 if (particles.empty()) {
102 G4cerr <<
" >>> G4BigBanger unable to process fragment "
116 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
120 mom.
boost(toTheLabFrame);
123 ipart->setMomentum(mom);
132 G4cout <<
" In SCM: total outgoing momentum " << G4endl
133 <<
" E " << totscm.
e() <<
" px " << totscm.
x()
134 <<
" py " << totscm.
y() <<
" pz " << totscm.
z() <<
G4endl;
135 G4cout <<
" In Lab: mom cons " << G4endl
136 <<
" E " <<
PEX.
e() - totlab.
e()
137 <<
" px " <<
PEX.
x() - totlab.
x()
138 <<
" py " <<
PEX.
y() - totlab.
y()
147 G4cout <<
" >>> G4BigBanger::generateBangInSCM" <<
G4endl;
151 const G4int itry_max = 1000;
160 G4int knd = (z>0) ? 1 : 2;
168 scm_momentums.reserve(a);
173 while(bad && itry < itry_max) {
175 scm_momentums.clear();
177 generateMomentumModules(etot, a, z);
181 scm_momentums.push_back(mom);
182 scm_momentums.push_back(-mom);
187 for(
G4int i = 0; i < a-2; i++) {
190 scm_momentums.push_back(mom);
196 G4double ct = -0.5*(tot_mod*tot_mod + momModules[a-2]*momModules[a-2]
197 - momModules[a-1]*momModules[a-1]) / tot_mod
202 if(std::fabs(ct) < ang_cut) {
208 G4double a_tr = std::sqrt(apr.
x()*apr.
x() + apr.
y()*apr.
y());
210 mom.
setX(mom2.
z()*apr.
x() + ( mom2.
x()*apr.
y() + mom2.
y()*apr.
z()*apr.
x())/a_tr);
211 mom.setY(mom2.
z()*apr.
y() + (-mom2.
x()*apr.
x() + mom2.
y()*apr.
z()*apr.
y())/a_tr);
212 mom.setZ(mom2.
z()*apr.
z() - mom2.
y()*a_tr);
214 scm_momentums.push_back(mom);
219 scm_momentums.push_back(mom1);
227 for(
G4int i = 0; i <
a; i++) {
228 G4int knd = i < z ? 1 : 2;
234 if (itry == itry_max)
G4cout <<
" BigBanger -> can not generate bang " <<
G4endl;
242 G4cout <<
" >>> G4BigBanger::generateMomentumModules" <<
G4endl;
254 G4double promax = maxProbability(a);
256 momModules.resize(a, 0.);
257 for(
G4int i = 0; i <
a; i++) {
258 momModules[i] = generateX(a, promax);
259 xtot += momModules[i];
262 G4cout <<
" i " << i <<
" x " << momModules[i] <<
G4endl;
267 momModules.push_back(0.5);
268 momModules.push_back(0.5);
271 for(
G4int i = 0; i <
a; i++) {
274 momModules[i] *= etot/xtot;
275 momModules[i] = std::sqrt(momModules[i] * (momModules[i] + 2.0 * mass));
278 G4cout <<
" i " << i <<
" pmod " << momModules[i] <<
G4endl;
291 if(x < 1.0 || x > 0.0) {
295 ekpr *= std::sqrt(1.0 - x) * theG4Pow->
powN((1.0 - x), (3*a-6)/2);
298 ekpr *= theG4Pow->
powN((1.0 - x), (3*a-5)/2);
310 return xProbability(2./3./(a-1.0), a);
316 const G4int itry_max = 1000;
320 while(itry < itry_max) {
324 if(xProbability(x, a) >= promax *
inuclRndm())
return x;
327 G4cout <<
" BigBanger -> can not generate x " <<
G4endl;
330 return maxProbability(a);
static G4Pow * GetInstance()
Hep3Vector boostVector() const
G4double powN(G4double x, G4int n) const
std::vector< ExP01TrackerHit * > a
static G4double getParticleMass(G4int type)
void getTargetData(const G4Fragment &target)
G4GLOB_DLL std::ostream G4cout
HepLorentzVector & boost(double, double, double)
G4LorentzVector generateWithRandomAngles(G4double p, G4double mass=0.)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
G4LorentzVector generateWithFixedTheta(G4double ct, G4double p, G4double mass=0.)
static constexpr double GeV
std::vector< G4InuclElementaryParticle >::iterator particleIterator
static constexpr double MeV
virtual G4bool validateOutput(const G4Fragment &target, G4CollisionOutput &output)
G4double bindingEnergy(G4int A, G4int Z)
virtual void deExcite(const G4Fragment &target, G4CollisionOutput &output)
G4GLOB_DLL std::ostream G4cerr