384 #ifdef debug_BIC_Propagate
385 G4cout <<
"G4BinaryCascade Propagate starting -------------------------------------------------------" <<
G4endl;
395 ClearAndDestroy(&theCapturedList);
396 ClearAndDestroy(&theSecondaryList);
397 theSecondaryList.clear();
398 ClearAndDestroy(&theFinalState);
399 std::vector<G4KineticTrack *>::iterator iter;
410 #ifdef debug_BIC_GetExcitationEnergy
411 G4cout <<
"ExcitationEnergy0 " << GetExcitationEnergy() <<
G4endl;
416 G4bool success = BuildLateParticleCollisions(secondaries);
419 products=HighEnergyModelFSProducts(products, secondaries);
420 ClearAndDestroy(secondaries);
423 #ifdef debug_G4BinaryCascade
424 G4cout <<
"G4BinaryCascade::Propagate: warning - high energy model failed energy conservation, returning unchanged high energy final state" <<
G4endl;
435 FindCollisions(&theSecondaryList);
438 if(theCollisionMgr->
Entries() == 0 )
442 #ifdef debug_BIC_return
452 G4bool haveProducts =
false;
453 G4int collisionCount=0;
454 G4int collisionLoopMaxCount=1000000;
455 while(theCollisionMgr->
Entries() > 0 && currentZ && --collisionLoopMaxCount>0)
466 if(theCollisionMgr->
Entries() > 0)
470 #ifdef debug_BIC_Propagate_Collisions
471 G4cout <<
" NextCollision * , Time, curtime = " << nextCollision <<
" "
487 if (ApplyCollision(nextCollision))
506 for(iter = theTargetList.begin(); iter != theTargetList.end(); ++iter)
510 if ( ! theTargetList.size() || ! nProtons ){
512 products = FillVoidNucleusProducts(products);
513 #ifdef debug_BIC_return
514 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
515 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
516 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
517 PrintKTVector(&theTargetList,std::string(
" theTargetList"));
518 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
520 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
521 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
522 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
523 G4cout <<
"returned products: " << products->size() <<
G4endl;
544 #ifdef debug_BIC_return
551 #ifdef debug_BIC_Propagate
552 G4cout <<
" Momentum transfer to Nucleus " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
560 if ( theSecondaryList.size() > 0 )
562 #ifdef debug_G4BinaryCascade
563 G4cerr <<
"G4BinaryCascade: Warning, have active particles at end" <<
G4endl;
564 PrintKTVector(&theSecondaryList,
"active particles @ end added to theFinalState");
567 for ( iter =theSecondaryList.begin(); iter != theSecondaryList.end(); ++iter)
569 theFinalState.push_back(*iter);
571 theSecondaryList.clear();
574 while ( theCollisionMgr->
Entries() > 0 )
576 #ifdef debug_G4BinaryCascade
577 G4cerr <<
" Warning: remove left over collision(s) " <<
G4endl;
582 #ifdef debug_BIC_Propagate_Excitation
584 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
585 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
587 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
589 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
590 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
591 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
597 G4double ExcitationEnergy=GetExcitationEnergy();
599 #ifdef debug_BIC_Propagate_finals
600 PrintKTVector(&theFinalState,std::string(
" FinalState be4 corr"));
601 G4cout <<
" Excitation Energy prefinal, #collisions:, out, captured "
602 << ExcitationEnergy <<
" "
603 << collisionCount <<
" "
604 << theFinalState.size() <<
" "
605 << theCapturedList.size()<<
G4endl;
608 if (ExcitationEnergy < 0 )
610 G4int maxtry=5, ntry=0;
613 ExcitationEnergy=GetExcitationEnergy();
614 }
while ( ++ntry < maxtry && ExcitationEnergy < 0 );
618 #ifdef debug_BIC_Propagate_finals
619 PrintKTVector(&theFinalState,std::string(
" FinalState corrected"));
620 G4cout <<
" Excitation Energy final, #collisions:, out, captured "
621 << ExcitationEnergy <<
" "
622 << collisionCount <<
" "
623 << theFinalState.size() <<
" "
624 << theCapturedList.size()<<
G4endl;
628 if ( ExcitationEnergy < 0. )
630 #ifdef debug_G4BinaryCascade
631 G4cerr <<
"G4BinaryCascade-Warning: negative excitation energy ";
633 PrintKTVector(&theFinalState,std::string(
"FinalState"));
634 PrintKTVector(&theCapturedList,std::string(
"captured"));
635 G4cout <<
"negative ExE:Final 4Momentum .mag: " << GetFinal4Momentum()
636 <<
" "<< GetFinal4Momentum().
mag()<< G4endl
637 <<
"negative ExE:FinalNucleusMom .mag: " << GetFinalNucleusMomentum()
638 <<
" "<< GetFinalNucleusMomentum().
mag()<<
G4endl;
640 #ifdef debug_BIC_return
641 G4cout <<
" negative Excitation E return empty products " << products <<
G4endl;
645 ClearAndDestroy(products);
655 products= ProductsAddFinalState(products, theFinalState);
657 products= ProductsAddPrecompound(products, precompoundProducts);
662 thePrimaryEscape =
true;
664 #ifdef debug_BIC_return
CLHEP::Hep3Vector G4ThreeVector
void RemoveCollision(G4CollisionInitialState *collision)
G4CollisionInitialState * GetNextCollision()
#define _DebugEpConservation(val)
#define _CheckChargeAndBaryonNumber_(val)
std::vector< G4ReactionProduct * > G4ReactionProductVector
virtual G4double GetOuterRadius()=0
G4GLOB_DLL std::ostream G4cout
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
static G4Proton * Proton()
virtual void Init(G4V3DNucleus *theNucleus)=0
virtual G4double GetMass()=0
static constexpr double MeV
G4V3DNucleus * the3DNucleus
G4double GetCollisionTime(void)
G4GLOB_DLL std::ostream G4cerr
CLHEP::HepLorentzVector G4LorentzVector