34 #define INCLXX_IN_GEANT4_MODE 1 45 #ifndef G4INCLNucleus_hh 46 #define G4INCLNucleus_hh 1 67 theInitialZ(charge), theInitialA(mass),
68 theNpInitial(0), theNnInitial(0),
69 initialInternalEnergy(0.),
70 incomingAngularMomentum(0.,0.,0.), incomingMomentum(0.,0.,0.),
71 initialCenterOfMass(0.,0.,0.),
75 theUniverseRadius(universeRadius),
76 isNucleusNucleus(false),
77 theProjectileRemnant(NULL),
141 for(
ParticleIter iter=created.begin(),
e=created.end(); iter!=
e; ++iter) {
143 if(!(*iter)->isOutOfWell()) {
144 totalEnergy += (*iter)->getEnergy() - (*iter)->getPotentialEnergy();
149 for(
ParticleIter iter=deleted.begin(),
e=deleted.end(); iter!=
e; ++iter) {
154 for(
ParticleIter iter=modified.begin(),
e=modified.end(); iter!=
e; ++iter) {
156 totalEnergy += (*iter)->getEnergy() - (*iter)->getPotentialEnergy();
160 for(
ParticleIter iter=out.begin(),
e=out.end(); iter!=
e; ++iter) {
161 if((*iter)->isCluster()) {
164 #ifdef INCLXX_IN_GEANT4_MODE 174 totalEnergy += (*iter)->getEnergy();
175 theA -= (*iter)->getA();
176 theZ -= (*iter)->getZ();
182 for(
ParticleIter iter=entering.begin(),
e=entering.end(); iter!=
e; ++iter) {
184 totalEnergy += (*iter)->getEnergy() - (*iter)->getPotentialEnergy();
190 INCL_DEBUG(
"A Particle is entering below the Fermi sea:" <<
'\n' << finalstate->
print() <<
'\n');
193 for(
ParticleIter iter=entering.begin(),
e=entering.end(); iter!=
e; ++iter) {
200 INCL_ERROR(
"Energy nonconservation! Energy at the beginning of the event = " 202 <<
" and after interaction = " 203 << totalEnergy <<
'\n' 204 << finalstate->
print());
209 INCL_WARN(
"Useless Nucleus::propagateParticles -method called." <<
'\n');
216 if((*p)->isNucleon())
217 totalEnergy += (*p)->getKineticEnergy() - (*p)->getPotentialEnergy();
218 else if((*p)->isResonance())
221 totalEnergy += (*p)->getEnergy() - (*p)->getPotentialEnergy();
241 for(
ParticleIter p=outgoing.begin(),
e=outgoing.end(); p!=
e; ++p) {
243 theSpin -= (*p)->getAngularMomentum();
264 const G4double mass = (*p)->getMass();
265 cm += (*p)->getPosition() * mass;
281 std::stringstream ss;
282 ss <<
"Particles in the nucleus:" <<
'\n' 283 <<
"Inside:" <<
'\n';
287 ss <<
"index = " << counter <<
'\n' 291 ss <<
"Outgoing:" <<
'\n';
303 if((*i)->isDelta()) deltas.push_back((*i));
305 if(deltas.empty())
return false;
308 INCL_DEBUG(
"Decay outgoing delta particle:" <<
'\n' 309 << (*i)->print() <<
'\n');
311 const G4double deltaMass = (*i)->getMass();
316 (*i)->setEnergy((*i)->getMass());
329 newMomentum *= decayMomentum / newMomentum.
mag();
340 nucleon->
boost(beta);
359 const G4bool unphysicalRemnant = (theZ<0 || theZ>
theA);
367 if((*i)->isDelta()) deltas.push_back((*i));
371 INCL_DEBUG(
"Decay inside delta particle:" <<
'\n' 372 << (*i)->print() <<
'\n');
378 if(unphysicalRemnant) {
379 INCL_WARN(
"Forcing delta decay inside an unphysical remnant (A=" <<
theA 380 <<
", Z=" <<
theZ <<
"). Might lead to energy-violation warnings." 399 if(unphysicalRemnant) {
400 INCL_DEBUG(
"Remnant is unphysical: Z=" <<
theZ <<
", A=" <<
theA <<
", emitting all the pions" <<
'\n');
411 if((*i)->isCluster()) clusters.push_back((*i));
413 if(clusters.empty())
return false;
415 for(
ParticleIter i=clusters.begin(),
e=clusters.end(); i!=
e; ++i) {
418 #ifdef INCLXX_IN_GEANT4_MODE 424 for(
ParticleIter j=decayProducts.begin(), end=decayProducts.end(); j!=end; ++j)
436 for(
ParticleIter j=decayProducts.begin(),
e=decayProducts.end(); j!=
e; ++j)
447 INCL_WARN(
"Forcing emissions of all pions in the nucleus." <<
'\n');
450 const G4double tinyPionEnergy = 0.1;
458 INCL_DEBUG(
"Forcing emission of the following particle: " 459 << thePion->
print() <<
'\n');
465 if(kineticEnergyOutside > 0.0)
472 toEject.push_back(thePion);
487 if(nEventCollisions==0 && nEventDecays==0 && nEventClusters==0)
523 if(outgoing.size() == 2) {
525 INCL_DEBUG(
"Two particles in the outgoing channel, applying exact two-body kinematics" <<
'\n');
529 Particle *p1 = outgoing.front(), *p2 = outgoing.back();
532 p1->
boost(aBoostVector);
540 p2->adjustEnergyFromMomentum();
542 p1->
boost(-aBoostVector);
543 p2->boost(-aBoostVector);
547 INCL_DEBUG(
"Trying to adjust final-state momenta to achieve energy and momentum conservation" <<
'\n');
549 const G4int maxIterations=8;
551 G4double val=1.E+100, oldVal=1.E+100, oldOldVal=1.E+100, oldOldOldVal;
553 std::vector<ThreeVector> minMomenta;
556 minMomenta.reserve(outgoing.size());
559 totalMomentum.
setX(0.0);
560 totalMomentum.
setY(0.0);
561 totalMomentum.
setZ(0.0);
563 totalMomentum += (*i)->getMomentum();
568 totalEnergy += (*i)->getEnergy();
571 for(
G4int iterations=0; iterations < maxIterations; ++iterations) {
574 oldOldOldVal = oldOldVal;
578 if(iterations%2 == 0) {
584 pOldTot += (*i)->getMomentum().
mag();
585 for(
ParticleIter i=outgoing.begin(),
e=outgoing.end(); i!=
e; ++i) {
587 (*i)->setMomentum(mom + deltaP*mom.
mag()/pOldTot);
588 (*i)->adjustEnergyFromMomentum();
594 for(
ParticleIter i=outgoing.begin(),
e=outgoing.end(); i!=
e; ++i) {
596 G4double pScale = ((*i)->getEnergy()*energyScale - std::pow((*i)->getMass(),2))/mom.
mag2();
598 (*i)->setEnergy((*i)->getEnergy()*energyScale);
599 (*i)->adjustMomentumFromEnergy();
605 totalMomentum.
setX(0.0);
606 totalMomentum.
setY(0.0);
607 totalMomentum.
setZ(0.0);
609 for(
ParticleIter i=outgoing.begin(),
e=outgoing.end(); i!=
e; ++i) {
610 totalMomentum += (*i)->getMomentum();
611 totalEnergy += (*i)->getEnergy();
617 INCL_DEBUG(
"Merit function: val=" << val <<
", oldVal=" << oldVal <<
", oldOldVal=" << oldOldVal <<
", oldOldOldVal=" << oldOldOldVal <<
'\n');
621 INCL_DEBUG(
"New minimum found, storing the particle momenta" <<
'\n');
624 minMomenta.push_back((*i)->getMomentum());
628 if(val > oldOldVal && oldVal > oldOldOldVal) {
629 INCL_DEBUG(
"Search is diverging, breaking out of the iteration loop: val=" << val <<
", oldVal=" << oldVal <<
", oldOldVal=" << oldOldVal <<
", oldOldOldVal=" << oldOldOldVal <<
'\n');
639 std::vector<ThreeVector>::const_iterator
v = minMomenta.begin();
640 for(
ParticleIter i=outgoing.begin(),
e=outgoing.end(); i!=
e; ++i, ++
v) {
641 (*i)->setMomentum(*v);
642 (*i)->adjustEnergyFromMomentum();
652 G4bool isNucleonAbsorption =
false;
654 G4bool isPionAbsorption =
false;
660 isPionAbsorption =
true;
671 if(outgoingParticles.size() == 0 &&
674 isNucleonAbsorption =
true;
681 for(
ParticleIter i=outgoingParticles.begin(),
e=outgoingParticles.end(); i!=
e; ++i ) {
684 if(isPionAbsorption) {
686 isPionAbsorption =
false;
690 eventInfo->
A[eventInfo->
nParticles] = (*i)->getA();
691 eventInfo->
Z[eventInfo->
nParticles] = (*i)->getZ();
693 eventInfo->
EKin[eventInfo->
nParticles] = (*i)->getKineticEnergy();
701 eventInfo->
history.push_back(
"");
713 if(std::abs(eStar)<1
E-10)
717 INCL_WARN(
"Negative excitation energy in projectile-like remnant! EStarRem = " << eventInfo->
EStarRem[eventInfo->
nRemnants] <<
'\n');
744 INCL_WARN(
"Negative excitation energy in target-like remnant! EStarRem = " << eventInfo->
EStarRem[eventInfo->
nRemnants] <<
'\n');
785 theBalance.
Z = theEventInfo.
Zp + theEventInfo.
Zt;
786 theBalance.
A = theEventInfo.
Ap + theEventInfo.
At;
793 for(
ParticleIter i=outgoingParticles.begin(),
e=outgoingParticles.end(); i!=
e; ++i ) {
794 theBalance.
Z -= (*i)->getZ();
795 theBalance.
A -= (*i)->getA();
798 theBalance.
energy -= (*i)->getEnergy();
799 theBalance.
momentum -= (*i)->getMomentum();
814 theBalance.
Z -=
getZ();
815 theBalance.
A -=
getA();
843 const G4double anExcitationEnergy = aMass
Short_t Zp
Charge number of the projectile nucleus.
void initializeParticles()
Short_t nRemnants
Number of remnants.
Bool_t nucleonAbsorption
True if the event is a nucleon absorption.
void setMass(G4double mass)
ThreeVector incomingMomentum
G4double computeTotalEnergy() const
Compute the current total energy.
Simple class implementing De Jong's spin model for nucleus-nucleus collisions.
NuclearDensity const * createDensity(const G4int A, const G4int Z)
ThreeVector incomingAngularMomentum
Int_t nEnergyViolationInteraction
Number of attempted collisions/decays for which the energy-conservation algorithm failed to find a so...
Float_t firstCollisionTime
Time of the first collision [fm/c].
G4double getExcitationEnergy() const
Get the excitation energy of the cluster.
Float_t emissionTime[maxSizeParticles]
Emission time [fm/c].
G4double getEmissionTime()
Int_t nCollisions
Number of accepted two-body collisions.
G4double getMass() const
Get the cached particle mass.
Float_t py[maxSizeParticles]
Particle momentum, y component [MeV/c].
G4bool decayOutgoingClusters()
Force the decay of unstable outgoing clusters.
Float_t firstCollisionXSec
Cross section of the first collision (mb)
G4bool isEventTransparent() const
Is the event transparent?
void setEmissionTime(G4double t)
Static class for carrying out cluster decays.
G4int getAcceptedDecays() const
void computeOneNucleonRecoilKinematics()
Compute the recoil kinematics for a 1-nucleon remnant.
ParticleList const & getOutgoingParticles() const
void applyFinalState(FinalState *)
PotentialType getPotentialType() const
Get the type of the potential for nucleons.
const G4double hc
[MeV*fm]
G4double getCurrentTime() const
void boost(const ThreeVector &aBoostVector)
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
Bool_t forcedCompoundNucleus
True if the event is a forced CN.
std::string print() const
G4double initialInternalEnergy
Float_t jzRem[maxSizeRemnants]
Remnant angular momentum, z component [ ].
ThreeVector const & getSpin() const
Get the spin of the nucleus.
G4double computeExcitationEnergy() const
Compute the current excitation energy.
Int_t nBlockedCollisions
Number of two-body collisions blocked by Pauli or CDPP.
Struct for conservation laws.
G4double getSeparationEnergy(const Particle *const p) const
Return the separation energy for a particle.
Bool_t pionAbsorption
True if the event is a pion absorption.
G4double toDegrees(G4double radians)
Float_t EKin[maxSizeParticles]
Particle kinetic energy [MeV].
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
G4int getA() const
Returns the baryon number.
G4int getBlockedCollisions() const
Float_t JRem[maxSizeRemnants]
Remnant spin [ ].
G4int getZ() const
Returns the charge number.
G4double computeSeparationEnergyBalance() const
Outgoing - incoming separation energies.
Int_t nReflectionAvatars
Number of reflection avatars.
G4double getKineticEnergy() const
Get the particle kinetic energy.
Float_t EKinRem[maxSizeRemnants]
Remnant kinetic energy [MeV].
void setProtonSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
Float_t pyRem[maxSizeRemnants]
Remnant momentum, y component [MeV/c].
Int_t nCollisionAvatars
Number of collision avatars.
Float_t pz[maxSizeParticles]
Particle momentum, z component [MeV/c].
std::string print() const
void updatePotentialEnergy(Particle *p) const
Update the particle potential energy.
Short_t At
Mass number of the target nucleus.
void setY(G4double ay)
Set the y coordinate.
G4double getInitialEnergy() const
Get the initial energy.
void setEnergy(G4double energy)
Short_t ZRem[maxSizeRemnants]
Remnant charge number.
Short_t ARem[maxSizeRemnants]
Remnant mass number.
Short_t Zt
Charge number of the target nucleus.
void removeScheduledAvatars()
Remove avatars that have been scheduled.
Float_t theta[maxSizeParticles]
Particle momentum polar angle [radians].
void useFusionKinematics()
Adjust the kinematics for complete-fusion events.
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
G4bool decayOutgoingDeltas()
Force the decay of outgoing deltas.
Short_t Z[maxSizeParticles]
Particle charge number.
ParticleList const & getOutgoingParticles() const
void setDensity(NuclearDensity const *const d)
Setter for theDensity.
G4int getEnergyViolationInteraction() const
Short_t nParticles
Number of particles in the final state.
G4bool nucleon(G4int ityp)
void particleHasBeenDestroyed(Particle *const)
G4double getFirstCollisionTime() const
Float_t jxRem[maxSizeRemnants]
Remnant angular momentum, x component [ ].
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
ParticleList const & getDestroyedParticles() const
void particleHasBeenEjected(Particle *const)
G4double getExcitationEnergy() const
Get the excitation energy of the nucleus.
Float_t pzRem[maxSizeRemnants]
Remnant momentum, z component [MeV/c].
G4int getAcceptedCollisions() const
G4bool isDelta() const
Is it a Delta?
NuclearDensity const * theDensity
Pointer to the NuclearDensity object.
void setPotentialEnergy(G4double v)
Set the particle potential energy.
Float_t EStarRem[maxSizeRemnants]
Remnant excitation energy [MeV].
virtual G4double getTableMass() const
Get the tabulated particle mass.
ParticleList const & getParticles() const
G4bool hasRemnant() const
Does the nucleus give a cascade remnant?
G4int getAvatars(AvatarType type) const
Int_t nDecayAvatars
Number of decay avatars.
void deleteProjectileRemnant()
Delete the projectile remnant.
G4INCL::ThreeVector thePosition
G4bool decayMe()
Force the phase-space decay of the Nucleus.
Float_t jyRem[maxSizeRemnants]
Remnant angular momentum, y component [ ].
ParticleSampler * theParticleSampler
Float_t firstCollisionSpectatorPosition
Position of the spectator on the first collision (fm)
Float_t phiRem[maxSizeRemnants]
Remnant momentum azimuthal angle [radians].
Int_t nBlockedDecays
Number of decays blocked by Pauli or CDPP.
ParticleList const & getEnteringParticles() const
ParticleList const & getParticles() const
G4bool getPionPotential() const
Do we want the pion potential?
G4int getBlockedDecays() const
Float_t pxRem[maxSizeRemnants]
Remnant momentum, x component [MeV/c].
Short_t A[maxSizeParticles]
Particle mass number.
Int_t nDecays
Number of accepted Delta decays.
Bool_t firstCollisionIsElastic
True if the first collision was elastic.
G4double theExcitationEnergy
void particleHasBeenUpdated(Particle *const)
Notify the Store about a particle update.
ThreeVector computeCenterOfMass() const
Compute the current center-of-mass position.
void propagateParticles(G4double step)
G4bool decayInsideDeltas()
Force the decay of deltas inside the nucleus.
void finalizeProjectileRemnant(const G4double emissionTime)
Finalise the projectile remnant.
G4double getPotentialEnergy() const
Get the particle potential energy.
NuclearPotential::INuclearPotential const * thePotential
Pointer to the NuclearPotential object.
G4double getFirstCollisionSpectatorPosition() const
void emitInsidePions()
Force emission of all pions inside the nucleus.
G4double getFirstCollisionXSec() const
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
void setTableMass()
Set the mass of the Particle to its table mass.
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
FinalStateValidity getValidity() const
G4bool hasPionPotential() const
Do we have a pion potential?
void setPotential(NuclearPotential::INuclearPotential const *const p)
Setter for thePotential.
Float_t thetaRem[maxSizeRemnants]
Remnant momentum polar angle [radians].
FinalState * getFinalState()
void fillEventInfo(EventInfo *eventInfo)
ParticleList const & getModifiedParticles() const
G4INCL::ThreeVector theMomentum
void setX(G4double ax)
Set the x coordinate.
G4double getFirstCollisionSpectatorMomentum() const
void insertParticle(Particle *p)
Insert a new particle (e.g. a projectile) in the nucleus.
Float_t phi[maxSizeParticles]
Particle momentum azimuthal angle [radians].
G4int getEmittedClusters() const
Nucleus(G4int mass, G4int charge, Config const *const conf, const G4double universeRadius=-1.)
virtual G4double getTableMass() const
Get the real particle mass.
void setZ(G4double az)
Set the z coordinate.
const G4INCL::ThreeVector & getMomentum() const
void computeRecoilKinematics()
Compute the recoil momentum and spin of the nucleus.
Float_t firstCollisionSpectatorMomentum
Momentum of the spectator on the first collision (fm)
G4double getInvariantMass() const
Get the the particle invariant mass.
ThreeVector initialCenterOfMass
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
const ThreeVector & getIncomingMomentum() const
Get the incoming momentum vector.
void addToOutgoing(Particle *p)
add the particle to the outgoing particle list.
ConservationBalance getConservationBalance(EventInfo const &theEventInfo, const G4bool afterRecoil) const
Compute charge, mass, energy and momentum balance.
Float_t px[maxSizeParticles]
Particle momentum, x component [MeV/c].
INuclearPotential const * createPotential(const PotentialType type, const G4int theA, const G4int theZ, const G4bool pionPotential)
Create an INuclearPotential object.
Short_t Ap
Mass number of the projectile nucleus.
Short_t nCascadeParticles
Number of cascade particles.
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
G4bool getFirstCollisionIsElastic() const
const G4double effectiveNucleonMass
ProjectileRemnant * theProjectileRemnant
Pointer to the quasi-projectile.
Short_t origin[maxSizeParticles]
Origin of the particle.
#define INCL_DATABLOCK(x)
void setNeutronSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
ParticleList::const_iterator ParticleIter
ParticleList const & getCreatedParticles() const
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent) const
Computes correction on the emission Q-value.
Int_t projectileType
Projectile particle type.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
G4double getTotalEnergyBeforeInteraction() const
G4double theUniverseRadius
The radius of the universe.
std::vector< std::string > history
History of the particle.