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

#include <G4INCLProjectileRemnant.hh>

+ Inheritance diagram for G4INCL::ProjectileRemnant:

Public Types

typedef std::vector< G4doubleEnergyLevels
 
typedef std::map< long, G4doubleEnergyLevelMap
 

Public Member Functions

 ProjectileRemnant (ParticleSpecies const &species, const G4double kineticEnergy)
 
 ~ProjectileRemnant ()
 
void reset ()
 Reset the projectile remnant to the state at the beginning of the cascade.
 
void removeParticle (Particle *const p, const G4double theProjectileCorrection)
 Remove a nucleon from the projectile remnant.
 
ParticleList addDynamicalSpectators (ParticleList pL)
 Add back dynamical spectators to the projectile remnant.
 
ParticleList addMostDynamicalSpectators (ParticleList pL)
 Add back dynamical spectators to the projectile remnant.
 
ParticleList addAllDynamicalSpectators (ParticleList const &pL)
 Add back all dynamical spectators to the projectile remnant.
 
void deleteStoredComponents ()
 Clear the stored projectile components and delete the particles.
 
void clearStoredComponents ()
 Clear the stored projectile components.
 
void clearEnergyLevels ()
 Clear the stored energy levels.
 
G4double computeExcitationEnergyExcept (const long exceptID) const
 Compute the excitation energy when a nucleon is removed.
 
G4double computeExcitationEnergyWith (const ParticleList &pL) const
 Compute the excitation energy if some nucleons are put back.
 
void storeComponents ()
 Store the projectile components.
 
G4int getNumberStoredComponents () const
 Get the number of the stored components.
 
void storeEnergyLevels ()
 Store the energy levels.
 
EnergyLevels const & getGroundStateEnergies () const
 
- 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
 
virtual void initializeParticles ()
 Initialise the NuclearDensity pointer and sample the particles.
 
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.
 
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 getEmissionPbarQvalueCorrection (const G4int AParent, const G4int ZParent, const G4bool Victim) const
 
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 setOutOfWell ()
 Mark the particle as out of its potential well.
 
G4bool isOutOfWell () const
 Check if the particle is out of its potential well.
 
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
 
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 58 of file G4INCLProjectileRemnant.hh.

Member Typedef Documentation

◆ EnergyLevelMap

◆ EnergyLevels

Constructor & Destructor Documentation

◆ ProjectileRemnant()

G4INCL::ProjectileRemnant::ProjectileRemnant ( ParticleSpecies const & species,
const G4double kineticEnergy )
inline

Definition at line 65 of file G4INCLProjectileRemnant.hh.

66 : Cluster(species.theZ, species.theA, species.theS) {
67
68 // Use the table mass
70
71 // Set the kinematics
72 const G4double projectileMass = getMass();
73 const G4double energy = kineticEnergy + projectileMass;
74 const G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
75
76 // Initialise the particles
80
81 // Store the energy levels of the ProjectileRemnant (used to compute its
82 // excitation energy)
84
85 // Boost the whole thing
86 const ThreeVector aBoostVector = ThreeVector(0.0, 0.0, momentumZ / energy);
87 boost(-aBoostVector);
88
89 // Freeze the internal motion of the particles
91
92 // Set as projectile spectator
94 }
double G4double
Definition G4Types.hh:83
void boost(const ThreeVector &aBoostVector)
Boost the cluster with the indicated velocity.
void internalBoostToCM()
Boost to the CM of the component particles.
virtual void makeProjectileSpectator()
Make all the components projectile spectators, too.
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
Cluster(const G4int Z, const G4int A, const G4int S, const G4bool createParticleSampler=true)
Standard Cluster constructor.
void freezeInternalMotion()
Freeze the internal motion of the particles.
void putParticlesOffShell()
Put the cluster components off shell.
G4double getMass() const
Get the cached particle mass.
void setTableMass()
Set the mass of the Particle to its table mass.
void storeEnergyLevels()
Store the energy levels.
G4double energy(const ThreeVector &p, const G4double m)

◆ ~ProjectileRemnant()

G4INCL::ProjectileRemnant::~ProjectileRemnant ( )
inline

Definition at line 96 of file G4INCLProjectileRemnant.hh.

96 {
98 // The ProjectileRemnant owns its particles
101 }
void clearEnergyLevels()
Clear the stored energy levels.
void deleteStoredComponents()
Clear the stored projectile components and delete the particles.

Member Function Documentation

◆ addAllDynamicalSpectators()

ParticleList G4INCL::ProjectileRemnant::addAllDynamicalSpectators ( ParticleList const & pL)

Add back all dynamical spectators to the projectile remnant.

Return a list of rejected dynamical spectators.

Definition at line 145 of file G4INCLProjectileRemnant.cc.

145 {
146 // Put all the spectators in the projectile
147 ThreeVector theNewMomentum = theMomentum;
148 G4double theNewEnergy = theEnergy;
149 G4int theNewA = theA;
150 G4int theNewZ = theZ;
151 G4int theNewS = theS;
152 for(ParticleIter p=pL.begin(), e=pL.end(); p!=e; ++p) {
153// assert((*p)->isNucleonorLambda());
154 // Add the initial (off-shell) momentum and energy to the projectile remnant
155 theNewMomentum += getStoredMomentum(*p);
156 theNewEnergy += (*p)->getEnergy();
157 theNewA += (*p)->getA();
158 theNewZ += (*p)->getZ();
159 theNewS += (*p)->getS();
160 }
161
162 // Check that the excitation energy of the new projectile remnant is non-negative
163 const G4double theNewMass = ParticleTable::getTableMass(theNewA,theNewZ,theNewS);
164 const G4double theNewExcitationEnergy = computeExcitationEnergyWith(pL);
165 const G4double theNewEffectiveMass = theNewMass + theNewExcitationEnergy;
166
167 // If this condition is satisfied, there is no solution. Fall back on the
168 // "most" method
169 if(theNewEnergy<theNewEffectiveMass) {
170 INCL_WARN("Could not add all the dynamical spectators back into the projectile remnant."
171 << " Falling back to the \"most\" method." << '\n');
173 }
174
175 // Add all the participants to the projectile remnant
176 for(ParticleIter p=pL.begin(), e=pL.end(); p!=e; ++p) {
177 particles.push_back(*p);
178 }
179
180 // Rescale the momentum of the projectile remnant so that sqrt(s) has the
181 // correct value
182 const G4double scalingFactorSquared = (theNewEnergy*theNewEnergy-theNewEffectiveMass*theNewEffectiveMass)/theNewMomentum.mag2();
183 const G4double scalingFactor = std::sqrt(scalingFactorSquared);
184 INCL_DEBUG("Scaling factor for the projectile-remnant momentum = " << scalingFactor << '\n');
185
186 theA = theNewA;
187 theZ = theNewZ;
188 theS = theNewS;
189 theMomentum = theNewMomentum * scalingFactor;
190 theEnergy = theNewEnergy;
191
192 return ParticleList();
193 }
#define INCL_WARN(x)
#define INCL_DEBUG(x)
int G4int
Definition G4Types.hh:85
ParticleList particles
G4INCL::ThreeVector theMomentum
G4double computeExcitationEnergyWith(const ParticleList &pL) const
Compute the excitation energy if some nucleons are put back.
ParticleList addMostDynamicalSpectators(ParticleList pL)
Add back dynamical spectators to the projectile remnant.
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
ParticleList::const_iterator ParticleIter

◆ addDynamicalSpectators()

ParticleList G4INCL::ProjectileRemnant::addDynamicalSpectators ( ParticleList pL)

Add back dynamical spectators to the projectile remnant.

Try to add the dynamical spectators back to the projectile remnant. Refuse to do so if this leads to a negative projectile excitation energy.

Return a list of rejected dynamical spectators.

Definition at line 122 of file G4INCLProjectileRemnant.cc.

122 {
123 // Try as hard as possible to add back all the dynamical spectators.
124 // Don't add spectators that lead to negative excitation energies, but
125 // iterate over the spectators as many times as possible, until
126 // absolutely sure that all of them were rejected.
127 unsigned int accepted;
128 unsigned long loopCounter = 0;
129 const unsigned long maxLoopCounter = 10000000;
130 do {
131 accepted = 0;
132 ParticleList toBeAdded = pL;
133 for(ParticleIter p=toBeAdded.begin(), e=toBeAdded.end(); p!=e; ++p) {
134 G4bool isAccepted = addDynamicalSpectator(*p);
135 if(isAccepted) {
136 pL.remove(*p);
137 accepted++;
138 }
139 }
140 ++loopCounter;
141 } while(loopCounter<maxLoopCounter && accepted > 0); /* Loop checking, 10.07.2015, D.Mancusi */
142 return pL;
143 }
bool G4bool
Definition G4Types.hh:86

◆ addMostDynamicalSpectators()

ParticleList G4INCL::ProjectileRemnant::addMostDynamicalSpectators ( ParticleList pL)

Add back dynamical spectators to the projectile remnant.

Try as hard as possible to add back all the dynamical spectators. Don't add spectators that lead to negative excitation energies. Start by adding all of them, and repeatedly remove the most troublesome one until the excitation energy becomes non-negative.

Return a list of rejected dynamical spectators.

Definition at line 195 of file G4INCLProjectileRemnant.cc.

195 {
196 // Try as hard as possible to add back all the dynamical spectators.
197 // Don't add spectators that lead to negative excitation energies. Start by
198 // adding all of them, and repeatedly remove the most troublesome one until
199 // the excitation energy becomes non-negative.
200
201 // Put all the spectators in the projectile
202 ThreeVector theNewMomentum = theMomentum;
203 G4double theNewEnergy = theEnergy;
204 G4int theNewA = theA;
205 G4int theNewZ = theZ;
206 G4int theNewS = theS;
207 for(ParticleIter p=pL.begin(), e=pL.end(); p!=e; ++p) {
208// assert((*p)->isNucleonorLambda());
209 // Add the initial (off-shell) momentum and energy to the projectile remnant
210 theNewMomentum += getStoredMomentum(*p);
211 theNewEnergy += (*p)->getEnergy();
212 theNewA += (*p)->getA();
213 theNewZ += (*p)->getZ();
214 theNewS += (*p)->getS();
215 }
216
217 // Check that the excitation energy of the new projectile remnant is non-negative
218 const G4double theNewMass = ParticleTable::getTableMass(theNewA,theNewZ,theNewS);
219 const G4double theNewInvariantMassSquared = theNewEnergy*theNewEnergy-theNewMomentum.mag2();
220
221 G4bool positiveExcitationEnergy = false;
222 if(theNewInvariantMassSquared>=0.) {
223 const G4double theNewInvariantMass = std::sqrt(theNewInvariantMassSquared);
224 positiveExcitationEnergy = (theNewInvariantMass-theNewMass>-1.e-5);
225 }
226
227 // Keep removing nucleons from the projectile remnant until we achieve a
228 // non-negative excitation energy.
229 ParticleList rejected;
230 while(!positiveExcitationEnergy && !pL.empty()) { /* Loop checking, 10.07.2015, D.Mancusi */
231 G4double maxExcitationEnergy = -1.E30;
232 ParticleMutableIter best = pL.end();
233 ThreeVector bestMomentum;
234 G4double bestEnergy = -1.;
235 G4int bestA = -1, bestZ = -1, bestS = 0;
236 for(ParticleList::iterator p=pL.begin(), e=pL.end(); p!=e; ++p) {
237 // Subtract the initial (off-shell) momentum and energy from the new
238 // projectile remnant
239 const ThreeVector theNewerMomentum = theNewMomentum - getStoredMomentum(*p);
240 const G4double theNewerEnergy = theNewEnergy - (*p)->getEnergy();
241 const G4int theNewerA = theNewA - (*p)->getA();
242 const G4int theNewerZ = theNewZ - (*p)->getZ();
243 const G4int theNewerS = theNewS - (*p)->getS();
244
245 const G4double theNewerMass = ParticleTable::getTableMass(theNewerA,theNewerZ,theNewerS);
246 const G4double theNewerInvariantMassSquared = theNewerEnergy*theNewerEnergy-theNewerMomentum.mag2();
247
248 if(theNewerInvariantMassSquared>=-1.e-5) {
249 const G4double theNewerInvariantMass = std::sqrt(std::max(0.,theNewerInvariantMassSquared));
250 const G4double theNewerExcitationEnergy = ((theNewerA>1) ? theNewerInvariantMass-theNewerMass : 0.);
251 // Pick the nucleon that maximises the excitation energy of the
252 // ProjectileRemnant
253 if(theNewerExcitationEnergy>maxExcitationEnergy) {
254 best = p;
255 maxExcitationEnergy = theNewerExcitationEnergy;
256 bestMomentum = theNewerMomentum;
257 bestEnergy = theNewerEnergy;
258 bestA = theNewerA;
259 bestZ = theNewerZ;
260 bestS = theNewerS;
261 }
262 }
263 }
264
265 // If we couldn't even calculate the excitation energy, fail miserably
266 if(best==pL.end())
267 return pL;
268
269 rejected.push_back(*best);
270 pL.erase(best);
271 theNewMomentum = bestMomentum;
272 theNewEnergy = bestEnergy;
273 theNewA = bestA;
274 theNewZ = bestZ;
275 theNewS = bestS;
276
277 if(maxExcitationEnergy>0.) {
278 // Stop here
279 positiveExcitationEnergy = true;
280 }
281 }
282
283 // Add the accepted participants to the projectile remnant
284 for(ParticleIter p=pL.begin(), e=pL.end(); p!=e; ++p) {
285 particles.push_back(*p);
286 }
287 theA = theNewA;
288 theZ = theNewZ;
289 theS = theNewS;
290 theMomentum = theNewMomentum;
291 theEnergy = theNewEnergy;
292
293 return rejected;
294 }
ParticleList::iterator ParticleMutableIter

Referenced by addAllDynamicalSpectators().

◆ clearEnergyLevels()

void G4INCL::ProjectileRemnant::clearEnergyLevels ( )
inline

Clear the stored energy levels.

Definition at line 153 of file G4INCLProjectileRemnant.hh.

153 {
154 theInitialEnergyLevels.clear();
155 theGroundStateEnergies.clear();
156 }

Referenced by ~ProjectileRemnant().

◆ clearStoredComponents()

void G4INCL::ProjectileRemnant::clearStoredComponents ( )
inline

Clear the stored projectile components.

Definition at line 148 of file G4INCLProjectileRemnant.hh.

148 {
149 storedComponents.clear();
150 }

Referenced by deleteStoredComponents().

◆ computeExcitationEnergyExcept()

G4double G4INCL::ProjectileRemnant::computeExcitationEnergyExcept ( const long exceptID) const

Compute the excitation energy when a nucleon is removed.

Compute the excitation energy of the projectile-like remnant as the difference between the initial and the present configuration. This follows the algorithm proposed by A. Boudard in INCL4.2-HI, as implemented in Geant4.

Returns
the excitation energy

Definition at line 326 of file G4INCLProjectileRemnant.cc.

326 {
327 const EnergyLevels theEnergyLevels = getPresentEnergyLevelsExcept(exceptID);
328 return computeExcitationEnergy(theEnergyLevels);
329 }
std::vector< G4double > EnergyLevels

Referenced by G4INCL::ParticleEntryChannel::fillFinalState().

◆ computeExcitationEnergyWith()

G4double G4INCL::ProjectileRemnant::computeExcitationEnergyWith ( const ParticleList & pL) const

Compute the excitation energy if some nucleons are put back.

Returns
the excitation energy

Definition at line 331 of file G4INCLProjectileRemnant.cc.

331 {
332 const EnergyLevels theEnergyLevels = getPresentEnergyLevelsWith(pL);
333 return computeExcitationEnergy(theEnergyLevels);
334 }

Referenced by addAllDynamicalSpectators().

◆ deleteStoredComponents()

void G4INCL::ProjectileRemnant::deleteStoredComponents ( )
inline

Clear the stored projectile components and delete the particles.

Definition at line 141 of file G4INCLProjectileRemnant.hh.

141 {
142 for(std::map<long,Particle*>::const_iterator p=storedComponents.begin(), e=storedComponents.end(); p!=e; ++p)
143 delete p->second;
145 }
void clearStoredComponents()
Clear the stored projectile components.

Referenced by ~ProjectileRemnant().

◆ getGroundStateEnergies()

EnergyLevels const & G4INCL::ProjectileRemnant::getGroundStateEnergies ( ) const
inline

Definition at line 207 of file G4INCLProjectileRemnant.hh.

207 {
208 return theGroundStateEnergies;
209 }

◆ getNumberStoredComponents()

G4int G4INCL::ProjectileRemnant::getNumberStoredComponents ( ) const
inline

Get the number of the stored components.

Definition at line 184 of file G4INCLProjectileRemnant.hh.

184 {
185 return (G4int)storedComponents.size();
186 }

◆ removeParticle()

void G4INCL::ProjectileRemnant::removeParticle ( Particle *const p,
const G4double theProjectileCorrection )

Remove a nucleon from the projectile remnant.

Parameters
pparticle to be removed
theProjectileCorrectioncorrection to be given to the projectile total energy

Definition at line 76 of file G4INCLProjectileRemnant.cc.

76 {
77// assert(p->isNucleon() || p->isLambda());
78
79 INCL_DEBUG("The following Particle is about to be removed from the ProjectileRemnant:"
80 << '\n' << p->print()
81 << "theProjectileCorrection=" << theProjectileCorrection << '\n');
82 // Update A, Z, S, momentum, and energy of the projectile remnant
83 theA -= p->getA();
84 theZ -= p->getZ();
85 theS -= p->getS();
86
87 ThreeVector const &oldMomentum = p->getMomentum();
88 const G4double oldEnergy = p->getEnergy();
90
91#if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE)
92 ThreeVector theTotalMomentum;
93 G4double theTotalEnergy = 0.;
94 const G4double theThreshold = 0.1;
95#endif
96
97 if(getA()>0) { // if there are any particles left
98// assert((unsigned int)getA()==particles.size());
99
100 const G4double theProjectileCorrectionPerNucleon = theProjectileCorrection / particles.size();
101
102 // Update the kinematics of the components
103 for(ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
104 (*i)->setEnergy((*i)->getEnergy() + theProjectileCorrectionPerNucleon);
105 (*i)->setMass((*i)->getInvariantMass());
106#if !defined(NDEBUG) && !defined(INCLXX_IN_GEANT4_MODE)
107 theTotalMomentum += (*i)->getMomentum();
108 theTotalEnergy += (*i)->getEnergy();
109#endif
110 }
111 }
112
113 theMomentum -= oldMomentum;
114 theEnergy -= oldEnergy - theProjectileCorrection;
115
116// assert(std::abs((theTotalMomentum-theMomentum).mag())<theThreshold);
117// assert(std::abs(theTotalEnergy-theEnergy)<theThreshold);
118 INCL_DEBUG("After Particle removal, the ProjectileRemnant looks like this:"
119 << '\n' << print());
120 }
void removeParticle(Particle *const p)
Remove a particle from the cluster components.
std::string print() const
G4int getA() const
Returns the baryon number.

Referenced by G4INCL::ParticleEntryChannel::fillFinalState().

◆ reset()

void G4INCL::ProjectileRemnant::reset ( )

Reset the projectile remnant to the state at the beginning of the cascade.

Definition at line 51 of file G4INCLProjectileRemnant.cc.

51 {
53 thePosition = ThreeVector();
54 theMomentum = ThreeVector();
55 theEnergy = 0.0;
57 theA = 0;
58 theZ = 0;
59 nCollisions = 0;
60
61 for(std::map<long, Particle*>::const_iterator i=storedComponents.begin(); i!=storedComponents.end(); ++i) {
62 Particle *p = new Particle(*(i->second));
63 EnergyLevelMap::iterator energyIter = theInitialEnergyLevels.find(i->first);
64// assert(energyIter!=theInitialEnergyLevels.end());
65 const G4double energyLevel = energyIter->second;
66 theInitialEnergyLevels.erase(energyIter);
67 theInitialEnergyLevels[p->getID()] = energyLevel;
68 addParticle(p);
69 }
70 if(theA>0)
73 INCL_DEBUG("ProjectileRemnant object was reset:" << '\n' << print());
74 }
void addParticle(Particle *const p)
G4INCL::ThreeVector thePosition

◆ storeComponents()

void G4INCL::ProjectileRemnant::storeComponents ( )
inline

Store the projectile components.

Definition at line 176 of file G4INCLProjectileRemnant.hh.

176 {
177 for(ParticleIter p=particles.begin(), e=particles.end(); p!=e; ++p) {
178 // Store the particles (needed for forced CN)
179 storedComponents[(*p)->getID()]=new Particle(**p);
180 }
181 }

Referenced by G4INCL::StandardPropagationModel::shootComposite().

◆ storeEnergyLevels()

void G4INCL::ProjectileRemnant::storeEnergyLevels ( )
inline

Store the energy levels.

Definition at line 189 of file G4INCLProjectileRemnant.hh.

189 {
190 EnergyLevels energies;
191
192 for(ParticleIter p=particles.begin(), e=particles.end(); p!=e; ++p) {
193 const G4double theCMEnergy = (*p)->getEnergy();
194 // Store the CM energy in the EnergyLevels map
195 theInitialEnergyLevels[(*p)->getID()] = theCMEnergy;
196 energies.push_back(theCMEnergy);
197 }
198
199 std::sort(energies.begin(), energies.end());
200// assert(energies.size()==(unsigned int)theA);
201 theGroundStateEnergies.resize(energies.size());
202 // Compute the partial sums of the CM energies -- they are our reference
203 // ground-state energies for any number of nucleons
204 std::partial_sum(energies.begin(), energies.end(), theGroundStateEnergies.begin());
205 }

Referenced by ProjectileRemnant().


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