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;
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();
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;
233 const G4bool cachingEnabled = (newA<=maxMassConfigurationSkipping && newA>=3);
236 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
237 HashContainer *theHashContainer;
241 theHashContainer = NULL;
242 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
247 theConfigContainer = NULL;
248 #elif !defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_None)
249 #error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask, None.
263 newZ = oldZ + candidateNucleon.
Z;
264 newS = oldS + candidateNucleon.
S;
275 if(phaseSpace > phaseSpaceCut)
continue;
279 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
280 Hashing::HashType configHash;
281 HashIterator aHashIter;
282 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
287 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
289 aHashIter = theHashContainer->lower_bound(configHash);
291 if(aHashIter!=theHashContainer->end()
292 && !(configHash < *aHashIter))
294 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
296 thisConfigIter = theConfigContainer->lower_bound(thisConfig);
298 if(thisConfigIter!=theConfigContainer->end()
299 && !(thisConfig < *thisConfigIter))
317 const G4double halfB = 0.72 * newZ *
332 #if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
333 theHashContainer->insert(aHashIter, configHash);
334 #elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
335 theConfigContainer->insert(thisConfigIter, thisConfig);
344 if(newZ >= ZMinForNewA && newZ <= ZMaxForNewA) {
361 for(
G4int j=0; j<oldA; ++j)