94{
95 if(debug_G4BinaryLightIonReactionResults)
G4cerr <<
" ######### Binary Light Ion Reaction starts ######### " <<
G4endl;
96 G4ping debug(
"debug_G4BinaryLightIonReaction");
99 tA=targetNucleus.GetA_asInt();
100 tZ=targetNucleus.GetZ_asInt();
103
105
106 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
107
110
111
112
113
114
115
116
117
118
119
120 if( (mom.t()-mom.mag())/pA < 50*MeV )
121 {
122
123
124 cascaders=FuseNucleiAndPrompound(mom);
125 if( !cascaders )
126 {
127
128
129
134 return &theResult;
135 }
136 }
137 else
138 {
139 result=Interact(mom,toBreit);
140
141 if(! result )
142 {
143
144
145 G4cerr <<
"G4BinaryLightIonReaction no final state for: " <<
G4endl;
151 G4cerr <<
" Target nucleus (A,Z)=("
152 << (swapped?pA:tA) << ","
153 << (swapped?pZ:tZ) <<
")" <<
G4endl;
154 G4cerr <<
" if frequent, please submit above information as bug report"
156
161 return &theResult;
162 }
163
164
165 G4double theStatisticalExEnergy = GetProjectileExcitation();
166
167
168 pInitialState = mom;
169
170 pInitialState.
setT(pInitialState.
getT() +
172
173
174 delete target3dNucleus;target3dNucleus=0;
175 delete projectile3dNucleus;projectile3dNucleus=0;
176
178
180
182
183
184
185
186 std::vector<G4ReactionProduct *>::iterator iter;
187
188
189
190
191
192
193
194 delete result;
195 result=0;
198
199 while (std::abs(momentum.e()-pspectators.
e()) > 10*MeV)
200
201 {
203
204
205 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
206 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
207 {
208 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
209 }
211 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
212 {
213 pFinalState +=
G4LorentzVector( (*iter)->GetMomentum(), (*iter)->GetTotalEnergy() );
214 }
215 momentum=pInitialState-pFinalState;
216 if (++loopcount > 10 )
217 {
218 break;
219 }
220 }
221
222
223 if ( std::abs(momentum.e()-pspectators.
e()) > 10*MeV )
224 {
225 for (iter=spectators->begin();iter!=spectators->end();iter++)
226 {
227 delete *iter;
228 }
229 delete spectators;
230 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
231 {
232 delete *iter;
233 }
234 delete cascaders;
235
236 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " <<
G4endl
237 <<
" initial - final " << momentum <<
" 3.mag "<< momentum.vect().mag() <<
G4endl
238 <<
" .. pInitialState/pFinalState/spectators " <<
G4endl
239 << pInitialState <<
G4endl
242 <<
" .. A,Z " << spectatorA <<
" "<< spectatorZ <<
G4endl;
243 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
249 G4cout <<
" Target nucleus (A,Z)=(" << targetNucleus.GetA_asInt()
250 <<
"," << targetNucleus.GetZ_asInt() <<
")" <<
G4endl;
251 G4cout <<
" if frequent, please submit above information as bug report"
253#ifdef debug_G4BinaryLightIonReaction
255 ed <<
"G4BinaryLightIonreaction: Terminate for above error" <<
G4endl;
257 ed);
258
259#endif
264 return &theResult;
265
266 }
267 if (spectatorA > 0 )
268 {
269
270 DeExciteSpectatorNucleus(spectators, cascaders, theStatisticalExEnergy, momentum);
271 } else {
272 delete spectators;
273 }
274 }
275
280
281
282
286 #ifdef debug_BLIR_result
288 #endif
289
290
291 G4ReactionProductVector::iterator iter;
292 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
293 {
294 if((*iter)->GetNewlyAdded())
295 {
298 (*iter)->GetTotalEnergy(),
299 (*iter)->GetMomentum() );
301 #ifdef debug_BLIR_result
302 p_raw+= tmp;
303 #endif
304 if(swapped)
305 {
306 tmp*=toBreit.inverse();
308 }
309 tmp *= toLab;
313
314 aNew.
SetTime(timePrimary + time);
315
317
319 ptot += tmp;
320
321
322 }
323 delete *iter;
324 }
325 delete cascaders;
326
327#ifdef debug_BLIR_result
328
329
331 GetIonMass(targetNucleus.GetZ_asInt(),targetNucleus.GetA_asInt());
332
333
334
335
336
340#endif
341
342 if(debug_G4BinaryLightIonReactionResults)
G4cerr <<
" ######### Binary Light Ion Reaction number ends ######### " <<
G4endl;
343
344 return &theResult;
345}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
void setVect(const Hep3Vector &)
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetGlobalTime() const
void SetTime(G4double aT)
void SetCreatorModelID(G4int id)
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()