108{
109 if(std::getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction starts ######### " <<
G4endl;
110 G4ping debug(
"debug_G4BinaryLightIonReaction");
113 tA=targetNucleus.GetA_asInt();
114 tZ=targetNucleus.GetZ_asInt();
117
119
120 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
121
124
125
126
127
128
129
130
131
132
133
134 if( (mom.t()-mom.mag())/pA < 50*MeV )
135 {
136
137
138 cascaders=FuseNucleiAndPrompound(mom);
139 if( !cascaders )
140 {
141
142
143
148 return &theResult;
149 }
150 }
151 else
152 {
153 result=Interact(mom,toBreit);
154
155 if(! result )
156 {
157
158
159 G4cerr <<
"G4BinaryLightIonReaction no final state for: " <<
G4endl;
165 G4cerr <<
" Target nucleus (A,Z)=("
166 << (swapped?pA:tA) << ","
167 << (swapped?pZ:tZ) <<
")" <<
G4endl;
168 G4cerr <<
" if frequent, please submit above information as bug report"
170
175 return &theResult;
176 }
177
178
179 G4double theStatisticalExEnergy = GetProjectileExcitation();
180
181
182 pInitialState = mom;
183
184 pInitialState.
setT(pInitialState.
getT() +
186
187
188 delete target3dNucleus;target3dNucleus=0;
189 delete projectile3dNucleus;projectile3dNucleus=0;
190
192
194
196
197
198
199
200 std::vector<G4ReactionProduct *>::iterator iter;
201
202
203
204
205
206
207
208 delete result;
209 result=0;
212
213 while (std::abs(momentum.e()-pspectators.
e()) > 10*MeV)
214
215 {
217
218
219 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
220 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
221 {
222 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
223 }
225 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
226 {
227 pFinalState +=
G4LorentzVector( (*iter)->GetMomentum(), (*iter)->GetTotalEnergy() );
228 }
229 momentum=pInitialState-pFinalState;
230 if (++loopcount > 10 )
231 {
232 if ( momentum.vect().mag() - momentum.e()> 10*keV )
233 {
234 G4cerr <<
"G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" <<
G4endl;
236 } else {
237 break;
238 }
239
240 }
241 }
242
243 if (spectatorA > 0 )
244 {
245
246 if ( momentum.vect().mag() - momentum.e()< 10*keV )
247 {
248
249 DeExciteSpectatorNucleus(spectators, cascaders, theStatisticalExEnergy, momentum);
250
251 } else {
252 for (iter=spectators->begin();iter!=spectators->end();iter++)
253 {
254 delete *iter;
255 }
256 delete spectators;
257 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
258 {
259 delete *iter;
260 }
261 delete cascaders;
262
263 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " << momentum
264 <<
" 3.mag "<< momentum.vect().mag() <<
G4endl
265 << " .. pInitialState/pFinalState/spectators " << pInitialState <<" "
266 << pFinalState <<
" " << pspectators <<
G4endl
267 <<
" .. A,Z " << spectatorA <<
" "<< spectatorZ <<
G4endl;
268 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
274 G4cout <<
" Target nucleus (A,Z)=(" << targetNucleus.GetA_asInt()
275 <<
"," << targetNucleus.GetZ_asInt() <<
")" <<
G4endl;
276 G4cout <<
" if frequent, please submit above information as bug report"
278#ifdef debug_G4BinaryLightIonReaction
280 ed <<
"G4BinaryLightIonreaction: Terminate for above error" <<
G4endl;
282 ed);
283
284#endif
289 return &theResult;
290 }
291 } else {
292 delete spectators;
293 }
294 }
295
300
301
302
306 G4ReactionProductVector::iterator iter;
307 #ifdef debug_BLIR_result
309 #endif
310
311
312 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
313 {
314 if((*iter)->GetNewlyAdded())
315 {
318 (*iter)->GetTotalEnergy(),
319 (*iter)->GetMomentum() );
321 #ifdef debug_BLIR_result
322 p_raw+= tmp;
323 #endif
324 if(swapped)
325 {
326 tmp*=toBreit.inverse();
328 }
329 tmp *= toLab;
333
334 aNew.
SetTime(timePrimary + time);
336
338 ptot += tmp;
339
340
341 }
342 delete *iter;
343 }
344 delete cascaders;
345
346#ifdef debug_BLIR_result
347
348
350 GetIonMass(targetNucleus.GetZ_asInt(),targetNucleus.GetA_asInt());
351
352
353
354
355
359#endif
360
361 if(std::getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction number ends ######### " <<
G4endl;
362
363 return &theResult;
364}
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 SetCreatorModelType(G4int idx)
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()