33 #define INCLXX_IN_GEANT4_MODE 1
45 const G4int ClusteringModelIntercomparison::clusterZMin[
ParticleTable::maxClusterMass+1] = {0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3};
46 const G4int ClusteringModelIntercomparison::clusterZMax[
ParticleTable::maxClusterMass+1] = {0, 0, 1, 2, 3, 3, 5, 5, 6, 6, 7, 7, 8};
60 0.0082645, 0.0069444};
71 #ifndef INCLXX_IN_GEANT4_MODE
73 G4bool cascadingFirstPredicate(ConsideredPartner
const &aPartner) {
74 return !aPartner.isTargetSpectator;
89 Particle *theLeadingParticle = particle;
108 const G4double arg = rmaxws*rmaxws - Rprime*Rprime;
113 const G4double cosmin = std::sqrt(arg)/rmaxws;
114 if(cospr <= cosmin) {
116 translat = rmaxws * cospr;
119 translat = rmaxws * (cospr - std::sqrt(cospr*cospr - cosmin*cosmin));
123 translat = rmaxws * cospr - std::sqrt(Rprime*Rprime - rmaxws*rmaxws*(1.0 - cospr*cospr));
127 const ThreeVector leadingParticlePosition = oldLeadingParticlePosition - theLeadingParticle->
getMomentum() * (translat/pk);
129 theLeadingParticle->
setPosition(leadingParticlePosition);
149 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
150 if (!(*i)->isNucleon())
continue;
151 if ((*i)->getID() == theLeadingParticle->
getID())
continue;
153 G4double space = ((*i)->getPosition() - leadingParticlePosition).mag2();
154 G4double momentum = ((*i)->getMomentum() - leadingParticleMomentum).mag2();
163 if(!(*i)->isTargetSpectator())
208 theLeadingParticle->
setPosition(oldLeadingParticlePosition);
210 return chosenCluster;
220 const G4int newA = oldA + 1;
221 const G4int oldAMinusOne = oldA - 1;
229 const G4bool cachingEnabled = (newA<=maxMassConfigurationSkipping && newA>=3);
232 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
233 HashContainer *theHashContainer;
237 theHashContainer = NULL;
238 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
243 theConfigContainer = NULL;
245 #error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask.
259 newZ = oldZ + candidateNucleon.
Z;
270 if(phaseSpace > phaseSpaceCut)
continue;
274 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
275 Hashing::HashType configHash;
276 HashIterator aHashIter;
277 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
282 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
284 aHashIter = theHashContainer->lower_bound(configHash);
286 if(aHashIter!=theHashContainer->end()
287 && !(configHash < *aHashIter))
289 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
291 thisConfigIter = theConfigContainer->lower_bound(thisConfig);
293 if(thisConfigIter!=theConfigContainer->end()
294 && !(thisConfig < *thisConfigIter))
312 const G4double halfB = 0.72 * newZ *
327 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
328 theHashContainer->insert(aHashIter, configHash);
329 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
330 theConfigContainer->insert(thisConfigIter, thisConfig);
338 if(newZ >= ZMinForNewA && newZ <= ZMaxForNewA) {
354 for(
G4int j=0; j<oldA; ++j)
G4int getA() const
Returns the baryon number.
virtual G4bool clusterCanEscape(Nucleus const *const, Cluster const *const)
Determine whether cluster can escape or not.
static const G4double clusterPosFact[ParticleTable::maxClusterMass+1]
Precomputed factor 1.0/A.
SortedNucleonConfigurationContainer::iterator SortedNucleonConfigurationIterator
G4double runningPotentials[ParticleTable::maxClusterMass+1]
G4double dot(const ThreeVector &v) const
Dot product.
ParticleList const & getParticles() const
Return the list of "active" particles (i.e.
G4int maxMassConfigurationSkipping
Maximum mass for configuration storage.
const G4double neutronMass
G4double runningEnergies[ParticleTable::maxClusterMass+1]
G4int getClusterMaxMass() const
Get the maximum mass for production of clusters.
const G4INCL::ThreeVector & getMomentum() const
Get the momentum vector.
Config const * getConfig()
Get the config object.
static const G4int clusterZMin[ParticleTable::maxClusterMass+1]
Lower limit of Z for cluster of mass A.
G4double getEnergy() const
Get the energy of the particle in MeV.
SortedNucleonConfigurationContainer checkedConfigurations[ParticleTable::maxClusterMass-2]
Array of containers for configurations that have already been checked.
Particle * candidateConfiguration[ParticleTable::maxClusterMass]
Best cluster configuration.
Cluster is a particle (inherits from the Particle class) that is actually a collection of elementary ...
G4double getPhaseSpace(const G4int oldA, ConsideredPartner const &p)
G4double mag2() const
Get the square of the length.
G4double getPotentialEnergy() const
Get the particle potential energy.
G4double getProtonNuclearRadius() const
std::set< SortedNucleonConfiguration > SortedNucleonConfigurationContainer
void findClusterStartingFrom(const G4int oldA, const G4int oldZ)
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
const G4int maxClusterMass
static const G4double clusterPhaseSpaceCut[ParticleTable::maxClusterMass+1]
Phase-space parameters for cluster formation.
G4bool * isInRunningConfiguration
Array of flags for nucleons in the running configuration.
virtual void setPosition(const G4INCL::ThreeVector &position)
ThreeVector runningPositions[ParticleTable::maxClusterMass+1]
G4int getZ() const
Returns the charge number.
G4int runningConfiguration[ParticleTable::maxClusterMass]
static const G4int clusterZMax[ParticleTable::maxClusterMass+1]
Upper limit of Z for cluster of mass A.
Class for storing and comparing sorted nucleon configurations.
G4double invariantMass(const G4double E, const ThreeVector &p)
Container for the relevant information.
virtual Cluster * getCluster(Nucleus *, Particle *)
Choose a cluster candidate to be produced.
G4double cascadingEnergyPool
NuclearDensity const * getDensity() const
Getter for theDensity.
G4double energy(const ThreeVector &p, const G4double m)
void fill(NucleonItem *config, size_t n)
Fill configuration with array of NucleonItem.
const G4INCL::ThreeVector & getPosition() const
Set the position vector.
static const G4double limitCosEscapeAngle
const G4double protonMass
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
ConsideredPartner * consideredPartners
Array of considered cluster partners.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
G4int runningMaxClusterAlgorithmMass
Functions for hashing a collection of NucleonItems.
G4double mag() const
Get the length of the vector.
static const G4double clusterPosFact2[ParticleTable::maxClusterMass+1]
Precomputed factor (1.0/A)^2.
static const G4double pos
ParticleList::const_iterator ParticleIter
ThreeVector runningMomenta[ParticleTable::maxClusterMass+1]