93{
94 if(std::getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction starts ######### " <<
G4endl;
95 G4ping debug(
"debug_G4BinaryLightIonReaction");
98 tA=targetNucleus.GetA_asInt();
99 tZ=targetNucleus.GetZ_asInt();
102
104
105 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
106
109
110
111
112
113
114
115
116
117
118
119 if( (mom.t()-mom.mag())/pA < 50*MeV )
120 {
121
122
123 cascaders=FuseNucleiAndPrompound(mom);
124 if( !cascaders )
125 {
126
127
128
133 return &theResult;
134 }
135 }
136 else
137 {
138 result=Interact(mom,toBreit);
139
140 if(! result )
141 {
142
143
144 G4cerr <<
"G4BinaryLightIonReaction no final state for: " <<
G4endl;
150 G4cerr <<
" Target nucleus (A,Z)=("
151 << (swapped?pA:tA) << ","
152 << (swapped?pZ:tZ) <<
")" <<
G4endl;
153 G4cerr <<
" if frequent, please submit above information as bug report"
155
160 return &theResult;
161 }
162
163
164 G4double theStatisticalExEnergy = GetProjectileExcitation();
165
166
167 pInitialState = mom;
168
169 pInitialState.
setT(pInitialState.
getT() +
171
172
173 delete target3dNucleus;target3dNucleus=0;
174 delete projectile3dNucleus;projectile3dNucleus=0;
175
177
179
181
182
183
184
185 std::vector<G4ReactionProduct *>::iterator iter;
186
187
188
189
190
191
192
193 delete result;
194 result=0;
197
198 while (std::abs(momentum.e()-pspectators.
e()) > 10*MeV)
199
200 {
202
203
204 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
205 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
206 {
207 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
208 }
210 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
211 {
212 pFinalState +=
G4LorentzVector( (*iter)->GetMomentum(), (*iter)->GetTotalEnergy() );
213 }
214 momentum=pInitialState-pFinalState;
215 if (++loopcount > 10 )
216 {
217 if ( momentum.vect().mag() - momentum.e()> 10*keV )
218 {
219 G4cerr <<
"G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" <<
G4endl;
221 } else {
222 break;
223 }
224
225 }
226 }
227
228 if (spectatorA > 0 )
229 {
230
231 if ( momentum.vect().mag() - momentum.e()< 10*keV )
232 {
233
234 DeExciteSpectatorNucleus(spectators, cascaders, theStatisticalExEnergy, momentum);
235
236 } else {
237 for (iter=spectators->begin();iter!=spectators->end();iter++)
238 {
239 delete *iter;
240 }
241 delete spectators;
242 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
243 {
244 delete *iter;
245 }
246 delete cascaders;
247
248 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " << momentum
249 <<
" 3.mag "<< momentum.vect().mag() <<
G4endl
250 << " .. pInitialState/pFinalState/spectators " << pInitialState <<" "
251 << pFinalState <<
" " << pspectators <<
G4endl
252 <<
" .. A,Z " << spectatorA <<
" "<< spectatorZ <<
G4endl;
253 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
259 G4cout <<
" Target nucleus (A,Z)=(" << targetNucleus.GetA_asInt()
260 <<
"," << targetNucleus.GetZ_asInt() <<
")" <<
G4endl;
261 G4cout <<
" if frequent, please submit above information as bug report"
263#ifdef debug_G4BinaryLightIonReaction
265 ed <<
"G4BinaryLightIonreaction: Terminate for above error" <<
G4endl;
267 ed);
268
269#endif
274 return &theResult;
275 }
276 } else {
277 delete spectators;
278 }
279 }
280
285
286
287
291 G4ReactionProductVector::iterator iter;
292 #ifdef debug_BLIR_result
294 #endif
295
296
297 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
298 {
299 if((*iter)->GetNewlyAdded())
300 {
303 (*iter)->GetTotalEnergy(),
304 (*iter)->GetMomentum() );
306 #ifdef debug_BLIR_result
307 p_raw+= tmp;
308 #endif
309 if(swapped)
310 {
311 tmp*=toBreit.inverse();
313 }
314 tmp *= toLab;
318
319 aNew.
SetTime(timePrimary + time);
320
322
324 ptot += tmp;
325
326
327 }
328 delete *iter;
329 }
330 delete cascaders;
331
332#ifdef debug_BLIR_result
333
334
336 GetIonMass(targetNucleus.GetZ_asInt(),targetNucleus.GetA_asInt());
337
338
339
340
341
345#endif
346
347 if(std::getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction number ends ######### " <<
G4endl;
348
349 return &theResult;
350}
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()