53 theProjectileFragmentation(ptr),
54 pA(0),pZ(0), tA(0),tZ(0),spectatorA(0),spectatorZ(0),
55 projectile3dNucleus(0),target3dNucleus(0)
75 outFile <<
"G4Binary Light Ion Cascade is an intra-nuclear cascade model\n"
76 <<
"using G4BinaryCasacde to model the interaction of a light\n"
77 <<
"nucleus with a nucleus.\n"
78 <<
"The lighter of the two nuclei is treated like a set of projectiles\n"
79 <<
"which are transported simultanously through the heavier nucleus.\n";
91 if(getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction starts ######### " <<
G4endl;
116 if( (mom.t()-mom.mag())/
pA < 50*
MeV )
141 G4cerr <<
"G4BinaryLightIonReaction no final state for: " <<
G4endl;
147 G4cerr <<
" Target nucleus (A,Z)=("
148 << (swapped?
pA:
tA) <<
","
150 G4cerr <<
" if frequent, please submit above information as bug report"
181 std::vector<G4ReactionProduct *>::iterator iter;
194 while (std::abs(momentum.e()-pspectators.e()) > 10*
MeV)
203 G4cout <<
"Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" <<
G4endl;
206 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
211 if (++loopcount > 10 )
213 if ( momentum.vect().mag() - momentum.e()> 10*
keV )
215 G4cerr <<
"G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" <<
G4endl;
227 if ( momentum.vect().mag() - momentum.e()> 10*
keV )
230 for (iter=spectators->begin();iter!=spectators->end();iter++)
235 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
241 G4cout <<
"G4BinaryLightIonReaction.cc: mom check: " << momentum
242 <<
" 3.mag "<< momentum.vect().mag() << G4endl
243 <<
" .. pInitialState/pFinalState/spectators " <<
pInitialState <<
" "
246 G4cout <<
"G4BinaryLightIonReaction invalid final state for: " <<
G4endl;
254 G4cout <<
" if frequent, please submit above information as bug report"
256 #ifdef debug_G4BinaryLightIonReaction
258 ed <<
"G4BinaryLightIonreaction: Terminate for above error" <<
G4endl;
278 toZ.rotateZ(-1*mom.phi());
279 toZ.rotateY(-1*mom.theta());
287 G4ReactionProductVector::iterator iter;
288 #ifdef debug_BLIR_result
293 for(iter=cascaders->begin(); iter!=cascaders->end(); iter++)
295 if((*iter)->GetNewlyAdded())
299 (*iter)->GetTotalEnergy(),
300 (*iter)->GetMomentum() );
302 #ifdef debug_BLIR_result
307 tmp*=toBreit.inverse();
308 tmp.setVect(-tmp.vect());
321 #ifdef debug_BLIR_result
336 if(getenv(
"BLICDEBUG") )
G4cerr <<
" ######### Binary Light Ion Reaction number ends ######### " <<
G4endl;
348 const int nAttemptScale = 2500;
349 const double ErrLimit = 1.E-6;
354 G4double TotalCollisionMass = TotalCollisionMom.m();
357 for(i = 0; i < Output->size(); i++)
359 SumMom +=
G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
360 SumMass += (*Output)[i]->GetDefinition()->GetPDGMass();
364 if (SumMass > TotalCollisionMass)
return FALSE;
365 SumMass = SumMom.m2();
366 if (SumMass < 0)
return FALSE;
367 SumMass = std::sqrt(SumMass);
373 for(i = 0; i < Output->size(); i++)
377 (*Output)[i]->SetMomentum(mom.vect());
378 (*Output)[i]->SetTotalEnergy(mom.e());
388 for(cAttempt = 0; cAttempt < nAttemptScale; cAttempt++)
391 for(i = 0; i < Output->size(); i++)
394 HadronMom.setVect(HadronMom.vect()+ factor*Scale*HadronMom.vect());
395 G4double E = std::sqrt(HadronMom.vect().mag2() +
sqr((*Output)[i]->GetDefinition()->GetPDGMass()));
397 (*Output)[i]->SetMomentum(HadronMom.vect());
398 (*Output)[i]->SetTotalEnergy(HadronMom.e());
402 Scale = TotalCollisionMass/Sum - 1;
404 if (std::abs(Scale) <= ErrLimit
405 || OldScale == Scale)
414 factor=
std::max(1.,
G4Log(std::abs(OldScale/(OldScale-Scale))));
421 G4cout <<
"G4G4BinaryLightIonReaction::EnergyAndMomentumCorrector - Warning"<<
G4endl;
422 G4cout <<
" Scale not unity at end of iteration loop: "<<TotalCollisionMass<<
" "<<Sum<<
" "<<Scale<<
G4endl;
423 G4cout <<
" Increase number of attempts or increase ERRLIMIT"<<
G4endl;
427 Beta = TotalCollisionMom.boostVector();
429 for(i = 0; i < Output->size(); i++)
433 (*Output)[i]->SetMomentum(mom.vect());
434 (*Output)[i]->SetTotalEnergy(mom.e());
460 if (m2Compound <
sqr(mFused) ) {
482 for(
size_t count = 0; count<cascaders->size(); count++)
484 cascaders->operator[](count)->SetNewlyAdded(
true);
518 G4LorentzVector tmpV(0,0,0,0);
519 #ifdef debug_BLIR_finalstate
520 G4LorentzVector pinitial;
522 G4LorentzVector nucleonMom(1./
pA*mom);
523 nucleonMom.setZ(nucleonMom.vect().mag());
533 nucleonPosition +=
pos;
540 initalState->push_back(it1);
541 #ifdef debug_BLIR_finalstate
547 #ifdef debug_BLIR_finalstate
548 if( result && result->size()>0)
550 G4LorentzVector presult;
551 G4ReactionProductVector::iterator iter;
553 for (iter=result->begin(); iter !=result->end(); ++iter)
555 presult +=
G4LorentzVector((*iter)->GetMomentum(),(*iter)->GetTotalEnergy());
559 <<
" final " << presult
564 if( result && result->size()==0)
578 }
while (! result && tryCount< 150);
586 G4double theStatisticalExEnergy = 0;
596 G4double localFermiEnergy = std::sqrt(nucMass*nucMass + localPfermi*localPfermi) - nucMass;
598 theStatisticalExEnergy += deltaE;
601 return theStatisticalExEnergy;
610 for(i=0; i<result->size(); i++)
612 if( (*result)[i]->GetNewlyAdded() )
615 cascaders->push_back((*result)[i]);
619 pspectators +=
G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
620 spectators->push_back((*result)[i]);
670 G4ReactionProductVector::iterator ispectator;
671 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
678 G4ReactionProductVector::iterator ispectator;
679 for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
681 (*ispectator)->SetNewlyAdded(
true);
682 cascaders->push_back(*ispectator);
695 G4ReactionProductVector::iterator ii;
698 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
700 (*ii)->SetNewlyAdded(
true);
702 tmp *= boost_fragments;
703 (*ii)->SetMomentum(tmp.vect());
704 (*ii)->SetTotalEnergy(tmp.e());
721 G4cout <<
"G4BinaryLightIonReaction E/P correction for nucleus failed, will try to correct overall" <<
G4endl;
727 for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
729 cascaders->push_back(*ii);
734 if ( ! EnergyIsCorrect )
740 G4cout <<
"G4BinaryLightIonReaction E/P corrections failed" <<
G4endl;
G4BinaryLightIonReaction(G4VPreCompoundModel *ptr=0)
virtual void ModelDescription(std::ostream &) const
const G4LorentzVector & GetMomentum() const
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
G4Fancy3DNucleus * projectile3dNucleus
CLHEP::HepLorentzRotation G4LorentzRotation
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
virtual ~G4BinaryLightIonReaction()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
G4ReactionProductVector * FuseNucleiAndPrompound(const G4LorentzVector &mom)
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
G4HadFinalState theResult
virtual const G4ThreeVector & GetPosition() const
void SetProjectilePotential(const G4double aPotential)
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState)
virtual const G4ParticleDefinition * GetDefinition() const
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4BinaryCascade * theModel
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
G4VPreCompoundModel * theProjectileFragmentation
void SetMomentum(const G4LorentzVector &value)
G4double GetKineticEnergy() const
void Init(G4int theA, G4int theZ)
G4double GetFermiMomentum(G4double density)
G4bool SetLighterAsProjectile(G4LorentzVector &mom, const G4LorentzRotation &toBreit)
G4double GetProjectileExcitation()
void SetNumberOfParticles(G4int value)
G4ReactionProductVector * Interact(G4LorentzVector &mom, const G4LorentzRotation &)
void DeExciteSpectatorNucleus(G4ReactionProductVector *spectators, G4ReactionProductVector *cascaders, G4double theStatisticalExEnergy, G4LorentzVector &momentum)
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *, G4V3DNucleus *)
const G4LorentzVector & Get4Momentum() const
G4LorentzVector pInitialState
G4LorentzVector Get4Momentum() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Log(G4double x)
G4HadronicInteraction * FindModel(const G4String &name)
void Set4Momentum(const G4LorentzVector &momentum)
void SetEnergyChange(G4double anEnergy)
G4double GetTotalEnergy() const
void Init(G4int anA, G4int aZ)
static const G4double factor
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()
void SetZandA_asInt(G4int Znew, G4int Anew)
G4LorentzVector SortResult(G4ReactionProductVector *result, G4ReactionProductVector *spectators, G4ReactionProductVector *cascaders)
G4ThreeVector GetMomentum() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
G4double GetOuterRadius()
G4LorentzVector operator()(G4LorentzVector a, G4ReactionProduct *b)
void SetNumberOfCharged(G4int value)
G4LorentzVector pFinalState
const G4VNuclearDensity * GetNuclearDensity() const
static const double eplus
const G4LorentzVector & Get4Momentum() const
G4double GetPDGCharge() const
G4bool debug_G4BinaryLightIonReactionResults
G4Nucleon * GetNextNucleon()
void SetMomentumChange(const G4ThreeVector &aV)
G4bool EnergyAndMomentumCorrector(G4ReactionProductVector *products, G4LorentzVector &TotalCollisionMom)
static const G4double pos
static const double fermi
G4Fancy3DNucleus * target3dNucleus
G4GLOB_DLL std::ostream G4cerr
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector
G4ExcitationHandler * theHandler