Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::Nucleus Class Reference

#include <G4INCLNucleus.hh>

Inheritance diagram for G4INCL::Nucleus:

Classes

struct  ConservationBalance
 Struct for conservation laws. More...

Public Member Functions

 Nucleus (G4int mass, G4int charge, G4int strangess, Config const *const conf, const G4double universeRadius=-1., AnnihilationType AType=Def)
virtual ~Nucleus ()
 Nucleus (const Nucleus &rhs)
 Dummy copy constructor to silence Coverity warning.
Nucleusoperator= (const Nucleus &rhs)
 Dummy assignment operator to silence Coverity warning.
AnnihilationType getAType () const
void setAType (AnnihilationType type)
void initializeParticles ()
void insertParticle (Particle *p)
 Insert a new particle (e.g. a projectile) in the nucleus.
void applyFinalState (FinalState *)
G4int getInitialA () const
G4int getInitialZ () const
G4int getInitialS () const
void propagateParticles (G4double step)
G4int getNumberOfEnteringProtons () const
G4int getNumberOfEnteringNeutrons () const
G4int getNumberOfEnteringPions () const
G4int getNumberOfEnteringKaons () const
G4int getNumberOfEnteringantiProtons () const
G4int getNumberOfEnteringantiNeutrons () const
G4double computeSeparationEnergyBalance () const
 Outgoing - incoming separation energies.
G4bool decayOutgoingDeltas ()
 Force the decay of outgoing deltas.
G4bool decayInsideDeltas ()
 Force the decay of deltas inside the nucleus.
G4bool decayInsideStrangeParticles ()
 Force the transformation of strange particles into a Lambda;.
G4bool decayOutgoingPionResonances (G4double timeThreshold)
 Force the decay of outgoing PionResonances (eta/omega).
G4bool decayOutgoingSigmaZero (G4double timeThreshold)
 Force the decay of outgoing Neutral Sigma.
G4bool decayOutgoingNeutralKaon ()
 Force the transformation of outgoing Neutral Kaon into propation eigenstate.
G4bool decayOutgoingClusters ()
 Force the decay of unstable outgoing clusters.
G4bool decayMe ()
 Force the phase-space decay of the Nucleus.
void emitInsidePions ()
 Force emission of all pions inside the nucleus.
void emitInsideStrangeParticles ()
 Force emission of all strange particles inside the nucleus.
G4int emitInsideLambda ()
 Force emission of all Lambda (desexitation code with strangeness not implanted yet).
G4int emitInsideAntilambda ()
 Force emission of all Antilambda.
G4bool emitInsideKaon ()
 Force emission of all Kaon inside the nucleus.
G4bool emitInsideAnnihilationProducts ()
 Force emission of all Antinucleon inside the nucleus.
void computeRecoilKinematics ()
 Compute the recoil momentum and spin of the nucleus.
ThreeVector computeCenterOfMass () const
 Compute the current center-of-mass position.
G4double computeTotalEnergy () const
 Compute the current total energy.
G4double computeExcitationEnergy () const
 Compute the current excitation energy.
void setIncomingAngularMomentum (const ThreeVector &j)
 Set the incoming angular-momentum vector.
const ThreeVectorgetIncomingAngularMomentum () const
 Get the incoming angular-momentum vector.
void setIncomingMomentum (const ThreeVector &p)
 Set the incoming momentum vector.
const ThreeVectorgetIncomingMomentum () const
 Get the incoming momentum vector.
void setInitialEnergy (const G4double e)
 Set the initial energy.
G4double getInitialEnergy () const
 Get the initial energy.
G4double getExcitationEnergy () const
 Get the excitation energy of the nucleus.
G4bool containsDeltas ()
 Returns true if the nucleus contains any deltas.
G4bool containsAntiKaon ()
 Returns true if the nucleus contains any anti Kaons.
G4bool containsLambda ()
 Returns true if the nucleus contains any Lambda.
G4bool containsAntilambda ()
 Returns true if the nucleus contains any Antilambda.
G4bool containsSigma ()
 Returns true if the nucleus contains any Sigma.
G4bool containsKaon ()
 Returns true if the nucleus contains any Kaons.
G4bool containsAntinucleon ()
 Returns true if the nucleus contains any Antinucleons.
G4bool containsEtas ()
 Returns true if the nucleus contains any etas.
G4bool containsOmegas ()
 Returns true if the nucleus contains any omegas.
void resetSrc ()
 Resets the src partners.
void setSrcInternalEnergy (double value)
void updateInternalEnergy (double value)
G4double getSrcInternalEnergy () const
std::string print ()
StoregetStore () const
void setStore (Store *str)
G4double getInitialInternalEnergy () const
G4bool isEventTransparent () const
 Is the event transparent?
G4bool hasRemnant () const
 Does the nucleus give a cascade remnant?
void fillEventInfo (EventInfo *eventInfo)
G4bool getTryCompoundNucleus ()
G4double getTransmissionBarrier (Particle const *const p)
 Get the transmission barrier.
void restoreSrcPartner (Particle *particle, ThreeVector m)
ConservationBalance getConservationBalance (EventInfo const &theEventInfo, const G4bool afterRecoil) const
 Compute charge, mass, energy and momentum balance.
void useFusionKinematics ()
 Adjust the kinematics for complete-fusion events.
G4double getSurfaceRadius (Particle const *const particle) const
 Get the maximum allowed radius for a given particle.
G4double getUniverseRadius () const
 Getter for theUniverseRadius.
void setUniverseRadius (const G4double universeRadius)
 Setter for theUniverseRadius.
G4bool isNucleusNucleusCollision () const
 Is it a nucleus-nucleus collision?
void setNucleusNucleusCollision ()
 Set a nucleus-nucleus collision.
void setParticleNucleusCollision ()
 Set a particle-nucleus collision.
void setProjectileRemnant (ProjectileRemnant *const c)
 Set the projectile remnant.
ProjectileRemnantgetProjectileRemnant () const
 Get the projectile remnant.
void deleteProjectileRemnant ()
 Delete the projectile remnant.
void finalizeProjectileRemnant (const G4double emissionTime)
 Finalise the projectile remnant.
void updatePotentialEnergy (Particle *p) const
 Update the particle potential energy.
void setDensity (NuclearDensity const *const d)
 Setter for theDensity.
NuclearDensity const * getDensity () const
 Getter for theDensity.
NuclearPotential::INuclearPotential const * getPotential () const
 Getter for thePotential.
AnnihilationType getAnnihilationType () const
 Getter for theAnnihilationType.
void setAnnihilationType (const AnnihilationType at)
 Setter for theAnnihilationType.
Public Member Functions inherited from G4INCL::Cluster
 Cluster (const G4int Z, const G4int A, const G4int S, const G4bool createParticleSampler=true)
 Standard Cluster constructor.
template<class Iterator>
 Cluster (Iterator begin, Iterator end)
virtual ~Cluster ()
 Cluster (const Cluster &rhs)
 Copy constructor.
Clusteroperator= (const Cluster &rhs)
 Assignment operator.
void swap (Cluster &rhs)
 Helper method for the assignment operator.
ParticleSpecies getSpecies () const
 Get the particle species.
void deleteParticles ()
void clearParticles ()
void setZ (const G4int Z)
 Set the charge number of the cluster.
void setA (const G4int A)
 Set the mass number of the cluster.
void setS (const G4int S)
 Set the strangess number of the cluster.
G4double getExcitationEnergy () const
 Get the excitation energy of the cluster.
void setExcitationEnergy (const G4double e)
 Set the excitation energy of the cluster.
virtual G4double getTableMass () const
 Get the real particle mass.
ParticleList const & getParticles () const
void removeParticle (Particle *const p)
 Remove a particle from the cluster components.
void addParticle (Particle *const p)
void updateClusterParameters ()
 Set total cluster mass, energy, size, etc. from the particles.
void addParticles (ParticleList const &pL)
 Add a list of particles to the cluster.
ParticleList getParticleList () const
 Returns the list of particles that make up the cluster.
std::string print () const
void internalBoostToCM ()
 Boost to the CM of the component particles.
void putParticlesOffShell ()
 Put the cluster components off shell.
void setPosition (const ThreeVector &position)
 Set the position of the cluster.
void boost (const ThreeVector &aBoostVector)
 Boost the cluster with the indicated velocity.
void freezeInternalMotion ()
 Freeze the internal motion of the particles.
virtual void rotatePosition (const G4double angle, const ThreeVector &axis)
 Rotate position of all the particles.
virtual void rotateMomentum (const G4double angle, const ThreeVector &axis)
 Rotate momentum of all the particles.
virtual void makeProjectileSpectator ()
 Make all the components projectile spectators, too.
virtual void makeTargetSpectator ()
 Make all the components target spectators, too.
virtual void makeParticipant ()
 Make all the components participants, too.
ThreeVector const & getSpin () const
 Get the spin of the nucleus.
void setSpin (const ThreeVector &j)
 Set the spin of the nucleus.
G4INCL::ThreeVector getAngularMomentum () const
 Get the total angular momentum (orbital + spin).
Public Member Functions inherited from G4INCL::Particle
 Particle ()
 Particle (ParticleType t, G4double energy, ThreeVector const &momentum, ThreeVector const &position)
 Particle (ParticleType t, ThreeVector const &momentum, ThreeVector const &position)
virtual ~Particle ()
 Particle (const Particle &rhs)
 Copy constructor.
Particleoperator= (const Particle &rhs)
 Assignment operator.
G4INCL::ParticleType getType () const
void setType (ParticleType t)
G4bool isNucleon () const
ParticipantType getParticipantType () const
void setParticipantType (ParticipantType const p)
G4bool isParticipant () const
G4bool isTargetSpectator () const
G4bool isProjectileSpectator () const
G4bool isPion () const
 Is this a pion?
G4bool isEta () const
 Is this an eta?
G4bool isOmega () const
 Is this an omega?
G4bool isEtaPrime () const
 Is this an etaprime?
G4bool isPhoton () const
 Is this a photon?
G4bool isResonance () const
 Is it a resonance?
G4bool isDelta () const
 Is it a Delta?
G4bool isSigma () const
 Is this a Sigma?
G4bool isKaon () const
 Is this a Kaon?
G4bool isAntiKaon () const
 Is this an antiKaon?
G4bool isLambda () const
 Is this a Lambda?
G4bool isNucleonorLambda () const
 Is this a Nucleon or a Lambda?
G4bool isHyperon () const
 Is this an Hyperon?
G4bool isMeson () const
 Is this a Meson?
G4bool isBaryon () const
 Is this a Baryon?
G4bool isStrange () const
 Is this a Strange?
G4bool isXi () const
 Is this a Xi?
G4bool isAntiNucleon () const
 Is this an antinucleon?
G4bool isAntiSigma () const
 Is this an antiSigma?
G4bool isAntiXi () const
 Is this an antiXi?
G4bool isAntiLambda () const
 Is this an antiLambda?
G4bool isAntiHyperon () const
 Is this an antiHyperon?
G4bool isAntiBaryon () const
 Is this an antiBaryon?
G4bool isAntiNucleonorAntiLambda () const
 Is this an antiNucleon or an antiLambda?
G4int getA () const
 Returns the baryon number.
G4int getZ () const
 Returns the charge number.
G4int getS () const
 Returns the strangeness number.
G4int getSrcPair () const
 Returns the strangeness number.
G4double getBeta () const
ThreeVector boostVector () const
void boost (const ThreeVector &aBoostVector)
void lorentzContract (const ThreeVector &aBoostVector, const ThreeVector &refPos)
 Lorentz-contract the particle position around some center.
G4double getMass () const
 Get the cached particle mass.
G4double getINCLMass () const
 Get the INCL particle mass.
G4double getRealMass () const
 Get the real particle mass.
void setRealMass ()
 Set the mass of the Particle to its real mass.
void setTableMass ()
 Set the mass of the Particle to its table mass.
void setINCLMass ()
 Set the mass of the Particle to its table mass.
G4double getEmissionQValueCorrection (const G4int AParent, const G4int ZParent) const
 Computes correction on the emission Q-value.
G4double getTransferQValueCorrection (const G4int AFrom, const G4int ZFrom, const G4int ATo, const G4int ZTo) const
 Computes correction on the transfer Q-value.
G4double getEmissionQValueCorrection (const G4int AParent, const G4int ZParent, const G4int SParent) const
 Computes correction on the emission Q-value for hypernuclei.
G4double getTransferQValueCorrection (const G4int AFrom, const G4int ZFrom, const G4int SFrom, const G4int ATo, const G4int ZTo, const G4int STo) const
 Computes correction on the transfer Q-value for hypernuclei.
G4double getInvariantMass () const
 Get the the particle invariant mass.
G4double getKineticEnergy () const
 Get the particle kinetic energy.
G4double getPotentialEnergy () const
 Get the particle potential energy.
void setPotentialEnergy (G4double v)
 Set the particle potential energy.
G4double getEnergy () const
void setMass (G4double mass)
void setEnergy (G4double energy)
const G4INCL::ThreeVectorgetMomentum () const
virtual void setMomentum (const G4INCL::ThreeVector &momentum)
const G4INCL::ThreeVectorgetPosition () const
G4double getHelicity ()
void setHelicity (G4double h)
void propagate (G4double step)
G4int getNumberOfCollisions () const
 Return the number of collisions undergone by the particle.
void setNumberOfCollisions (G4int n)
 Set the number of collisions undergone by the particle.
void incrementNumberOfCollisions ()
 Increment the number of collisions undergone by the particle.
G4int getNumberOfDecays () const
 Return the number of decays undergone by the particle.
void setNumberOfDecays (G4int n)
 Set the number of decays undergone by the particle.
void incrementNumberOfDecays ()
 Increment the number of decays undergone by the particle.
void setNumberOfSrcPair (int n)
 Set the number of srcpairs.
void setOutOfWell ()
 Mark the particle as out of its potential well.
G4bool isOutOfWell () const
 Check if the particle is out of its potential well.
void setSrcPartner ()
 Set and reset src partner.
void resetSrcPartner ()
G4bool isSrcPartner () const
 Check if the particle is a src partner.
void setEmissionTime (G4double t)
G4double getEmissionTime ()
ThreeVector getTransversePosition () const
 Transverse component of the position w.r.t. the momentum.
ThreeVector getLongitudinalPosition () const
 Longitudinal component of the position w.r.t. the momentum.
const ThreeVectoradjustMomentumFromEnergy ()
 Rescale the momentum to match the total energy.
G4double adjustEnergyFromMomentum ()
 Recompute the energy to match the momentum.
G4bool isCluster () const
void setFrozenMomentum (const ThreeVector &momentum)
 Set the frozen particle momentum.
void setFrozenEnergy (const G4double energy)
 Set the frozen particle momentum.
ThreeVector getFrozenMomentum () const
 Get the frozen particle momentum.
G4double getFrozenEnergy () const
 Get the frozen particle momentum.
ThreeVector getPropagationVelocity () const
 Get the propagation velocity of the particle.
void freezePropagation ()
 Freeze particle propagation.
void thawPropagation ()
 Unfreeze particle propagation.
virtual void rotatePositionAndMomentum (const G4double angle, const ThreeVector &axis)
 Rotate the particle position and momentum.
std::string print () const
std::string dump () const
long getID () const
ParticleList const * getParticles () const
G4double getReflectionMomentum () const
 Return the reflection momentum.
void setUncorrelatedMomentum (const G4double p)
 Set the uncorrelated momentum.
void rpCorrelate ()
 Make the particle follow a strict r-p correlation.
void rpDecorrelate ()
 Make the particle not follow a strict r-p correlation.
G4double getCosRPAngle () const
 Get the cosine of the angle between position and momentum.
G4double getParticleBias () const
 Get the particle bias.
void setParticleBias (G4double ParticleBias)
 Set the particle bias.
std::vector< G4intgetBiasCollisionVector () const
 Get the vector list of biased vertices on the particle path.
void setBiasCollisionVector (std::vector< G4int > BiasCollisionVector)
 Set the vector list of biased vertices on the particle path.
G4int getNumberOfKaon () const
 Number of Kaon inside de nucleus.
void setNumberOfKaon (const G4int NK)
G4int getParentResonancePDGCode () const
void setParentResonancePDGCode (const G4int parentPDGCode)
G4int getParentResonanceID () const
void setParentResonanceID (const G4int parentID)

Additional Inherited Members

Static Public Member Functions inherited from G4INCL::Particle
static G4double getTotalBias ()
 General bias vector function.
static void setINCLBiasVector (std::vector< G4double > NewVector)
static void FillINCLBiasVector (G4double newBias)
static G4double getBiasFromVector (std::vector< G4int > VectorBias)
static std::vector< G4intMergeVectorBias (Particle const *const p1, Particle const *const p2)
static std::vector< G4intMergeVectorBias (std::vector< G4int > p1, Particle const *const p2)
Static Public Attributes inherited from G4INCL::Particle
static std::vector< G4doubleINCLBiasVector
 Time ordered vector of all bias applied.
static G4ThreadLocal G4int nextBiasedCollisionID = 0
Protected Member Functions inherited from G4INCL::Particle
void swap (Particle &rhs)
 Helper method for the assignment operator.
Protected Attributes inherited from G4INCL::Cluster
ParticleList particles
G4double theExcitationEnergy
ThreeVector theSpin
ParticleSamplertheParticleSampler
Protected Attributes inherited from G4INCL::Particle
G4int theZ
G4int theA
G4int theS
ParticipantType theParticipantType
G4INCL::ParticleType theType
G4double theEnergy
G4doublethePropagationEnergy
G4double theFrozenEnergy
G4INCL::ThreeVector theMomentum
G4INCL::ThreeVectorthePropagationMomentum
G4INCL::ThreeVector theFrozenMomentum
G4INCL::ThreeVector thePosition
G4int nCollisions
G4int nDecays
G4int nSrcPair
G4double thePotentialEnergy
long ID
G4bool rpCorrelated
G4double uncorrelatedMomentum
G4double theParticleBias
G4int theNKaon
 The number of Kaons inside the nucleus (update during the cascade).
G4int theParentResonancePDGCode
G4int theParentResonanceID

Detailed Description

Definition at line 67 of file G4INCLNucleus.hh.

Constructor & Destructor Documentation

◆ Nucleus() [1/2]

G4INCL::Nucleus::Nucleus ( G4int mass,
G4int charge,
G4int strangess,
Config const *const conf,
const G4double universeRadius = -1.,
AnnihilationType AType = Def )

Definition at line 70 of file G4INCLNucleus.cc.

72 : Cluster(charge,mass,strangess,true),
73 theInitialZ(charge), theInitialA(mass), theInitialS(strangess),
74 theNpInitial(0), theNnInitial(0),
75 theNlInitial(0),
76 theNSpInitial(0), theNSzInitial(0), theNSmInitial(0),
77 theNpionplusInitial(0), theNpionminusInitial(0),
78 theNkaonplusInitial(0), theNkaonminusInitial(0),
79 theNantiprotonInitial(0),theNantineutronInitial(0),
80 initialInternalEnergy(0.), srcInternalEnergy(0.),
81 incomingAngularMomentum(0.,0.,0.), incomingMomentum(0.,0.,0.),
82 initialCenterOfMass(0.,0.,0.),
83 remnant(true),
84 initialEnergy(0.),
85 tryCN(false),
86 theUniverseRadius(universeRadius),
87 isNucleusNucleus(false),
88 theProjectileRemnant(NULL),
89 theDensity(NULL),
90 thePotential(NULL),
91 theAType(AType)
92 {
93 PotentialType potentialType;
94 G4bool pionPotential;
95 if(conf) {
96 potentialType = conf->getPotentialType();
97 pionPotential = conf->getPionPotential();
98 } else { // By default we don't use energy dependent
99 // potential. This is convenient for some tests.
100 potentialType = IsospinPotential;
101 pionPotential = true;
102 }
103
104 thePotential = NuclearPotential::createPotential(potentialType, theA, theZ, pionPotential);
105
106 ParticleTable::setProtonSeparationEnergy(thePotential->getSeparationEnergy(Proton));
107 ParticleTable::setNeutronSeparationEnergy(thePotential->getSeparationEnergy(Neutron));
108
109 if (theAType==PType) theDensity = NuclearDensityFactory::createDensity(theA+1, theZ+1, theS);
110 else if (theAType==NType) theDensity = NuclearDensityFactory::createDensity(theA+1, theZ, theS);
111 else if (theAType==DNbarNPbarNType) theDensity = NuclearDensityFactory::createDensity(theA+2, theZ, theS);
112 else if (theAType==DNbarPPbarPType) theDensity = NuclearDensityFactory::createDensity(theA+2, theZ+2, theS);
113 else if (theAType==DNbarPPbarNType || theAType==DNbarNPbarPType) theDensity = NuclearDensityFactory::createDensity(theA+2, theZ+1, theS);
114 else
116
117 theParticleSampler->setPotential(thePotential);
118 theParticleSampler->setDensity(theDensity);
119
120 if(theUniverseRadius<0)
121 theUniverseRadius = theDensity->getMaximumRadius();
122 theStore = new Store(conf);
123 }
bool G4bool
Definition G4Types.hh:86
ParticleSampler * theParticleSampler
Cluster(const G4int Z, const G4int A, const G4int S, const G4bool createParticleSampler=true)
Standard Cluster constructor.
NuclearDensity const * createDensity(const G4int A, const G4int Z, const G4int S)
INuclearPotential const * createPotential(const PotentialType type, const G4int theA, const G4int theZ, const G4bool pionPotential)
Create an INuclearPotential object.
void setNeutronSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
void setProtonSeparationEnergy(const G4double s)
Setter for protonSeparationEnergy.
@ DNbarNPbarNType
@ DNbarNPbarPType
@ DNbarPPbarPType
@ DNbarPPbarNType

Referenced by Nucleus(), and operator=().

◆ ~Nucleus()

G4INCL::Nucleus::~Nucleus ( )
virtual

Definition at line 125 of file G4INCLNucleus.cc.

125 {
126 delete theStore;
128 /* We don't delete the potential and the density here any more -- Factories
129 * are caching them
130 delete thePotential;
131 delete theDensity;*/
132 }
void deleteProjectileRemnant()
Delete the projectile remnant.

◆ Nucleus() [2/2]

G4INCL::Nucleus::Nucleus ( const Nucleus & rhs)

Dummy copy constructor to silence Coverity warning.

Member Function Documentation

◆ applyFinalState()

void G4INCL::Nucleus::applyFinalState ( FinalState * finalstate)

Apply reaction final state information to the nucleus.

Definition at line 157 of file G4INCLNucleus.cc.

157 {
158 if(!finalstate) // do nothing if no final state was returned
159 return;
160
161 G4double totalEnergy = 0.0;
162
163 FinalStateValidity const validity = finalstate->getValidity();
164 if(validity == ValidFS) {
165
166 ParticleList const &created = finalstate->getCreatedParticles();
167 for(ParticleIter iter=created.begin(), e=created.end(); iter!=e; ++iter) {
168 theStore->add((*iter));
169 if(!(*iter)->isOutOfWell()) {
170 totalEnergy += (*iter)->getEnergy() - (*iter)->getPotentialEnergy();
171 }
172 }
173
174 ParticleList const &deleted = finalstate->getDestroyedParticles();
175 for(ParticleIter iter=deleted.begin(), e=deleted.end(); iter!=e; ++iter) {
176 theStore->particleHasBeenDestroyed(*iter);
177 }
178
179 ParticleList const &modified = finalstate->getModifiedParticles();
180 for(ParticleIter iter=modified.begin(), e=modified.end(); iter!=e; ++iter) {
181 theStore->particleHasBeenUpdated(*iter);
182 totalEnergy += (*iter)->getEnergy() - (*iter)->getPotentialEnergy();
183 }
184
185 ParticleList const &out = finalstate->getOutgoingParticles();
186 for(ParticleIter iter=out.begin(), e=out.end(); iter!=e; ++iter) {
187 if((*iter)->isCluster()) {
188 Cluster *clusterOut = dynamic_cast<Cluster*>((*iter));
189// assert(clusterOut);
190#ifdef INCLXX_IN_GEANT4_MODE
191 if(!clusterOut)
192 continue;
193#endif
194 ParticleList const &components = clusterOut->getParticles();
195 for(ParticleIter in=components.begin(), end=components.end(); in!=end; ++in)
196 theStore->particleHasBeenEjected(*in);
197 } else {
198 theStore->particleHasBeenEjected(*iter);
199 }
200 totalEnergy += (*iter)->getEnergy(); // No potential here because the particle is gone
201 theA -= (*iter)->getA();
202 theZ -= (*iter)->getZ();
203 theS -= (*iter)->getS();
204 theStore->addToOutgoing(*iter);
205 (*iter)->setEmissionTime(theStore->getBook().getCurrentTime());
206 }
207
208 ParticleList const &entering = finalstate->getEnteringParticles();
209 for(ParticleIter iter=entering.begin(), e=entering.end(); iter!=e; ++iter) {
210 insertParticle(*iter);
211 totalEnergy += (*iter)->getEnergy() - (*iter)->getPotentialEnergy();
212 }
213
214 // actually perform the removal of the scheduled avatars
215 theStore->removeScheduledAvatars();
216 } else if(validity == ParticleBelowFermiFS || validity == ParticleBelowZeroFS) {
217 INCL_DEBUG("A Particle is entering below the Fermi sea:" << '\n' << finalstate->print() << '\n');
218 tryCN = true;
219 ParticleList const &entering = finalstate->getEnteringParticles();
220 for(ParticleIter iter=entering.begin(), e=entering.end(); iter!=e; ++iter) {
221 insertParticle(*iter);
222 }
223 }
224
225 if(validity==ValidFS &&
226 std::abs(totalEnergy - finalstate->getTotalEnergyBeforeInteraction()) > 0.1) {
227 INCL_ERROR("Energy nonconservation! Energy at the beginning of the event = "
228 << finalstate->getTotalEnergyBeforeInteraction()
229 <<" and after interaction = "
230 << totalEnergy << '\n'
231 << finalstate->print());
232 }
233 }
#define INCL_ERROR(x)
#define INCL_DEBUG(x)
double G4double
Definition G4Types.hh:83
void insertParticle(Particle *p)
Insert a new particle (e.g. a projectile) in the nucleus.
ParticleList::const_iterator ParticleIter
std::vector< Base * > ParticleList
Definition PoPI.hpp:186

Referenced by decayInsideDeltas(), decayInsideStrangeParticles(), and emitInsideAnnihilationProducts().

◆ computeCenterOfMass()

ThreeVector G4INCL::Nucleus::computeCenterOfMass ( ) const

Compute the current center-of-mass position.

Returns
the center-of-mass position vector [fm].

Definition at line 292 of file G4INCLNucleus.cc.

292 {
293 ThreeVector cm(0.,0.,0.);
294 G4double totalMass = 0.0;
295 ParticleList const &inside = theStore->getParticles();
296 for(ParticleIter p=inside.begin(), e=inside.end(); p!=e; ++p) {
297 const G4double mass = (*p)->getMass();
298 cm += (*p)->getPosition() * mass;
299 totalMass += mass;
300 }
301 cm /= totalMass;
302 return cm;
303 }

Referenced by computeRecoilKinematics().

◆ computeExcitationEnergy()

G4double G4INCL::Nucleus::computeExcitationEnergy ( ) const

Compute the current excitation energy.

Returns
the excitation energy [MeV]

Definition at line 305 of file G4INCLNucleus.cc.

305 {
306 const G4double totalEnergy = computeTotalEnergy();
307 const G4double separationEnergies = computeSeparationEnergyBalance();
308
309 return totalEnergy - initialInternalEnergy - separationEnergies;
310
311 }
G4double computeSeparationEnergyBalance() const
Outgoing - incoming separation energies.
G4double computeTotalEnergy() const
Compute the current total energy.

◆ computeRecoilKinematics()

void G4INCL::Nucleus::computeRecoilKinematics ( )

Compute the recoil momentum and spin of the nucleus.

Definition at line 259 of file G4INCLNucleus.cc.

259 {
260 // If the remnant consists of only one nucleon, we need to apply a special
261 // procedure to put it on mass shell.
262 if(theA==1) {
264 computeOneNucleonRecoilKinematics();
265 remnant=false;
266 return;
267 }
268
269 // Compute the recoil momentum and angular momentum
270 theMomentum = incomingMomentum;
271 theSpin = incomingAngularMomentum;
272
273 ParticleList const &outgoing = theStore->getOutgoingParticles();
274 for(ParticleIter p=outgoing.begin(), e=outgoing.end(); p!=e; ++p) {
275 theMomentum -= (*p)->getMomentum();
276 theSpin -= (*p)->getAngularMomentum();
277 }
278 if(theProjectileRemnant) {
279 theMomentum -= theProjectileRemnant->getMomentum();
280 theSpin -= theProjectileRemnant->getAngularMomentum();
281 }
282
283 // Subtract orbital angular momentum
285 theSpin -= (thePosition-initialCenterOfMass).vector(theMomentum);
286
289 remnant=true;
290 }
ThreeVector theSpin
G4double theExcitationEnergy
void emitInsidePions()
Force emission of all pions inside the nucleus.
ThreeVector computeCenterOfMass() const
Compute the current center-of-mass position.
G4INCL::ThreeVector theMomentum
void setMass(G4double mass)
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
G4INCL::ThreeVector thePosition
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.

◆ computeSeparationEnergyBalance()

G4double G4INCL::Nucleus::computeSeparationEnergyBalance ( ) const
inline

Outgoing - incoming separation energies.

Used by CDPP.

Definition at line 148 of file G4INCLNucleus.hh.

148 {
149 G4double S = 0.0;
150 ParticleList const &outgoing = theStore->getOutgoingParticles();
151 for(ParticleIter i=outgoing.begin(), e=outgoing.end(); i!=e; ++i) {
152 const ParticleType t = (*i)->getType();
153 switch(t) {
154 case Proton:
155 case Neutron:
156 case DeltaPlusPlus:
157 case DeltaPlus:
158 case DeltaZero:
159 case DeltaMinus:
160 case Lambda:
161 case PiPlus:
162 case PiMinus:
163 case KPlus:
164 case KMinus:
165 case KZero:
166 case KZeroBar:
167 case KShort:
168 case KLong:
169 case SigmaPlus:
170 case SigmaZero:
171 case SigmaMinus:
172 S += thePotential->getSeparationEnergy(*i);
173 break;
174 case antiSigmaPlus:
175 case antiSigmaZero:
176 case antiSigmaMinus:
177 case antiLambda:
178 case antiProton:
179 case antiNeutron:
180 S -= thePotential->getSeparationEnergy(*i);
181 break;
182 case Composite:
183 S += (*i)->getZ() * thePotential->getSeparationEnergy(Proton)
184 + ((*i)->getA() + (*i)->getS() - (*i)->getZ()) * thePotential->getSeparationEnergy(Neutron)
185 - (*i)->getS() * thePotential->getSeparationEnergy(Lambda);
186 break;
187 case antiComposite:
188 S -= (*i)->getZ() * thePotential->getSeparationEnergy(antiProton)
189 + ((*i)->getA() + (*i)->getS() - (*i)->getZ()) * thePotential->getSeparationEnergy(antiNeutron);
190 break;
191 default:
192 break;
193 }
194 }
195
196 S -= theNpInitial * thePotential->getSeparationEnergy(Proton);
197 S -= theNnInitial * thePotential->getSeparationEnergy(Neutron);
198 S -= theNlInitial * thePotential->getSeparationEnergy(Lambda);
199 S -= theNSpInitial * thePotential->getSeparationEnergy(SigmaPlus);
200 S -= theNSzInitial * thePotential->getSeparationEnergy(SigmaZero);
201 S -= theNSmInitial * thePotential->getSeparationEnergy(SigmaMinus);
202 S -= theNpionplusInitial*thePotential->getSeparationEnergy(PiPlus);;
203 S -= theNkaonplusInitial*thePotential->getSeparationEnergy(KPlus);
204 S -= theNpionminusInitial*thePotential->getSeparationEnergy(PiMinus);
205 S -= theNkaonminusInitial*thePotential->getSeparationEnergy(KMinus);
206 S += theNantiprotonInitial*thePotential->getSeparationEnergy(antiProton);
207 S += theNantineutronInitial*thePotential->getSeparationEnergy(antiNeutron);
208 return S;
209 }
G4double S(G4double temp)

Referenced by computeExcitationEnergy().

◆ computeTotalEnergy()

G4double G4INCL::Nucleus::computeTotalEnergy ( ) const

Compute the current total energy.

Returns
the total energy [MeV]

Definition at line 239 of file G4INCLNucleus.cc.

239 {
240 G4double totalEnergy = 0.0;
241 ParticleList const &inside = theStore->getParticles();
242 for(ParticleIter p=inside.begin(), e=inside.end(); p!=e; ++p) {
243 if((*p)->isNucleon()) // Ugly: we should calculate everything using total energies!
244 totalEnergy += (*p)->getKineticEnergy() - (*p)->getPotentialEnergy();
245 else if((*p)->isResonance())
246 totalEnergy += (*p)->getEnergy() - (*p)->getPotentialEnergy() - ParticleTable::effectiveNucleonMass;
247 else if((*p)->isHyperon())
248 totalEnergy += (*p)->getEnergy() - (*p)->getPotentialEnergy() - ParticleTable::getRealMass((*p)->getType());
249 //else if((*p)->isAntiLambda())
250 // totalEnergy += (*p)->getEnergy() - (*p)->getPotentialEnergy() + ParticleTable::getRealMass((*p)->getType()) - ParticleTable::getSeparationEnergyINCL(Lambda, theA, theZ);
251 //std::cout << ParticleTable::getRealMass((*p)->getType()) << std::endl;}
252 else
253 totalEnergy += (*p)->getEnergy() - (*p)->getPotentialEnergy();
254 }
255
256 return totalEnergy;
257 }
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2).
const G4double effectiveNucleonMass

Referenced by computeExcitationEnergy(), and initializeParticles().

◆ containsAntiKaon()

G4bool G4INCL::Nucleus::containsAntiKaon ( )
inline

Returns true if the nucleus contains any anti Kaons.

Definition at line 339 of file G4INCLNucleus.hh.

339 {
340 ParticleList const &inside = theStore->getParticles();
341 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
342 if((*i)->isAntiKaon()) return true;
343 return false;
344 }

◆ containsAntilambda()

G4bool G4INCL::Nucleus::containsAntilambda ( )
inline

Returns true if the nucleus contains any Antilambda.

Definition at line 355 of file G4INCLNucleus.hh.

355 {
356 ParticleList const &inside = theStore->getParticles();
357 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
358 if((*i)->isAntiLambda()) return true;
359 return false;
360 }

◆ containsAntinucleon()

G4bool G4INCL::Nucleus::containsAntinucleon ( )
inline

Returns true if the nucleus contains any Antinucleons.

Definition at line 379 of file G4INCLNucleus.hh.

379 {
380 ParticleList const &inside = theStore->getParticles();
381 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
382 if((*i)->isAntiNucleon()) return true;
383 return false;
384 }

◆ containsDeltas()

G4bool G4INCL::Nucleus::containsDeltas ( )
inline

Returns true if the nucleus contains any deltas.

Definition at line 331 of file G4INCLNucleus.hh.

331 {
332 ParticleList const &inside = theStore->getParticles();
333 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
334 if((*i)->isDelta()) return true;
335 return false;
336 }

◆ containsEtas()

G4bool G4INCL::Nucleus::containsEtas ( )
inline

Returns true if the nucleus contains any etas.

Definition at line 387 of file G4INCLNucleus.hh.

387 {
388 ParticleList const &inside = theStore->getParticles();
389 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
390 if((*i)->isEta()) return true;
391 return false;
392 }

◆ containsKaon()

G4bool G4INCL::Nucleus::containsKaon ( )
inline

Returns true if the nucleus contains any Kaons.

Definition at line 371 of file G4INCLNucleus.hh.

371 {
372 ParticleList const &inside = theStore->getParticles();
373 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
374 if((*i)->isKaon()) return true;
375 return false;
376 }

◆ containsLambda()

G4bool G4INCL::Nucleus::containsLambda ( )
inline

Returns true if the nucleus contains any Lambda.

Definition at line 347 of file G4INCLNucleus.hh.

347 {
348 ParticleList const &inside = theStore->getParticles();
349 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
350 if((*i)->isLambda()) return true;
351 return false;
352 }

◆ containsOmegas()

G4bool G4INCL::Nucleus::containsOmegas ( )
inline

Returns true if the nucleus contains any omegas.

Definition at line 395 of file G4INCLNucleus.hh.

395 {
396 ParticleList const &inside = theStore->getParticles();
397 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
398 if((*i)->isOmega()) return true;
399 return false;
400 }

◆ containsSigma()

G4bool G4INCL::Nucleus::containsSigma ( )
inline

Returns true if the nucleus contains any Sigma.

Definition at line 363 of file G4INCLNucleus.hh.

363 {
364 ParticleList const &inside = theStore->getParticles();
365 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
366 if((*i)->isSigma()) return true;
367 return false;
368 }

◆ decayInsideDeltas()

G4bool G4INCL::Nucleus::decayInsideDeltas ( )

Force the decay of deltas inside the nucleus.

Returns
true if any delta was forced to decay.

Definition at line 399 of file G4INCLNucleus.cc.

399 {
400 /* If there is a pion potential, do nothing (deltas will be counted as
401 * excitation energy).
402 * If, however, the remnant is unphysical (Z<0 or Z>A), force the deltas to
403 * decay and get rid of all the pions. In case you're wondering, you can
404 * end up with Z<0 or Z>A if the remnant contains more pi- than protons or
405 * more pi+ than neutrons, respectively.
406 */
407 const G4bool unphysicalRemnant = (theZ<0 || theZ>theA);
408 if(thePotential->hasPionPotential() && !unphysicalRemnant)
409 return false;
410
411 // Build a list of deltas (avoid modifying the list you are iterating on).
412 ParticleList const &inside = theStore->getParticles();
413 ParticleList deltas;
414 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
415 if((*i)->isDelta()) deltas.push_back((*i));
416
417 // Loop over the deltas, make them decay
418 for(ParticleIter i=deltas.begin(), e=deltas.end(); i!=e; ++i) {
419 INCL_DEBUG("Decay inside delta particle:" << '\n'
420 << (*i)->print() << '\n');
421 // Create a forced-decay avatar. Note the last boolean parameter. Note
422 // also that if the remnant is unphysical we more or less explicitly give
423 // up energy conservation and CDPP by passing a NULL pointer for the
424 // nucleus.
425 IAvatar *decay;
426 if(unphysicalRemnant) {
427 INCL_WARN("Forcing delta decay inside an unphysical remnant (A=" << theA
428 << ", Z=" << theZ << "). Might lead to energy-violation warnings."
429 << '\n');
430 decay = new DecayAvatar((*i), 0.0, NULL, true);
431 } else
432 decay = new DecayAvatar((*i), 0.0, this, true);
433 FinalState *fs = decay->getFinalState();
434
435 // The pion can be ejected only if we managed to satisfy energy
436 // conservation and if pion emission does not lead to negative excitation
437 // energies.
438 if(fs->getValidity()==ValidFS) {
439 // Apply the final state to the nucleus
440 applyFinalState(fs);
441 }
442 delete fs;
443 delete decay;
444 }
445
446 // If the remnant is unphysical, emit all the pions
447 if(unphysicalRemnant) {
448 INCL_DEBUG("Remnant is unphysical: Z=" << theZ << ", A=" << theA << ", emitting all the pions" << '\n');
450 }
451
452 return true;
453 }
#define INCL_WARN(x)
void applyFinalState(FinalState *)
ParticleList decay(Cluster *const c)
Carries out a cluster decay.

◆ decayInsideStrangeParticles()

G4bool G4INCL::Nucleus::decayInsideStrangeParticles ( )

Force the transformation of strange particles into a Lambda;.

Returns
true if any strange particles was forced to absorb.

Definition at line 455 of file G4INCLNucleus.cc.

455 {
456
457 /* Transform each strange particles into a lambda
458 * Every Kaon (KPlus and KZero) are emited
459 */
460 const G4bool unphysicalRemnant = (theZ<0 || theZ>theA);
461 if(unphysicalRemnant){
463 INCL_WARN("Remnant is unphysical: Z=" << theZ << ", A=" << theA << ", too much strange particles? -> all emit" << '\n');
464 return false;
465 }
466
467 /* Build a list of particles with a strangeness == -1 except Lambda,
468 * and two other one for proton and neutron
469 */
470 ParticleList const &inside = theStore->getParticles();
471 ParticleList stranges;
472 ParticleList protons;
473 ParticleList neutrons;
474 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i){
475 if((*i)->isSigma() || (*i)->isAntiKaon()) stranges.push_back((*i));
476 else if((*i)->isNucleon() && (*i)->getZ() == 1) protons.push_back((*i));
477 else if((*i)->isNucleon() && (*i)->getZ() == 0) neutrons.push_back((*i));
478 }
479
480 if((stranges.size() > protons.size()) || (stranges.size() > neutrons.size())){
481 INCL_WARN("Remnant is unphysical: Nproton=" << protons.size() << ", Nneutron=" << neutrons.size() << ", Strange particles : " << stranges.size() << '\n');
483 return false;
484 }
485
486 // Loop over the strange particles, make them absorbe
487 ParticleIter protonIter = protons.begin();
488 ParticleIter neutronIter = neutrons.begin();
489 for(ParticleIter i=stranges.begin(), e=stranges.end(); i!=e; ++i) {
490 INCL_DEBUG("Absorbe inside strange particles:" << '\n'
491 << (*i)->print() << '\n');
492 IAvatar *decay;
493 if((*i)->getType() == SigmaMinus){
494 decay = new DecayAvatar((*protonIter), (*i), 0.0, this, true);
495 ++protonIter;
496 }
497 else if((*i)->getType() == SigmaPlus){
498 decay = new DecayAvatar((*neutronIter), (*i), 0.0, this, true);
499 ++neutronIter;
500 }
501 else if(Random::shoot()*(protons.size() + neutrons.size()) < protons.size()){
502 decay = new DecayAvatar((*protonIter), (*i), 0.0, this, true);
503 ++protonIter;
504 }
505 else {
506 decay = new DecayAvatar((*neutronIter), (*i), 0.0, this, true);
507 ++neutronIter;
508 }
509 FinalState *fs = decay->getFinalState();
510 applyFinalState(fs);
511 delete fs;
512 delete decay;
513 }
514
515 return true;
516 }
void emitInsideStrangeParticles()
Force emission of all strange particles inside the nucleus.
G4double shoot()

◆ decayMe()

G4bool G4INCL::Nucleus::decayMe ( )

Force the phase-space decay of the Nucleus.

Only applied if Z==0 or N==0.

Returns
true if the nucleus was forced to decay.

Definition at line 696 of file G4INCLNucleus.cc.

696 {
697 // Do the phase-space decay only if Z=0 or N=0
698 if(theA<=1 || (theZ!=0 && (theA+theS)!=theZ))
699 return false;
700
701 ParticleList decayProducts = ClusterDecay::decay(this);
702 for(ParticleIter j=decayProducts.begin(), e=decayProducts.end(); j!=e; ++j){
703 (*j)->setBiasCollisionVector(this->getBiasCollisionVector());
704 theStore->addToOutgoing(*j);
705 }
706
707 return true;
708 }
std::vector< G4int > getBiasCollisionVector() const
Get the vector list of biased vertices on the particle path.

◆ decayOutgoingClusters()

G4bool G4INCL::Nucleus::decayOutgoingClusters ( )

Force the decay of unstable outgoing clusters.

Returns
true if any cluster was forced to decay.

Definition at line 671 of file G4INCLNucleus.cc.

671 {
672 ParticleList const &out = theStore->getOutgoingParticles();
673 ParticleList clusters;
674 for(ParticleIter i=out.begin(), e=out.end(); i!=e; ++i) {
675 if((*i)->isCluster()) clusters.push_back((*i));
676 }
677 if(clusters.empty()) return false;
678
679 for(ParticleIter i=clusters.begin(), e=clusters.end(); i!=e; ++i) {
680 Cluster *cluster = dynamic_cast<Cluster*>(*i); // Can't avoid using a cast here
681// assert(cluster);
682#ifdef INCLXX_IN_GEANT4_MODE
683 if(!cluster)
684 continue;
685#endif
686 cluster->deleteParticles(); // Don't need them
687 ParticleList decayProducts = ClusterDecay::decay(cluster);
688 for(ParticleIter j=decayProducts.begin(), end=decayProducts.end(); j!=end; ++j){
689 (*j)->setBiasCollisionVector(cluster->getBiasCollisionVector());
690 theStore->addToOutgoing(*j);
691 }
692 }
693 return true;
694 }

◆ decayOutgoingDeltas()

G4bool G4INCL::Nucleus::decayOutgoingDeltas ( )

Force the decay of outgoing deltas.

Returns
true if any delta was forced to decay.

Definition at line 346 of file G4INCLNucleus.cc.

346 {
347 ParticleList const &out = theStore->getOutgoingParticles();
348 ParticleList deltas;
349 for(ParticleIter i=out.begin(), e=out.end(); i!=e; ++i) {
350 if((*i)->isDelta()) deltas.push_back((*i));
351 }
352 if(deltas.empty()) return false;
353
354 for(ParticleIter i=deltas.begin(), e=deltas.end(); i!=e; ++i) {
355 INCL_DEBUG("Decay outgoing delta particle:" << '\n'
356 << (*i)->print() << '\n');
357 const ThreeVector beta = -(*i)->boostVector();
358 const G4double deltaMass = (*i)->getMass();
359
360 // Set the delta momentum to zero and sample the decay in the CM frame.
361 // This makes life simpler if we are using real particle masses.
362 (*i)->setMomentum(ThreeVector());
363 (*i)->setEnergy((*i)->getMass());
364
365 // Use a DecayAvatar
366 IAvatar *decay = new DecayAvatar((*i), 0.0, NULL);
367 FinalState *fs = decay->getFinalState();
368 Particle * const pion = fs->getCreatedParticles().front();
369 Particle * const nucleon = fs->getModifiedParticles().front();
370
371 // Adjust the decay momentum if we are using the real masses
372 const G4double decayMomentum = KinematicsUtils::momentumInCM(deltaMass,
373 nucleon->getTableMass(),
374 pion->getTableMass());
375 ThreeVector newMomentum = pion->getMomentum();
376 newMomentum *= decayMomentum / newMomentum.mag();
377
378 pion->setTableMass();
379 pion->setMomentum(newMomentum);
380 pion->adjustEnergyFromMomentum();
381 pion->setEmissionTime(nucleon->getEmissionTime());
382 pion->boost(beta);
383 pion->setBiasCollisionVector(nucleon->getBiasCollisionVector());
384
385 nucleon->setTableMass();
386 nucleon->setMomentum(-newMomentum);
387 nucleon->adjustEnergyFromMomentum();
388 nucleon->boost(beta);
389
390 theStore->addToOutgoing(pion);
391
392 delete fs;
393 delete decay;
394 }
395
396 return true;
397 }
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
G4bool nucleon(G4int ityp)

◆ decayOutgoingNeutralKaon()

G4bool G4INCL::Nucleus::decayOutgoingNeutralKaon ( )

Force the transformation of outgoing Neutral Kaon into propation eigenstate.

Returns
true if any kaon was forced to decay.

Definition at line 648 of file G4INCLNucleus.cc.

648 {
649 ParticleList const &out = theStore->getOutgoingParticles();
650 ParticleList neutralkaon;
651 for(ParticleIter i=out.begin(), e=out.end(); i!=e; ++i) {
652 if((*i)->getType() == KZero || (*i)->getType() == KZeroBar) neutralkaon.push_back((*i));
653 }
654 if(neutralkaon.empty()) return false;
655
656 for(ParticleIter i=neutralkaon.begin(), e=neutralkaon.end(); i!=e; ++i) {
657 INCL_DEBUG("Transform outgoing neutral kaon:" << '\n'
658 << (*i)->print() << '\n');
659
660 // Use a DecayAvatar
661 IAvatar *decay = new DecayAvatar((*i), 0.0, NULL);
662 FinalState *fs = decay->getFinalState();
663
664 delete fs;
665 delete decay;
666 }
667
668 return true;
669 }

◆ decayOutgoingPionResonances()

G4bool G4INCL::Nucleus::decayOutgoingPionResonances ( G4double timeThreshold)

Force the decay of outgoing PionResonances (eta/omega).

Returns
true if any eta was forced to decay.

Definition at line 518 of file G4INCLNucleus.cc.

518 {
519 ParticleList const &out = theStore->getOutgoingParticles();
520 ParticleList pionResonances;
521 for(ParticleIter i=out.begin(), e=out.end(); i!=e; ++i) {
522// if((*i)->isEta() || (*i)->isOmega()) pionResonances.push_back((*i));
523 if(((*i)->isEta() && timeThreshold > ParticleTable::getWidth(Eta)) || ((*i)->isOmega() && timeThreshold > ParticleTable::getWidth(Omega))) pionResonances.push_back((*i));
524 }
525 if(pionResonances.empty()) return false;
526
527 for(ParticleIter i=pionResonances.begin(), e=pionResonances.end(); i!=e; ++i) {
528 INCL_DEBUG("Decay outgoing pionResonances particle:" << '\n'
529 << (*i)->print() << '\n');
530 const ThreeVector beta = -(*i)->boostVector();
531 const G4double pionResonanceMass = (*i)->getMass();
532
533 // Set the pionResonance momentum to zero and sample the decay in the CM frame.
534 // This makes life simpler if we are using real particle masses.
535 (*i)->setMomentum(ThreeVector());
536 (*i)->setEnergy((*i)->getMass());
537
538 // Use a DecayAvatar
539 IAvatar *decay = new DecayAvatar((*i), 0.0, NULL);
540 FinalState *fs = decay->getFinalState();
541
542 Particle * const theModifiedParticle = fs->getModifiedParticles().front();
543 ParticleList const &created = fs->getCreatedParticles();
544 Particle * const theCreatedParticle1 = created.front();
545
546 if (created.size() == 1) {
547
548 // Adjust the decay momentum if we are using the real masses
549 const G4double decayMomentum = KinematicsUtils::momentumInCM(pionResonanceMass,theModifiedParticle->getTableMass(),theCreatedParticle1->getTableMass());
550 ThreeVector newMomentum = theCreatedParticle1->getMomentum();
551 newMomentum *= decayMomentum / newMomentum.mag();
552
553 theCreatedParticle1->setTableMass();
554 theCreatedParticle1->setMomentum(newMomentum);
555 theCreatedParticle1->adjustEnergyFromMomentum();
556 theCreatedParticle1->setEmissionTime((*i)->getEmissionTime());
557 theCreatedParticle1->boost(beta);
558 theCreatedParticle1->setBiasCollisionVector(theModifiedParticle->getBiasCollisionVector());
559
560 theModifiedParticle->setTableMass();
561 theModifiedParticle->setMomentum(-newMomentum);
562 theModifiedParticle->adjustEnergyFromMomentum();
563 theModifiedParticle->boost(beta);
564
565 theStore->addToOutgoing(theCreatedParticle1);
566 }
567 else if (created.size() == 2) {
568 Particle * const theCreatedParticle2 = created.back();
569
570 theCreatedParticle1->boost(beta);
571 theCreatedParticle1->setBiasCollisionVector(theModifiedParticle->getBiasCollisionVector());
572 theCreatedParticle1->setEmissionTime((*i)->getEmissionTime());
573 theCreatedParticle2->boost(beta);
574 theCreatedParticle2->setBiasCollisionVector(theModifiedParticle->getBiasCollisionVector());
575 theCreatedParticle2->setEmissionTime((*i)->getEmissionTime());
576 theModifiedParticle->boost(beta);
577
578 theStore->addToOutgoing(theCreatedParticle1);
579 theStore->addToOutgoing(theCreatedParticle2);
580 }
581 else {
582 INCL_ERROR("Wrong number (< 2) of created particles during the decay of a pion resonance");
583 }
584 delete fs;
585 delete decay;
586 }
587
588 return true;
589 }
G4double getWidth(const ParticleType t)
Get particle width (in s).

◆ decayOutgoingSigmaZero()

G4bool G4INCL::Nucleus::decayOutgoingSigmaZero ( G4double timeThreshold)

Force the decay of outgoing Neutral Sigma.

Returns
true if any Sigma was forced to decay.

Definition at line 591 of file G4INCLNucleus.cc.

591 {
592 ParticleList const &out = theStore->getOutgoingParticles();
593 ParticleList neutralsigma;
594 for(ParticleIter i=out.begin(), e=out.end(); i!=e; ++i) {
595 if((*i)->getType() == SigmaZero && timeThreshold > ParticleTable::getWidth(SigmaZero)) neutralsigma.push_back((*i));
596 }
597 if(neutralsigma.empty()) return false;
598
599 for(ParticleIter i=neutralsigma.begin(), e=neutralsigma.end(); i!=e; ++i) {
600 INCL_DEBUG("Decay outgoing neutral sigma:" << '\n'
601 << (*i)->print() << '\n');
602 const ThreeVector beta = -(*i)->boostVector();
603 const G4double neutralsigmaMass = (*i)->getMass();
604
605 // Set the neutral sigma momentum to zero and sample the decay in the CM frame.
606 // This makes life simpler if we are using real particle masses.
607 (*i)->setMomentum(ThreeVector());
608 (*i)->setEnergy((*i)->getMass());
609
610 // Use a DecayAvatar
611 IAvatar *decay = new DecayAvatar((*i), 0.0, NULL);
612 FinalState *fs = decay->getFinalState();
613
614 Particle * const theModifiedParticle = fs->getModifiedParticles().front();
615 ParticleList const &created = fs->getCreatedParticles();
616 Particle * const theCreatedParticle = created.front();
617
618 if (created.size() == 1) {
619
620 // Adjust the decay momentum if we are using the real masses
621 const G4double decayMomentum = KinematicsUtils::momentumInCM(neutralsigmaMass,theModifiedParticle->getTableMass(),theCreatedParticle->getTableMass());
622 ThreeVector newMomentum = theCreatedParticle->getMomentum();
623 newMomentum *= decayMomentum / newMomentum.mag();
624
625 theCreatedParticle->setTableMass();
626 theCreatedParticle->setMomentum(newMomentum);
627 theCreatedParticle->adjustEnergyFromMomentum();
628 theCreatedParticle->boost(beta);
629 theCreatedParticle->setBiasCollisionVector(theModifiedParticle->getBiasCollisionVector());
630
631 theModifiedParticle->setTableMass();
632 theModifiedParticle->setMomentum(-newMomentum);
633 theModifiedParticle->adjustEnergyFromMomentum();
634 theModifiedParticle->boost(beta);
635
636 theStore->addToOutgoing(theCreatedParticle);
637 }
638 else {
639 INCL_ERROR("Wrong number (!= 1) of created particles during the decay of a sigma zero");
640 }
641 delete fs;
642 delete decay;
643 }
644
645 return true;
646 }

◆ deleteProjectileRemnant()

void G4INCL::Nucleus::deleteProjectileRemnant ( )
inline

Delete the projectile remnant.

Definition at line 525 of file G4INCLNucleus.hh.

525 {
526 delete theProjectileRemnant;
527 theProjectileRemnant = NULL;
528 }

Referenced by ~Nucleus().

◆ emitInsideAnnihilationProducts()

G4bool G4INCL::Nucleus::emitInsideAnnihilationProducts ( )

Force emission of all Antinucleon inside the nucleus.

Definition at line 923 of file G4INCLNucleus.cc.

923 {
924 /* Forcing annihilation of all Antinucleons in the nucleus and emission of the resulting particles.
925 */
926 INCL_DEBUG("Forcing annihilation of all Antinucleons and emission of all produced mesons in the nucleus." << '\n' );
927 const G4double tinyEnergy = 0.1; // MeV
928
929 ParticleList const &inside = theStore->getParticles();
930 ParticleList antinucleons;
931 ParticleList toEject; // mesons from antinucleon annihilations to be ejected
932 G4double theNewZ=theZ;
933
934 // Build a list of remaining antinucleons
935 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
936 if((*i)->isAntiNucleon()) antinucleons.push_back((*i));
937
938 // Loop over the antinucleons, build a list of mesons to be ejected
939 for(ParticleIter i=antinucleons.begin(), e=antinucleons.end(); i!=e; ++i) {
940 Particle * theAnnihilated = nullptr;
941 G4double dist_NbarNuc = 1000.; //just a high random beginning
942 G4double temp_dist = 0.;
943 // Nucleon annihilated
944 for (ParticleIter pnuc=inside.begin(), enuc=inside.end(); pnuc!=enuc;++pnuc){
945 if ((*pnuc)->isNucleon()){
946 temp_dist = ((*pnuc)->getPosition() - (*i)->getPosition()).mag(); // calculate distance between the antinucleon and nucleons in the nucleus
947 if(temp_dist < dist_NbarNuc){ //obtain information of the last nucleon that was close enough
948 dist_NbarNuc = temp_dist;
949 theAnnihilated = (*pnuc);
950 }
951 }
952 }
953 // Annihilation (meson production)
954 INCL_DEBUG("Forcing collision of the following particle :" <<'\n' << (*i)->print() << '\n' << theAnnihilated->print() << '\n' );
955 theNewZ = theNewZ - (theAnnihilated->getZ() + ((*i)->getZ()));
956 BinaryCollisionAvatar *collision = new BinaryCollisionAvatar(0.,9999.,this,theAnnihilated,(*i)); //Binary Collision Avatar to annihilate; XS=9999. means force annihilation
957 FinalState *fs = collision->getFinalState();
958 applyFinalState(fs);
959 INCL_DEBUG("Forcing Emission of the resulting particle of the forced annihilation" << '\n');
960 ParticleList modifiedparts = fs->getModifiedParticles();
961 for(ParticleIter outs=modifiedparts.begin(), eouts=modifiedparts.end();outs!=eouts;outs++){
962 toEject.push_back((*outs));
963 }
964 ParticleList const &created = fs->getCreatedParticles();
965 if(created.size() !=0){
966 for(ParticleIter out=created.begin(),eout=created.end();out!=eout;out++){
967 toEject.push_back((*out));
968 }
969 }
970 delete fs;
971 delete collision;
972 }
973
974 // Loop over the mesons to be ejected
975 for(ParticleIter iEject=toEject.begin(),eEject=toEject.end();iEject!=eEject;iEject++){ //Eject all produced mesons
976 (*iEject)->setEmissionTime(theStore->getBook().getCurrentTime());
977 G4double theQValueCorrection = (*iEject)->getEmissionQValueCorrection(theA,theZ,theS);
978 G4double kineticEnergyOutside = (*iEject)->getKineticEnergy() - (*iEject)->getPotentialEnergy() + theQValueCorrection;
979 (*iEject)->setTableMass();
980 if(kineticEnergyOutside > 0.0)
981 (*iEject)->setEnergy((*iEject)->getMass() + kineticEnergyOutside);
982 else
983 (*iEject)->setEnergy((*iEject)->getMass() + tinyEnergy);
984 (*iEject)->adjustMomentumFromEnergy();
985 (*iEject)->setPotentialEnergy(0.);
986 theStore->particleHasBeenEjected(*iEject);
987 theStore->addToOutgoing(*iEject);
988 }
989
990 theZ = theNewZ;
991 return true;
992 }

◆ emitInsideAntilambda()

G4int G4INCL::Nucleus::emitInsideAntilambda ( )

Force emission of all Antilambda.

Definition at line 836 of file G4INCLNucleus.cc.

836 {
837 /* Forcing emissions of all Antilambdas in the nucleus.
838 * This probably violates energy conservation
839 * (although the computation of the recoil kinematics
840 * might sweep this under the carpet).
841 */
842 INCL_DEBUG("Forcing emissions of all antiLambda in the nucleus." << '\n');
843
844 // Emit the Lambda with this kinetic energy
845 const G4double tinyEnergy = 0.1; // MeV
846
847 // Push out the emitted Lambda
848 ParticleList const &inside = theStore->getParticles();
849 ParticleList toEject;
850 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i) {
851 if((*i)->isAntiLambda()) {
852 Particle * const theAntiLambda = *i;
853 INCL_DEBUG("Forcing emission of the following particle: "
854 << theAntiLambda->print() << '\n');
855 theAntiLambda->setEmissionTime(theStore->getBook().getCurrentTime());
856 // Correction for real masses
857 const G4double theQValueCorrection = theAntiLambda->getEmissionQValueCorrection(theA,theZ,theS); // Does it work for strange particles? Should be check
858 const G4double kineticEnergyOutside = theAntiLambda->getKineticEnergy() - theAntiLambda->getPotentialEnergy() + theQValueCorrection;
859 theAntiLambda->setTableMass();
860 if(kineticEnergyOutside > 0.0)
861 theAntiLambda->setEnergy(theAntiLambda->getMass()+kineticEnergyOutside);
862 else
863 theAntiLambda->setEnergy(theAntiLambda->getMass()+tinyEnergy);
864 theAntiLambda->adjustMomentumFromEnergy();
865 theAntiLambda->setPotentialEnergy(0.);
866 theA -= theAntiLambda->getA();
867 theS -= theAntiLambda->getS();
868 toEject.push_back(theAntiLambda);
869 }
870 }
871 for(ParticleIter i=toEject.begin(), e=toEject.end(); i!=e; ++i) {
872 theStore->particleHasBeenEjected(*i);
873 theStore->addToOutgoing(*i);
874 (*i)->setParticleBias(Particle::getTotalBias());
875 }
876 return (G4int)toEject.size();
877 }
int G4int
Definition G4Types.hh:85
static G4double getTotalBias()
General bias vector function.

◆ emitInsideKaon()

G4bool G4INCL::Nucleus::emitInsideKaon ( )

Force emission of all Kaon inside the nucleus.

Definition at line 879 of file G4INCLNucleus.cc.

879 {
880 /* Forcing emissions of all Kaon (not antiKaons) in the nucleus.
881 * This probably violates energy conservation
882 * (although the computation of the recoil kinematics
883 * might sweep this under the carpet).
884 */
885 INCL_DEBUG("Forcing emissions of all Kaon in the nucleus." << '\n');
886
887 // Emit the Kaon with this kinetic energy (not supposed to append
888 const G4double tinyEnergy = 0.1; // MeV
889
890 // Push out the emitted kaon
891 ParticleList const &inside = theStore->getParticles();
892 ParticleList toEject;
893 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i) {
894 if((*i)->isKaon()) {
895 Particle * const theKaon = *i;
896 INCL_DEBUG("Forcing emission of the following particle: "
897 << theKaon->print() << '\n');
898 theKaon->setEmissionTime(theStore->getBook().getCurrentTime());
899 // Correction for real masses
900 const G4double theQValueCorrection = theKaon->getEmissionQValueCorrection(theA,theZ,theS);
901 const G4double kineticEnergyOutside = theKaon->getKineticEnergy() - theKaon->getPotentialEnergy() + theQValueCorrection;
902 theKaon->setTableMass();
903 if(kineticEnergyOutside > 0.0)
904 theKaon->setEnergy(theKaon->getMass()+kineticEnergyOutside);
905 else
906 theKaon->setEnergy(theKaon->getMass()+tinyEnergy);
907 theKaon->adjustMomentumFromEnergy();
908 theKaon->setPotentialEnergy(0.);
909 theZ -= theKaon->getZ();
910 theS -= theKaon->getS();
911 toEject.push_back(theKaon);
912 }
913 }
914 for(ParticleIter i=toEject.begin(), e=toEject.end(); i!=e; ++i) {
915 theStore->particleHasBeenEjected(*i);
916 theStore->addToOutgoing(*i);
917 (*i)->setParticleBias(Particle::getTotalBias());
918 }
919 theNKaon -= 1;
920 return toEject.size() != 0;
921 }
G4int theNKaon
The number of Kaons inside the nucleus (update during the cascade).

◆ emitInsideLambda()

G4int G4INCL::Nucleus::emitInsideLambda ( )

Force emission of all Lambda (desexitation code with strangeness not implanted yet).

Definition at line 793 of file G4INCLNucleus.cc.

793 {
794 /* Forcing emissions of all Lambda in the nucleus.
795 * This probably violates energy conservation
796 * (although the computation of the recoil kinematics
797 * might sweep this under the carpet).
798 */
799 INCL_DEBUG("Forcing emissions of all Lambda in the nucleus." << '\n');
800
801 // Emit the Lambda with this kinetic energy
802 const G4double tinyEnergy = 0.1; // MeV
803
804 // Push out the emitted Lambda
805 ParticleList const &inside = theStore->getParticles();
806 ParticleList toEject;
807 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i) {
808 if((*i)->isLambda()) {
809 Particle * const theLambda = *i;
810 INCL_DEBUG("Forcing emission of the following particle: "
811 << theLambda->print() << '\n');
812 theLambda->setEmissionTime(theStore->getBook().getCurrentTime());
813 // Correction for real masses
814 const G4double theQValueCorrection = theLambda->getEmissionQValueCorrection(theA,theZ,theS); // Does it work for strange particles? Should be check
815 const G4double kineticEnergyOutside = theLambda->getKineticEnergy() - theLambda->getPotentialEnergy() + theQValueCorrection;
816 theLambda->setTableMass();
817 if(kineticEnergyOutside > 0.0)
818 theLambda->setEnergy(theLambda->getMass()+kineticEnergyOutside);
819 else
820 theLambda->setEnergy(theLambda->getMass()+tinyEnergy);
821 theLambda->adjustMomentumFromEnergy();
822 theLambda->setPotentialEnergy(0.);
823 theA -= theLambda->getA();
824 theS -= theLambda->getS();
825 toEject.push_back(theLambda);
826 }
827 }
828 for(ParticleIter i=toEject.begin(), e=toEject.end(); i!=e; ++i) {
829 theStore->particleHasBeenEjected(*i);
830 theStore->addToOutgoing(*i);
831 (*i)->setParticleBias(Particle::getTotalBias());
832 }
833 return (G4int)toEject.size();
834 }

◆ emitInsidePions()

void G4INCL::Nucleus::emitInsidePions ( )

Force emission of all pions inside the nucleus.

Definition at line 710 of file G4INCLNucleus.cc.

710 {
711 /* Forcing emissions of all pions in the nucleus. This probably violates
712 * energy conservation (although the computation of the recoil kinematics
713 * might sweep this under the carpet).
714 */
715 INCL_WARN("Forcing emissions of all pions in the nucleus." << '\n');
716
717 // Emit the pions with this kinetic energy
718 const G4double tinyPionEnergy = 0.1; // MeV
719
720 // Push out the emitted pions
721 ParticleList const &inside = theStore->getParticles();
722 ParticleList toEject;
723 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i) {
724 if((*i)->isPion()) {
725 Particle * const thePion = *i;
726 INCL_DEBUG("Forcing emission of the following particle: "
727 << thePion->print() << '\n');
728 thePion->setEmissionTime(theStore->getBook().getCurrentTime());
729 // Correction for real masses
730 const G4double theQValueCorrection = thePion->getEmissionQValueCorrection(theA,theZ,theS);
731 const G4double kineticEnergyOutside = thePion->getKineticEnergy() - thePion->getPotentialEnergy() + theQValueCorrection;
732 thePion->setTableMass();
733 if(kineticEnergyOutside > 0.0)
734 thePion->setEnergy(thePion->getMass()+kineticEnergyOutside);
735 else
736 thePion->setEnergy(thePion->getMass()+tinyPionEnergy);
737 thePion->adjustMomentumFromEnergy();
738 thePion->setPotentialEnergy(0.);
739 theZ -= thePion->getZ();
740 toEject.push_back(thePion);
741 }
742 }
743 for(ParticleIter i=toEject.begin(), e=toEject.end(); i!=e; ++i) {
744 theStore->particleHasBeenEjected(*i);
745 theStore->addToOutgoing(*i);
746 (*i)->setParticleBias(Particle::getTotalBias());
747 }
748 }

Referenced by computeRecoilKinematics(), and decayInsideDeltas().

◆ emitInsideStrangeParticles()

void G4INCL::Nucleus::emitInsideStrangeParticles ( )

Force emission of all strange particles inside the nucleus.

Definition at line 750 of file G4INCLNucleus.cc.

750 {
751 /* Forcing emissions of Sigmas and antiKaons.
752 * This probably violates energy conservation
753 * (although the computation of the recoil kinematics
754 * might sweep this under the carpet).
755 */
756 INCL_DEBUG("Forcing emissions of all strange particles in the nucleus." << '\n');
757
758 // Emit the strange particles with this kinetic energy
759 const G4double tinyEnergy = 0.1; // MeV
760
761 // Push out the emitted strange particles
762 ParticleList const &inside = theStore->getParticles();
763 ParticleList toEject;
764 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i) {
765 if((*i)->isSigma() || (*i)->isAntiKaon()) {
766 Particle * const theParticle = *i;
767 INCL_DEBUG("Forcing emission of the following particle: "
768 << theParticle->print() << '\n');
769 theParticle->setEmissionTime(theStore->getBook().getCurrentTime());
770 // Correction for real masses
771 const G4double theQValueCorrection = theParticle->getEmissionQValueCorrection(theA,theZ,theS); // Does it work for strange particles? should be check
772 const G4double kineticEnergyOutside = theParticle->getKineticEnergy() - theParticle->getPotentialEnergy() + theQValueCorrection;
773 theParticle->setTableMass();
774 if(kineticEnergyOutside > 0.0)
775 theParticle->setEnergy(theParticle->getMass()+kineticEnergyOutside);
776 else
777 theParticle->setEnergy(theParticle->getMass()+tinyEnergy);
778 theParticle->adjustMomentumFromEnergy();
779 theParticle->setPotentialEnergy(0.);
780 theA -= theParticle->getA();
781 theZ -= theParticle->getZ();
782 theS -= theParticle->getS();
783 toEject.push_back(theParticle);
784 }
785 }
786 for(ParticleIter i=toEject.begin(), e=toEject.end(); i!=e; ++i) {
787 theStore->particleHasBeenEjected(*i);
788 theStore->addToOutgoing(*i);
789 (*i)->setParticleBias(Particle::getTotalBias());
790 }
791 }

Referenced by decayInsideStrangeParticles().

◆ fillEventInfo()

void G4INCL::Nucleus::fillEventInfo ( EventInfo * eventInfo)

Fill the event info which contains INCL output data

Definition at line 1164 of file G4INCLNucleus.cc.

1164 {
1165 eventInfo->nParticles = 0;
1166 G4bool isNucleonAbsorption = false;
1167 G4bool isPionAbsorption = false;
1168 // It is possible to have pion absorption event only if the
1169 // projectile is pion.
1170 if(eventInfo->projectileType == PiPlus ||
1171 eventInfo->projectileType == PiMinus ||
1172 eventInfo->projectileType == PiZero) {
1173 isPionAbsorption = true;
1174 }
1175
1176 // Forced CN
1177 eventInfo->forcedCompoundNucleus = tryCN;
1178
1179 // Outgoing particles
1180 ParticleList const &outgoingParticles = getStore()->getOutgoingParticles();
1181
1182 // Check if we have a nucleon absorption event: nucleon projectile
1183 // and no ejected particles.
1184 if(outgoingParticles.size() == 0 &&
1185 (eventInfo->projectileType == Proton ||
1186 eventInfo->projectileType == Neutron)) {
1187 isNucleonAbsorption = true;
1188 }
1189
1190 // Reset the remnant counter
1191 eventInfo->nRemnants = 0;
1192 eventInfo->history.clear();
1193
1194 for(ParticleIter i=outgoingParticles.begin(), e=outgoingParticles.end(); i!=e; ++i ) {
1195 // We have a pion absorption event only if the projectile is
1196 // pion and there are no ejected pions.
1197 if(isPionAbsorption) {
1198 if((*i)->isPion()) {
1199 isPionAbsorption = false;
1200 }
1201 }
1202
1203 eventInfo->ParticleBias[eventInfo->nParticles] = (*i)->getParticleBias();
1204
1205#ifdef INCLXX_IN_GEANT4_MODE
1206 eventInfo->A[eventInfo->nParticles] = (G4INCL::Short_t)(*i)->getA();
1207 eventInfo->Z[eventInfo->nParticles] = (G4INCL::Short_t)(*i)->getZ();
1208 eventInfo->S[eventInfo->nParticles] = (G4INCL::Short_t)(*i)->getS();
1209#else
1210 eventInfo->A[eventInfo->nParticles] = (Short_t)(*i)->getA();
1211 eventInfo->Z[eventInfo->nParticles] = (Short_t)(*i)->getZ();
1212 eventInfo->S[eventInfo->nParticles] = (Short_t)(*i)->getS();
1213#endif
1214 eventInfo->emissionTime[eventInfo->nParticles] = (*i)->getEmissionTime();
1215 eventInfo->EKin[eventInfo->nParticles] = (*i)->getKineticEnergy();
1216 ThreeVector mom = (*i)->getMomentum();
1217 eventInfo->px[eventInfo->nParticles] = mom.getX();
1218 eventInfo->py[eventInfo->nParticles] = mom.getY();
1219 eventInfo->pz[eventInfo->nParticles] = mom.getZ();
1220 eventInfo->theta[eventInfo->nParticles] = Math::toDegrees(mom.theta());
1221 eventInfo->phi[eventInfo->nParticles] = Math::toDegrees(mom.phi());
1222 eventInfo->origin[eventInfo->nParticles] = -1;
1223#ifdef INCLXX_IN_GEANT4_MODE
1224 eventInfo->parentResonancePDGCode[eventInfo->nParticles] = (*i)->getParentResonancePDGCode();
1225 eventInfo->parentResonanceID[eventInfo->nParticles] = (*i)->getParentResonanceID();
1226#endif
1227 eventInfo->history.push_back("");
1228 if ((*i)->getType() != Composite && (*i)->getType() != antiComposite ) {
1229 ParticleSpecies pt((*i)->getType());
1230 eventInfo->PDGCode[eventInfo->nParticles] = pt.getPDGCode();
1231 }
1232 else if((*i)->getType() == Composite) {
1233 ParticleSpecies pt((*i)->getA(), (*i)->getZ(), (*i)->getS());
1234 eventInfo->PDGCode[eventInfo->nParticles] = pt.getPDGCode();
1235 }
1236 else if((*i)->getType() == antiComposite) {
1237 ParticleSpecies pt(-(*i)->getA(), -(*i)->getZ(), (*i)->getS());
1238 eventInfo->PDGCode[eventInfo->nParticles] = pt.getPDGCode();
1239 }
1240 eventInfo->nParticles++;
1241 }
1242 eventInfo->nucleonAbsorption = isNucleonAbsorption;
1243 eventInfo->pionAbsorption = isPionAbsorption;
1244 eventInfo->nCascadeParticles = eventInfo->nParticles;
1245
1246 // Projectile-like remnant characteristics
1247 if(theProjectileRemnant && (theProjectileRemnant->getA()>0 || theProjectileRemnant->getA()<0)) {
1248#ifdef INCLXX_IN_GEANT4_MODE
1249 eventInfo->ARem[eventInfo->nRemnants] = (G4INCL::Short_t)theProjectileRemnant->getA();
1250 eventInfo->ZRem[eventInfo->nRemnants] = (G4INCL::Short_t)theProjectileRemnant->getZ();
1251 eventInfo->SRem[eventInfo->nRemnants] = (G4INCL::Short_t)theProjectileRemnant->getS();
1252#else
1253 eventInfo->ARem[eventInfo->nRemnants] = (Short_t)theProjectileRemnant->getA();
1254 eventInfo->ZRem[eventInfo->nRemnants] = (Short_t)theProjectileRemnant->getZ();
1255 eventInfo->SRem[eventInfo->nRemnants] = (Short_t)theProjectileRemnant->getS();
1256#endif
1257 G4double eStar = theProjectileRemnant->getExcitationEnergy();
1258 if(std::abs(eStar)<1E-10)
1259 eStar = 0.0; // blame rounding and set the excitation energy to zero
1260 eventInfo->EStarRem[eventInfo->nRemnants] = eStar;
1261 if(eventInfo->EStarRem[eventInfo->nRemnants]<0.) {
1262 INCL_WARN("Negative excitation energy in projectile-like remnant! EStarRem = " << eventInfo->EStarRem[eventInfo->nRemnants] << '\n');
1263 }
1264 const ThreeVector &spin = theProjectileRemnant->getSpin();
1265 if(eventInfo->ARem[eventInfo->nRemnants]%2==0) { // even-A nucleus
1266 eventInfo->JRem[eventInfo->nRemnants] = (G4int) (spin.mag()/PhysicalConstants::hc + 0.5);
1267 } else { // odd-A nucleus
1268 eventInfo->JRem[eventInfo->nRemnants] = ((G4int) (spin.mag()/PhysicalConstants::hc)) + 0.5;
1269 }
1270 eventInfo->EKinRem[eventInfo->nRemnants] = theProjectileRemnant->getKineticEnergy();
1271 const ThreeVector &mom = theProjectileRemnant->getMomentum();
1272 eventInfo->pxRem[eventInfo->nRemnants] = mom.getX();
1273 eventInfo->pyRem[eventInfo->nRemnants] = mom.getY();
1274 eventInfo->pzRem[eventInfo->nRemnants] = mom.getZ();
1275 eventInfo->jxRem[eventInfo->nRemnants] = spin.getX() / PhysicalConstants::hc;
1276 eventInfo->jyRem[eventInfo->nRemnants] = spin.getY() / PhysicalConstants::hc;
1277 eventInfo->jzRem[eventInfo->nRemnants] = spin.getZ() / PhysicalConstants::hc;
1278 eventInfo->thetaRem[eventInfo->nRemnants] = Math::toDegrees(mom.theta());
1279 eventInfo->phiRem[eventInfo->nRemnants] = Math::toDegrees(mom.phi());
1280 eventInfo->nRemnants++;
1281 }
1282
1283 // Target-like remnant characteristics
1284 if(hasRemnant()) {
1285#ifdef INCLXX_IN_GEANT4_MODE
1286 eventInfo->ARem[eventInfo->nRemnants] = (G4INCL::Short_t)getA();
1287 eventInfo->ZRem[eventInfo->nRemnants] = (G4INCL::Short_t)getZ();
1288 eventInfo->SRem[eventInfo->nRemnants] = (G4INCL::Short_t)getS();
1289#else
1290 eventInfo->ARem[eventInfo->nRemnants] = (Short_t)getA();
1291 eventInfo->ZRem[eventInfo->nRemnants] = (Short_t)getZ();
1292 eventInfo->SRem[eventInfo->nRemnants] = (Short_t)getS();
1293#endif
1294 eventInfo->EStarRem[eventInfo->nRemnants] = getExcitationEnergy();
1295 if(eventInfo->EStarRem[eventInfo->nRemnants]<0.) {
1296 INCL_WARN("Negative excitation energy in target-like remnant! EStarRem = " << eventInfo->EStarRem[eventInfo->nRemnants] << " eventNumber=" << eventInfo->eventNumber << '\n');
1297 }
1298 const ThreeVector &spin = getSpin();
1299 if(eventInfo->ARem[eventInfo->nRemnants]%2==0) { // even-A nucleus
1300 eventInfo->JRem[eventInfo->nRemnants] = (G4int) (spin.mag()/PhysicalConstants::hc + 0.5);
1301 } else { // odd-A nucleus
1302 eventInfo->JRem[eventInfo->nRemnants] = ((G4int) (spin.mag()/PhysicalConstants::hc)) + 0.5;
1303 }
1304 eventInfo->EKinRem[eventInfo->nRemnants] = getKineticEnergy();
1305 const ThreeVector &mom = getMomentum();
1306 eventInfo->pxRem[eventInfo->nRemnants] = mom.getX();
1307 eventInfo->pyRem[eventInfo->nRemnants] = mom.getY();
1308 eventInfo->pzRem[eventInfo->nRemnants] = mom.getZ();
1309 eventInfo->jxRem[eventInfo->nRemnants] = spin.getX() / PhysicalConstants::hc;
1310 eventInfo->jyRem[eventInfo->nRemnants] = spin.getY() / PhysicalConstants::hc;
1311 eventInfo->jzRem[eventInfo->nRemnants] = spin.getZ() / PhysicalConstants::hc;
1312 eventInfo->thetaRem[eventInfo->nRemnants] = Math::toDegrees(mom.theta());
1313 eventInfo->phiRem[eventInfo->nRemnants] = Math::toDegrees(mom.phi());
1314 eventInfo->nRemnants++;
1315 }
1316
1317 // Global counters, flags, etc.
1318 Book const &theBook = theStore->getBook();
1319 eventInfo->nCollisions = theBook.getAcceptedCollisions();
1320 eventInfo->nBlockedCollisions = theBook.getBlockedCollisions();
1321 eventInfo->nDecays = theBook.getAcceptedDecays();
1322 eventInfo->nBlockedDecays = theBook.getBlockedDecays();
1323 eventInfo->firstCollisionTime = theBook.getFirstCollisionTime();
1324 eventInfo->firstCollisionXSec = theBook.getFirstCollisionXSec();
1325 eventInfo->firstCollisionSpectatorPosition = theBook.getFirstCollisionSpectatorPosition();
1326 eventInfo->firstCollisionSpectatorMomentum = theBook.getFirstCollisionSpectatorMomentum();
1327 eventInfo->firstCollisionIsElastic = theBook.getFirstCollisionIsElastic();
1328 eventInfo->nReflectionAvatars = theBook.getAvatars(SurfaceAvatarType);
1329 eventInfo->nCollisionAvatars = theBook.getAvatars(CollisionAvatarType);
1330 eventInfo->nDecayAvatars = theBook.getAvatars(DecayAvatarType);
1331 eventInfo->nEnergyViolationInteraction = theBook.getEnergyViolationInteraction();
1332 eventInfo->nSrcPairs = theBook.getSrcPairs();
1333 eventInfo->nSrcCollisions = theBook.getAcceptedSrcCollisions();
1334 }
ThreeVector const & getSpin() const
Get the spin of the nucleus.
Store * getStore() const
G4double getExcitationEnergy() const
Get the excitation energy of the nucleus.
G4bool hasRemnant() const
Does the nucleus give a cascade remnant?
G4int getS() const
Returns the strangeness number.
G4int getZ() const
Returns the charge number.
G4double getKineticEnergy() const
Get the particle kinetic energy.
const G4INCL::ThreeVector & getMomentum() const
G4int getA() const
Returns the baryon number.
ParticleList const & getOutgoingParticles() const
G4double toDegrees(G4double radians)
const G4double hc
[MeV*fm]
short Short_t
@ SurfaceAvatarType
@ CollisionAvatarType
@ DecayAvatarType

◆ finalizeProjectileRemnant()

void G4INCL::Nucleus::finalizeProjectileRemnant ( const G4double emissionTime)

Finalise the projectile remnant.

Complete the treatment of the projectile remnant. If it contains nucleons, assign its excitation energy and spin. Move stuff to the outgoing list, if appropriate.

Parameters
emissionTimethe emission time of the projectile remnant

Definition at line 1426 of file G4INCLNucleus.cc.

1426 {
1427 // Deal with the projectile remnant
1428 const G4int prA = theProjectileRemnant->getA();
1429 if(prA>=1 || prA<=-1) {
1430 // Set the mass
1431 const G4double aMass = theProjectileRemnant->getInvariantMass();
1432 theProjectileRemnant->setMass(aMass);
1433
1434 // Compute the excitation energy from the invariant
1435 G4double anExcitationEnergy;
1436 if(prA>=1)
1437 anExcitationEnergy = aMass - ParticleTable::getTableMass(prA, theProjectileRemnant->getZ(), theProjectileRemnant->getS());
1438 else
1439 anExcitationEnergy = aMass - ParticleTable::getTableMass(-prA, -(theProjectileRemnant->getZ()), theProjectileRemnant->getS());
1440
1441 // Set the excitation energy
1442 theProjectileRemnant->setExcitationEnergy(anExcitationEnergy);
1443
1444 // No spin!
1445 theProjectileRemnant->setSpin(ThreeVector());
1446
1447 // Set the emission time
1448 theProjectileRemnant->setEmissionTime(anEmissionTime);
1449 }
1450 }

◆ getAnnihilationType()

AnnihilationType G4INCL::Nucleus::getAnnihilationType ( ) const
inline

Getter for theAnnihilationType.

Definition at line 559 of file G4INCLNucleus.hh.

559{ return theAType; }; //D

◆ getAType()

AnnihilationType G4INCL::Nucleus::getAType ( ) const

Definition at line 134 of file G4INCLNucleus.cc.

134 {
135 return theAType;
136 }

◆ getConservationBalance()

Nucleus::ConservationBalance G4INCL::Nucleus::getConservationBalance ( EventInfo const & theEventInfo,
const G4bool afterRecoil ) const

Compute charge, mass, energy and momentum balance.

Definition at line 1338 of file G4INCLNucleus.cc.

1338 {
1339 ConservationBalance theBalance;
1340 // Initialise balance variables with the incoming values
1341 INCL_DEBUG("theEventInfo " << theEventInfo.Zt << " " << theEventInfo.At << '\n');
1342 theBalance.Z = theEventInfo.Zp + theEventInfo.Zt;
1343 theBalance.A = theEventInfo.Ap + theEventInfo.At;
1344 theBalance.S = theEventInfo.Sp + theEventInfo.St;
1345 INCL_DEBUG("theBalance Z and A " << theBalance.Z << " " << theBalance.A << '\n');
1346 theBalance.energy = getInitialEnergy() + getSrcInternalEnergy();
1347 theBalance.momentum = getIncomingMomentum();
1348
1349 // Process outgoing particles
1350 ParticleList const &outgoingParticles = theStore->getOutgoingParticles();
1351 for(ParticleIter i=outgoingParticles.begin(), e=outgoingParticles.end(); i!=e; ++i ) {
1352 theBalance.Z -= (*i)->getZ();
1353 theBalance.A -= (*i)->getA();
1354 theBalance.S -= (*i)->getS();
1355 // For outgoing clusters, the total energy automatically includes the
1356 // excitation energy
1357 theBalance.energy -= (*i)->getEnergy(); // Note that outgoing particles should have the real mass
1358 theBalance.momentum -= (*i)->getMomentum();
1359 }
1360
1361 // Projectile-like remnant contribution, if present
1362 if(theProjectileRemnant && (theProjectileRemnant->getA()>0 || theProjectileRemnant->getA()<0)) {
1363 theBalance.Z -= theProjectileRemnant->getZ();
1364 theBalance.A -= theProjectileRemnant->getA();
1365 theBalance.S -= theProjectileRemnant->getS();
1366 if(theProjectileRemnant->getA()>0)
1367 theBalance.energy -= ParticleTable::getTableMass(theProjectileRemnant->getA(),theProjectileRemnant->getZ(),theProjectileRemnant->getS()) + theProjectileRemnant->getExcitationEnergy();
1368 else if(theProjectileRemnant->getA()<0)
1369 theBalance.energy -= ParticleTable::getTableMass(-(theProjectileRemnant->getA()),-(theProjectileRemnant->getZ()),theProjectileRemnant->getS()) + theProjectileRemnant->getExcitationEnergy();
1370 theBalance.energy -= theProjectileRemnant->getKineticEnergy();
1371 theBalance.momentum -= theProjectileRemnant->getMomentum();
1372 }
1373
1374 //Missed particle contribution, for anticomposite model B
1375 ParticleList const & missedParticles = theStore->getMissedParticles();
1376 for(ParticleIter i=missedParticles.begin(), e=missedParticles.end(); i!=e;++i){
1377 theBalance.Z -= (*i)->getZ();
1378 theBalance.A -= (*i)->getA();
1379 theBalance.S -= (*i)->getS();
1380 theBalance.energy -= (*i)->getEnergy();
1381 //theBalance.momentum -= (*i)->getMomentum();
1382 }
1383
1384 // Target-like remnant contribution, if present
1385 if(hasRemnant()) {
1386 theBalance.Z -= getZ();
1387 theBalance.A -= getA();
1388 theBalance.S -= getS();
1389 theBalance.energy -= ParticleTable::getTableMass(getA(),getZ(),getS()) +
1391 if(afterRecoil)
1392 theBalance.energy -= getKineticEnergy();
1393 theBalance.momentum -= getMomentum();
1394
1395 Book const &theBook = theStore->getBook();
1396
1397 if (getExcitationEnergy() < 0. && theBook.getAcceptedSrcCollisions()) {
1398 INCL_DEBUG("excitation energy negative and afterrecoil "
1399 << afterRecoil << " " << getExcitationEnergy()
1400 << " eventNumber=" << theEventInfo.eventNumber << " "
1401 << getInitialInternalEnergy() << '\n');
1402 INCL_DEBUG("excitation energy negative and afterrecoil "
1404 << " " << initialEnergy << '\n');
1405 }
1406
1407 if (theBook.getAcceptedSrcCollisions() && !afterRecoil) {
1408 INCL_DEBUG("excitation energy " << getExcitationEnergy()
1409 << " and afterrecoil 1 , kinetic energy ="
1410 << getKineticEnergy() << ", eventNumber="
1411 << theEventInfo.eventNumber << '\n');
1412 }
1413 }
1414
1415 return theBalance;
1416 }
G4double getSrcInternalEnergy() const
G4double getInitialInternalEnergy() const
const ThreeVector & getIncomingMomentum() const
Get the incoming momentum vector.
G4double getInitialEnergy() const
Get the initial energy.
Struct for conservation laws.

◆ getDensity()

NuclearDensity const * G4INCL::Nucleus::getDensity ( ) const
inline

Getter for theDensity.

Definition at line 553 of file G4INCLNucleus.hh.

553{ return theDensity; };

◆ getExcitationEnergy()

G4double G4INCL::Nucleus::getExcitationEnergy ( ) const
inline

Get the excitation energy of the nucleus.

Method computeRecoilKinematics() should be called first.

Definition at line 328 of file G4INCLNucleus.hh.

328{ return theExcitationEnergy; }

Referenced by fillEventInfo(), and getConservationBalance().

◆ getIncomingAngularMomentum()

const ThreeVector & G4INCL::Nucleus::getIncomingAngularMomentum ( ) const
inline

Get the incoming angular-momentum vector.

Definition at line 306 of file G4INCLNucleus.hh.

306{ return incomingAngularMomentum; }

◆ getIncomingMomentum()

const ThreeVector & G4INCL::Nucleus::getIncomingMomentum ( ) const
inline

Get the incoming momentum vector.

Definition at line 314 of file G4INCLNucleus.hh.

314 {
315 return incomingMomentum;
316 }

Referenced by getConservationBalance().

◆ getInitialA()

G4int G4INCL::Nucleus::getInitialA ( ) const
inline

Definition at line 126 of file G4INCLNucleus.hh.

126{ return theInitialA; };

◆ getInitialEnergy()

G4double G4INCL::Nucleus::getInitialEnergy ( ) const
inline

Get the initial energy.

Definition at line 322 of file G4INCLNucleus.hh.

322{ return initialEnergy; }

Referenced by getConservationBalance().

◆ getInitialInternalEnergy()

G4double G4INCL::Nucleus::getInitialInternalEnergy ( ) const
inline

Definition at line 434 of file G4INCLNucleus.hh.

434{ return initialInternalEnergy; };

Referenced by getConservationBalance().

◆ getInitialS()

G4int G4INCL::Nucleus::getInitialS ( ) const
inline

Definition at line 128 of file G4INCLNucleus.hh.

128{ return theInitialS; };

◆ getInitialZ()

G4int G4INCL::Nucleus::getInitialZ ( ) const
inline

Definition at line 127 of file G4INCLNucleus.hh.

127{ return theInitialZ; };

◆ getNumberOfEnteringantiNeutrons()

G4int G4INCL::Nucleus::getNumberOfEnteringantiNeutrons ( ) const
inline

Definition at line 142 of file G4INCLNucleus.hh.

142{ return theNantineutronInitial; };

◆ getNumberOfEnteringantiProtons()

G4int G4INCL::Nucleus::getNumberOfEnteringantiProtons ( ) const
inline

Definition at line 141 of file G4INCLNucleus.hh.

141{ return theNantiprotonInitial; };

◆ getNumberOfEnteringKaons()

G4int G4INCL::Nucleus::getNumberOfEnteringKaons ( ) const
inline

Definition at line 140 of file G4INCLNucleus.hh.

140{ return theNkaonplusInitial+theNkaonminusInitial; };

◆ getNumberOfEnteringNeutrons()

G4int G4INCL::Nucleus::getNumberOfEnteringNeutrons ( ) const
inline

Definition at line 138 of file G4INCLNucleus.hh.

138{ return theNnInitial; };

◆ getNumberOfEnteringPions()

G4int G4INCL::Nucleus::getNumberOfEnteringPions ( ) const
inline

Definition at line 139 of file G4INCLNucleus.hh.

139{ return theNpionplusInitial+theNpionminusInitial; };

◆ getNumberOfEnteringProtons()

G4int G4INCL::Nucleus::getNumberOfEnteringProtons ( ) const
inline

Definition at line 137 of file G4INCLNucleus.hh.

137{ return theNpInitial; };

◆ getPotential()

NuclearPotential::INuclearPotential const * G4INCL::Nucleus::getPotential ( ) const
inline

Getter for thePotential.

Definition at line 556 of file G4INCLNucleus.hh.

556{ return thePotential; };

◆ getProjectileRemnant()

ProjectileRemnant * G4INCL::Nucleus::getProjectileRemnant ( ) const
inline

Get the projectile remnant.

Definition at line 522 of file G4INCLNucleus.hh.

522{ return theProjectileRemnant; }

◆ getSrcInternalEnergy()

G4double G4INCL::Nucleus::getSrcInternalEnergy ( ) const
inline

Definition at line 417 of file G4INCLNucleus.hh.

417 {
418 return srcInternalEnergy;
419 }

Referenced by getConservationBalance().

◆ getStore()

Store * G4INCL::Nucleus::getStore ( ) const
inline

Definition at line 428 of file G4INCLNucleus.hh.

428{return theStore; };

Referenced by fillEventInfo().

◆ getSurfaceRadius()

G4double G4INCL::Nucleus::getSurfaceRadius ( Particle const *const particle) const
inline

Get the maximum allowed radius for a given particle.

Calls the NuclearDensity::getMaxRFromP() method for nucleons and deltas, and the NuclearDensity::getTrasmissionRadius() method for pions.

Parameters
particlepointer to a particle
Returns
surface radius

Definition at line 485 of file G4INCLNucleus.hh.

485 {
486 if(particle->isNucleon() || particle->isLambda() || particle->isResonance()){
487 const G4double pr = particle->getReflectionMomentum()/thePotential->getFermiMomentum(particle);
488 if(pr>=1.)
489 return getUniverseRadius();
490 else
491 return theDensity->getMaxRFromP(particle->getType(), pr);
492 }
493 else {
494 // Temporarily set RPION = RMAX
495 return getUniverseRadius();
496 //return 0.5*(theDensity->getTransmissionRadius(particle)+getUniverseRadius());
497 }
498 }
G4double getUniverseRadius() const
Getter for theUniverseRadius.

◆ getTransmissionBarrier()

G4double G4INCL::Nucleus::getTransmissionBarrier ( Particle const *const p)
inline

Get the transmission barrier.

Definition at line 456 of file G4INCLNucleus.hh.

456 {
457 const G4double theTransmissionRadius = theDensity->getTransmissionRadius(p);
458 const G4double theParticleZ = p->getZ();
459 return PhysicalConstants::eSquared*(theZ-theParticleZ)*theParticleZ/theTransmissionRadius;
460 }
const G4double eSquared
Coulomb conversion factor [MeV*fm].

◆ getTryCompoundNucleus()

G4bool G4INCL::Nucleus::getTryCompoundNucleus ( )
inline

Definition at line 453 of file G4INCLNucleus.hh.

453{ return tryCN; }

◆ getUniverseRadius()

G4double G4INCL::Nucleus::getUniverseRadius ( ) const
inline

Getter for theUniverseRadius.

Definition at line 501 of file G4INCLNucleus.hh.

501{ return theUniverseRadius; }

Referenced by getSurfaceRadius().

◆ hasRemnant()

G4bool G4INCL::Nucleus::hasRemnant ( ) const
inline

Does the nucleus give a cascade remnant?

To be called after computeRecoilKinematics().

Definition at line 446 of file G4INCLNucleus.hh.

446{ return remnant; }

Referenced by fillEventInfo(), and getConservationBalance().

◆ initializeParticles()

void G4INCL::Nucleus::initializeParticles ( )
virtual

Call the Cluster method to generate the initial distribution of particles. At the beginning all particles are assigned as spectators.

Reimplemented from G4INCL::Cluster.

Definition at line 142 of file G4INCLNucleus.cc.

142 {
143 // Reset the variables connected with the projectile remnant
144 delete theProjectileRemnant;
145 theProjectileRemnant = NULL;
147
148 for(ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
150 }
151 theStore->add(particles);
152 particles.clear();
153 initialInternalEnergy = computeTotalEnergy();
154 initialCenterOfMass = thePosition;
155 }
ParticleList particles
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
void updatePotentialEnergy(Particle *p) const
Update the particle potential energy.

◆ insertParticle()

void G4INCL::Nucleus::insertParticle ( Particle * p)
inline

Insert a new particle (e.g. a projectile) in the nucleus.

Definition at line 88 of file G4INCLNucleus.hh.

88 {
89 theZ += p->getZ();
90 theA += p->getA();
91 theS += p->getS();
92 theStore->particleHasEntered(p);
93 if(p->isNucleon()) {
94 theNpInitial += Math::heaviside(ParticleTable::getIsospin(p->getType()));
95 theNnInitial += Math::heaviside(-ParticleTable::getIsospin(p->getType()));
96 }
97 if(p->isLambda())
98 theNlInitial++;
99 if(p->getType() == SigmaPlus)
100 theNSpInitial++;
101 if(p->getType() == SigmaZero)
102 theNSzInitial++;
103 if(p->getType() == SigmaMinus)
104 theNSmInitial++;
105
106 if(p->isPion()) {
107 theNpionplusInitial += Math::heaviside(ParticleTable::getIsospin(p->getType()));
108 theNpionminusInitial += Math::heaviside(-ParticleTable::getIsospin(p->getType()));
109 }
110 if(p->isKaon() || p->isAntiKaon()) {
111 theNkaonplusInitial += Math::heaviside(ParticleTable::getIsospin(p->getType()));
112 theNkaonminusInitial += Math::heaviside(-ParticleTable::getIsospin(p->getType()));
113 }
114 if(p->isAntiNucleon()) {
115 if (p->getZ()<0) theNantiprotonInitial += Math::heaviside(-ParticleTable::getIsospin(p->getType()));
116 else theNantineutronInitial += Math::heaviside(ParticleTable::getIsospin(p->getType()));
117 }
118 if(!p->isTargetSpectator()) theStore->getBook().incrementCascading();
119 };
G4int heaviside(G4int n)
G4int getIsospin(const ParticleType t)
Get the isospin of a particle.

Referenced by applyFinalState().

◆ isEventTransparent()

G4bool G4INCL::Nucleus::isEventTransparent ( ) const

Is the event transparent?

To be called at the end of the cascade.

Definition at line 994 of file G4INCLNucleus.cc.

994 {
995
996 Book const &theBook = theStore->getBook();
997 const G4int nEventCollisions = theBook.getAcceptedCollisions();
998 const G4int nEventDecays = theBook.getAcceptedDecays();
999 const G4int nEventClusters = theBook.getEmittedClusters();
1000 if(nEventCollisions==0 && nEventDecays==0 && nEventClusters==0)
1001 return true;
1002
1003 return false;
1004
1005 }

◆ isNucleusNucleusCollision()

G4bool G4INCL::Nucleus::isNucleusNucleusCollision ( ) const
inline

Is it a nucleus-nucleus collision?

Definition at line 507 of file G4INCLNucleus.hh.

507{ return isNucleusNucleus; }

◆ operator=()

Nucleus & G4INCL::Nucleus::operator= ( const Nucleus & rhs)

Dummy assignment operator to silence Coverity warning.

◆ print()

std::string G4INCL::Nucleus::print ( )

Print the nucleus info

Definition at line 315 of file G4INCLNucleus.cc.

316 {
317 std::stringstream ss;
318 ss << "Particles in the nucleus:" << '\n'
319 << "Inside:" << '\n';
320 G4int counter = 1;
321 ParticleList const &inside = theStore->getParticles();
322 for(ParticleIter p=inside.begin(), e=inside.end(); p!=e; ++p) {
323 ss << "index = " << counter << '\n'
324 << (*p)->print();
325 counter++;
326 }
327 ss <<"Outgoing:" << '\n';
328 ParticleList const &outgoing = theStore->getOutgoingParticles();
329 for(ParticleIter p=outgoing.begin(), e=outgoing.end(); p!=e; ++p)
330 ss << (*p)->print();
331
332 return ss.str();
333 }

◆ propagateParticles()

void G4INCL::Nucleus::propagateParticles ( G4double step)

Propagate the particles one time step.

Parameters
steplength of the time step

Definition at line 235 of file G4INCLNucleus.cc.

235 {
236 INCL_WARN("Useless Nucleus::propagateParticles -method called." << '\n');
237 }

◆ resetSrc()

void G4INCL::Nucleus::resetSrc ( )
inline

Resets the src partners.

Definition at line 403 of file G4INCLNucleus.hh.

403 {
404 ParticleList const &inside = theStore->getParticles();
405 for(ParticleIter i=inside.begin(), e=inside.end(); i!=e; ++i)
406 (*i)->resetSrcPartner();
407 }

◆ restoreSrcPartner()

void G4INCL::Nucleus::restoreSrcPartner ( Particle * particle,
ThreeVector m )

Definition at line 335 of file G4INCLNucleus.cc.

335 {
336
337 std::cout << "restoreSrcPartner: " << particle->print() << std::endl;
338 std::cout << "restoreSrcPartner: " << m.print() << std::endl;
339
340 particle->setMomentum(m);
341 particle->adjustEnergyFromMomentum();
342
343 std::cout << "restoreSrcPartner bis: " << particle->print() << std::endl;
344}

◆ setAnnihilationType()

void G4INCL::Nucleus::setAnnihilationType ( const AnnihilationType at)
inline

Setter for theAnnihilationType.

Definition at line 562 of file G4INCLNucleus.hh.

562 {
563 theAType = at;
564 }; //D

◆ setAType()

void G4INCL::Nucleus::setAType ( AnnihilationType type)

Definition at line 138 of file G4INCLNucleus.cc.

138 {
139 theAType = type;
140 }

◆ setDensity()

void G4INCL::Nucleus::setDensity ( NuclearDensity const *const d)
inline

Setter for theDensity.

Definition at line 546 of file G4INCLNucleus.hh.

546 {
547 theDensity=d;
549 theParticleSampler->setDensity(theDensity);
550 };

◆ setIncomingAngularMomentum()

void G4INCL::Nucleus::setIncomingAngularMomentum ( const ThreeVector & j)
inline

Set the incoming angular-momentum vector.

Definition at line 301 of file G4INCLNucleus.hh.

301 {
302 incomingAngularMomentum = j;
303 }

◆ setIncomingMomentum()

void G4INCL::Nucleus::setIncomingMomentum ( const ThreeVector & p)
inline

Set the incoming momentum vector.

Definition at line 309 of file G4INCLNucleus.hh.

309 {
310 incomingMomentum = p;
311 }

◆ setInitialEnergy()

void G4INCL::Nucleus::setInitialEnergy ( const G4double e)
inline

Set the initial energy.

Definition at line 319 of file G4INCLNucleus.hh.

319{ initialEnergy = e; }

◆ setNucleusNucleusCollision()

void G4INCL::Nucleus::setNucleusNucleusCollision ( )
inline

Set a nucleus-nucleus collision.

Definition at line 510 of file G4INCLNucleus.hh.

510{ isNucleusNucleus=true; }

◆ setParticleNucleusCollision()

void G4INCL::Nucleus::setParticleNucleusCollision ( )
inline

Set a particle-nucleus collision.

Definition at line 513 of file G4INCLNucleus.hh.

513{ isNucleusNucleus=false; }

◆ setProjectileRemnant()

void G4INCL::Nucleus::setProjectileRemnant ( ProjectileRemnant *const c)
inline

Set the projectile remnant.

Definition at line 516 of file G4INCLNucleus.hh.

516 {
517 delete theProjectileRemnant;
518 theProjectileRemnant = c;
519 }

◆ setSrcInternalEnergy()

void G4INCL::Nucleus::setSrcInternalEnergy ( double value)
inline

Definition at line 409 of file G4INCLNucleus.hh.

409 {
410 srcInternalEnergy = value;
411 }

◆ setStore()

void G4INCL::Nucleus::setStore ( Store * str)
inline

Definition at line 429 of file G4INCLNucleus.hh.

429 {
430 delete theStore;
431 theStore = str;
432 };

◆ setUniverseRadius()

void G4INCL::Nucleus::setUniverseRadius ( const G4double universeRadius)
inline

Setter for theUniverseRadius.

Definition at line 504 of file G4INCLNucleus.hh.

504{ theUniverseRadius=universeRadius; }

◆ updateInternalEnergy()

void G4INCL::Nucleus::updateInternalEnergy ( double value)
inline

Definition at line 413 of file G4INCLNucleus.hh.

413 {
414 initialInternalEnergy += value;
415 }

◆ updatePotentialEnergy()

void G4INCL::Nucleus::updatePotentialEnergy ( Particle * p) const
inline

Update the particle potential energy.

Definition at line 541 of file G4INCLNucleus.hh.

541 {
542 p->setPotentialEnergy(thePotential->computePotentialEnergy(p));
543 }

Referenced by initializeParticles().

◆ useFusionKinematics()

void G4INCL::Nucleus::useFusionKinematics ( )

Adjust the kinematics for complete-fusion events.

Definition at line 1418 of file G4INCLNucleus.cc.

1418 {
1419 setEnergy(initialEnergy);
1420 setMomentum(incomingMomentum);
1421 setSpin(incomingAngularMomentum);
1424 }
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
virtual G4double getTableMass() const
Get the real particle mass.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
void setEnergy(G4double energy)

The documentation for this class was generated from the following files: