35#define INCLXX_IN_GEANT4_MODE 1
39#ifndef G4INCLClusteringModelIntercomparison_hh
40#define G4INCLClusteringModelIntercomparison_hh 1
42#ifdef INCLXX_IN_GEANT4_MODE
43#define INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set 1
67 cascadingEnergyPool(0.),
70 runningMaxClusterAlgorithmMass(theConfig->getClusterMaxMass()),
73 consideredPartners(NULL),
74 isInRunningConfiguration(NULL),
80 for(
G4int A=0; A<=runningMaxClusterAlgorithmMass; ++A) {
86 std::fill(candidateConfiguration,
90 std::fill(runningEnergies,
94 std::fill(runningPotentials,
98 std::fill(runningConfiguration,
105 delete [] consideredPartners;
106 delete [] isInRunningConfiguration;
113 void findClusterStartingFrom(
const G4int oldA,
const G4int oldZ);
122#if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
124#elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
127#error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask.
130 G4int selectedA, selectedZ;
133 G4int clusterZMaxAll, clusterNMaxAll;
137 static const G4double limitCosEscapeAngle;
142 G4int runningMaxClusterAlgorithmMass;
144 G4int nConsideredMax;
166 G4bool *isInRunningConfiguration;
175#if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
176 typedef std::set<Hashing::HashType> HashContainer;
177 typedef HashContainer::iterator HashIterator;
181#elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
189 class SortedNucleonConfiguration {
192 typedef G4int NucleonItem;
195 SortedNucleonConfiguration() : theSize(0), nucleons(NULL) {}
198 SortedNucleonConfiguration(
const SortedNucleonConfiguration &rhs) :
199 theSize(rhs.theSize),
200 nucleons(new NucleonItem[theSize])
202 std::copy(rhs.nucleons, rhs.nucleons+theSize, nucleons);
206 ~SortedNucleonConfiguration() {
211 void swap(SortedNucleonConfiguration &rhs) {
212 std::swap(theSize, rhs.theSize);
213 std::swap(nucleons, rhs.nucleons);
217 SortedNucleonConfiguration &operator=(
const SortedNucleonConfiguration &rhs) {
218 SortedNucleonConfiguration tempConfig(rhs);
230 return std::lexicographical_compare(nucleons, nucleons+theSize, rhs.nucleons, rhs.nucleons+theSize);
234 void fill(NucleonItem *
config,
size_t n) {
236 nucleons =
new NucleonItem[theSize];
238 std::sort(nucleons, nucleons+theSize);
246 NucleonItem *nucleons;
249 typedef std::set<SortedNucleonConfiguration> SortedNucleonConfigurationContainer;
250 typedef SortedNucleonConfigurationContainer::iterator SortedNucleonConfigurationIterator;
255#error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask.
262 G4int maxMassConfigurationSkipping;
Functions for hashing a collection of NucleonItems.
Cluster coalescence algorithm used in the IAEA intercomparison.
virtual ~ClusteringModelIntercomparison()
ClusteringModelIntercomparison(Config const *const theConfig)
virtual G4bool clusterCanEscape(Nucleus const *const, Cluster const *const)
virtual Cluster * getCluster(Nucleus *, Particle *)
static const G4int clusterZMin[maxClusterMass+1]
static const G4int clusterZMax[maxClusterMass+1]
static const G4int maxClusterMass
bool operator<(shared_ctrl_handle const &lhs, shared_ctrl_handle const &rhs)
void swap(shared_ptr< P > &, shared_ptr< P > &)