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.
80 {
81
82 const G4int maxClusterAlgorithmMass = nucleus->getStore()->getConfig()->getClusterMaxMass();
83 runningMaxClusterAlgorithmMass = std::min(maxClusterAlgorithmMass, nucleus->getA()/2);
84
85
86 if(runningMaxClusterAlgorithmMass<=1)
87 return NULL;
88
89 theNucleus = nucleus;
90 Particle *theLeadingParticle = particle;
91
92
93 sqtot = 50000.0;
94 selectedA = 0;
95 selectedZ = 0;
96
97
98
100
102
103
105
106
107 const G4double pk = theLeadingParticle->getMomentum().mag();
108 const G4double cospr = theLeadingParticle->getPosition().dot(theLeadingParticle->getMomentum())/(theNucleus->
getUniverseRadius() * pk);
109 const G4double arg = rmaxws*rmaxws - Rprime*Rprime;
111
112 if(arg > 0.0) {
113
114 const G4double cosmin = std::sqrt(arg)/rmaxws;
115 if(cospr <= cosmin) {
116
117 translat = rmaxws * cospr;
118 } else {
119
120 translat = rmaxws * (cospr - std::sqrt(cospr*cospr - cosmin*cosmin));
121 }
122 } else {
123
124 translat = rmaxws * cospr - std::sqrt(Rprime*Rprime - rmaxws*rmaxws*(1.0 - cospr*cospr));
125 }
126
127 const ThreeVector oldLeadingParticlePosition = theLeadingParticle->getPosition();
128 const ThreeVector leadingParticlePosition = oldLeadingParticlePosition - theLeadingParticle->getMomentum() * (translat/pk);
129 const ThreeVector &leadingParticleMomentum = theLeadingParticle->getMomentum();
130 theLeadingParticle->setPosition(leadingParticlePosition);
131
132
133 const G4int theNucleusA = theNucleus->
getA();
134 if(nConsideredMax < theNucleusA) {
135 delete [] consideredPartners;
136 delete [] isInRunningConfiguration;
137 nConsideredMax = 2*theNucleusA;
138 consideredPartners = new ConsideredPartner[nConsideredMax];
139 isInRunningConfiguration =
new G4bool [nConsideredMax];
140 std::fill(isInRunningConfiguration,
141 isInRunningConfiguration + nConsideredMax,
142 false);
143 }
144
145
146
147 cascadingEnergyPool = 0.;
148 nConsidered = 0;
150 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
151 if (!(*i)->isNucleonorLambda()) continue;
152 if ((*i)->getID() == theLeadingParticle->getID()) continue;
153
154 G4double space = ((*i)->getPosition() - leadingParticlePosition).mag2();
155 G4double momentum = ((*i)->getMomentum() - leadingParticleMomentum).mag2();
156 G4double size = space*momentum*clusterPosFact2[runningMaxClusterAlgorithmMass];
157
158
159
160 if(size < clusterPhaseSpaceCut[runningMaxClusterAlgorithmMass]) {
161 consideredPartners[nConsidered] = *i;
162
163
164 if(!(*i)->isTargetSpectator())
165 cascadingEnergyPool += consideredPartners[nConsidered].
energy - consideredPartners[nConsidered].
potentialEnergy - 931.3;
166 nConsidered++;
167
168
169 }
170 }
171
172
173
174
175
176
177#ifndef INCL_CACHING_CLUSTERING_MODEL_INTERCOMPARISON_None
178
179
180
181 maxMassConfigurationSkipping = runningMaxClusterAlgorithmMass-2;
182 for(
G4int i=0; i<runningMaxClusterAlgorithmMass-2; ++i)
183 checkedConfigurations[i].clear();
184#endif
185
186
187
188 runningPositions[1] = leadingParticlePosition;
189 runningMomenta[1] = leadingParticleMomentum;
190 runningEnergies[1] = theLeadingParticle->getEnergy();
191 runningPotentials[1] = theLeadingParticle->getPotentialEnergy();
192
193
194
195
196
197 findClusterStartingFrom(1, theLeadingParticle->getZ(), 0);
198
199
200
201
202
203 Cluster *chosenCluster = 0;
204 if(selectedA!=0) {
205 candidateConfiguration[selectedA-1] = theLeadingParticle;
206 chosenCluster = new Cluster(candidateConfiguration,
207 candidateConfiguration + selectedA);
208 }
209
210
211 theLeadingParticle->setPosition(oldLeadingParticlePosition);
212
213 return chosenCluster;
214 }
G4double getProtonNuclearRadius() const
NuclearDensity const * getDensity() const
Getter for theDensity.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
G4int getA() const
Returns the baryon number.
ParticleList const & getParticles() const
ParticleList::const_iterator ParticleIter