34 #define INCLXX_IN_GEANT4_MODE 1 49 #include "G4INCLPauliBlocking.hh" 51 #include "G4INCLCrossSections.hh" 69 #include "G4INCLCascadeAction.hh" 79 :propagationModel(0), theA(208), theZ(82),
80 targetInitSuccess(false),
82 maxUniverseRadius(0.),
83 maxInteractionDistance(0.),
84 fixedImpactParameter(0.),
87 forceTransparent(false),
91 #ifdef INCLXX_IN_GEANT4_MODE 93 #else // INCLXX_IN_GEANT4_MODE 95 #endif // INCLXX_IN_GEANT4_MODE 143 #ifndef INCLXX_IN_GEANT4_MODE 158 #ifndef INCLXX_IN_GEANT4_MODE 159 NuclearMassTable::deleteTable();
167 #ifndef INCLXX_IN_GEANT4_MODE 168 Logger::deleteLoggerSlave();
179 if(A < 0 || A > 300 || Z < 1 || Z > 200) {
180 INCL_ERROR(
"Unsupported target: A = " << A <<
" Z = " << Z <<
'\n' 181 <<
"Target configuration rejected." <<
'\n');
185 (projectileSpecies.
theZ==projectileSpecies.
theA || projectileSpecies.
theZ==0)) {
186 INCL_ERROR(
"Unsupported projectile: A = " << projectileSpecies.
theA <<
" Z = " << projectileSpecies.
theZ <<
'\n' 187 <<
"Projectile configuration rejected." <<
'\n');
217 if(projectileSpecies.
theA > 0)
246 INCL_WARN(
"Target initialisation failed for A=" << targetA <<
", Z=" << targetZ <<
'\n');
295 INCL_DEBUG(
"Selected impact parameter: " << impactParameter <<
'\n');
301 if(effectiveImpactParameter < 0.) {
318 unsigned long loopCounter = 0;
319 const unsigned long maxLoopCounter = 10000000;
333 if(avatar == 0)
break;
368 INCL_DEBUG(
"Trying compound nucleus" <<
'\n');
372 #ifndef INCLXX_IN_GEANT4_MODE 382 if(projectileRemnant) {
410 INCL_DEBUG(
"Cascade resulted in complete fusion, using realistic fusion kinematics" <<
'\n');
416 INCL_WARN(
"Complete-fusion kinematics yields negative excitation energy, returning a transparent!" <<
'\n');
432 INCL_ERROR(
"Computing one-nucleon recoil kinematics. We should never be here nowadays, cascade should stop earlier than this." <<
'\n');
436 #ifndef INCLXX_IN_GEANT4_MODE 438 globalConservationChecks(
false);
450 #ifndef INCLXX_IN_GEANT4_MODE 452 globalConservationChecks(
true);
491 std::vector<Particle *> shuffledComponents(initialProjectileComponents.begin(), initialProjectileComponents.end());
493 std::random_shuffle(shuffledComponents.begin(), shuffledComponents.end(),
Random::getAdapter());
496 G4bool atLeastOneNucleonEntering =
false;
497 for(std::vector<Particle*>::const_iterator p=shuffledComponents.begin(),
e=shuffledComponents.end(); p!=
e; ++p) {
501 (*p)->getPropagationVelocity(),
503 if(!intersectionInteractionDistance.
exists)
507 atLeastOneNucleonEntering =
true;
520 theCNZ += (*p)->getZ();
530 if(!success || !atLeastOneNucleonEntering) {
531 INCL_DEBUG(
"No nucleon entering in forced CN, forcing a transparent" <<
'\n');
541 theCNEnergy -= theProjectileRemnant->
getEnergy();
542 theCNMomentum -= theProjectileRemnant->
getMomentum();
553 const G4double theCNInvariantMassSquared = theCNEnergy*theCNEnergy-theCNMomentum.
mag2();
554 if(theCNInvariantMassSquared<0.) {
559 const G4double theCNExcitationEnergy = std::sqrt(theCNInvariantMassSquared) - theCNMass;
560 if(theCNExcitationEnergy<0.) {
562 INCL_DEBUG(
"CN excitation energy is negative, forcing a transparent" <<
'\n' 563 <<
" theCNA = " << theCNA <<
'\n' 564 <<
" theCNZ = " << theCNZ <<
'\n' 565 <<
" theCNEnergy = " << theCNEnergy <<
'\n' 566 <<
" theCNMomentum = (" << theCNMomentum.
getX() <<
", "<< theCNMomentum.
getY() <<
", " << theCNMomentum.
getZ() <<
")" <<
'\n' 567 <<
" theCNExcitationEnergy = " << theCNExcitationEnergy <<
'\n' 568 <<
" theCNSpin = (" << theCNSpin.
getX() <<
", "<< theCNSpin.
getY() <<
", " << theCNSpin.
getZ() <<
")" <<
'\n' 574 INCL_DEBUG(
"CN excitation energy is positive, forcing a CN" <<
'\n' 575 <<
" theCNA = " << theCNA <<
'\n' 576 <<
" theCNZ = " << theCNZ <<
'\n' 577 <<
" theCNEnergy = " << theCNEnergy <<
'\n' 578 <<
" theCNMomentum = (" << theCNMomentum.
getX() <<
", "<< theCNMomentum.
getY() <<
", " << theCNMomentum.
getZ() <<
")" <<
'\n' 579 <<
" theCNExcitationEnergy = " << theCNExcitationEnergy <<
'\n' 580 <<
" theCNSpin = (" << theCNSpin.
getX() <<
", "<< theCNSpin.
getY() <<
", " << theCNSpin.
getZ() <<
")" <<
'\n' 607 theRecoilFunctor(theSolution.
x);
609 INCL_WARN(
"Couldn't accommodate remnant recoil while satisfying energy conservation, root-finding algorithm failed." <<
'\n');
614 #ifndef INCLXX_IN_GEANT4_MODE 615 void INCL::globalConservationChecks(
G4bool afterRecoil) {
621 if(theBalance.
Z != 0) {
622 INCL_ERROR(
"Violation of charge conservation! ZBalance = " << theBalance.
Z <<
'\n');
624 if(theBalance.
A != 0) {
625 INCL_ERROR(
"Violation of baryon-number conservation! ABalance = " << theBalance.
A <<
'\n');
627 G4double EThreshold, pLongThreshold, pTransThreshold;
632 pTransThreshold = 1.;
636 pLongThreshold = 0.1;
637 pTransThreshold = 0.1;
639 if(std::abs(theBalance.
energy)>EThreshold) {
640 INCL_WARN(
"Violation of energy conservation > " << EThreshold <<
" MeV. EBalance = " << theBalance.
energy <<
" afterRecoil = " << afterRecoil <<
" eventNumber=" <<
theEventInfo.
eventNumber <<
'\n');
642 if(std::abs(pLongBalance)>pLongThreshold) {
643 INCL_WARN(
"Violation of longitudinal momentum conservation > " << pLongThreshold <<
" MeV/c. pLongBalance = " << pLongBalance <<
" afterRecoil = " << afterRecoil <<
" eventNumber=" <<
theEventInfo.
eventNumber <<
'\n');
645 if(std::abs(pTransBalance)>pTransThreshold) {
646 INCL_WARN(
"Violation of transverse momentum conservation > " << pTransThreshold <<
" MeV/c. pTransBalance = " << pTransBalance <<
" afterRecoil = " << afterRecoil <<
" eventNumber=" <<
theEventInfo.
eventNumber <<
'\n');
661 <<
"), stopping cascade" <<
'\n');
667 INCL_DEBUG(
"No participants in the nucleus and no incoming particles left, stopping cascade" <<
'\n');
674 <<
"), stopping cascade" <<
'\n');
680 INCL_DEBUG(
"Trying to make a compound nucleus, stopping cascade" <<
'\n');
724 G4int nUnmergedSpectators = 0;
727 if(dynSpectators.empty() && geomSpectators.empty()) {
729 }
else if(dynSpectators.size()==1 && geomSpectators.empty()) {
740 nUnmergedSpectators = rejected.size();
748 return nUnmergedSpectators;
762 INCL_DEBUG(
"Initialised interaction distance: r0 = " << r0 <<
'\n' 763 <<
" theNNDistance = " << theNNDistance <<
'\n' 773 for(
IsotopeIter i=theIsotopes.begin(),
e=theIsotopes.end(); i!=
e; ++i) {
777 rMax =
std::max(maximumRadius, rMax);
782 rMax =
std::min(pMaximumRadius, nMaximumRadius);
Short_t Ap
Projectile mass number given as input.
Short_t Zp
Charge number of the projectile nucleus.
Float_t effectiveImpactParameter
Effective (Coulomb-distorted) impact parameter [fm].
G4double maxUniverseRadius
void fillFinalState(FinalState *fs)
void initializeParticles()
Float_t nucleonAbsorptionCrossSection
Nucleon absorption cross section.
G4int minRemnantSize
Remnant size below which cascade stops.
Bool_t nucleonAbsorption
True if the event is a nucleon absorption.
G4bool containsDeltas()
Returns true if the nucleus contains any deltas.
IsotopeVector::iterator IsotopeIter
void setMass(G4double mass)
static void setCutNN(const G4double c)
void deleteCrossSections()
G4bool prepareReaction(const ParticleSpecies &projectileSpecies, const G4double kineticEnergy, const G4int A, const G4int Z)
G4bool continueCascade()
Stopping criterion for the cascade.
void cascade()
The actual cascade loop.
Float_t pLongBalance
Longitudinal momentum-conservation balance [MeV/c].
G4double maxInteractionDistance
Int_t nEnergyViolationInteraction
Number of attempted collisions/decays for which the energy-conservation algorithm failed to find a so...
G4double getEnergy() const
void postCascade()
Finalise the cascade and clean up.
G4bool preCascade(ParticleSpecies const &projectileSpecies, const G4double kineticEnergy)
Initialise the cascade.
Int_t nForcedCompoundNucleus
Number of forced compound-nucleus events.
std::string cascadeModel
Name of the cascade model.
G4bool decayOutgoingClusters()
Force the decay of unstable outgoing clusters.
G4bool isEventTransparent() const
Is the event transparent?
Abstract interface to the nuclear potential.
virtual G4INCL::IAvatar * propagate(FinalState const *const fs)=0
Float_t errorReactionCrossSection
Error on the calculated reaction cross section.
ParticleList const & getOutgoingParticles() const
Config const *const theConfig
void applyFinalState(FinalState *)
void updateGlobalInfo()
Update global counters and other members of theGlobalInfo object.
void setZ(const G4int Z)
Set the charge number of the cluster.
void initialize(Config const *const)
Initialize generator according to a Config object.
const ThreeVector & getIncomingAngularMomentum() const
Get the incoming angular-momentum vector.
G4int getCascading() const
G4double interactionDistanceNN(const ParticleSpecies &aSpecies, const G4double kineticEnergy)
Float_t forcedCNCrossSection
Calculated forced-compound-nucleus cross section.
Float_t pionAbsorptionCrossSection
Pion absorption cross section.
G4double getCutNN() const
void clearCache()
Clear the INuclearPotential cache.
std::vector< Int_t > finalRandomSeeds
Final seeds for the pseudo-random-number generator.
Bool_t forcedDeltasOutside
Event involved forced delta decays outside the nucleus.
G4double computeExcitationEnergy() const
Compute the current excitation energy.
void deletePhaseSpaceGenerator()
Struct for conservation laws.
Bool_t pionAbsorption
True if the event is a pion absorption.
G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
Bool_t clusterDecay
Event involved cluster decay.
G4int getA() const
Returns the baryon number.
void deleteIncoming()
Clear the incoming list and delete the particles.
G4int getZ() const
Returns the charge number.
Float_t Ep
Projectile kinetic energy given as input.
Short_t At
Target mass number given as input.
Int_t nTransparents
Number of transparent shots.
void reset()
Reset the projectile remnant to the state at the beginning of the cascade.
std::vector< Int_t > initialRandomSeeds
Initial seeds for the pseudo-random-number generator.
CascadeAction * cascadeAction
Float_t stoppingTime
Cascade stopping time [fm/c].
Float_t Ep
Projectile kinetic energy given as input.
G4bool isNaturalTarget() const
Natural targets.
IPropagationModel * propagationModel
Short_t At
Mass number of the target nucleus.
G4double getNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
void setEnergy(G4double energy)
static G4ThreadLocal Int_t eventNumber
Number of the event.
void clearCache()
Clear the INuclearPotential cache.
void finalizeGlobalInfo(Random::SeedVector const &initialSeeds)
IsotopeVector const & getIsotopes() const
Get the isotope vector.
Short_t Zt
Charge number of the target nucleus.
Float_t impactParameter
Impact parameter [fm].
G4double fixedImpactParameter
void rescaleOutgoingForRecoil()
Rescale the energies of the outgoing particles.
void useFusionKinematics()
Adjust the kinematics for complete-fusion events.
void deleteCoulomb()
Delete the Coulomb-distortion object.
Static class for selecting Coulomb distortion.
INCL(Config const *const config)
void initMaxInteractionDistance(ParticleSpecies const &p, const G4double kineticEnergy)
Initialise the maximum interaction distance.
static std::string const getVersionString()
Get the INCL version string.
Simple container for output of calculation-wide results.
double A(double temperature)
Float_t pTransBalance
Transverse momentum-conservation balance [MeV/c].
Float_t EBalance
Energy-conservation balance [MeV].
G4bool decayOutgoingDeltas()
Force the decay of outgoing deltas.
virtual G4double shoot(ParticleSpecies const &projectileSpecies, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)=0
G4double getImpactParameter() const
Bool_t deltasInside
Event involved deltas in the nucleus at the end of the cascade.
ParticleList extractDynamicalSpectators()
Returns a list of dynamical spectators.
Int_t nForcedTransparents
Number of forced transparents.
Class that stores isotopic abundances for a given element.
std::string deexcitationModel
Name of the de-excitation model.
void initUniverseRadius(ParticleSpecies const &p, const G4double kineticEnergy, const G4int A, const G4int Z)
Initialize the universe radius.
std::string getDeExcitationString() const
Get the de-excitation string.
void initialize(Config const *const theConfig)
Initialize the Coulomb-distortion algorithm.
Intersection getEarlierTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the first intersection of a straight particle trajectory with a sphere.
G4double getExcitationEnergy() const
Get the excitation energy of the nucleus.
const EventInfo & processEvent()
Alternative CascadeAction for dumping avatars.
G4bool hasRemnant() const
Does the nucleus give a cascade remnant?
Class to adjust remnant recoil in the reaction CM system.
Float_t completeFusionCrossSection
Calculated complete-fusion cross section (nParticles==0)
Int_t nShots
Number of shots.
LocalEnergyType getLocalEnergyBBType() const
Get the type of local energy for N-N avatars.
Int_t nUnmergedSpectators
Number of dynamical spectators that were merged back into the projectile remnant. ...
IsotopicDistribution const & getNaturalIsotopicDistribution(const G4int Z)
G4bool isNucleusNucleusCollision() const
Is it a nucleus-nucleus collision?
G4bool decayMe()
Force the phase-space decay of the Nucleus.
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
std::vector< Isotope > IsotopeVector
Functions that encapsulate a mass table.
Float_t reactionCrossSection
Calculated reaction cross section.
ParticleList const & getParticles() const
ProjectileRemnant * getProjectileRemnant() const
Get the projectile remnant.
G4bool getTryCompoundNucleus()
Float_t geometricCrossSection
Geometric cross section.
G4bool initializeTarget(const G4int A, const G4int Z)
Short_t Zp
Projectile charge number given as input.
void initVerbosityLevelFromEnvvar()
LocalEnergyType getLocalEnergyPiType() const
Get the type of local energy for pi-N and decay avatars.
void addParticleEntryAvatar(IAvatar *a)
Add one ParticleEntry avatar.
Float_t errorCompleteFusionCrossSection
Error on the calculated complete-fusion cross section (nParticles==0)
void setA(const G4int A)
Set the mass number of the cluster.
ParticleList addAllDynamicalSpectators(ParticleList const &pL)
Add back all dynamical spectators to the projectile remnant.
G4double maxImpactParameter
G4bool decayInsideDeltas()
Force the decay of deltas inside the nucleus.
void finalizeProjectileRemnant(const G4double emissionTime)
Finalise the projectile remnant.
G4double getMaximumNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
Static class for cluster formation.
void deleteClusteringModel()
Delete the clustering model.
virtual void setNucleus(G4INCL::Nucleus *nucleus)=0
Int_t nPionAbsorptions
Number of nucleon absorptions (no outcoming pions)
G4double interactionDistancePiN(const G4double projectileKineticEnergy)
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
void initialize(Config const *const theConfig)
Initialize the Coulomb-distortion algorithm.
void reset()
Reset the EventInfo members.
FinalStateValidity getValidity() const
void makeCompoundNucleus()
Make a compound nucleus.
virtual G4double getStoppingTime()=0
FinalState * getFinalState()
Int_t nEnergyViolationInteraction
Number of attempted collisions/decays for which the energy-conservation algorithm failed to find a so...
Solution solve(RootFunctor const *const f, const G4double x0)
Numerically solve a one-dimensional equation.
static void deleteBackupParticles()
Release the memory allocated for the backup particles.
void fillEventInfo(EventInfo *eventInfo)
G4int drawRandomNaturalIsotope(const G4int Z)
Adapter const & getAdapter()
ParticleSpecies getProjectileSpecies() const
Get the projectile species.
void initialize(Config const *const aConfig)
Initialize the Coulomb-distortion algorithm.
Short_t Zt
Target charge number given as input.
Intersection-point structure.
Bool_t transparent
True if the event is transparent.
G4int getTargetZ() const
Get the target charge number.
G4double getProjectileKineticEnergy() const
Get the projectile kinetic energy.
const G4INCL::ThreeVector & getMomentum() const
void computeRecoilKinematics()
Compute the recoil momentum and spin of the nucleus.
virtual G4double getCurrentTime()=0
G4int makeProjectileRemnant()
Make a projectile pre-fragment out of geometrical spectators.
Int_t nNucleonAbsorptions
Number of nucleon absorptions (no outcoming particles)
const ThreeVector & getIncomingMomentum() const
Get the incoming momentum vector.
Float_t energyViolationInteractionCrossSection
Cross section for attempted collisions/decays for which the energy-conservation algorithm failed to f...
G4int getTargetA() const
Get the target mass number.
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.
CascadeActionType getCascadeActionType() const
Get the cascade-action type.
Bool_t forcedDeltasInside
Event involved forced delta decays inside the nucleus.
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.
void initialize(Config const *const theConfig=0)
Initialize the particle table.
G4double getHadronizationTime() const
Get the hadronization time.
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
Float_t errorForcedCNCrossSection
Error on the calculated forced-compound-nucleus cross section.
void distortOut(ParticleList const &pL, Nucleus const *const n)
Modify the momentum of an outgoing particle.
Simple class for computing intersections between a straight line and a sphere.
void initialize(Config const *const theConfig)
Initialize the Coulomb-distortion algorithm.
void clearIncoming()
Clear the incoming list.
Int_t nCompleteFusion
Number of complete-fusion events (nParticles==0)
Int_t projectileType
Projectile particle type.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
ParticleList const & getIncomingParticles() const