Choose a cluster candidate to be produced. At this point we don't yet decide if it can pass through the Coulomb barrier or not.
52 {
53
54 const G4int maxClusterAlgorithmMass = nucleus->getStore()->getConfig()->getClusterMaxMass();
55 runningMaxClusterAlgorithmMass = std::min(maxClusterAlgorithmMass, nucleus->getA()/2);
56
57
58 if(runningMaxClusterAlgorithmMass<=1)
59 return NULL;
60
61 theNucleus = nucleus;
62 Particle *theLeadingParticle = particle;
63
64
65 sqtot = 50000.0;
66 selectedA = 0;
67 selectedZ = 0;
68
69
70
72
74
75
77
78
79 const G4double pk = theLeadingParticle->getMomentum().mag();
80 const G4double cospr = theLeadingParticle->getPosition().dot(theLeadingParticle->getMomentum())/(theNucleus->
getUniverseRadius() * pk);
81 const G4double arg = rmaxws*rmaxws - Rprime*Rprime;
83
84 if(arg > 0.0) {
85
86 const G4double cosmin = std::sqrt(arg)/rmaxws;
87 if(cospr <= cosmin) {
88
89 translat = rmaxws * cospr;
90 } else {
91
92 translat = rmaxws * (cospr - std::sqrt(cospr*cospr - cosmin*cosmin));
93 }
94 } else {
95
96 translat = rmaxws * cospr - std::sqrt(Rprime*Rprime - rmaxws*rmaxws*(1.0 - cospr*cospr));
97 }
98
99 const ThreeVector oldLeadingParticlePosition = theLeadingParticle->getPosition();
100 const ThreeVector leadingParticlePosition = oldLeadingParticlePosition - theLeadingParticle->getMomentum() * (translat/pk);
101 const ThreeVector &leadingParticleMomentum = theLeadingParticle->getMomentum();
102 theLeadingParticle->setPosition(leadingParticlePosition);
103
104
105 const G4int theNucleusA = theNucleus->
getA();
106 if(nConsideredMax < theNucleusA) {
107 delete [] consideredPartners;
108 delete [] isInRunningConfiguration;
109 nConsideredMax = 2*theNucleusA;
110 consideredPartners = new Particle *[nConsideredMax];
111 isInRunningConfiguration =
new G4bool [nConsideredMax];
112 std::fill(isInRunningConfiguration,
113 isInRunningConfiguration + nConsideredMax,
114 false);
115 }
116
117
118
119 cascadingEnergyPool = 0.;
120 nConsidered = 0;
122 for(
ParticleIter i = particles.begin(); i != particles.end(); ++i) {
123 if (!(*i)->isNucleon()) continue;
124 if ((*i)->getID() == theLeadingParticle->getID()) continue;
125
126 G4double space = ((*i)->getPosition() - leadingParticlePosition).mag2();
127 G4double momentum = ((*i)->getMomentum() - leadingParticleMomentum).mag2();
129
130
131
133 consideredPartners[nConsidered] = *i;
134
135
136 if(!(*i)->isTargetSpectator())
137 cascadingEnergyPool += (*i)->
getEnergy() - (*i)->getPotentialEnergy() - 931.3;
138 nConsidered++;
139
140
141 }
142 }
143
144
145
146
147 std::partition(consideredPartners, consideredPartners+nConsidered, cascadingFirstPredicate);
148
149
150
151
152 maxMassConfigurationSkipping = runningMaxClusterAlgorithmMass-2;
153 for(
G4int i=0; i<runningMaxClusterAlgorithmMass-2; ++i)
154 checkedConfigurations[i].clear();
155
156
157
158 runningPositions[1] = leadingParticlePosition;
159 runningMomenta[1] = leadingParticleMomentum;
160 runningEnergies[1] = theLeadingParticle->getEnergy();
161 runningPotentials[1] = theLeadingParticle->getPotentialEnergy();
162
163
164
165
166
167 findClusterStartingFrom(1, theLeadingParticle->getZ());
168
169
170
171
172
173 Cluster *chosenCluster = 0;
174 if(selectedA!=0) {
175 candidateConfiguration[selectedA-1] = theLeadingParticle;
176 chosenCluster = new Cluster(candidateConfiguration,
177 candidateConfiguration + selectedA);
178 }
179
180
181 theLeadingParticle->setPosition(oldLeadingParticlePosition);
182
183 return chosenCluster;
184 }
G4double getNuclearRadius()
NuclearDensity * getDensity() const
Getter for theDensity.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
static const G4double clusterPosFact2[maxClusterMass+1]
static const G4double clusterPhaseSpaceCut[maxClusterMass+1]
G4double getEnergy() const
G4int getA() const
Returns the baryon number.
ParticleList const & getParticles() const
std::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter