158const G4int G4IntraNucleiCascader::itry_max = 100;
159const G4int G4IntraNucleiCascader::reflection_cut = 50;
160const G4double G4IntraNucleiCascader::small_ekin = 0.001*MeV;
161const G4double G4IntraNucleiCascader::quasielast_cut = 1*MeV;
170 theCascadeHistory(0), tnuclei(0), bnuclei(0), bparticle(0),
171 minimum_recoil_A(0.), coulombBarrier(0.),
183 delete theElementaryParticleCollider;
184 delete theRecoilMaker;
185 delete theClusterMaker;
186 delete theCascadeHistory;
187 delete nucleusTarget;
219 if (theCascadeHistory) theCascadeHistory->
Print(
G4cout);
221 finalize(itry, bullet, target, globalOutput);
232 G4cout <<
" >>> G4IntraNucleiCascader::rescatter " <<
G4endl;
245 if (theCascadeHistory) theCascadeHistory->
Print(
G4cout);
247 finalize(itry, bullet, target, globalOutput);
254 G4cout <<
" >>> G4IntraNucleiCascader::initialize " <<
G4endl;
270 if (!bnuclei && !bparticle) {
271 G4cerr <<
" G4IntraNucleiCascader: projectile is not a valid particle."
280 G4cerr <<
" Target is not a nucleus. Abandoning." <<
G4endl;
285 coulombBarrier = 0.00126*tnuclei->
getZ() / (1.+
G4cbrt(tnuclei->
getA()));
289 minimum_recoil_A = 0.;
293 G4cout <<
" intitial momentum E " << momentum_in.
e() <<
" Px "
294 << momentum_in.
x() <<
" Py " << momentum_in.
y() <<
" Pz "
305 G4cout <<
" IntraNucleiCascader itry " << itry <<
" inter_case "
311 new_cascad_particles.clear();
312 theExitonConfiguration.
clear();
313 cascad_particles.clear();
315 if (theCascadeHistory) theCascadeHistory->
Clear();
323 G4cout <<
" >>> G4IntraNucleiCascader::setupCascade" <<
G4endl;
338 cascad_particles = all_particles.first;
341 if (cascad_particles.size() == 0) {
344 for (i = 0; i < ab; i++) {
345 G4int knd = i < zb ? 1 : 2;
352 for (i = 0; i < ihn; i++) theExitonConfiguration.
incrementHoles(2);
353 for (i = 0; i < ihz; i++) theExitonConfiguration.
incrementHoles(1);
366 while (!cascad_particles.empty() && !model->
empty()) {
370 G4cout <<
" Iteration " << iloop <<
": Number of cparticles "
371 << cascad_particles.size() <<
" last one: \n"
372 << cascad_particles.back() <<
G4endl;
376 if (theCascadeHistory) {
377 theCascadeHistory->
AddEntry(cascad_particles.back());
379 G4cout <<
" active cparticle got history ID "
380 << cascad_particles.back().getHistoryId() <<
G4endl;
387 G4cout <<
" particle is non-interacting; moving to output" <<
G4endl;
390 cascad_particles.pop_back();
396 theElementaryParticleCollider,
397 new_cascad_particles);
400 if (theCascadeHistory && new_cascad_particles.size()>1)
401 theCascadeHistory->
AddVertex(cascad_particles.back(), new_cascad_particles);
404 G4cout <<
" After generate fate: New particles "
405 << new_cascad_particles.size() <<
G4endl
406 <<
" Discarding last cparticle from list " <<
G4endl;
409 cascad_particles.pop_back();
413 if (new_cascad_particles.size() == 1) {
423 cascad_particles.push_back(currentCParticle);
439 G4cout <<
" KE " << KE <<
" barrier " << Q*coulombBarrier <<
G4endl;
441 if (KE < Q*coulombBarrier) {
447 if (KE > 0.0001) CBP =
G4Exp(-0.0181*0.5*tnuclei->
getZ()*
448 (1./KE - 1./coulombBarrier)*
449 std::sqrt(mass*(coulombBarrier-KE)) );
472 cascad_particles.insert(cascad_particles.end(),
473 new_cascad_particles.begin(),
474 new_cascad_particles.end());
478 G4cout <<
" adding new exciton holes " << holes.first <<
","
479 << holes.second <<
G4endl;
483 if (holes.second > 0)
489 output, cascad_particles);
493 G4cout <<
" cparticles remaining " << cascad_particles.size()
494 <<
" nucleus (model) has "
497 <<
" residual fragment A " << aresid <<
G4endl;
500 if (aresid <= minimum_recoil_A)
return;
509 G4cout <<
" >>> G4IntraNucleiCascader::finishCascade ?" <<
G4endl;
513 cascad_particles.clear();
522 if (theClusterMaker) {
545 G4cerr <<
" Recoil nucleus is not physical: A=" << afin <<
" Z="
553 G4cout <<
" afin " << afin <<
" zfin " << zfin <<
G4endl;
556 if (afin == 0)
return true;
559 G4int last_type = (zfin==1) ? 1 : 2;
565 if (mres-mass < -small_ekin) {
570 if (mres-mass > small_ekin) {
572 G4cerr <<
" extra energy with recoil nucleon" <<
G4endl;
582 G4cout <<
" adding recoiling nucleon to output list\n"
583 << last_particle <<
G4endl;
596 if (std::abs(Eex) < quasielast_cut) {
598 G4cout <<
" quasi-elastic scatter with " << Eex <<
" MeV recoil"
615 G4cerr <<
"Got null pointer for recoil fragment!" <<
G4endl;
620 G4cout <<
" adding recoil fragment to output list" <<
G4endl;
640 if (afin <= minimum_recoil_A && minimum_recoil_A < tnuclei->getA()) {
643 G4cout <<
" minimum recoil fragment increased to A " << minimum_recoil_A
659 if (itry >= itry_max) {
661 G4cout <<
" IntraNucleiCascader-> no inelastic interaction after "
662 << itry <<
" attempts " <<
G4endl;
667 G4cout <<
" IntraNucleiCascader output after trials " << itry <<
G4endl;
671 globalOutput.
add(output);
682 if (theNucleusA > 1) {
684 nucleusTarget->
fill(0., theNucleusA, theNucleusZ, 0.);
685 return nucleusTarget;
701 G4cout <<
" >>> G4IntraNucleiCascader::preloadCascade" <<
G4endl;
709 G4cout <<
" >>> G4IntraNucleiCascader::copyWoundedNucleus" <<
G4endl;
712 theExitonConfiguration.
clear();
729 <<
" neutrons hit, " << theExitonConfiguration.
protonHoles
730 <<
" protons hit" <<
G4endl;
740 G4cout <<
" >>> G4IntraNucleiCascader::copySecondaries" <<
G4endl;
742 for (
size_t i=0; i<secondaries->size(); i++) {
749 std::sort(cascad_particles.begin(), cascad_particles.end(),
753 G4cout <<
" Original list of " << secondaries->size() <<
" secondaries"
754 <<
" produced " << cascad_particles.size() <<
" cascade, "
777 G4cout <<
" >>> G4IntraNucleiCascader::processSecondary "
782 cascad_particles.resize(cascad_particles.size()+1);
798 G4cout <<
" Created cascade particle \n" << cpart <<
G4endl;
808 G4cout <<
" >>> G4IntraNucleiCascader::releaseSecondary "
813 if (
dynamic_cast<const G4Ions*
>(kpd)) {
821 G4cout <<
" Created pre-cascade fragment\n" << inucl <<
G4endl;
830 G4cout <<
" Created invalid pre-cascade particle\n" << ipart <<
G4endl;
846 if (theCascadeHistory) theCascadeHistory->
DropEntry(trapped);
852 if (theCascadeHistory) theCascadeHistory->
DropEntry(trapped);
859 G4cout <<
" non-standard should be absorbed, now released\n"
872 G4cout <<
" unstable must be decayed in flight" <<
G4endl;
879 G4cerr <<
" no decay table! Releasing trapped particle" <<
G4endl;
889 G4cerr <<
" no daughters! Releasing trapped particle" <<
G4endl;
901 daughters->
Boost(decayEnergy, decayDir);
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
std::vector< G4InuclElementaryParticle >::iterator particleIterator
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4int getGeneration() const
void updateZone(G4int izone)
const G4InuclElementaryParticle & getParticle() const
void setGeneration(G4int gen)
void updatePosition(const G4ThreeVector &pos)
void setMovingInsideNuclei(G4bool isMovingIn=true)
G4int getNumberOfReflections() const
void initializePath(G4double npath)
G4int getCurrentZone() const
const G4ThreeVector & getPosition() const
static const G4CascadeChannel * GetTable(G4int initialState)
void FindClusters(G4CollisionOutput &finalState)
void setVerboseLevel(G4int verbose)
virtual void setVerboseLevel(G4int verbose=0)
G4InteractionCase interCase
void Print(std::ostream &os) const
G4int AddVertex(G4CascadParticle &cpart, std::vector< G4CascadParticle > &daug)
void DropEntry(const G4CascadParticle &cpart)
G4int AddEntry(G4CascadParticle &cpart)
void setVerboseLevel(G4int verbose=0)
static G4bool doCoalescence()
static G4bool showHistory()
G4bool wholeEvent() const
void addExcitonConfiguration(const G4ExitonConfiguration exciton)
void setTolerance(G4double tolerance)
const G4LorentzVector & getRecoilMomentum() const
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4double getRecoilExcitation() const
G4bool goodNucleus() const
void setRecoilExcitation(G4double Eexc)
G4Fragment * makeRecoilFragment()
G4bool goodFragment() const
G4int numberOfOutgoingParticles() const
void addRecoilFragment(const G4Fragment *aFragment)
const std::vector< G4InuclNuclei > & getOutgoingNuclei() const
void printCollisionOutput(std::ostream &os=G4cout) const
void addOutgoingParticle(const G4InuclElementaryParticle &particle)
const std::vector< G4InuclElementaryParticle > & getOutgoingParticles() const
void setOnShell(G4InuclParticle *bullet, G4InuclParticle *target)
void setVerboseLevel(G4int verbose)
G4int numberOfOutgoingNuclei() const
G4bool acceptable() const
void add(const G4CollisionOutput &right)
void trivialise(G4InuclParticle *bullet, G4InuclParticle *target)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection)
G4VDecayChannel * SelectADecayChannel(G4double parentMass=-1.)
void incrementQP(G4int ip)
void incrementHoles(G4int ip)
G4InuclParticle * getBullet() const
void set(G4InuclParticle *part1, G4InuclParticle *part2)
G4bool hadNucleus() const
G4InuclParticle * getTarget() const
void processTrappedParticle(const G4CascadParticle &trapped)
void releaseSecondary(const G4KineticTrack *aSecondary)
void copyWoundedNucleus(G4V3DNucleus *theNucleus)
G4bool particleCanInteract(const G4CascadParticle &cpart) const
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
void setVerboseLevel(G4int verbose=0)
void decayTrappedParticle(const G4CascadParticle &trapped)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4bool initialize(G4InuclParticle *bullet, G4InuclParticle *target)
virtual ~G4IntraNucleiCascader()
G4InuclParticle * createTarget(G4V3DNucleus *theNucleus)
void preloadCascade(G4V3DNucleus *theNucleus, G4KineticTrackVector *theSecondaries)
void copySecondaries(G4KineticTrackVector *theSecondaries)
void processSecondary(const G4KineticTrack *aSecondary)
void newCascade(G4int itry)
void finalize(G4int itry, G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
void fill(G4int ityp, Model model=DefaultModel)
static G4double getParticleMass(G4int type)
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
const G4ParticleDefinition * getDefinition() const
G4double getKineticEnergy() const
G4LorentzVector getMomentum() const
G4double getEnergy() const
G4double getCharge() const
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
G4int getZone(G4double r) const
G4int getNumberOfNeutrons() const
G4CascadParticle initializeCascad(G4InuclElementaryParticle *particle)
G4bool worthToPropagate(const G4CascadParticle &cparticle) const
G4int getNumberOfProtons() const
void generateParticleFate(G4CascadParticle &cparticle, G4ElementaryParticleCollider *theEPCollider, std::vector< G4CascadParticle > &cascade)
void reset(G4int nHitNeutrons=0, G4int nHitProtons=0, const std::vector< G4ThreeVector > *hitPoints=0)
G4bool stillInside(const G4CascadParticle &cparticle)
void generateModel(G4InuclNuclei *nuclei)
std::pair< std::vector< G4CascadParticle >, std::vector< G4InuclElementaryParticle > > modelLists
std::pair< G4int, G4int > getTypesOfNucleonsInvolved() const
G4double getRadiusUnits() const
void setVerboseLevel(G4int verbose)
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetParticleType() const
G4int GetAtomicNumber() const
G4double GetPDGMass() const
G4int GetAtomicMass() const
G4DecayTable * GetDecayTable() const
const G4String & GetParticleName() const
virtual G4Nucleon * GetNextNucleon()=0
virtual G4int GetCharge()=0
virtual G4bool StartLoop()=0
virtual G4int GetMassNumber()=0
virtual void setVerboseLevel(G4int verbose=0)
virtual G4DecayProducts * DecayIt(G4double parentMass=-1.0)=0
G4double G4cbrt(G4double x)