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 if(getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction starts ######### " <<
G4endl;
100 G4bool swapped=SetLighterAsProjectile(mom, toBreit);
114 if( (mom.t()-mom.mag())/pA < 50*
MeV )
118 cascaders=FuseNucleiAndPrompound(mom);
122 result=Interact(mom,toBreit);
129 G4cerr <<
"G4BinaryLightIonReaction no final state for: " <<
G4endl;
135 G4cerr <<
" Target nucleus (A,Z)=("
136 << (swapped?pA:tA) <<
","
137 << (swapped?pZ:tZ) <<
")" <<
G4endl;
138 G4cerr <<
" if frequent, please submit above information as bug report"
151 G4double theStatisticalExEnergy = GetProjectileExcitation();
156 pInitialState.
setT(pInitialState.
getT() +
160 delete target3dNucleus;target3dNucleus=0;
161 delete projectile3dNucleus;projectile3dNucleus=0;
170 std::vector<G4ReactionProduct *>::iterator iter;
183 while (std::abs(momentum.
e()-pspectators.
e()) > 10*
MeV)
188 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
189 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
191 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
195 for(i=0; i<cascaders->size(); i++)
197 pFinalState +=
G4LorentzVector( (*cascaders)[i]->GetMomentum(), (*cascaders)[i]->GetTotalEnergy() );
199 momentum=pInitialState-pFinalState;
200 if (++loopcount > 10 )
202 if ( momentum.
vect().
mag() - momentum.
e()> 10*
keV )
204 G4cerr <<
"G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" <<
G4endl;
216 if ( momentum.
vect().
mag() - momentum.
e()> 10*
keV )
219 G4ReactionProductVector::iterator ispectator;
220 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
226 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " << momentum
227 <<
" 3.mag "<< momentum.
vect().
mag() << G4endl
228 <<
" .. pInitialState/pFinalState/spectators " << pInitialState <<
" "
229 << pFinalState <<
" " << pspectators << G4endl
230 <<
" .. A,Z " << spectatorA <<
" "<< spectatorZ <<
G4endl;
231 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
239 G4cout <<
" if frequent, please submit above information as bug report"
250 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 ######### " <<
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);
437 for(
size_t count = 0; count<cascaders->size(); count++)
439 cascaders->operator[](count)->SetNewlyAdded(
true);
456 projectile3dNucleus->
Init(pA, pZ);
463 target3dNucleus->
Init(tA, tZ);
475 nucleonMom.setZ(nucleonMom.vect().mag());
478 theFermi.
Init(pA,pZ);
485 nucleonPosition +=
pos;
492 initalState->push_back(it1);
495 result=theModel->
Propagate(initalState, target3dNucleus);
496 if( result && result->size()==0)
503 delete target3dNucleus;
504 delete projectile3dNucleus;
510 }
while (! result && tryCount< 150);
513 G4double G4BinaryLightIonReaction::GetProjectileExcitation()
515 spectatorA=spectatorZ=0;
524 G4double theStatisticalExEnergy = 0;
540 G4double localFermiEnergy = std::sqrt(nucMass*nucMass + localPfermi*localPfermi) - nucMass;
542 theStatisticalExEnergy += deltaE;
545 return theStatisticalExEnergy;
554 for(i=0; i<result->size(); i++)
556 if( (*result)[i]->GetNewlyAdded() )
558 pFinalState +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
559 cascaders->push_back((*result)[i]);
563 pspectators +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
564 spectators->push_back((*result)[i]);
591 if(spectatorZ>0 && spectatorA>1)
595 aProRes.
SetA(spectatorA);
596 aProRes.
SetZ(spectatorZ);
604 proFrag = theHandler->
BreakItUp(aProRes);
613 G4ReactionProductVector::iterator ispectator;
614 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
619 else if(spectatorA!=0)
621 G4ReactionProductVector::iterator ispectator;
622 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
624 (*ispectator)->SetNewlyAdded(
true);
625 cascaders->push_back(*ispectator);
626 pFragments+=
G4LorentzVector((*ispectator)->GetMomentum(),(*ispectator)->GetTotalEnergy());
637 G4ReactionProductVector::iterator ii;
640 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
642 (*ii)->SetNewlyAdded(
true);
644 tmp *= boost_fragments;
645 (*ii)->SetMomentum(tmp.vect());
646 (*ii)->SetTotalEnergy(tmp.e());
659 G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCas);
660 if ( ! EnergyIsCorrect && debug_G4BinaryLightIonReactionResults)
662 G4cout <<
"G4BinaryLightIonReaction E/P correction for nucleus failed, will try to correct overall" <<
G4endl;
668 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
670 cascaders->push_back(*ii);
675 if ( ! EnergyIsCorrect )
678 if (! EnergyAndMomentumCorrector(cascaders,pInitialState))
680 if(debug_G4BinaryLightIonReactionResults)
681 G4cout <<
"G4BinaryLightIonReaction E/P corrections failed" <<
G4endl;
Hep3Vector boostVector() const
G4BinaryLightIonReaction(G4VPreCompoundModel *ptr=0)
virtual void ModelDescription(std::ostream &) const
const G4LorentzVector & GetMomentum() const
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepLorentzRotation G4LorentzRotation
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
virtual ~G4BinaryLightIonReaction()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
G4double G4NeutronHPJENDLHEData::G4double result
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
virtual const G4ThreeVector & GetPosition() const
void SetProjectilePotential(const G4double aPotential)
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState) const
HepLorentzRotation & rotateY(double delta)
void SetA(G4double value)
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4ExcitationHandler * GetExcitationHandler() const
G4IonTable * GetIonTable() const
G4GLOB_DLL std::ostream G4cout
CascadeState SetState(const CascadeState new_state)
const G4ParticleDefinition * GetDefinition() const
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
void SetMomentum(const G4LorentzVector &value)
G4double GetKineticEnergy() const
void Init(G4int theA, G4int theZ)
G4double GetFermiMomentum(G4double density)
void SetNumberOfParticles(G4int value)
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *, G4V3DNucleus *)
const G4LorentzVector & Get4Momentum() const
G4LorentzVector Get4Momentum() const
HepLorentzRotation & rotateZ(double delta)
G4HadronicInteraction * FindModel(const G4String &name)
void Set4Momentum(const G4LorentzVector &momentum)
void SetEnergyChange(G4double anEnergy)
G4double GetTotalEnergy() const
void Init(G4int anA, G4int aZ)
G4double GetPDGMass() const
G4double GetDensity(const G4ThreeVector &aPosition) const
static G4ParticleTable * GetParticleTable()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4HadronicInteractionRegistry * Instance()
simulatedPeak Scale(1/simulationNormalisationFactor)
G4ThreeVector GetMomentum() const
virtual G4ParticleDefinition * GetDefinition() const
void SetZ(G4double value)
G4double GetOuterRadius()
HepLorentzRotation inverse() const
G4LorentzVector operator()(G4LorentzVector a, G4ReactionProduct *b)
void SetNumberOfCharged(G4int value)
void setVect(const Hep3Vector &)
const G4VNuclearDensity * GetNuclearDensity() const
G4double GetPDGCharge() const
G4Nucleon * GetNextNucleon()
void SetMomentumChange(const G4ThreeVector &aV)
G4int GetNumberOfSecondaries() const
void AddSecondary(G4DynamicParticle *aP)
G4GLOB_DLL std::ostream G4cerr
G4int GetBaryonNumber() const
G4double GetTotalEnergy() const
CLHEP::HepLorentzVector G4LorentzVector