33 #define INCLXX_IN_GEANT4_MODE 1 
   64     for(std::map<long, Particle*>::const_iterator i=storedComponents.begin(); i!=storedComponents.end(); ++i) {
 
   66       EnergyLevelMap::iterator energyIter = theInitialEnergyLevels.find(i->first);
 
   68       const G4double energyLevel = energyIter->second;
 
   69       theInitialEnergyLevels.erase(energyIter);
 
   70       theInitialEnergyLevels[p->
getID()] = energyLevel;
 
   75     INCL_DEBUG(
"ProjectileRemnant object was reset:" << std::endl << 
print());
 
   81     INCL_DEBUG(
"The following Particle is about to be removed from the ProjectileRemnant:" 
   82         << std::endl << p->
print()
 
   83         << 
"theProjectileCorrection=" << theProjectileCorrection << std::endl);
 
   92 #if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE) 
  101       const G4double theProjectileCorrectionPerNucleon = theProjectileCorrection / 
particles.size();
 
  105         (*i)->setEnergy((*i)->getEnergy() + theProjectileCorrectionPerNucleon);
 
  106         (*i)->setMass((*i)->getInvariantMass());
 
  107 #if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE) 
  108         theTotalMomentum += (*i)->getMomentum();
 
  109         theTotalEnergy += (*i)->getEnergy();
 
  115     theEnergy -= oldEnergy - theProjectileCorrection;
 
  119     INCL_DEBUG(
"After Particle removal, the ProjectileRemnant looks like this:" 
  120         << std::endl << 
print());
 
  128     unsigned int accepted;
 
  133         G4bool isAccepted = addDynamicalSpectator(*
p);
 
  139     } 
while(accepted > 0);
 
  152       theNewMomentum += getStoredMomentum(*
p);
 
  153       theNewEnergy += (*p)->getEnergy();
 
  154       theNewA += (*p)->getA();
 
  155       theNewZ += (*p)->getZ();
 
  161     const G4double theNewEffectiveMass = theNewMass + theNewExcitationEnergy;
 
  165     if(theNewEnergy<theNewEffectiveMass) {
 
  166       INCL_WARN(
"Could not add all the dynamical spectators back into the projectile remnant." 
  167            << 
" Falling back to the \"most\" method." << std::endl);
 
  178     const G4double scalingFactorSquared = (theNewEnergy*theNewEnergy-theNewEffectiveMass*theNewEffectiveMass)/theNewMomentum.
mag2();
 
  179     const G4double scalingFactor = std::sqrt(scalingFactorSquared);
 
  180     INCL_DEBUG(
"Scaling factor for the projectile-remnant momentum = " << scalingFactor << std::endl);
 
  204       theNewMomentum += getStoredMomentum(*
p);
 
  205       theNewEnergy += (*p)->getEnergy();
 
  206       theNewA += (*p)->getA();
 
  207       theNewZ += (*p)->getZ();
 
  212     const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.
mag2();
 
  214     G4bool positiveExcitationEnergy = 
false;
 
  215     if(theNewInvariantMassSquared>=0.) {
 
  216       const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
 
  217       positiveExcitationEnergy = (theNewInvariantMass-theNewMass>-1.e-5);
 
  223     while(!positiveExcitationEnergy && !pL.empty()) {
 
  224       G4double maxExcitationEnergy = -1.E30;
 
  228       G4int bestA = -1, bestZ = -1;
 
  229       for(ParticleList::iterator 
p=pL.begin(), e=pL.end(); 
p!=e; ++
p) {
 
  232         const ThreeVector theNewerMomentum = theNewMomentum - getStoredMomentum(*
p);
 
  233         const G4double theNewerEnergy = theNewEnergy - (*p)->getEnergy();
 
  234         const G4int theNewerA = theNewA - (*p)->getA();
 
  235         const G4int theNewerZ = theNewZ - (*p)->getZ();
 
  238         const G4double theNewerInvariantMassSquared = theNewerEnergy*theNewerEnergy-theNewerMomentum.
mag2();
 
  240         if(theNewerInvariantMassSquared>=-1.e-5) {
 
  241           const G4double theNewerInvariantMass = std::sqrt(
std::max(0.,theNewerInvariantMassSquared));
 
  242           const G4double theNewerExcitationEnergy = theNewerInvariantMass-theNewerMass;
 
  245           if(theNewerExcitationEnergy>maxExcitationEnergy) {
 
  247             maxExcitationEnergy = theNewerExcitationEnergy;
 
  248             bestMomentum = theNewerMomentum;
 
  249             bestEnergy = theNewerEnergy;
 
  260       rejected.push_back(*best);
 
  262       theNewMomentum = bestMomentum;
 
  263       theNewEnergy = bestEnergy;
 
  267       if(maxExcitationEnergy>0.) {
 
  269         positiveExcitationEnergy = 
true;
 
  289     ThreeVector const &oldMomentum = getStoredMomentum(p);
 
  296     const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.
mag2();
 
  298     if(theNewInvariantMassSquared<0.)
 
  301     const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
 
  303     if(theNewInvariantMass-theNewMass<-1.e-5)
 
  316     const EnergyLevels theEnergyLevels = getPresentEnergyLevelsExcept(exceptID);
 
  317     return computeExcitationEnergy(theEnergyLevels);
 
  321     const EnergyLevels theEnergyLevels = getPresentEnergyLevelsWith(pL);
 
  322     return computeExcitationEnergy(theEnergyLevels);
 
  325   G4double ProjectileRemnant::computeExcitationEnergy(
const EnergyLevels &levels)
 const {
 
  330     const unsigned theNewA = levels.size();
 
  335     const G4double groundState = theGroundStateEnergies.at(theNewA-1);
 
  338     const G4double excitedState = std::accumulate(
 
  343     return excitedState-groundState;
 
  349       if((*p)->getID()!=exceptID) {
 
  350         EnergyLevelMap::const_iterator i = theInitialEnergyLevels.find((*p)->getID());
 
  352         theEnergyLevels.push_back(i->second);
 
  356     return theEnergyLevels;
 
  362       EnergyLevelMap::const_iterator i = theInitialEnergyLevels.find((*p)->getID());
 
  364       theEnergyLevels.push_back(i->second);
 
  367       EnergyLevelMap::const_iterator i = theInitialEnergyLevels.find((*p)->getID());
 
  369       theEnergyLevels.push_back(i->second);
 
  373     return theEnergyLevels;
 
G4int getA() const 
Returns the baryon number. 
 
G4int shuffleComponentsHelper(G4int range)
Helper function for ProjectileRemnant::shuffleStoredComponents. 
 
ParticleList addAllDynamicalSpectators(ParticleList pL)
Add back all dynamical spectators to the projectile remnant. 
 
const G4INCL::ThreeVector & getMomentum() const 
 
Class for constructing a projectile-like remnant. 
 
std::string print() const 
 
G4double getEnergy() const 
 
void reset()
Reset the projectile remnant to the state at the beginning of the cascade. 
 
G4double computeExcitationEnergyWith(const ParticleList &pL) const 
Compute the excitation energy if some nucleons are put back. 
 
UnorderedVector< Particle * > ParticleList
 
const G4ParticleDefinition const G4Material *G4double range
 
std::string print() const 
 
G4int getZ() const 
Returns the charge number. 
 
G4double computeExcitationEnergyExcept(const long exceptID) const 
Compute the excitation energy when a nucleon is removed. 
 
G4INCL::ThreeVector thePosition
 
void removeParticle(Particle *const p)
Remove a particle from the cluster components. 
 
ParticleList addDynamicalSpectators(ParticleList pL)
Add back dynamical spectators to the projectile remnant. 
 
T max(const T t1, const T t2)
brief Return the largest of the two arguments 
 
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei. 
 
void setTableMass()
Set the mass of the Particle to its table mass. 
 
ParticleList addMostDynamicalSpectators(ParticleList pL)
Add back dynamical spectators to the projectile remnant. 
 
void addParticle(Particle *const p)
 
std::vector< G4double > EnergyLevels
 
void removeParticle(Particle *const p, const G4double theProjectileCorrection)
Remove a nucleon from the projectile remnant. 
 
G4INCL::ThreeVector theMomentum
 
ParticleList::iterator ParticleMutableIter
 
G4double thePotentialEnergy
 
ParticleList::const_iterator ParticleIter