34 #define INCLXX_IN_GEANT4_MODE 1
65 const G4double energyLevel = energyIter->second;
79 INCL_DEBUG(
"The following Particle is about to be removed from the ProjectileRemnant:"
81 <<
"theProjectileCorrection=" << theProjectileCorrection <<
'\n');
90 #if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE)
99 const G4double theProjectileCorrectionPerNucleon = theProjectileCorrection /
particles.size();
103 (*i)->setEnergy((*i)->getEnergy() + theProjectileCorrectionPerNucleon);
104 (*i)->setMass((*i)->getInvariantMass());
105 #if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE)
106 theTotalMomentum += (*i)->getMomentum();
107 theTotalEnergy += (*i)->getEnergy();
113 theEnergy -= oldEnergy - theProjectileCorrection;
117 INCL_DEBUG(
"After Particle removal, the ProjectileRemnant looks like this:"
126 unsigned int accepted;
127 unsigned long loopCounter = 0;
128 const unsigned long maxLoopCounter = 10000000;
140 }
while(loopCounter<maxLoopCounter && accepted > 0);
155 theNewEnergy += (*p)->getEnergy();
156 theNewA += (*p)->getA();
157 theNewZ += (*p)->getZ();
158 theNewS += (*p)->getS();
164 const G4double theNewEffectiveMass = theNewMass + theNewExcitationEnergy;
168 if(theNewEnergy<theNewEffectiveMass) {
169 INCL_WARN(
"Could not add all the dynamical spectators back into the projectile remnant."
170 <<
" Falling back to the \"most\" method." <<
'\n');
181 const G4double scalingFactorSquared = (theNewEnergy*theNewEnergy-theNewEffectiveMass*theNewEffectiveMass)/theNewMomentum.
mag2();
182 const G4double scalingFactor = std::sqrt(scalingFactorSquared);
183 INCL_DEBUG(
"Scaling factor for the projectile-remnant momentum = " << scalingFactor <<
'\n');
210 theNewEnergy += (*p)->getEnergy();
211 theNewA += (*p)->getA();
212 theNewZ += (*p)->getZ();
213 theNewS += (*p)->getS();
218 const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.
mag2();
220 G4bool positiveExcitationEnergy =
false;
221 if(theNewInvariantMassSquared>=0.) {
222 const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
223 positiveExcitationEnergy = (theNewInvariantMass-theNewMass>-1.e-5);
229 while(!positiveExcitationEnergy && !pL.empty()) {
230 G4double maxExcitationEnergy = -1.E30;
234 G4int bestA = -1, bestZ = -1, bestS = 0;
235 for(ParticleList::iterator
p=pL.begin(),
e=pL.end();
p!=
e; ++
p) {
239 const G4double theNewerEnergy = theNewEnergy - (*p)->getEnergy();
240 const G4int theNewerA = theNewA - (*p)->getA();
241 const G4int theNewerZ = theNewZ - (*p)->getZ();
242 const G4int theNewerS = theNewS - (*p)->getS();
245 const G4double theNewerInvariantMassSquared = theNewerEnergy*theNewerEnergy-theNewerMomentum.
mag2();
247 if(theNewerInvariantMassSquared>=-1.
e-5) {
248 const G4double theNewerInvariantMass = std::sqrt(
std::max(0.,theNewerInvariantMassSquared));
249 const G4double theNewerExcitationEnergy = ((theNewerA>1) ? theNewerInvariantMass-theNewerMass : 0.);
252 if(theNewerExcitationEnergy>maxExcitationEnergy) {
254 maxExcitationEnergy = theNewerExcitationEnergy;
255 bestMomentum = theNewerMomentum;
256 bestEnergy = theNewerEnergy;
268 rejected.push_back(*best);
270 theNewMomentum = bestMomentum;
271 theNewEnergy = bestEnergy;
276 if(maxExcitationEnergy>0.) {
278 positiveExcitationEnergy =
true;
306 const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.
mag2();
308 if(theNewInvariantMassSquared<0.)
311 const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
313 if(theNewInvariantMass-theNewMass<-1.
e-5)
340 const unsigned theNewA = levels.size();
348 const G4double excitedState = std::accumulate(
353 return excitedState-groundState;
359 if((*p)->getID()!=exceptID) {
362 theEnergyLevels.push_back(i->second);
366 return theEnergyLevels;
374 theEnergyLevels.push_back(i->second);
379 theEnergyLevels.push_back(i->second);
383 return theEnergyLevels;