34 #define INCLXX_IN_GEANT4_MODE 1
46 const G4int ClusteringModelIntercomparison::clusterZMin[
ParticleTable::maxClusterMass+1] = {0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3};
47 const G4int ClusteringModelIntercomparison::clusterZMax[
ParticleTable::maxClusterMass+1] = {0, 0, 1, 2, 3, 3, 5, 5, 6, 6, 7, 7, 8};
61 0.0082645, 0.0069444};
72 #ifdef INCL_DO_NOT_COMPILE
74 G4bool cascadingFirstPredicate(ConsideredPartner
const &aPartner) {
75 return !aPartner.isTargetSpectator;
90 Particle *theLeadingParticle = particle;
109 const G4double arg = rmaxws*rmaxws - Rprime*Rprime;
114 const G4double cosmin = std::sqrt(arg)/rmaxws;
115 if(cospr <= cosmin) {
117 translat = rmaxws * cospr;
120 translat = rmaxws * (cospr - std::sqrt(cospr*cospr - cosmin*cosmin));
124 translat = rmaxws * cospr - std::sqrt(Rprime*Rprime - rmaxws*rmaxws*(1.0 - cospr*cospr));
128 const ThreeVector leadingParticlePosition = oldLeadingParticlePosition - theLeadingParticle->
getMomentum() * (translat/pk);
130 theLeadingParticle->
setPosition(leadingParticlePosition);
150 for(
ParticleIter i=particles.begin(),
e=particles.end(); i!=
e; ++i) {
151 if (!(*i)->isNucleonorLambda())
continue;
152 if ((*i)->getID() == theLeadingParticle->
getID())
continue;
154 G4double space = ((*i)->getPosition() - leadingParticlePosition).mag2();
155 G4double momentum = ((*i)->getMomentum() - leadingParticleMomentum).mag2();
164 if(!(*i)->isTargetSpectator())
177 #ifndef INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_None
211 theLeadingParticle->
setPosition(oldLeadingParticlePosition);
213 return chosenCluster;
223 const G4int newA = oldA + 1;
224 const G4int oldAMinusOne = oldA - 1;
232 const G4bool cachingEnabled = (newA<=maxMassConfigurationSkipping && newA>=3);
235 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
236 HashContainer *theHashContainer;
240 theHashContainer = NULL;
241 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
246 theConfigContainer = NULL;
247 #elif !defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_None)
248 #error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask, None.
262 newZ = oldZ + candidateNucleon.
Z;
273 if(phaseSpace > phaseSpaceCut)
continue;
277 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
278 Hashing::HashType configHash;
279 HashIterator aHashIter;
280 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
285 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
287 aHashIter = theHashContainer->lower_bound(configHash);
289 if(aHashIter!=theHashContainer->end()
290 && !(configHash < *aHashIter))
292 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
294 thisConfigIter = theConfigContainer->lower_bound(thisConfig);
296 if(thisConfigIter!=theConfigContainer->end()
297 && !(thisConfig < *thisConfigIter))
315 const G4double halfB = 0.72 * newZ *
330 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
331 theHashContainer->insert(aHashIter, configHash);
332 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
333 theConfigContainer->insert(thisConfigIter, thisConfig);
342 if(newZ >= ZMinForNewA && newZ <= ZMaxForNewA) {
358 for(
G4int j=0; j<oldA; ++j)
ParticleList::const_iterator ParticleIter
const G4INCL::ThreeVector & getPosition() const
ParticleList const & getParticles() const
G4double invariantMass(const G4double E, const ThreeVector &p)
static const G4double pos
G4double getEnergy() const
const G4INCL::ThreeVector & getMomentum() const
void findClusterStartingFrom(const G4int oldA, const G4int oldZ)
G4double dot(const ThreeVector &v) const
const G4int maxClusterMass
ThreeVector runningMomenta[ParticleTable::maxClusterMass+1]
Container for the relevant information.
Functions for hashing a collection of NucleonItems.
virtual G4bool clusterCanEscape(Nucleus const *const, Cluster const *const)
static const G4double limitCosEscapeAngle
static const G4double clusterPosFact2[ParticleTable::maxClusterMass+1]
Precomputed factor (1.0/A)^2.
NuclearDensity const * getDensity() const
Getter for theDensity.
G4double runningPotentials[ParticleTable::maxClusterMass+1]
virtual Cluster * getCluster(Nucleus *, Particle *)
ConsideredPartner * consideredPartners
Array of considered cluster partners.
static const G4int clusterZMin[ParticleTable::maxClusterMass+1]
Lower limit of Z for cluster of mass A.
void fill(NucleonItem *config, size_t n)
Fill configuration with array of NucleonItem.
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
static const G4int clusterZMax[ParticleTable::maxClusterMass+1]
Upper limit of Z for cluster of mass A.
static const G4double clusterPhaseSpaceCut[ParticleTable::maxClusterMass+1]
Phase-space parameters for cluster formation.
G4double getPotentialEnergy() const
Get the particle potential energy.
virtual void setPosition(const G4INCL::ThreeVector &position)
G4int runningConfiguration[ParticleTable::maxClusterMass]
G4double getProtonNuclearRadius() const
const G4double neutronMass
Class for storing and comparing sorted nucleon configurations.
G4int getZ() const
Returns the charge number.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
G4int getA() const
Returns the baryon number.
G4int runningMaxClusterAlgorithmMass
G4double getPhaseSpace(const G4int oldA, ConsideredPartner const &p)
G4double cascadingEnergyPool
G4int getClusterMaxMass() const
Get the maximum mass for production of clusters.
Config const * getConfig()
SortedNucleonConfigurationContainer checkedConfigurations[ParticleTable::maxClusterMass-2]
Array of containers for configurations that have already been checked.
const G4double protonMass
ThreeVector runningPositions[ParticleTable::maxClusterMass+1]
G4int maxMassConfigurationSkipping
Maximum mass for configuration storage.
std::set< SortedNucleonConfiguration > SortedNucleonConfigurationContainer
SortedNucleonConfigurationContainer::iterator SortedNucleonConfigurationIterator
static const G4double clusterPosFact[ParticleTable::maxClusterMass+1]
Precomputed factor 1.0/A.
G4double runningEnergies[ParticleTable::maxClusterMass+1]
Particle * candidateConfiguration[ParticleTable::maxClusterMass]
Best cluster configuration.
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4bool * isInRunningConfiguration
Array of flags for nucleons in the running configuration.