51 theProjectileFragmentation(ptr),
52 pA(0),pZ(0), tA(0),tZ(0),spectatorA(0),spectatorZ(0),
53 projectile3dNucleus(0),target3dNucleus(0)
60 theProjectileFragmentation = pre;
65 debug_G4BinaryLightIonReactionResults=getenv(
"debug_G4BinaryLightIonReactionResults")!=0;
73 outFile <<
"G4Binary Light Ion Cascade is an intra-nuclear cascade model\n"
74 <<
"using G4BinaryCasacde to model the interaction of a light\n"
75 <<
"nucleus with a nucleus.\n"
76 <<
"The lighter of the two nuclei is treated like a set of projectiles\n"
77 <<
"which are transported simultanously through the heavier nucleus.\n";
89 static G4int eventcounter=0;
91 if(getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction number starts ######### "<<eventcounter<<
G4endl;
102 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
116 if( (mom.t()-mom.mag())/pA < 50*
MeV )
120 cascaders=FuseNucleiAndPrompound(mom);
124 result=Interact(mom,toBreit);
131 G4cerr <<
"G4BinaryLightIonReaction no final state for: " <<
G4endl;
137 G4cerr <<
" Target nucleus (A,Z)=("
138 << (swapped?pA:tA) <<
","
139 << (swapped?pZ:tZ) <<
")" <<
G4endl;
140 G4cerr <<
" if frequent, please submit above information as bug report"
153 G4double theStatisticalExEnergy = GetProjectileExcitation();
158 pInitialState.
setT(pInitialState.
getT() +
162 delete target3dNucleus;target3dNucleus=0;
163 delete projectile3dNucleus;projectile3dNucleus=0;
172 std::vector<G4ReactionProduct *>::iterator iter;
185 while (std::abs(momentum.
e()-pspectators.
e()) > 10*
MeV)
190 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
191 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
193 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
197 for(i=0; i<cascaders->size(); i++)
199 pFinalState +=
G4LorentzVector( (*cascaders)[i]->GetMomentum(), (*cascaders)[i]->GetTotalEnergy() );
201 momentum=pInitialState-pFinalState;
202 if (++loopcount > 10 )
204 if ( momentum.
vect().
mag() - momentum.
e()> 10*
keV )
206 G4cerr <<
"G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" <<
G4endl;
218 if ( momentum.
vect().
mag() - momentum.
e()> 10*
keV )
221 G4ReactionProductVector::iterator ispectator;
222 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
228 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " << momentum
229 <<
" 3.mag "<< momentum.
vect().
mag() << G4endl
230 <<
" .. pInitialState/pFinalState/spectators " << pInitialState <<
" "
231 << pFinalState <<
" " << pspectators << G4endl
232 <<
" .. A,Z " << spectatorA <<
" "<< spectatorZ <<
G4endl;
233 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
241 G4cout <<
" if frequent, please submit above information as bug report"
252 DeExciteSpectatorNucleus(spectators, cascaders, theStatisticalExEnergy, momentum);
267 for(i=0; i<cascaders->size(); i++)
269 if((*cascaders)[i]->GetNewlyAdded())
273 (*cascaders)[i]->GetTotalEnergy(),
274 (*cascaders)[i]->GetMomentum() );
278 tmp*=toBreit.inverse();
291 delete (*cascaders)[i];
295 #ifdef debug_BLIR_result
297 G4cout <<
" Energy conservation initial/primary/nucleus/final/delta(init-final) "
302 if(getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction number ends ######### "<<eventcounter<<
G4endl;
310 G4bool G4BinaryLightIonReaction::EnergyAndMomentumCorrector(
314 const int nAttemptScale = 2500;
315 const double ErrLimit = 1.E-6;
320 G4double TotalCollisionMass = TotalCollisionMom.
m();
323 for(i = 0; i < Output->size(); i++)
325 SumMom +=
G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
326 SumMass += (*Output)[i]->GetDefinition()->GetPDGMass();
330 if (SumMass > TotalCollisionMass)
return FALSE;
331 SumMass = SumMom.m2();
332 if (SumMass < 0)
return FALSE;
333 SumMass = std::sqrt(SumMass);
339 for(i = 0; i < Output->size(); i++)
343 (*Output)[i]->SetMomentum(mom.
vect());
344 (*Output)[i]->SetTotalEnergy(mom.
e());
354 for(cAttempt = 0; cAttempt < nAttemptScale; cAttempt++)
357 for(i = 0; i < Output->size(); i++)
361 G4double E = std::sqrt(HadronMom.
vect().
mag2() +
sqr((*Output)[i]->GetDefinition()->GetPDGMass()));
363 (*Output)[i]->SetMomentum(HadronMom.
vect());
364 (*Output)[i]->SetTotalEnergy(HadronMom.
e());
368 Scale = TotalCollisionMass/Sum - 1;
370 if (std::abs(Scale) <= ErrLimit
371 || OldScale ==
Scale)
373 if (debug_G4BinaryLightIonReactionResults)
G4cout <<
"E/p corrector: " << cAttempt <<
G4endl;
380 factor=std::max(1.,std::log(std::abs(OldScale/(OldScale-Scale))));
385 if( (!success) && debug_G4BinaryLightIonReactionResults)
387 G4cout <<
"G4G4BinaryLightIonReaction::EnergyAndMomentumCorrector - Warning"<<
G4endl;
388 G4cout <<
" Scale not unity at end of iteration loop: "<<TotalCollisionMass<<
" "<<Sum<<
" "<<Scale<<
G4endl;
389 G4cout <<
" Increase number of attempts or increase ERRLIMIT"<<
G4endl;
395 for(i = 0; i < Output->size(); i++)
399 (*Output)[i]->SetMomentum(mom.
vect());
400 (*Output)[i]->SetTotalEnergy(mom.
e());
422 aPreFrag.
SetA(pA+tA);
423 aPreFrag.
SetZ(pZ+tZ);
433 ->
FindIon(pZ+tZ,pA+tA,0,pZ+tZ);
440 for(
size_t count = 0; count<cascaders->size(); count++)
442 cascaders->operator[](count)->SetNewlyAdded(
true);
459 projectile3dNucleus->
Init(pA, pZ);
466 target3dNucleus->
Init(tA, tZ);
478 nucleonMom.setZ(nucleonMom.vect().mag());
481 theFermi.
Init(pA,pZ);
488 nucleonPosition += pos;
495 initalState->push_back(it1);
498 result=theModel->
Propagate(initalState, target3dNucleus);
499 if( result && result->size()==0)
506 delete target3dNucleus;
507 delete projectile3dNucleus;
513 }
while (! result && tryCount< 150);
516 G4double G4BinaryLightIonReaction::GetProjectileExcitation()
518 spectatorA=spectatorZ=0;
527 G4double theStatisticalExEnergy = 0;
543 G4double localFermiEnergy = std::sqrt(nucMass*nucMass + localPfermi*localPfermi) - nucMass;
545 theStatisticalExEnergy += deltaE;
548 return theStatisticalExEnergy;
557 for(i=0; i<result->size(); i++)
559 if( (*result)[i]->GetNewlyAdded() )
561 pFinalState +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
562 cascaders->push_back((*result)[i]);
566 pspectators +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
567 spectators->push_back((*result)[i]);
594 if(spectatorZ>0 && spectatorA>1)
598 aProRes.
SetA(spectatorA);
599 aProRes.
SetZ(spectatorZ);
604 pFragment=
G4LorentzVector(0,0,0,mFragment+std::max(0.,theStatisticalExEnergy) );
610 proFrag = theHandler->
BreakItUp(aProRes);
619 G4ReactionProductVector::iterator ispectator;
620 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
625 else if(spectatorA!=0)
627 G4ReactionProductVector::iterator ispectator;
628 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
630 (*ispectator)->SetNewlyAdded(
true);
631 cascaders->push_back(*ispectator);
632 pFragments+=
G4LorentzVector((*ispectator)->GetMomentum(),(*ispectator)->GetTotalEnergy());
643 G4ReactionProductVector::iterator ii;
646 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
648 (*ii)->SetNewlyAdded(
true);
650 tmp *= boost_fragments;
651 (*ii)->SetMomentum(tmp.vect());
652 (*ii)->SetTotalEnergy(tmp.e());
665 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCas);
666 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
668 G4cout <<
"G4BinaryLightIonReaction E/P correction for nucleus failed, will try to correct overall" <<
G4endl;
674 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
676 cascaders->push_back(*ii);
681 if ( ! EnergyIsCorrect )
684 if (! EnergyAndMomentumCorrector(cascaders,pInitialState))
686 if(debug_G4BinaryLightIonReactionResults)
687 G4cout <<
"G4BinaryLightIonReaction E/P corrections failed" <<
G4endl;