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) {
105 particles.push_back(new Particle(**p));
117 swap(temporaryCluster);
205 theA += (*p)->getA();
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:"
259 theCMPosition += (*p)->getPosition();
260 theTotalMomentum += (*p)->getMomentum();
263 theCMPosition /=
theA;
281 (*p)->setMomentum(((*p)->getMomentum()-theTotalMomentum/
theA)*rescaling);
284 (*p)->setPosition(((*p)->getPosition()-theCMPosition)*rescaling);
307 const G4double theDynamicalPotential = computeDynamicalPotential();
308 INCL_DEBUG(
"The dynamical potential is " << theDynamicalPotential <<
" MeV" <<
'\n');
311 const G4double energy = (*p)->getEnergy() - theDynamicalPotential;
315 (*p)->setEnergy(energy);
316 (*p)->setMass(std::sqrt(energy*energy - momentum.
mag2()));
318 INCL_DEBUG(
"Cluster components are now off shell:" <<
'\n'
331 (*p)->setPosition((*p)->getPosition()+shift);
346 (*p)->boost(aBoostVector);
352 INCL_DEBUG(
"Cluster was boosted with (bx,by,bz)=("
353 << aBoostVector.
getX() <<
", " << aBoostVector.
getY() <<
", " << aBoostVector.
getZ() <<
"):"
369 const G4double pMass = (*p)->getMass();
370 const ThreeVector frozenMomentum = normMomentum * pMass;
371 const G4double frozenEnergy = std::sqrt(frozenMomentum.
mag2()+pMass*pMass);
372 (*p)->setFrozenMomentum(frozenMomentum);
373 (*p)->setFrozenEnergy(frozenEnergy);
374 (*p)->freezePropagation();
400 (*p)->makeProjectileSpectator();
408 (*p)->makeTargetSpectator();
416 (*p)->makeParticipant();
438 G4double computeDynamicalPotential() {
439 G4double theDynamicalPotential = 0.0;
441 theDynamicalPotential += (*p)->getEnergy();
444 theDynamicalPotential /=
theA;
446 return theDynamicalPotential;
G4double S(G4double temp)
Singleton for recycling allocation of instances of a given class.
#define INCL_DECLARE_ALLOCATION_POOL(T)
Class for sampling particles in a nucleus.
ThreeVector const & getSpin() const
Get the spin of the nucleus.
void boost(const ThreeVector &aBoostVector)
Boost the cluster with the indicated velocity.
void internalBoostToCM()
Boost to the CM of the component particles.
void removeParticle(Particle *const p)
Remove a particle from the cluster components.
ParticleSpecies getSpecies() const
Get the particle species.
ParticleList const & getParticles() const
virtual void makeProjectileSpectator()
Make all the components projectile spectators, too.
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
void setS(const G4int S)
Set the strangess number of the cluster.
virtual void rotateMomentum(const G4double angle, const ThreeVector &axis)
Rotate momentum of all the particles.
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
ParticleSampler * theParticleSampler
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
void addParticles(ParticleList const &pL)
Add a list of particles to the cluster.
Cluster(const G4int Z, const G4int A, const G4int S, const G4bool createParticleSampler=true)
Standard Cluster constructor.
virtual void makeTargetSpectator()
Make all the components target spectators, too.
G4double getExcitationEnergy() const
Get the excitation energy of the cluster.
virtual G4double getTableMass() const
Get the real particle mass.
void swap(Cluster &rhs)
Helper method for the assignment operator.
virtual void rotatePosition(const G4double angle, const ThreeVector &axis)
Rotate position of all the particles.
Cluster & operator=(const Cluster &rhs)
Assignment operator.
void setPosition(const ThreeVector &position)
Set the position of the cluster.
void setA(const G4int A)
Set the mass number of the cluster.
Cluster(Iterator begin, Iterator end)
Cluster(const Cluster &rhs)
Copy constructor.
void addParticle(Particle *const p)
virtual void makeParticipant()
Make all the components participants, too.
G4double theExcitationEnergy
void updateClusterParameters()
Set total cluster mass, energy, size, etc. from the particles.
void freezeInternalMotion()
Freeze the internal motion of the particles.
void setZ(const G4int Z)
Set the charge number of the cluster.
ParticleList getParticleList() const
Returns the list of particles that make up the cluster.
std::string print() const
void putParticlesOffShell()
Put the cluster components off shell.
G4int getS() const
Returns the strangeness number.
G4INCL::ThreeVector theMomentum
virtual G4INCL::ThreeVector getAngularMomentum() const
G4double getEnergy() const
G4double getPotentialEnergy() const
Get the particle potential energy.
virtual void makeTargetSpectator()
G4double thePotentialEnergy
G4int getZ() const
Returns the charge number.
const G4INCL::ThreeVector & getPosition() const
G4INCL::ParticleType theType
G4int getNumberOfCollisions() const
Return the number of collisions undergone by the particle.
virtual void makeProjectileSpectator()
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
void setINCLMass()
Set the mass of the Particle to its table mass.
G4double getRealMass() const
Get the real particle mass.
const G4INCL::ThreeVector & getMomentum() const
Particle & operator=(const Particle &rhs)
Assignment operator.
virtual void makeParticipant()
void setType(ParticleType t)
G4double getMass() const
Get the cached particle mass.
void boost(const ThreeVector &aBoostVector)
virtual void setPosition(const G4INCL::ThreeVector &position)
void swap(Particle &rhs)
Helper method for the assignment operator.
G4int getA() const
Returns the baryon number.
G4INCL::ThreeVector thePosition
void setY(G4double ay)
Set the y coordinate.
void setZ(G4double az)
Set the z coordinate.
void setX(G4double ax)
Set the x coordinate.
std::string print() const
std::string getName(const ParticleType t)
Get the native INCL name of the particle.
ParticleList::const_iterator ParticleIter