34 #define INCLXX_IN_GEANT4_MODE 1
38 #ifndef G4INCLCluster_hh
39 #define G4INCLCluster_hh 1
71 if(createParticleSampler)
78 template<
class Iterator>
86 for(Iterator i = begin; i != end; ++i) {
117 swap(temporaryCluster);
205 theA += (*p)->getA();
206 theZ += (*p)->getZ();
207 theS += (*p)->getS();
222 std::stringstream
ss;
223 ss <<
"Cluster (ID = " <<
ID <<
") type = ";
226 <<
" A = " <<
theA <<
'\n'
227 <<
" Z = " <<
theZ <<
'\n'
228 <<
" S = " <<
theS <<
'\n'
229 <<
" mass = " <<
getMass() <<
'\n'
237 <<
"Contains the following particles:"
260 theCMPosition += (*p)->getPosition();
261 theTotalMomentum += (*p)->getMomentum();
262 theTotalEnergy += (*p)->getEnergy();
264 theCMPosition /=
theA;
282 (*p)->setMomentum(((*p)->getMomentum()-theTotalMomentum/
theA)*rescaling);
285 (*p)->setPosition(((*p)->getPosition()-theCMPosition)*rescaling);
309 INCL_DEBUG(
"The dynamical potential is " << theDynamicalPotential <<
" MeV" <<
'\n');
312 const G4double energy = (*p)->getEnergy() - theDynamicalPotential;
316 (*p)->setEnergy(energy);
317 (*p)->setMass(std::sqrt(energy*energy - momentum.
mag2()));
319 INCL_DEBUG(
"Cluster components are now off shell:" <<
'\n'
332 (*p)->setPosition((*p)->getPosition()+shift);
347 (*p)->boost(aBoostVector);
353 INCL_DEBUG(
"Cluster was boosted with (bx,by,bz)=("
354 << aBoostVector.
getX() <<
", " << aBoostVector.
getY() <<
", " << aBoostVector.
getZ() <<
"):"
370 const G4double pMass = (*p)->getMass();
371 const ThreeVector frozenMomentum = normMomentum * pMass;
372 const G4double frozenEnergy = std::sqrt(frozenMomentum.
mag2()+pMass*pMass);
373 (*p)->setFrozenMomentum(frozenMomentum);
374 (*p)->setFrozenEnergy(frozenEnergy);
375 (*p)->freezePropagation();
401 (*p)->makeProjectileSpectator();
409 (*p)->makeTargetSpectator();
417 (*p)->makeParticipant();
440 G4double theDynamicalPotential = 0.0;
442 theDynamicalPotential += (*p)->getEnergy();
445 theDynamicalPotential /=
theA;
447 return theDynamicalPotential;
ParticleList::const_iterator ParticleIter
Class for sampling particles in a nucleus.
void setZ(G4double az)
Set the z coordinate.
void setZ(const G4int Z)
Set the charge number of the cluster.
const G4INCL::ThreeVector & getPosition() const
void boost(const ThreeVector &aBoostVector)
Boost the cluster with the indicated velocity.
G4double getEnergy() const
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
ParticleSampler * theParticleSampler
#define INCL_DECLARE_ALLOCATION_POOL(T)
const G4INCL::ThreeVector & getMomentum() const
G4int getS() const
Returns the strangeness number.
G4INCL::ThreeVector theMomentum
ParticleList getParticleList() const
Returns the list of particles that make up the cluster.
void setINCLMass()
Set the mass of the Particle to its table mass.
G4double getExcitationEnergy() const
Get the excitation energy of the cluster.
G4double getMass() const
Get the cached particle mass.
virtual G4double getTableMass() const
Get the real particle mass.
std::string print() const
virtual void makeTargetSpectator()
void setX(G4double ax)
Set the x coordinate.
G4double theExcitationEnergy
Cluster(const G4int Z, const G4int A, const G4int S, const G4bool createParticleSampler=true)
Standard Cluster constructor.
ParticleList const & getParticles() const
G4INCL::ParticleType theType
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
G4double getPotentialEnergy() const
Get the particle potential energy.
virtual void makeParticipant()
Make all the components participants, too.
virtual void rotatePosition(const G4double angle, const ThreeVector &axis)
Rotate position of all the particles.
std::string print() const
virtual void makeProjectileSpectator()
Make all the components projectile spectators, too.
virtual void setPosition(const G4INCL::ThreeVector &position)
void putParticlesOffShell()
Put the cluster components off shell.
void updateClusterParameters()
Set total cluster mass, energy, size, etc. from the particles.
void freezeInternalMotion()
Freeze the internal motion of the particles.
G4INCL::ThreeVector thePosition
G4double thePotentialEnergy
double A(double temperature)
G4int getZ() const
Returns the charge number.
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
Singleton for recycling allocation of instances of a given class.
G4int getA() const
Returns the baryon number.
void setType(ParticleType t)
std::string getName(const ParticleType t)
Get the native INCL name of the particle.
void addParticle(Particle *const p)
void swap(Particle &rhs)
Helper method for the assignment operator.
ParticleSpecies getSpecies() const
Get the particle species.
ThreeVector const & getSpin() const
Get the spin of the nucleus.
virtual void makeParticipant()
G4double getRealMass() const
Get the real particle mass.
virtual void makeProjectileSpectator()
G4int getNumberOfCollisions() const
Return the number of collisions undergone by the particle.
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
void swap(Cluster &rhs)
Helper method for the assignment operator.
G4double computeDynamicalPotential()
Compute the dynamical cluster potential.
void internalBoostToCM()
Boost to the CM of the component particles.
void boost(const ThreeVector &aBoostVector)
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
void setS(const G4int S)
Set the strangess number of the cluster.
Particle & operator=(const Particle &rhs)
Assignment operator.
virtual G4INCL::ThreeVector getAngularMomentum() const
virtual void rotateMomentum(const G4double angle, const ThreeVector &axis)
Rotate momentum of all the particles.
void removeParticle(Particle *const p)
Remove a particle from the cluster components.
Cluster(const Cluster &rhs)
Copy constructor.
void setA(const G4int A)
Set the mass number of the cluster.
void addParticles(ParticleList const &pL)
Add a list of particles to the cluster.
Cluster(Iterator begin, Iterator end)
Cluster & operator=(const Cluster &rhs)
Assignment operator.
void setPosition(const ThreeVector &position)
Set the position of the cluster.
virtual void makeTargetSpectator()
Make all the components target spectators, too.
void setY(G4double ay)
Set the y coordinate.