147 using namespace G4InuclParticleNames;
148 using namespace G4InuclSpecialFunctions;
152 const G4int G4IntraNucleiCascader::itry_max = 100;
153 const G4int G4IntraNucleiCascader::reflection_cut = 50;
154 const G4double G4IntraNucleiCascader::small_ekin = 0.001*
MeV;
155 const G4double G4IntraNucleiCascader::quasielast_cut = 1*
MeV;
164 theCascadeHistory(0), tnuclei(0), bnuclei(0), bparticle(0),
165 minimum_recoil_A(0.), coulombBarrier(0.),
177 delete theElementaryParticleCollider;
178 delete theRecoilMaker;
179 delete theClusterMaker;
180 delete theCascadeHistory;
181 delete nucleusTarget;
187 model->setVerboseLevel(verbose);
213 if (theCascadeHistory) theCascadeHistory->
Print(
G4cout);
215 finalize(itry, bullet, target, globalOutput);
226 G4cout <<
" >>> G4IntraNucleiCascader::rescatter " <<
G4endl;
239 if (theCascadeHistory) theCascadeHistory->
Print(
G4cout);
241 finalize(itry, bullet, target, globalOutput);
248 G4cout <<
" >>> G4IntraNucleiCascader::initialize " <<
G4endl;
264 if (!bnuclei && !bparticle) {
265 G4cerr <<
" G4IntraNucleiCascader: projectile is not a valid particle."
274 G4cerr <<
" Target is not a nucleus. Abandoning." <<
G4endl;
278 model->generateModel(tnuclei);
279 coulombBarrier = 0.00126*tnuclei->
getZ() / (1.+
G4cbrt(tnuclei->
getA()));
283 minimum_recoil_A = 0.;
287 G4cout <<
" intitial momentum E " << momentum_in.
e() <<
" Px "
288 << momentum_in.
x() <<
" Py " << momentum_in.
y() <<
" Pz "
299 G4cout <<
" IntraNucleiCascader itry " << itry <<
" inter_case "
305 new_cascad_particles.clear();
306 theExitonConfiguration.
clear();
307 cascad_particles.clear();
309 if (theCascadeHistory) theCascadeHistory->
Clear();
317 G4cout <<
" >>> G4IntraNucleiCascader::setupCascade" <<
G4endl;
324 cascad_particles.push_back(
model->initializeCascad(bparticle));
330 model->initializeCascad(bnuclei, tnuclei, all_particles);
332 cascad_particles = all_particles.first;
335 if (cascad_particles.size() == 0) {
338 for (i = 0; i < ab; i++) {
339 G4int knd = i < zb ? 1 : 2;
346 for (i = 0; i < ihn; i++) theExitonConfiguration.
incrementHoles(2);
347 for (i = 0; i < ihz; i++) theExitonConfiguration.
incrementHoles(1);
359 while (!cascad_particles.empty() && !
model->empty()) {
363 G4cout <<
" Iteration " << iloop <<
": Number of cparticles "
364 << cascad_particles.size() <<
" last one: \n"
365 << cascad_particles.back() <<
G4endl;
369 if (theCascadeHistory) {
370 theCascadeHistory->
AddEntry(cascad_particles.back());
372 G4cout <<
" active cparticle got history ID "
373 << cascad_particles.back().getHistoryId() <<
G4endl;
377 model->generateParticleFate(cascad_particles.back(),
378 theElementaryParticleCollider,
379 new_cascad_particles);
382 if (theCascadeHistory && new_cascad_particles.size()>1)
383 theCascadeHistory->
AddVertex(cascad_particles.back(), new_cascad_particles);
386 G4cout <<
" After generate fate: New particles "
387 << new_cascad_particles.size() << G4endl
388 <<
" Discarding last cparticle from list " <<
G4endl;
391 cascad_particles.pop_back();
395 if (new_cascad_particles.size() == 1) {
398 if (
model->stillInside(currentCParticle)) {
403 model->worthToPropagate(currentCParticle)) {
405 cascad_particles.push_back(currentCParticle);
421 G4cout <<
" KE " << KE <<
" barrier " << Q*coulombBarrier <<
G4endl;
423 if (KE < Q*coulombBarrier) {
429 if (KE > 0.0001) CBP = std::exp(-0.0181*0.5*tnuclei->
getZ()*
430 (1./KE - 1./coulombBarrier)*
431 std::sqrt(mass*(coulombBarrier-KE)) );
454 cascad_particles.insert(cascad_particles.end(),
455 new_cascad_particles.begin(),
456 new_cascad_particles.end());
458 std::pair<G4int, G4int> holes =
model->getTypesOfNucleonsInvolved();
460 G4cout <<
" adding new exciton holes " << holes.first <<
","
461 << holes.second <<
G4endl;
465 if (holes.second > 0)
471 output, cascad_particles);
475 G4cout <<
" cparticles remaining " << cascad_particles.size()
476 <<
" nucleus (model) has "
477 <<
model->getNumberOfNeutrons() <<
" n, "
478 <<
model->getNumberOfProtons() <<
" p "
479 <<
" residual fragment A " << aresid <<
G4endl;
482 if (aresid <= minimum_recoil_A)
return;
491 G4cout <<
" >>> G4IntraNucleiCascader::finishCascade ?" <<
G4endl;
495 cascad_particles.clear();
504 if (theClusterMaker) {
527 G4cerr <<
" Recoil nucleus is not physical: A=" << afin <<
" Z="
535 G4cout <<
" afin " << afin <<
" zfin " << zfin <<
G4endl;
538 if (afin == 0)
return true;
541 G4int last_type = (zfin==1) ? 1 : 2;
547 if (mres-mass < -small_ekin) {
552 if (mres-mass > small_ekin) {
554 G4cerr <<
" extra energy with recoil nucleon" <<
G4endl;
564 G4cout <<
" adding recoiling nucleon to output list\n"
565 << last_particle <<
G4endl;
578 if (std::abs(Eex) < quasielast_cut) {
580 G4cout <<
" quasi-elastic scatter with " << Eex <<
" MeV recoil"
597 G4cerr <<
"Got null pointer for recoil fragment!" <<
G4endl;
602 G4cout <<
" adding recoil fragment to output list" <<
G4endl;
622 if (afin <= minimum_recoil_A && minimum_recoil_A < tnuclei->getA()) {
625 G4cout <<
" minimum recoil fragment increased to A " << minimum_recoil_A
641 if (itry >= itry_max) {
643 G4cout <<
" IntraNucleiCascader-> no inelastic interaction after "
644 << itry <<
" attempts " <<
G4endl;
649 G4cout <<
" IntraNucleiCascader output after trials " << itry <<
G4endl;
653 globalOutput.
add(output);
664 if (theNucleusA > 1) {
666 nucleusTarget->
fill(0., theNucleusA, theNucleusZ, 0.);
667 return nucleusTarget;
683 G4cout <<
" >>> G4IntraNucleiCascader::preloadCascade" <<
G4endl;
691 G4cout <<
" >>> G4IntraNucleiCascader::copyWoundedNucleus" <<
G4endl;
694 theExitonConfiguration.
clear();
710 <<
" neutrons hit, " << theExitonConfiguration.
protonHoles
711 <<
" protons hit" <<
G4endl;
721 G4cout <<
" >>> G4IntraNucleiCascader::copySecondaries" <<
G4endl;
723 for (
size_t i=0; i<secondaries->size(); i++) {
730 std::sort(cascad_particles.begin(), cascad_particles.end(),
734 G4cout <<
" Original list of " << secondaries->size() <<
" secondaries"
735 <<
" produced " << cascad_particles.size() <<
" cascade, "
758 G4cout <<
" >>> G4IntraNucleiCascader::processSecondary "
763 cascad_particles.resize(cascad_particles.size()+1);
779 G4cout <<
" Created cascade particle \n" << cpart <<
G4endl;
789 G4cout <<
" >>> G4IntraNucleiCascader::releaseSecondary "
794 if (dynamic_cast<G4Ions*>(kpd)) {
802 G4cout <<
" Created pre-cascade fragment\n" << inucl <<
G4endl;
811 G4cout <<
" Created invalid pre-cascade particle\n" << ipart <<
G4endl;
827 if (theCascadeHistory) theCascadeHistory->
DropEntry(trapped);
833 if (theCascadeHistory) theCascadeHistory->
DropEntry(trapped);
840 G4cout <<
" non-standard should be absorbed, now released\n"
853 G4cout <<
" unstable must be decayed in flight" <<
G4endl;
860 G4cerr <<
" no decay table! Releasing trapped particle" <<
G4endl;
870 G4cerr <<
" no daughters! Releasing trapped particle" <<
G4endl;
882 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
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
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)
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)
G4ParticleDefinition * GetDefinition() const
G4bool initialize(G4InuclParticle *bullet, G4InuclParticle *target)
G4GLOB_DLL std::ostream G4cout
void decayTrappedParticle(const G4CascadParticle &trapped)
G4bool goodFragment() const
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
G4int numberOfOutgoingParticles() const
const XML_Char XML_Content * model
G4double G4cbrt(G4double x)
void DropEntry(const G4CascadParticle &cpart)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4int GetAtomicMass() const
G4VDecayChannel * SelectADecayChannel()
G4InteractionCase interCase
void processSecondary(const G4KineticTrack *aSecondary)
G4int AddEntry(G4CascadParticle &cpart)
void newCascade(G4int itry)
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
void fill(G4int ityp, Model model=DefaultModel)
G4double getCharge() const
G4InuclParticle * getBullet() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
virtual void setVerboseLevel(G4int verbose=0)
void setVerboseLevel(G4int verbose=0)
void setVerboseLevel(G4int verbose=0)
G4ParticleDefinition * GetParticleType() const
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()
G4int getNumberOfReflections() const
G4int AddVertex(G4CascadParticle &cpart, std::vector< G4CascadParticle > &daug)
G4ParticleDefinition * getDefinition() const
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