33 #define INCLXX_IN_GEANT4_MODE 1
37 #ifndef G4INCLCluster_hh
38 #define G4INCLCluster_hh 1
68 if(createParticleSampler)
75 template<
class Iterator>
83 for(Iterator i = begin; i != end; ++i) {
114 swap(temporaryCluster);
194 std::stringstream ss;
195 ss <<
"Cluster (ID = " <<
ID <<
") type = ";
198 <<
" A = " <<
theA << std::endl
199 <<
" Z = " <<
theZ << std::endl
200 <<
" mass = " <<
getMass() << std::endl
201 <<
" energy = " <<
theEnergy << std::endl
208 <<
"Contains the following particles:"
231 theCMPosition += (*p)->getPosition();
232 theTotalMomentum += (*p)->getMomentum();
233 theTotalEnergy += (*p)->getEnergy();
235 theCMPosition /=
theA;
253 (*p)->setMomentum(((*p)->getMomentum()-theTotalMomentum/
theA)*rescaling);
256 (*p)->setPosition(((*p)->getPosition()-theCMPosition)*rescaling);
279 const G4double theDynamicalPotential = computeDynamicalPotential();
280 INCL_DEBUG(
"The dynamical potential is " << theDynamicalPotential <<
" MeV" << std::endl);
283 const G4double energy = (*p)->getEnergy() - theDynamicalPotential;
287 (*p)->setEnergy(energy);
288 (*p)->setMass(std::sqrt(energy*energy - momentum.
mag2()));
290 INCL_DEBUG(
"Cluster components are now off shell:" << std::endl
303 (*p)->setPosition((*p)->getPosition()+shift);
318 (*p)->boost(aBoostVector);
324 INCL_DEBUG(
"Cluster was boosted with (bx,by,bz)=("
325 << aBoostVector.
getX() <<
", " << aBoostVector.
getY() <<
", " << aBoostVector.
getZ() <<
"):"
326 << std::endl <<
print());
341 const G4double pMass = (*p)->getMass();
342 const ThreeVector frozenMomentum = normMomentum * pMass;
343 const G4double frozenEnergy = std::sqrt(frozenMomentum.
mag2()+pMass*pMass);
344 (*p)->setFrozenMomentum(frozenMomentum);
345 (*p)->setFrozenEnergy(frozenEnergy);
346 (*p)->freezePropagation();
360 (*p)->rotate(angle, axis);
368 (*p)->makeProjectileSpectator();
376 (*p)->makeTargetSpectator();
384 (*p)->makeParticipant();
406 G4double computeDynamicalPotential() {
407 G4double theDynamicalPotential = 0.0;
409 theDynamicalPotential += (*p)->getEnergy();
412 theDynamicalPotential /=
theA;
414 return theDynamicalPotential;
G4int getA() const
Returns the baryon number.
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.
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.
void boost(const ThreeVector &aBoostVector)
const G4INCL::ThreeVector & getMomentum() const
G4double getEnergy() const
void setINCLMass()
Set the mass of the Particle to its table mass.
virtual void makeProjectileSpectator()
void boost(const ThreeVector &aBoostVector)
Boost the cluster with the indicated velocity.
G4double getPotentialEnergy() const
Get the particle potential energy.
void setY(G4double ay)
Set the y coordinate.
virtual void rotate(const G4double angle, const ThreeVector &axis)
Rotate the particle position and momentum.
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
Class for sampling particles in a nucleus.
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.
void swap(shared_ptr< P > &, shared_ptr< P > &)
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.
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.
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.