34 #define INCLXX_IN_GEANT4_MODE 1 38 #ifndef G4INCLCluster_hh 39 #define G4INCLCluster_hh 1 70 if(createParticleSampler)
77 template<
class Iterator>
85 for(Iterator i = begin; i != end; ++i) {
116 swap(temporaryCluster);
199 theA += (*p)->getA();
200 theZ += (*p)->getZ();
215 std::stringstream ss;
216 ss <<
"Cluster (ID = " <<
ID <<
") type = ";
219 <<
" A = " <<
theA <<
'\n' 220 <<
" Z = " <<
theZ <<
'\n' 221 <<
" mass = " <<
getMass() <<
'\n' 229 <<
"Contains the following particles:" 252 theCMPosition += (*p)->getPosition();
253 theTotalMomentum += (*p)->getMomentum();
254 theTotalEnergy += (*p)->getEnergy();
256 theCMPosition /=
theA;
274 (*p)->setMomentum(((*p)->getMomentum()-theTotalMomentum/
theA)*rescaling);
277 (*p)->setPosition(((*p)->getPosition()-theCMPosition)*rescaling);
301 INCL_DEBUG(
"The dynamical potential is " << theDynamicalPotential <<
" MeV" <<
'\n');
304 const G4double energy = (*p)->getEnergy() - theDynamicalPotential;
308 (*p)->setEnergy(energy);
309 (*p)->setMass(std::sqrt(energy*energy - momentum.
mag2()));
311 INCL_DEBUG(
"Cluster components are now off shell:" <<
'\n' 324 (*p)->setPosition((*p)->getPosition()+shift);
339 (*p)->boost(aBoostVector);
345 INCL_DEBUG(
"Cluster was boosted with (bx,by,bz)=(" 346 << aBoostVector.
getX() <<
", " << aBoostVector.
getY() <<
", " << aBoostVector.
getZ() <<
"):" 362 const G4double pMass = (*p)->getMass();
363 const ThreeVector frozenMomentum = normMomentum * pMass;
364 const G4double frozenEnergy = std::sqrt(frozenMomentum.
mag2()+pMass*pMass);
365 (*p)->setFrozenMomentum(frozenMomentum);
366 (*p)->setFrozenEnergy(frozenEnergy);
367 (*p)->freezePropagation();
393 (*p)->makeProjectileSpectator();
401 (*p)->makeTargetSpectator();
409 (*p)->makeParticipant();
432 G4double theDynamicalPotential = 0.0;
434 theDynamicalPotential += (*p)->getEnergy();
437 theDynamicalPotential /=
theA;
439 return theDynamicalPotential;
virtual void rotateMomentum(const G4double angle, const ThreeVector &axis)
Rotate momentum of all the particles.
virtual void makeTargetSpectator()
G4double getEnergy() const
G4double getExcitationEnergy() const
Get the excitation energy of the cluster.
void putParticlesOffShell()
Put the cluster components off shell.
const G4INCL::ThreeVector & getPosition() const
G4double getMass() const
Get the cached particle mass.
virtual void makeTargetSpectator()
Make all the components target spectators, too.
void setZ(const G4int Z)
Set the charge number of the cluster.
void boost(const ThreeVector &aBoostVector)
INCL_DECLARE_ALLOCATION_POOL(Cluster)
static G4double angle[DIM]
ThreeVector const & getSpin() const
Get the spin of the nucleus.
void setINCLMass()
Set the mass of the Particle to its table mass.
virtual void makeProjectileSpectator()
Singleton for recycling allocation of instances of a given class.
void boost(const ThreeVector &aBoostVector)
Boost the cluster with the indicated velocity.
G4int getA() const
Returns the baryon number.
G4int getZ() const
Returns the charge number.
void updateClusterParameters()
Set total cluster mass, energy, size, etc. from the particles.
void setY(G4double ay)
Set the y coordinate.
G4int getNumberOfCollisions() const
Return the number of collisions undergone by the particle.
Class for sampling particles in a nucleus.
std::string print() const
double A(double temperature)
void swap(Cluster &rhs)
Helper method for the assignment operator.
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
Cluster(const Cluster &rhs)
Copy constructor.
virtual void setPosition(const G4INCL::ThreeVector &position)
void freezeInternalMotion()
Freeze the internal motion of the particles.
G4INCL::ThreeVector thePosition
virtual void makeParticipant()
Make all the components participants, too.
ParticleSampler * theParticleSampler
ParticleList const & getParticles() const
void removeParticle(Particle *const p)
Remove a particle from the cluster components.
G4double theExcitationEnergy
void setA(const G4int A)
Set the mass number of the cluster.
G4INCL::ParticleType theType
G4double getPotentialEnergy() const
Get the particle potential energy.
Cluster & operator=(const Cluster &rhs)
Assignment operator.
void addParticles(ParticleList const &pL)
Add a list of particles to the cluster.
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
void swap(Particle &rhs)
Helper method for the assignment operator.
virtual void rotatePosition(const G4double angle, const ThreeVector &axis)
Rotate position of all the particles.
std::string print() const
void setType(ParticleType t)
ParticleSpecies getSpecies() const
void internalBoostToCM()
Boost to the CM of the component particles.
Cluster(Iterator begin, Iterator end)
G4double getRealMass() const
Get the real particle mass.
Particle & operator=(const Particle &rhs)
Assignment operator.
void addParticle(Particle *const p)
G4INCL::ThreeVector theMomentum
void setX(G4double ax)
Set the x coordinate.
virtual void makeProjectileSpectator()
Make all the components projectile spectators, too.
virtual void makeParticipant()
G4double computeDynamicalPotential()
Compute the dynamical cluster potential.
virtual G4double getTableMass() const
Get the real particle mass.
void setZ(G4double az)
Set the z coordinate.
const G4INCL::ThreeVector & getMomentum() const
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
virtual G4INCL::ThreeVector getAngularMomentum() const
void setSpin(const ThreeVector &j)
Set the spin of the nucleus.
G4double thePotentialEnergy
void setPosition(const ThreeVector &position)
Set the position of the cluster.
ParticleList::const_iterator ParticleIter
ParticleList getParticleList() const
Returns the list of particles that make up the cluster.
std::string getName(const ParticleType t)
Get the native INCL name of the particle.
Cluster(const G4int Z, const G4int A, const G4bool createParticleSampler=true)
Standard Cluster constructor.