34 #define INCLXX_IN_GEANT4_MODE 1 
   38 #ifndef G4INCLCascade_hh 
   39 #define G4INCLCascade_hh 1 
   93       Config const * 
const theConfig;
 
  101       G4int minRemnantSize;
 
  113             outgoingParticles(n->getStore()->getOutgoingParticles()),
 
  115               for(
ParticleIter p=outgoingParticles.begin(), e=outgoingParticles.end(); 
p!=e; ++
p) {
 
  116                 particleMomenta.push_back((*p)->getMomentum());
 
  117                 particleKineticEnergies.push_back((*p)->getKineticEnergy());
 
  120               if(aPR && aPR->getA()>0) {
 
  121                 particleMomenta.push_back(aPR->getMomentum());
 
  122                 particleKineticEnergies.push_back(aPR->getKineticEnergy());
 
  123                 outgoingParticles.push_back(aPR);
 
  126           virtual ~RecoilFunctor() {}
 
  134             scaleParticleEnergies(x);
 
  135             return nucleus->getConservationBalance(theEventInfo,
true).energy;
 
  139           void cleanUp(
const G4bool success)
 const {
 
  141               scaleParticleEnergies(1.);
 
  148           ParticleList outgoingParticles;
 
  150           EventInfo 
const &theEventInfo;
 
  152           std::list<ThreeVector> particleMomenta;
 
  154           std::list<G4double> particleKineticEnergies;
 
  160           void scaleParticleEnergies(
const G4double rescale)
 const {
 
  162             ThreeVector pBalance = nucleus->getIncomingMomentum();
 
  163             std::list<ThreeVector>::const_iterator iP = particleMomenta.begin();
 
  164             std::list<G4double>::const_iterator iE = particleKineticEnergies.begin();
 
  165             for( 
ParticleIter i = outgoingParticles.begin(), e = outgoingParticles.end(); i!=e; ++i, ++iP, ++iE)
 
  167               const G4double mass = (*i)->getMass();
 
  168               const G4double newKineticEnergy = (*iE) * rescale;
 
  170               (*i)->setMomentum(*iP);
 
  171               (*i)->setEnergy(mass + newKineticEnergy);
 
  172               (*i)->adjustMomentumFromEnergy();
 
  174               pBalance -= (*i)->getMomentum();
 
  177             nucleus->setMomentum(pBalance);
 
  179             const G4double pRem2 = pBalance.mag2();
 
  180             const G4double recoilEnergy = pRem2/
 
  181               (std::sqrt(pRem2+remnantMass*remnantMass) + remnantMass);
 
  182             nucleus->setEnergy(remnantMass + recoilEnergy);
 
  187       class RecoilCMFunctor : 
public RootFunctor {
 
  193           RecoilCMFunctor(Nucleus * 
const n, 
const EventInfo &ei) :
 
  196             theIncomingMomentum(nucleus->getIncomingMomentum()),
 
  197             outgoingParticles(n->getStore()->getOutgoingParticles()),
 
  199               thePTBoostVector = nucleus->getIncomingMomentum()/nucleus->getInitialEnergy();
 
  200               for(
ParticleIter p=outgoingParticles.begin(), e=outgoingParticles.end(); 
p!=e; ++
p) {
 
  201                 (*p)->boost(thePTBoostVector);
 
  202                 particleCMMomenta.push_back((*p)->getMomentum());
 
  204               ProjectileRemnant * 
const aPR = n->getProjectileRemnant();
 
  205               if(aPR && aPR->getA()>0) {
 
  206                 aPR->boost(thePTBoostVector);
 
  207                 particleCMMomenta.push_back(aPR->getMomentum());
 
  208                 outgoingParticles.push_back(aPR);
 
  211           virtual ~RecoilCMFunctor() {}
 
  219             scaleParticleCMMomenta(x);
 
  220             return nucleus->getConservationBalance(theEventInfo,
true).energy;
 
  224           void cleanUp(
const G4bool success)
 const {
 
  226               scaleParticleCMMomenta(1.);
 
  233           ThreeVector thePTBoostVector;
 
  235           ThreeVector theIncomingMomentum;
 
  237           ParticleList outgoingParticles;
 
  239           EventInfo 
const &theEventInfo;
 
  241           std::list<ThreeVector> particleCMMomenta;
 
  247           void scaleParticleCMMomenta(
const G4double rescale)
 const {
 
  249             ThreeVector remnantMomentum = theIncomingMomentum;
 
  250             std::list<ThreeVector>::const_iterator iP = particleCMMomenta.begin();
 
  251             for( 
ParticleIter i = outgoingParticles.begin(), e = outgoingParticles.end(); i!=e; ++i, ++iP)
 
  253               (*i)->setMomentum(*iP * rescale);
 
  254               (*i)->adjustEnergyFromMomentum();
 
  255               (*i)->boost(-thePTBoostVector);
 
  257               remnantMomentum -= (*i)->getMomentum();
 
  260             nucleus->setMomentum(remnantMomentum);
 
  262             const G4double pRem2 = remnantMomentum.mag2();
 
  263             const G4double recoilEnergy = pRem2/
 
  264               (std::sqrt(pRem2+remnantMass*remnantMass) + remnantMass);
 
  265             nucleus->setEnergy(remnantMass + recoilEnergy);
 
  274       void rescaleOutgoingForRecoil();
 
  276 #ifndef INCLXX_IN_GEANT4_MODE 
  286       void globalConservationChecks(
G4bool afterRecoil);
 
  313       G4int makeProjectileRemnant();
 
  322       void makeCompoundNucleus();
 
  325       G4bool preCascade(ParticleSpecies 
const &projectileSpecies, 
const G4double kineticEnergy);
 
  337       void initMaxInteractionDistance(ParticleSpecies 
const &
p, 
const G4double kineticEnergy);
 
  344       void initUniverseRadius(ParticleSpecies 
const &
p, 
const G4double kineticEnergy, 
const G4int A, 
const G4int Z);
 
  347       void updateGlobalInfo();
 
INCL & operator=(const INCL &rhs)
Dummy assignment operator to silence Coverity warning. 
 
const GlobalInfo & getGlobalInfo() const 
 
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z)
 
G4int getTargetZ() const 
Get the target charge number. 
 
Class containing default actions to be performed at intermediate cascade steps. 
 
void finalizeGlobalInfo(Random::SeedVector const &initialSeeds)
 
INCL(Config const *const config)
 
Simple container for output of calculation-wide results. 
 
double A(double temperature)
 
Simple container for output of event results. 
 
G4int getTargetA() const 
Get the target mass number. 
 
const EventInfo & processEvent()
 
G4bool initializeTarget(const G4int A, const G4int Z)
 
ParticleSpecies getProjectileSpecies() const 
Get the projectile species. 
 
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei. 
 
RootFunctor(const G4double x0, const G4double x1)
 
ProjectileRemnant * getProjectileRemnant() const 
Get the projectile remnant. 
 
G4double getProjectileKineticEnergy() const 
Get the projectile kinetic energy. 
 
ParticleList::const_iterator ParticleIter
 
Static root-finder algorithm.