99 collisionTime=deltaz/velocity;
100 distance_fast=position.
x()*position.
x() + position.
y()*position.
y();
108 collisionTime = (position * velocity) / velocity.
mag2();
109 position -= velocity * collisionTime;
110 distance_fast=position.
mag2();
115 if (collisionTime > 0)
118 if(0.7*
pi*distance_fast>maxCrossSection)
return time;
128 mom1 = toCMSFrame * mom1;
129 mom2 = toCMSFrame * mom2;
134 (toCMSFrame * coordinate2).vect());
140 G4double distance = pos * pos - (pos*
mom) * (pos*mom) / (mom.mag2());
148 if(
pi*distance>maxCrossSection)
return time;
154 pi*distance>maxChargedCrossSection)
return time;
160 sqrtS>1.91*
GeV &&
pi*distance>maxChargedCrossSection)
return time;
207 if ( totalCrossSection > 0 )
220 if (distance <= totalCrossSection /
pi)
222 time = collisionTime;
301 if (aCrossSection > 0.0)
305 #ifdef debug_G4Scatterer
306 G4cout <<
"be4 FinalState 1(p,e,m): "
317 if(!products || products->size() == 0)
return products;
319 #ifdef debug_G4Scatterer
326 #ifdef debug_G4Scatterer
327 G4cout <<
" FinalState 1: "
328 <<
final->Get4Momentum()<<
" "
329 <<
final->Get4Momentum().mag() ;
332 if(products->size() == 1)
return products;
333 final=products->operator[](1);
334 #ifdef debug_G4Scatterer
336 <<
final->Get4Momentum() <<
" "
337 <<
final->Get4Momentum().mag() <<
" " <<
G4endl;
340 final= products->operator[](0);
342 if(products->size()==2)
344 final=products->operator[](1);
345 pFinal +=
final->Get4Momentum();
348 #ifdef debug_G4Scatterer
349 if ( (pInitial-pFinal).mag() > 0.1*
MeV )
351 G4cout <<
"G4Scatterer: momentum imbalance, pInitial= " <<pInitial <<
" pFinal= " <<pFinal<<
G4endl;
356 for(
size_t hpw=0; hpw<products->size(); hpw++)
358 energyBalance-=products->operator[](hpw)->Get4Momentum().t();
359 pxBalance-=products->operator[](hpw)->Get4Momentum().vect().x();
360 pyBalance-=products->operator[](hpw)->Get4Momentum().vect().y();
361 pzBalance-=products->operator[](hpw)->Get4Momentum().vect().z();
362 chargeBalance-=
G4lrint(products->operator[](hpw)->GetDefinition()->GetPDGCharge());
363 baryonBalance-=products->operator[](hpw)->GetDefinition()->GetBaryonNumber();
365 if(std::getenv(
"ScattererEnergyBalanceCheck"))
366 std::cout <<
"DEBUGGING energy balance A: "
374 if(chargeBalance !=0 )
378 for(
size_t hpw=0; hpw<products->size(); hpw++)
380 G4cout << products->operator[](hpw)->GetDefinition()->GetParticleName()<<
G4endl;
383 "Problem in ChargeBalance");
405 collisionInCharge = component;
418 return collisionInCharge;
432 return aCrossSection;
439 std::vector<G4KineticTrack *> & someCandidates,
443 std::vector<G4KineticTrack *>::iterator j=someCandidates.begin();
444 for(; j != someCandidates.end(); ++j)
452 aTarget.push_back(*j);
463 std::vector<G4KineticTrack *> & theTargets)
466 return Scatter(*aProjectile, target_reloc);