Geant4 11.4.0
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.
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 58 of file G4INCLProjectileRemnant.hh.

Member Typedef Documentation

◆ EnergyLevelMap

Definition at line 63 of file G4INCLProjectileRemnant.hh.

◆ EnergyLevels

Definition at line 62 of file G4INCLProjectileRemnant.hh.

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 147 of file G4INCLProjectileRemnant.cc.

147 {
148 // Put all the spectators in the projectile
149 ThreeVector theNewMomentum = theMomentum;
150 G4double theNewEnergy = theEnergy;
151 G4int theNewA = theA;
152 G4int theNewZ = theZ;
153 G4int theNewS = theS;
154 for(ParticleIter p=pL.begin(), e=pL.end(); p!=e; ++p) {
155// assert((*p)->isNucleonorLambda() || (*p)->isAntiNucleon());
156 // Add the initial (off-shell) momentum and energy to the projectile remnant
157 theNewMomentum += getStoredMomentum(*p);
158 theNewEnergy += (*p)->getEnergy();
159 theNewA += (*p)->getA();
160 theNewZ += (*p)->getZ();
161 theNewS += (*p)->getS();
162 }
163
164 // Check that the excitation energy of the new projectile remnant is non-negative
165 G4double theNewMass;
166 if(theA < 0)
167 theNewMass = ParticleTable::getTableMass(-theNewA,-theNewZ,theNewS);
168 else
169 theNewMass = ParticleTable::getTableMass(theNewA,theNewZ,theNewS);
170 const G4double theNewExcitationEnergy = computeExcitationEnergyWith(pL);
171 const G4double theNewEffectiveMass = theNewMass + theNewExcitationEnergy;
172
173 // If this condition is satisfied, there is no solution. Fall back on the
174 // "most" method
175 if(theNewEnergy<theNewEffectiveMass) {
176 INCL_WARN("Could not add all the dynamical spectators back into the projectile remnant."
177 << " Falling back to the \"most\" method." << '\n');
179 }
180
181 // Add all the participants to the projectile remnant
182 for(ParticleIter p=pL.begin(), e=pL.end(); p!=e; ++p) {
183 particles.push_back(*p);
184 }
185
186 // Rescale the momentum of the projectile remnant so that sqrt(s) has the
187 // correct value
188 const G4double scalingFactorSquared = (theNewEnergy*theNewEnergy-theNewEffectiveMass*theNewEffectiveMass)/theNewMomentum.mag2();
189 const G4double scalingFactor = std::sqrt(scalingFactorSquared);
190 INCL_DEBUG("Scaling factor for the projectile-remnant momentum = " << scalingFactor << '\n');
191
192 theA = theNewA;
193 theZ = theNewZ;
194 theS = theNewS;
195 theMomentum = theNewMomentum * scalingFactor;
196 theEnergy = theNewEnergy;
197
198 return ParticleList();
199 }
#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
std::vector< Base * > ParticleList
Definition PoPI.hpp:186

◆ 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 124 of file G4INCLProjectileRemnant.cc.

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

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

344 {
345 const EnergyLevels theEnergyLevels = getPresentEnergyLevelsExcept(exceptID);
346 return computeExcitationEnergy(theEnergyLevels);
347 }
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 349 of file G4INCLProjectileRemnant.cc.

349 {
350 const EnergyLevels theEnergyLevels = getPresentEnergyLevelsWith(pL);
351 return computeExcitationEnergy(theEnergyLevels);
352 }

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 78 of file G4INCLProjectileRemnant.cc.

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