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);
300 const G4double theDynamicalPotential = computeDynamicalPotential();
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();
431 G4double computeDynamicalPotential() {
432 G4double theDynamicalPotential = 0.0;
434 theDynamicalPotential += (*p)->getEnergy();
437 theDynamicalPotential /=
theA;
439 return theDynamicalPotential;
G4int getA() const
Returns the baryon number.
#define INCL_DECLARE_ALLOCATION_POOL(T)
virtual void rotateMomentum(const G4double angle, const ThreeVector &axis)
Rotate momentum of all the particles.
G4int getNumberOfCollisions() const
Return the number of collisions undergone by the particle.
virtual void makeTargetSpectator()
virtual G4double getTableMass() const
Get the real particle mass.
G4double getMass() const
Get the cached particle mass.
void putParticlesOffShell()
Put the cluster components off shell.
ParticleList const & getParticles() const
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)
const G4INCL::ThreeVector & getMomentum() const
static G4double angle[DIM]
G4double getEnergy() const
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.
void updateClusterParameters()
Set total cluster mass, energy, size, etc. from the particles.
G4double getPotentialEnergy() const
Get the particle potential energy.
void setY(G4double ay)
Set the y coordinate.
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
Class for sampling particles in a nucleus.
double A(double temperature)
std::string print() const
void swap(Cluster &rhs)
Helper method for the assignment operator.
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
virtual G4INCL::ThreeVector getAngularMomentum() const
Cluster(const Cluster &rhs)
Copy constructor.
virtual void setPosition(const G4INCL::ThreeVector &position)
G4int getZ() const
Returns the charge number.
void freezeInternalMotion()
Freeze the internal motion of the particles.
G4INCL::ThreeVector thePosition
virtual void makeParticipant()
Make all the components participants, too.
ParticleSampler * theParticleSampler
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.
ParticleList getParticleList() const
Returns the list of particles that make up the cluster.
G4INCL::ParticleType theType
Cluster & operator=(const Cluster &rhs)
Assignment operator.
G4double energy(const ThreeVector &p, const G4double m)
void addParticles(ParticleList const &pL)
Add a list of particles to the cluster.
const G4INCL::ThreeVector & getPosition() const
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.
void setType(ParticleType t)
void internalBoostToCM()
Boost to the CM of the component particles.
ParticleSpecies getSpecies() const
Get the particle species.
Cluster(Iterator begin, Iterator end)
Particle & operator=(const Particle &rhs)
Assignment operator.
void addParticle(Particle *const p)
G4INCL::ThreeVector theMomentum
ThreeVector const & getSpin() const
Get the spin of the nucleus.
std::string print() const
void setX(G4double ax)
Set the x coordinate.
G4double getExcitationEnergy() const
Get the excitation energy of the cluster.
G4double getRealMass() const
Get the real particle mass.
virtual void makeProjectileSpectator()
Make all the components projectile spectators, too.
virtual void makeParticipant()
void setZ(G4double az)
Set the z coordinate.
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
void setExcitationEnergy(const G4double e)
Set the excitation energy of the cluster.
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
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.