77 if (etot < 0.0) etot = 0.0;
80 G4cout <<
" BigBanger: target\n" << target
81 <<
"\n etot " << etot <<
G4endl;
86 PEXrest.
boost(-toTheLabFrame);
87 G4cout <<
" target rest frame: px " << PEXrest.
px() <<
" py "
88 << PEXrest.
py() <<
" pz " << PEXrest.
pz() <<
" E " << PEXrest.
e()
92 generateBangInSCM(etot,
A,
Z);
96 for(
G4int i = 0; i <
G4int(particles.size()); i++)
100 if (particles.empty()) {
101 G4cerr <<
" >>> G4BigBanger unable to process fragment "
115 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
119 mom.
boost(toTheLabFrame);
122 ipart->setMomentum(mom);
132 <<
" E " << totscm.
e() <<
" px " << totscm.
x()
133 <<
" py " << totscm.
y() <<
" pz " << totscm.
z() <<
G4endl;
135 <<
" E " <<
PEX.
e() - totlab.
e()
136 <<
" px " <<
PEX.
x() - totlab.
x()
137 <<
" py " <<
PEX.
y() - totlab.
y()
146 G4cout <<
" >>> G4BigBanger::generateBangInSCM" <<
G4endl;
150 const G4int itry_max = 1000;
159 G4int knd = (z>0) ? 1 : 2;
167 scm_momentums.reserve(a);
172 while(bad && itry < itry_max) {
174 scm_momentums.clear();
176 generateMomentumModules(etot, a, z);
180 scm_momentums.push_back(mom);
181 scm_momentums.push_back(-mom);
186 for(
G4int i = 0; i < a-2; i++) {
189 scm_momentums.push_back(mom);
195 G4double ct = -0.5*(tot_mod*tot_mod + momModules[a-2]*momModules[a-2]
196 - momModules[a-1]*momModules[a-1]) / tot_mod
201 if(std::fabs(ct) < ang_cut) {
207 G4double a_tr = std::sqrt(apr.
x()*apr.
x() + apr.
y()*apr.
y());
209 mom.
setX(mom2.
z()*apr.
x() + ( mom2.
x()*apr.
y() + mom2.
y()*apr.
z()*apr.
x())/a_tr);
210 mom.
setY(mom2.
z()*apr.
y() + (-mom2.
x()*apr.
x() + mom2.
y()*apr.
z()*apr.
y())/a_tr);
211 mom.
setZ(mom2.
z()*apr.
z() - mom2.
y()*a_tr);
213 scm_momentums.push_back(mom);
218 scm_momentums.push_back(mom1);
226 for(
G4int i = 0; i < a; i++) {
227 G4int knd = i < z ? 1 : 2;
237 scm_momentums[i].setE( 0.0 );
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;
301 if(x < 1.0 || x > 0.0) {
305 ekpr *= std::sqrt(1.0 - x) * theG4Pow->
powN((1.0 - x), (3*a-6)/2);
308 ekpr *= theG4Pow->
powN((1.0 - x), (3*a-5)/2);
320 return xProbability(2./3./(a-1.0), a);
326 const G4int itry_max = 1000;
330 while(itry < itry_max) {
334 if(xProbability(x, a) >= promax *
inuclRndm())
return x;
337 G4cout <<
" BigBanger -> can not generate x " <<
G4endl;
340 return maxProbability(a);
std::vector< G4InuclElementaryParticle >::iterator particleIterator
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
virtual void deExcite(const G4Fragment &target, G4CollisionOutput &output)
void getTargetData(const G4Fragment &target)
virtual G4bool validateOutput(const G4Fragment &target, G4CollisionOutput &output)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
static G4double getParticleMass(G4int type)
static G4Pow * GetInstance()
G4double powN(G4double x, G4int n) const
G4LorentzVector generateWithFixedTheta(G4double ct, G4double p, G4double mass=0.)
G4double bindingEnergy(G4int A, G4int Z)
G4LorentzVector generateWithRandomAngles(G4double p, G4double mass=0.)