50 G4int G4BinaryLightIonReaction::theBLIR_ID = -1;
59 theProjectileFragmentation(ptr),
60 pA(0),pZ(0), tA(0),tZ(0),spectatorA(0),spectatorZ(0),
61 projectile3dNucleus(0),target3dNucleus(0)
68 theProjectileFragmentation = pre;
72 if ( theBLIR_ID == -1 ) {
75 if ( theBLIR_ID == -1 ) {
85 debug_G4BinaryLightIonReactionResults=std::getenv(
"debug_G4BinaryLightIonReactionResults")!=0;
93 outFile <<
"G4Binary Light Ion Cascade is an intra-nuclear cascade model\n"
94 <<
"using G4BinaryCasacde to model the interaction of a light\n"
95 <<
"nucleus with a nucleus.\n"
96 <<
"The lighter of the two nuclei is treated like a set of projectiles\n"
97 <<
"which are transported simultaneously through the heavier nucleus.\n";
109 if(std::getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction starts ######### " <<
G4endl;
110 G4ping debug(
"debug_G4BinaryLightIonReaction");
120 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
134 if( (mom.
t()-mom.
mag())/pA < 50*MeV )
138 cascaders=FuseNucleiAndPrompound(mom);
153 result=Interact(mom,toBreit);
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"
179 G4double theStatisticalExEnergy = GetProjectileExcitation();
184 pInitialState.
setT(pInitialState.
getT() +
188 delete target3dNucleus;target3dNucleus=0;
189 delete projectile3dNucleus;projectile3dNucleus=0;
200 std::vector<G4ReactionProduct *>::iterator iter;
213 while (std::abs(momentum.
e()-pspectators.
e()) > 10*MeV)
219 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
220 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
222 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
225 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
227 pFinalState +=
G4LorentzVector( (*iter)->GetMomentum(), (*iter)->GetTotalEnergy() );
229 momentum=pInitialState-pFinalState;
230 if (++loopcount > 10 )
232 if ( momentum.
vect().
mag() - momentum.
e()> 10*keV )
234 G4cerr <<
"G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" <<
G4endl;
246 if ( momentum.
vect().
mag() - momentum.
e()< 10*keV )
249 DeExciteSpectatorNucleus(spectators, cascaders, theStatisticalExEnergy, momentum);
252 for (iter=spectators->begin();iter!=spectators->end();iter++)
257 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
263 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " << momentum
265 <<
" .. pInitialState/pFinalState/spectators " << pInitialState <<
" "
266 << pFinalState <<
" " << pspectators <<
G4endl
267 <<
" .. A,Z " << spectatorA <<
" "<< spectatorZ <<
G4endl;
268 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
276 G4cout <<
" if frequent, please submit above information as bug report"
278#ifdef debug_G4BinaryLightIonReaction
280 ed <<
"G4BinaryLightIonreaction: Terminate for above error" <<
G4endl;
306 G4ReactionProductVector::iterator iter;
307 #ifdef debug_BLIR_result
312 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
314 if((*iter)->GetNewlyAdded())
318 (*iter)->GetTotalEnergy(),
319 (*iter)->GetMomentum() );
321 #ifdef debug_BLIR_result
334 aNew.
SetTime(timePrimary + time);
346#ifdef debug_BLIR_result
361 if(std::getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction number ends ######### " <<
G4endl;
369G4bool G4BinaryLightIonReaction::EnergyAndMomentumCorrector(
373 const int nAttemptScale = 2500;
374 const double ErrLimit = 1.E-6;
379 G4double TotalCollisionMass = TotalCollisionMom.
m();
382 for(i = 0; i < Output->size(); i++)
384 SumMom +=
G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
385 SumMass += (*Output)[i]->GetDefinition()->GetPDGMass();
389 if (SumMass > TotalCollisionMass)
return FALSE;
390 SumMass = SumMom.m2();
391 if (SumMass < 0)
return FALSE;
392 SumMass = std::sqrt(SumMass);
398 for(i = 0; i < Output->size(); i++)
402 (*Output)[i]->SetMomentum(mom.
vect());
403 (*Output)[i]->SetTotalEnergy(mom.
e());
413 for(cAttempt = 0; cAttempt < nAttemptScale; cAttempt++)
416 for(i = 0; i < Output->size(); i++)
420 G4double E = std::sqrt(HadronMom.
vect().
mag2() +
sqr((*Output)[i]->GetDefinition()->GetPDGMass()));
422 (*Output)[i]->SetMomentum(HadronMom.
vect());
423 (*Output)[i]->SetTotalEnergy(HadronMom.
e());
427 Scale = TotalCollisionMass/Sum - 1;
429 if (std::abs(Scale) <= ErrLimit
430 || OldScale == Scale)
432 if (debug_G4BinaryLightIonReactionResults)
G4cout <<
"E/p corrector: " << cAttempt <<
G4endl;
439 factor=std::max(1.,
G4Log(std::abs(OldScale/(OldScale-Scale))));
444 if( (!success) && debug_G4BinaryLightIonReactionResults)
446 G4cout <<
"G4G4BinaryLightIonReaction::EnergyAndMomentumCorrector - Warning"<<
G4endl;
447 G4cout <<
" Scale not unity at end of iteration loop: "<<TotalCollisionMass<<
" "<<Sum<<
" "<<Scale<<
G4endl;
448 G4cout <<
" Increase number of attempts or increase ERRLIMIT"<<
G4endl;
454 for(i = 0; i < Output->size(); i++)
458 (*Output)[i]->SetMomentum(mom.
vect());
459 (*Output)[i]->SetTotalEnergy(mom.
e());
470 tmp = tA; tA=pA; pA=tmp;
471 tmp = tZ; tZ=pZ; pZ=tmp;
485 if (m2Compound <
sqr(mFused) ) {
507 for(
size_t count = 0; count<cascaders->size(); count++)
509 cascaders->operator[](count)->SetNewlyAdded(
true);
526 projectile3dNucleus->
Init(pA, pZ);
533 target3dNucleus->
Init(tA, tZ);
544 #ifdef debug_BLIR_finalstate
548 nucleonMom.setZ(nucleonMom.vect().mag());
551 theFermi.
Init(pA,pZ);
558 nucleonPosition +=
pos;
565 initalState->push_back(it1);
566 #ifdef debug_BLIR_finalstate
571 result=theModel->
Propagate(initalState, target3dNucleus);
572 #ifdef debug_BLIR_finalstate
573 if( result && result->size()>0)
576 G4ReactionProductVector::iterator iter;
578 for (iter=result->begin(); iter !=result->end(); ++iter)
580 presult +=
G4LorentzVector((*iter)->GetMomentum(),(*iter)->GetTotalEnergy());
583 G4cout <<
"BLIC check result : initial " << pinitial <<
" mass tgt " << target3dNucleus->
GetMass()
584 <<
" final " << presult
589 if( result && result->size()==0)
596 delete target3dNucleus;
597 delete projectile3dNucleus;
603 }
while (! result && tryCount< 150);
606G4double G4BinaryLightIonReaction::GetProjectileExcitation()
611 G4double theStatisticalExEnergy = 0;
621 G4double localFermiEnergy = std::sqrt(nucMass*nucMass + localPfermi*localPfermi) - nucMass;
623 theStatisticalExEnergy += deltaE;
626 return theStatisticalExEnergy;
632 spectatorA=spectatorZ=0;
635 for(i=0; i<result->size(); i++)
637 if( (*result)[i]->GetNewlyAdded() )
639 pFinalState +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
640 cascaders->push_back((*result)[i]);
644 pspectators +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
645 spectators->push_back((*result)[i]);
647 spectatorZ+=
G4lrint((*result)[i]->GetDefinition()->GetPDGCharge()/eplus);
674 if(spectatorZ>0 && spectatorA>1)
683 pFragment=
G4LorentzVector(0,0,0,mFragment+std::max(0.,theStatisticalExEnergy) );
686 proFrag = theHandler->
BreakItUp(aProRes);
695 G4ReactionProductVector::iterator ispectator;
696 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
701 else if(spectatorA!=0)
703 G4ReactionProductVector::iterator ispectator;
704 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
706 (*ispectator)->SetNewlyAdded(
true);
707 cascaders->push_back(*ispectator);
708 pFinalState+=
G4LorentzVector((*ispectator)->GetMomentum(),(*ispectator)->GetTotalEnergy());
720 G4ReactionProductVector::iterator ii;
723 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
725 (*ii)->SetNewlyAdded(
true);
727 tmp *= boost_fragments;
728 (*ii)->SetMomentum(tmp.vect());
729 (*ii)->SetTotalEnergy(tmp.e());
743 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCas);
744 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
746 G4cout <<
"G4BinaryLightIonReaction E/P correction for nucleus failed, will try to correct overall" <<
G4endl;
752 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
754 cascaders->push_back(*ii);
759 if ( ! EnergyIsCorrect )
762 if (! EnergyAndMomentumCorrector(cascaders,pInitialState))
764 if(debug_G4BinaryLightIonReactionResults)
765 G4cout <<
"G4BinaryLightIonReaction E/P corrections failed" <<
G4endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Log(G4double x)
CLHEP::HepLorentzRotation G4LorentzRotation
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
Hep3Vector boostVector() const
void setVect(const Hep3Vector &)
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *, G4V3DNucleus *)
virtual ~G4BinaryLightIonReaction()
G4BinaryLightIonReaction(G4VPreCompoundModel *ptr=0)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
virtual void ModelDescription(std::ostream &) const
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState)
G4Nucleon * GetNextNucleon()
const G4VNuclearDensity * GetNuclearDensity() const
G4double GetOuterRadius()
void Init(G4int theA, G4int theZ)
G4double GetFermiMomentum(G4double density)
void Init(G4int anA, G4int aZ)
void SetNumberOfCharged(G4int value)
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
void SetMomentum(const G4LorentzVector &value)
void SetNumberOfParticles(G4int value)
void SetZandA_asInt(G4int Znew, G4int Anew)
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)
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
CascadeState SetState(const CascadeState new_state)
void SetProjectilePotential(const G4double aPotential)
const G4LorentzVector & Get4Momentum() const
const G4ThreeVector & GetPosition() const
const G4LorentzVector & GetMomentum() const
virtual const G4ParticleDefinition * GetDefinition() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
static G4int Register(const G4String &)
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
G4double GetDensity(const G4ThreeVector &aPosition) const
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
G4ExcitationHandler * GetExcitationHandler() const
G4LorentzVector operator()(G4LorentzVector a, G4ReactionProduct *b)