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 DEBUG(
"ProjectileRemnant object was reset:" << std::endl <<
print());
81 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 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);
157 theNewMomentum += getStoredMomentum(*
p);
158 theNewEnergy += (*p)->getEnergy();
159 theNewA += (*p)->getA();
160 theNewZ += (*p)->getZ();
165 const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.
mag2();
167 G4bool positiveExcitationEnergy =
false;
168 if(theNewInvariantMassSquared>=0.) {
169 const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
170 positiveExcitationEnergy = (theNewInvariantMass-theNewMass>-1.e-5);
176 while(!positiveExcitationEnergy && !pL.empty()) {
177 G4double maxExcitationEnergy = -1.E30;
178 ParticleList::iterator best = pL.end();
181 G4int bestA = -1, bestZ = -1;
182 for(ParticleList::iterator
p=pL.begin();
p!=pL.end(); ++
p) {
185 const ThreeVector theNewerMomentum = theNewMomentum - getStoredMomentum(*
p);
186 const G4double theNewerEnergy = theNewEnergy - (*p)->getEnergy();
187 const G4int theNewerA = theNewA - (*p)->getA();
188 const G4int theNewerZ = theNewZ - (*p)->getZ();
191 const G4double theNewerInvariantMassSquared = theNewerEnergy*theNewerEnergy-theNewerMomentum.
mag2();
193 if(theNewerInvariantMassSquared>=-1.
e-5) {
194 const G4double theNewerInvariantMass = std::sqrt(std::max(0.,theNewerInvariantMassSquared));
195 const G4double theNewerExcitationEnergy = theNewerInvariantMass-theNewerMass;
198 if(theNewerExcitationEnergy>maxExcitationEnergy) {
200 maxExcitationEnergy = theNewerExcitationEnergy;
201 bestMomentum = theNewerMomentum;
202 bestEnergy = theNewerEnergy;
213 rejected.push_back(*best);
215 theNewMomentum = bestMomentum;
216 theNewEnergy = bestEnergy;
220 if(maxExcitationEnergy>0.) {
222 positiveExcitationEnergy =
true;
242 ThreeVector const &oldMomentum = getStoredMomentum(p);
249 const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.
mag2();
251 if(theNewInvariantMassSquared<0.)
254 const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
256 if(theNewInvariantMass-theNewMass<-1.
e-5)
276 const G4double groundState = theGroundStateEnergies.at(
theA-2);
280 const G4double excitedState = std::accumulate(
281 theEnergyLevels.begin(),
282 theEnergyLevels.end(),
285 return excitedState-groundState;