34#define INCLXX_IN_GEANT4_MODE 1
38#ifndef G4INCLClusteringModelIntercomparison_hh
39#define G4INCLClusteringModelIntercomparison_hh 1
41#ifdef INCLXX_IN_GEANT4_MODE
42#define INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set 1
104 cascadingEnergyPool(0.),
105 protonMass(ParticleTable::getRealMass(
Proton)),
106 neutronMass(ParticleTable::getRealMass(
Neutron)),
107 lambdaMass(ParticleTable::getRealMass(
Lambda)),
108 runningMaxClusterAlgorithmMass(theConfig->getClusterMaxMass()),
111 consideredPartners(NULL),
112 isInRunningConfiguration(NULL),
113 maxMassConfigurationSkipping(ParticleTable::maxClusterMass)
118 for(
G4int A=0;
A<=runningMaxClusterAlgorithmMass; ++
A) {
119 if(clusterZMax[
A]>clusterZMaxAll)
120 clusterZMaxAll = clusterZMax[
A];
121 if(
A-clusterZMin[
A]>clusterNMaxAll)
122 clusterNMaxAll =
A-clusterZMin[
A];
124 std::fill(candidateConfiguration,
128 std::fill(runningEnergies,
132 std::fill(runningPotentials,
136 std::fill(runningConfiguration,
143 delete [] consideredPartners;
144 delete [] isInRunningConfiguration;
151 void findClusterStartingFrom(
const G4int oldA,
const G4int oldZ,
const G4int oldS);
160#if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
162#elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set) || defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_None)
165#error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask, None.
168 G4int selectedA, selectedZ, selectedS;
171 G4int clusterZMaxAll, clusterNMaxAll;
189 static const G4double limitCosEscapeAngle;
195 G4int runningMaxClusterAlgorithmMass;
197 G4int nConsideredMax;
220 G4bool *isInRunningConfiguration;
229#if defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_HashMask)
230 typedef std::set<Hashing::HashType> HashContainer;
231 typedef HashContainer::iterator HashIterator;
235#elif defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_Set)
243 class SortedNucleonConfiguration {
246 typedef G4int NucleonItem;
249 SortedNucleonConfiguration() : theSize(0), nucleons(NULL) {}
252 SortedNucleonConfiguration(
const SortedNucleonConfiguration &rhs) :
253 theSize(rhs.theSize),
254 nucleons(new NucleonItem[theSize])
256 std::copy(rhs.nucleons, rhs.nucleons+theSize, nucleons);
260 ~SortedNucleonConfiguration() {
265 void swap(SortedNucleonConfiguration &rhs) {
266 std::swap(theSize, rhs.theSize);
267 std::swap(nucleons, rhs.nucleons);
271 SortedNucleonConfiguration &
operator=(
const SortedNucleonConfiguration &rhs) {
272 SortedNucleonConfiguration tempConfig(rhs);
284 return std::lexicographical_compare(nucleons, nucleons+theSize, rhs.nucleons, rhs.nucleons+theSize);
288 void fill(NucleonItem *
config,
size_t n) {
290 nucleons =
new NucleonItem[theSize];
292 std::sort(nucleons, nucleons+theSize);
300 NucleonItem *nucleons;
303 typedef std::set<SortedNucleonConfiguration> SortedNucleonConfigurationContainer;
304 typedef SortedNucleonConfigurationContainer::iterator SortedNucleonConfigurationIterator;
308#elif !defined(INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_None)
309#error Unrecognized INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON. Allowed values are: Set, HashMask, None.
316 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 *)
bool operator<(const HepRotation &r, const HepLorentzRotation <)
const G4int maxClusterMass
yystype & operator=(const yystype &right)
Container for the relevant information.
ConsideredPartner(Particle *const p)