35#define INCLXX_IN_GEANT4_MODE 1
39#ifndef G4INCLCascade_hh
40#define G4INCLCascade_hh 1
94 Config const *
const theConfig;
101 G4int minRemnantSize;
113 outgoingParticles(n->getStore()->getOutgoingParticles()),
115 for(
ParticleIter p=outgoingParticles.begin(); p!=outgoingParticles.end(); ++p) {
116 particleMomenta.push_back((*p)->getMomentum());
117 particleKineticEnergies.push_back((*p)->getKineticEnergy());
120 virtual ~RecoilFunctor() {}
128 scaleParticleEnergies(x);
133 void cleanUp(
const G4bool success)
const {
135 scaleParticleEnergies(1.);
144 EventInfo
const &theEventInfo;
146 std::list<ThreeVector> particleMomenta;
148 std::list<G4double> particleKineticEnergies;
154 void scaleParticleEnergies(
const G4double rescale)
const {
156 ThreeVector pBalance = nucleus->getIncomingMomentum();
157 std::list<ThreeVector>::const_iterator iP = particleMomenta.begin();
158 std::list<G4double>::const_iterator iE = particleKineticEnergies.begin();
159 for(
ParticleIter i = outgoingParticles.begin(); i != outgoingParticles.end(); ++i, ++iP, ++iE)
161 const G4double mass = (*i)->getMass();
162 const G4double newKineticEnergy = (*iE) * rescale;
164 (*i)->setMomentum(*iP);
165 (*i)->setEnergy(mass + newKineticEnergy);
166 (*i)->adjustMomentumFromEnergy();
168 pBalance -= (*i)->getMomentum();
171 nucleus->setMomentum(pBalance);
173 const G4double pRem2 = pBalance.mag2();
174 const G4double recoilEnergy = pRem2/
175 (std::sqrt(pRem2+remnantMass*remnantMass) + remnantMass);
176 nucleus->setEnergy(remnantMass + recoilEnergy);
181 class RecoilCMFunctor :
public RootFunctor {
187 RecoilCMFunctor(Nucleus *
const n,
const EventInfo &ei) :
190 theIncomingMomentum(nucleus->getIncomingMomentum()),
191 outgoingParticles(
n->getStore()->getOutgoingParticles()),
193 thePTBoostVector = nucleus->getIncomingMomentum()/nucleus->getInitialEnergy();
194 for(
ParticleIter p=outgoingParticles.begin(); p!=outgoingParticles.end(); ++p) {
195 (*p)->boost(thePTBoostVector);
196 particleCMMomenta.push_back((*p)->getMomentum());
199 virtual ~RecoilCMFunctor() {}
207 scaleParticleCMMomenta(x);
208 return nucleus->getConservationBalance(theEventInfo,
true).energy;
212 void cleanUp(
const G4bool success)
const {
214 scaleParticleCMMomenta(1.);
221 ThreeVector thePTBoostVector;
223 ThreeVector theIncomingMomentum;
227 EventInfo
const &theEventInfo;
229 std::list<ThreeVector> particleCMMomenta;
235 void scaleParticleCMMomenta(
const G4double rescale)
const {
237 ThreeVector remnantMomentum = theIncomingMomentum;
238 std::list<ThreeVector>::const_iterator iP = particleCMMomenta.begin();
239 for(
ParticleIter i = outgoingParticles.begin(); i != outgoingParticles.end(); ++i, ++iP)
241 (*i)->setMomentum(*iP * rescale);
242 (*i)->adjustEnergyFromMomentum();
243 (*i)->boost(-thePTBoostVector);
245 remnantMomentum -= (*i)->getMomentum();
248 nucleus->setMomentum(remnantMomentum);
250 const G4double pRem2 = remnantMomentum.mag2();
251 const G4double recoilEnergy = pRem2/
252 (std::sqrt(pRem2+remnantMass*remnantMass) + remnantMass);
253 nucleus->setEnergy(remnantMass + recoilEnergy);
262 void rescaleOutgoingForRecoil();
264#ifndef INCLXX_IN_GEANT4_MODE
274 void globalConservationChecks(
G4bool afterRecoil);
301 G4int makeProjectileRemnant();
310 void makeCompoundNucleus();
313 G4bool preCascade(ParticleSpecies
const projectileSpecies,
const G4double kineticEnergy);
325 void initMaxInteractionDistance(ParticleSpecies
const &p,
const G4double kineticEnergy);
332 void initUniverseRadius(ParticleSpecies
const &p,
const G4double kineticEnergy,
const G4int A,
const G4int Z);
Simple container for output of event results.
Simple container for output of calculation-wide results.
Static root-finder algorithm.
G4int getTargetA() const
Get the target mass number.
ParticleSpecies getProjectileSpecies() const
Get the projectile species.
std::string const echo() const
Echo the input options.
G4int getTargetZ() const
Get the target charge number.
G4float getProjectileKineticEnergy() const
Get the projectile kinetic energy.
G4bool initializeTarget(const G4int A, const G4int Z)
const EventInfo & processEvent()
const GlobalInfo & getGlobalInfo() const
void finalizeGlobalInfo()
std::string configToString()
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z)
ConservationBalance getConservationBalance(EventInfo const &theEventInfo, const G4bool afterRecoil) const
Compute charge, mass, energy and momentum balance.
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
RootFunctor(const G4double x0, const G4double x1)
std::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter