154 using namespace G4InuclParticleNames;
155 using namespace G4InuclSpecialFunctions;
159 const G4int G4IntraNucleiCascader::itry_max = 100;
160 const G4int G4IntraNucleiCascader::reflection_cut = 50;
161 const G4double G4IntraNucleiCascader::small_ekin = 0.001*
MeV;
162 const G4double G4IntraNucleiCascader::quasielast_cut = 1*
MeV;
171 theCascadeHistory(0), tnuclei(0), bnuclei(0), bparticle(0),
172 minimum_recoil_A(0.), coulombBarrier(0.),
184 delete theElementaryParticleCollider;
185 delete theRecoilMaker;
186 delete theClusterMaker;
187 delete theCascadeHistory;
188 delete nucleusTarget;
194 model->setVerboseLevel(verbose);
220 if (theCascadeHistory) theCascadeHistory->
Print(
G4cout);
222 finalize(itry, bullet, target, globalOutput);
233 G4cout <<
" >>> G4IntraNucleiCascader::rescatter " <<
G4endl;
246 if (theCascadeHistory) theCascadeHistory->
Print(
G4cout);
248 finalize(itry, bullet, target, globalOutput);
255 G4cout <<
" >>> G4IntraNucleiCascader::initialize " <<
G4endl;
271 if (!bnuclei && !bparticle) {
272 G4cerr <<
" G4IntraNucleiCascader: projectile is not a valid particle."
281 G4cerr <<
" Target is not a nucleus. Abandoning." <<
G4endl;
285 model->generateModel(tnuclei);
286 coulombBarrier = 0.00126*tnuclei->
getZ() / (1.+
G4cbrt(tnuclei->
getA()));
290 minimum_recoil_A = 0.;
294 G4cout <<
" intitial momentum E " << momentum_in.
e() <<
" Px "
295 << momentum_in.
x() <<
" Py " << momentum_in.
y() <<
" Pz "
306 G4cout <<
" IntraNucleiCascader itry " << itry <<
" inter_case "
312 new_cascad_particles.clear();
313 theExitonConfiguration.
clear();
314 cascad_particles.clear();
316 if (theCascadeHistory) theCascadeHistory->
Clear();
324 G4cout <<
" >>> G4IntraNucleiCascader::setupCascade" <<
G4endl;
331 cascad_particles.push_back(
model->initializeCascad(bparticle));
337 model->initializeCascad(bnuclei, tnuclei, all_particles);
339 cascad_particles = all_particles.first;
342 if (cascad_particles.size() == 0) {
345 for (i = 0; i <
ab; i++) {
346 G4int knd = i < zb ? 1 : 2;
353 for (i = 0; i < ihn; i++) theExitonConfiguration.
incrementHoles(2);
354 for (i = 0; i < ihz; i++) theExitonConfiguration.
incrementHoles(1);
367 while (!cascad_particles.empty() && !
model->empty()) {
371 G4cout <<
" Iteration " << iloop <<
": Number of cparticles "
372 << cascad_particles.size() <<
" last one: \n"
373 << cascad_particles.back() <<
G4endl;
377 if (theCascadeHistory) {
378 theCascadeHistory->
AddEntry(cascad_particles.back());
380 G4cout <<
" active cparticle got history ID "
381 << cascad_particles.back().getHistoryId() <<
G4endl;
388 G4cout <<
" particle is non-interacting; moving to output" <<
G4endl;
391 cascad_particles.pop_back();
396 model->generateParticleFate(cascad_particles.back(),
397 theElementaryParticleCollider,
398 new_cascad_particles);
401 if (theCascadeHistory && new_cascad_particles.size()>1)
402 theCascadeHistory->
AddVertex(cascad_particles.back(), new_cascad_particles);
405 G4cout <<
" After generate fate: New particles "
406 << new_cascad_particles.size() << G4endl
407 <<
" Discarding last cparticle from list " <<
G4endl;
410 cascad_particles.pop_back();
414 if (new_cascad_particles.size() == 1) {
417 if (
model->stillInside(currentCParticle)) {
422 model->worthToPropagate(currentCParticle)) {
424 cascad_particles.push_back(currentCParticle);
440 G4cout <<
" KE " << KE <<
" barrier " << Q*coulombBarrier <<
G4endl;
442 if (KE < Q*coulombBarrier) {
448 if (KE > 0.0001) CBP =
G4Exp(-0.0181*0.5*tnuclei->
getZ()*
449 (1./KE - 1./coulombBarrier)*
450 std::sqrt(mass*(coulombBarrier-KE)) );
473 cascad_particles.insert(cascad_particles.end(),
474 new_cascad_particles.begin(),
475 new_cascad_particles.end());
477 std::pair<G4int, G4int> holes =
model->getTypesOfNucleonsInvolved();
479 G4cout <<
" adding new exciton holes " << holes.first <<
","
480 << holes.second <<
G4endl;
484 if (holes.second > 0)
490 output, cascad_particles);
494 G4cout <<
" cparticles remaining " << cascad_particles.size()
495 <<
" nucleus (model) has "
496 <<
model->getNumberOfNeutrons() <<
" n, "
497 <<
model->getNumberOfProtons() <<
" p "
498 <<
" residual fragment A " << aresid <<
G4endl;
501 if (aresid <= minimum_recoil_A)
return;
510 G4cout <<
" >>> G4IntraNucleiCascader::finishCascade ?" <<
G4endl;
514 cascad_particles.clear();
523 if (theClusterMaker) {
546 G4cerr <<
" Recoil nucleus is not physical: A=" << afin <<
" Z="
554 G4cout <<
" afin " << afin <<
" zfin " << zfin <<
G4endl;
557 if (afin == 0)
return true;
560 G4int last_type = (zfin==1) ? 1 : 2;
566 if (mres-mass < -small_ekin) {
571 if (mres-mass > small_ekin) {
573 G4cerr <<
" extra energy with recoil nucleon" <<
G4endl;
583 G4cout <<
" adding recoiling nucleon to output list\n"
584 << last_particle <<
G4endl;
597 if (std::abs(Eex) < quasielast_cut) {
599 G4cout <<
" quasi-elastic scatter with " << Eex <<
" MeV recoil"
616 G4cerr <<
"Got null pointer for recoil fragment!" <<
G4endl;
621 G4cout <<
" adding recoil fragment to output list" <<
G4endl;
641 if (afin <= minimum_recoil_A && minimum_recoil_A < tnuclei->getA()) {
644 G4cout <<
" minimum recoil fragment increased to A " << minimum_recoil_A
660 if (itry >= itry_max) {
662 G4cout <<
" IntraNucleiCascader-> no inelastic interaction after "
663 << itry <<
" attempts " <<
G4endl;
668 G4cout <<
" IntraNucleiCascader output after trials " << itry <<
G4endl;
672 globalOutput.
add(output);
683 if (theNucleusA > 1) {
685 nucleusTarget->
fill(0., theNucleusA, theNucleusZ, 0.);
686 return nucleusTarget;
702 G4cout <<
" >>> G4IntraNucleiCascader::preloadCascade" <<
G4endl;
710 G4cout <<
" >>> G4IntraNucleiCascader::copyWoundedNucleus" <<
G4endl;
713 theExitonConfiguration.
clear();
730 <<
" neutrons hit, " << theExitonConfiguration.
protonHoles
731 <<
" protons hit" <<
G4endl;
741 G4cout <<
" >>> G4IntraNucleiCascader::copySecondaries" <<
G4endl;
743 for (
size_t i=0; i<secondaries->size(); i++) {
750 std::sort(cascad_particles.begin(), cascad_particles.end(),
754 G4cout <<
" Original list of " << secondaries->size() <<
" secondaries"
755 <<
" produced " << cascad_particles.size() <<
" cascade, "
778 G4cout <<
" >>> G4IntraNucleiCascader::processSecondary "
783 cascad_particles.resize(cascad_particles.size()+1);
799 G4cout <<
" Created cascade particle \n" << cpart <<
G4endl;
809 G4cout <<
" >>> G4IntraNucleiCascader::releaseSecondary "
814 if (dynamic_cast<const G4Ions*>(kpd)) {
822 G4cout <<
" Created pre-cascade fragment\n" << inucl <<
G4endl;
831 G4cout <<
" Created invalid pre-cascade particle\n" << ipart <<
G4endl;
847 if (theCascadeHistory) theCascadeHistory->
DropEntry(trapped);
853 if (theCascadeHistory) theCascadeHistory->
DropEntry(trapped);
860 G4cout <<
" non-standard should be absorbed, now released\n"
873 G4cout <<
" unstable must be decayed in flight" <<
G4endl;
880 G4cerr <<
" no decay table! Releasing trapped particle" <<
G4endl;
890 G4cerr <<
" no daughters! Releasing trapped particle" <<
G4endl;
902 daughters->
Boost(decayEnergy, decayDir);
G4bool hadNucleus() const
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
void trivialise(G4InuclParticle *bullet, G4InuclParticle *target)
void setVerboseLevel(G4int verbose)
G4bool goodNucleus() const
void processTrappedParticle(const G4CascadParticle &trapped)
std::pair< std::vector< G4CascadParticle >, std::vector< G4InuclElementaryParticle > > modelLists
const G4ParticleDefinition * GetParticleType() const
static const G4CascadeChannel * GetTable(G4int initialState)
static G4bool showHistory()
void incrementQP(G4int ip)
virtual G4int GetCharge()=0
G4LorentzVector getMomentum() const
void setVerboseLevel(G4int verbose)
const G4ThreeVector & GetPosition() const
G4int getGeneration() const
void initializePath(G4double npath)
virtual G4bool StartLoop()=0
void printCollisionOutput(std::ostream &os=G4cout) const
static G4bool doCoalescence()
virtual G4int GetMassNumber()=0
void Print(std::ostream &os) const
const G4ParticleDefinition * getDefinition() const
G4bool wholeEvent() const
void addOutgoingParticle(const G4InuclElementaryParticle &particle)
G4double getEnergy() const
void updatePosition(const G4ThreeVector &pos)
const G4LorentzVector & getRecoilMomentum() const
virtual const G4ThreeVector & GetPosition() const
static G4double getParticleMass(G4int type)
void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection)
G4bool particleCanInteract(const G4CascadParticle &cpart) const
void setGeneration(G4int gen)
G4double getRecoilExcitation() const
G4InuclParticle * createTarget(G4V3DNucleus *theNucleus)
const G4InuclElementaryParticle & getParticle() const
const G4String & GetParticleName() const
G4bool acceptable() const
virtual void setVerboseLevel(G4int verbose=0)
G4int GetAtomicNumber() const
G4double getKineticEnergy() const
G4DecayTable * GetDecayTable() const
void updateZone(G4int izone)
void incrementHoles(G4int ip)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void add(const G4CollisionOutput &right)
G4bool initialize(G4InuclParticle *bullet, G4InuclParticle *target)
G4GLOB_DLL std::ostream G4cout
void decayTrappedParticle(const G4CascadParticle &trapped)
G4bool goodFragment() const
G4VDecayChannel * SelectADecayChannel(G4double parentMass=-1.)
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
G4int numberOfOutgoingParticles() const
G4double G4cbrt(G4double x)
void DropEntry(const G4CascadParticle &cpart)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4int GetAtomicMass() const
G4InteractionCase interCase
void processSecondary(const G4KineticTrack *aSecondary)
G4int AddEntry(G4CascadParticle &cpart)
void newCascade(G4int itry)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4int numberOfOutgoingNuclei() const
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
void set(G4InuclParticle *part1, G4InuclParticle *part2)
void copyWoundedNucleus(G4V3DNucleus *theNucleus)
G4double GetPDGMass() const
void setMovingInsideNuclei(G4bool isMovingIn=true)
void setTolerance(G4double tolerance)
void copySecondaries(G4KineticTrackVector *theSecondaries)
const std::vector< G4InuclNuclei > & getOutgoingNuclei() const
const std::vector< G4InuclElementaryParticle > & getOutgoingParticles() const
G4int getCurrentZone() const
static constexpr double GeV
void fill(G4int ityp, Model model=DefaultModel)
G4double getCharge() const
G4InuclParticle * getBullet() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
virtual void setVerboseLevel(G4int verbose=0)
static constexpr double MeV
void setVerboseLevel(G4int verbose=0)
void setVerboseLevel(G4int verbose=0)
virtual G4Nucleon * GetNextNucleon()=0
const G4ThreeVector & getPosition() const
virtual G4DecayProducts * DecayIt(G4double parentMass=-1.0)=0
void addRecoilFragment(const G4Fragment *aFragment)
void FindClusters(G4CollisionOutput &finalState)
void setRecoilExcitation(G4double Eexc)
void finalize(G4int itry, G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4InuclParticle * getTarget() const
const G4LorentzVector & Get4Momentum() const
virtual ~G4IntraNucleiCascader()
const G4ParticleDefinition * GetDefinition() const
const XML_Char XML_Content * model
G4int getNumberOfReflections() const
G4int AddVertex(G4CascadParticle &cpart, std::vector< G4CascadParticle > &daug)
void releaseSecondary(const G4KineticTrack *aSecondary)
void addExcitonConfiguration(const G4ExitonConfiguration exciton)
void preloadCascade(G4V3DNucleus *theNucleus, G4KineticTrackVector *theSecondaries)
G4Fragment * makeRecoilFragment()
void setOnShell(G4InuclParticle *bullet, G4InuclParticle *target)
G4GLOB_DLL std::ostream G4cerr