35#define INCLXX_IN_GEANT4_MODE 1
39#ifndef G4INCLCluster_hh
40#define G4INCLCluster_hh 1
70 if(createParticleSampler)
77 template<
class Iterator>
85 for(Iterator i = begin; i != end; ++i) {
112 swap(temporaryCluster);
192 std::stringstream ss;
193 ss <<
"Cluster (ID = " <<
ID <<
") type = ";
196 <<
" A = " <<
theA << std::endl
197 <<
" Z = " <<
theZ << std::endl
198 <<
" mass = " <<
getMass() << std::endl
199 <<
" energy = " <<
theEnergy << std::endl
206 <<
"Contains the following particles:"
229 theCMPosition += (*p)->getPosition();
230 theTotalMomentum += (*p)->getMomentum();
231 theTotalEnergy += (*p)->getEnergy();
233 theCMPosition /=
theA;
251 (*p)->setMomentum(((*p)->getMomentum()-theTotalMomentum/
theA)*rescaling);
254 (*p)->setPosition(((*p)->getPosition()-theCMPosition)*rescaling);
266 DEBUG(
"Cluster boosted to internal CM:" << std::endl <<
print());
277 const G4double theDynamicalPotential = computeDynamicalPotential();
278 DEBUG(
"The dynamical potential is " << theDynamicalPotential <<
" MeV" << std::endl);
281 const G4double energy = (*p)->getEnergy() - theDynamicalPotential;
285 (*p)->setEnergy(energy);
286 (*p)->setMass(std::sqrt(energy*energy - momentum.
mag2()));
287 DEBUG(
"Cluster components are now off shell:" << std::endl
301 (*p)->setPosition((*p)->getPosition()+shift);
316 (*p)->boost(aBoostVector);
321 DEBUG(
"Cluster was boosted with (bx,by,bz)=("
322 << aBoostVector.
getX() <<
", " << aBoostVector.
getY() <<
", " << aBoostVector.
getZ() <<
"):"
323 << std::endl <<
print());
338 const G4double pMass = (*p)->getMass();
339 const ThreeVector frozenMomentum = normMomentum * pMass;
340 const G4double frozenEnergy = std::sqrt(frozenMomentum.
mag2()+pMass*pMass);
341 (*p)->setFrozenMomentum(frozenMomentum);
342 (*p)->setFrozenEnergy(frozenEnergy);
343 (*p)->freezePropagation();
357 (*p)->rotate(angle, axis);
365 (*p)->makeProjectileSpectator();
373 (*p)->makeTargetSpectator();
381 (*p)->makeParticipant();
403 G4double computeDynamicalPotential() {
404 G4double theDynamicalPotential = 0.0;
406 theDynamicalPotential += (*p)->getEnergy();
409 theDynamicalPotential /=
theA;
411 return theDynamicalPotential;
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.
Cluster(const G4int Z, const G4int A, const G4bool createParticleSampler=true)
Standard Cluster constructor.
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.
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.
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 freezeInternalMotion()
Freeze the internal motion of the particles.
virtual void rotate(const G4double angle, const ThreeVector &axis)
Rotate position and momentum of all 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.
static ParticleSampler * createParticleSampler(const G4int A, const G4int Z)
static std::string getName(const ParticleType t)
Get the native INCL name of the particle.
G4INCL::ThreeVector theMomentum
virtual G4INCL::ThreeVector getAngularMomentum() const
G4double getEnergy() const
G4double getPotentialEnergy() const
Get the particle potential energy.
virtual void makeTargetSpectator()
G4double thePotentialEnergy
virtual void rotate(const G4double angle, const ThreeVector &axis)
Rotate the particle position and momentum.
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::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter