102 #define _CheckChargeAndBaryonNumber_(val) CheckChargeAndBaryonNumber(val)
105 #define _CheckChargeAndBaryonNumber_(val)
109 #define _DebugEpConservation(val) DebugEpConservation(val)
112 #define _DebugEpConservation(val)
115G4int G4BinaryCascade::theBIC_ID = -1;
129 theImR.push_back(theDecay);
132 theImR.push_back(aAb);
135 theImR.push_back(aSc);
141 theCutOnPAbsorb= 0*MeV;
155 thePrimaryEscape =
true;
164 projectileA=projectileZ=0;
165 currentInitialEnergy=initial_nuclear_mass=0.;
174 ClearAndDestroy(&theTargetList);
175 ClearAndDestroy(&theSecondaryList);
176 ClearAndDestroy(&theCapturedList);
177 delete thePropagator;
178 delete theCollisionMgr;
179 for(
auto & ptr : theImR) {
delete ptr; }
181 delete theLateParticle;
182 delete theH1Scatterer;
187 outFile <<
"G4BinaryCascade is an intra-nuclear cascade model in which\n"
188 <<
"an incident hadron collides with a nucleon, forming two\n"
189 <<
"final-state particles, one or both of which may be resonances.\n"
190 <<
"The resonances then decay hadronically and the decay products\n"
191 <<
"are then propagated through the nuclear potential along curved\n"
192 <<
"trajectories until they re-interact or leave the nucleus.\n"
193 <<
"This model is valid for incident pions up to 1.5 GeV and\n"
194 <<
"nucleons up to 10 GeV.\n"
195 <<
"The remaining excited nucleus is handed on to ";
201 else if (theExcitationHandler)
203 outFile <<
"G4ExcitationHandler";
208 outFile <<
"void.\n";
214 outFile <<
"G4BinaryCascade propagtes secondaries produced by a high\n"
215 <<
"energy model through the wounded nucleus.\n"
216 <<
"Secondaries are followed after the formation time and if\n"
217 <<
"within the nucleus are propagated through the nuclear\n"
218 <<
"potential along curved trajectories until they interact\n"
219 <<
"with a nucleon, decay, or leave the nucleus.\n"
220 <<
"An interaction of a secondary with a nucleon produces two\n"
221 <<
"final-state particles, one or both of which may be resonances.\n"
222 <<
"Resonances decay hadronically and the decay products\n"
223 <<
"are in turn propagated through the nuclear potential along curved\n"
224 <<
"trajectories until they re-interact or leave the nucleus.\n"
225 <<
"This model is valid for pions up to 1.5 GeV and\n"
226 <<
"nucleons up to about 3.5 GeV.\n"
227 <<
"The remaining excited nucleus is handed on to ";
233 else if (theExcitationHandler)
235 outFile <<
"G4ExcitationHandler";
240 outFile <<
"void.\n";
257 if(fBCDEBUG)
G4cerr <<
" ######### Binary Cascade Reaction starts ######### "<<
G4endl;
262 if(initial4Momentum.
e()-initial4Momentum.
m()<theBCminP &&
284 G4cerr <<
"G4BinaryCascade should not be used for projectiles other than nucleons or pions."<<
G4endl;
285 G4cerr <<
"If you want to continue, please switch on the developer environment: "<<
G4endl;
287 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade - used for unvalid particle type - Fatal");
292 thePrimaryType = definition;
293 thePrimaryEscape =
false;
299 G4int interactionCounter = 0,collisionLoopMaxCount;
307 ClearAndDestroy(products);
316 collisionLoopMaxCount = 200;
321 initialPosition=GetSpherePoint(1.1*radius, initial4Momentum);
322 kt =
new G4KineticTrack(definition, 0., initialPosition, initial4Momentum);
326 secondaries->push_back(kt);
334 }
while(! products && --collisionLoopMaxCount>0);
336 if(++interactionCounter>99)
break;
338 }
while(products && products->size() == 0);
340 if(products && products->size()>0)
346 G4ReactionProductVector::iterator iter;
348 for(iter = products->begin(); iter != products->end(); ++iter)
352 (*iter)->GetTotalEnergy(),
353 (*iter)->GetMomentum());
355 G4double time=(*iter)->GetFormationTime();
356 if(time < 0.0) { time = 0.0; }
357 aNew.
SetTime(timePrimary + time);
368 if(fBCDEBUG)
G4cerr <<
" ######### Binary Cascade Reaction void, return initial state ######### "<<
G4endl;
376 ClearAndDestroy(products);
383 if(fBCDEBUG)
G4cerr <<
" ######### Binary Cascade Reaction ends ######### "<<
G4endl;
392 G4ping debug(
"debug_G4BinaryCascade");
393#ifdef debug_BIC_Propagate
394 G4cout <<
"G4BinaryCascade Propagate starting -------------------------------------------------------" <<
G4endl;
404 ClearAndDestroy(&theCapturedList);
405 ClearAndDestroy(&theSecondaryList);
406 theSecondaryList.clear();
407 ClearAndDestroy(&theFinalState);
408 std::vector<G4KineticTrack *>::iterator iter;
419#ifdef debug_BIC_GetExcitationEnergy
420 G4cout <<
"ExcitationEnergy0 " << GetExcitationEnergy() <<
G4endl;
425 G4bool success = BuildLateParticleCollisions(secondaries);
428 products=HighEnergyModelFSProducts(products, secondaries);
429 ClearAndDestroy(secondaries);
432#ifdef debug_G4BinaryCascade
433 G4cout <<
"G4BinaryCascade::Propagate: warning - high energy model failed energy conservation, returning unchanged high energy final state" <<
G4endl;
444 FindCollisions(&theSecondaryList);
447 if(theCollisionMgr->
Entries() == 0 )
451#ifdef debug_BIC_return
461 G4bool haveProducts =
false;
462#ifdef debug_BIC_Propagate_Collisions
463 G4int collisionCount=0;
465 G4int collisionLoopMaxCount=1000000;
466 while(theCollisionMgr->
Entries() > 0 && currentZ && --collisionLoopMaxCount>0)
477 if(theCollisionMgr->
Entries() > 0)
481#ifdef debug_BIC_Propagate_Collisions
482 G4cout <<
" NextCollision * , Time, curtime = " << nextCollision <<
" "
498 if (ApplyCollision(nextCollision))
502#ifdef debug_BIC_Propagate_Collisions
517 for(iter = theTargetList.begin(); iter != theTargetList.end(); ++iter)
521 if ( ! theTargetList.size() || ! nProtons ){
523 products = FillVoidNucleusProducts(products);
524#ifdef debug_BIC_return
525 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
526 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
527 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
528 PrintKTVector(&theTargetList,std::string(
" theTargetList"));
529 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
531 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
532 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
533 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
534 G4cout <<
"returned products: " << products->size() <<
G4endl;
555#ifdef debug_BIC_return
562#ifdef debug_BIC_Propagate
563 G4cout <<
" Momentum transfer to Nucleus " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
571 if ( theSecondaryList.size() > 0 )
573#ifdef debug_G4BinaryCascade
574 G4cerr <<
"G4BinaryCascade: Warning, have active particles at end" <<
G4endl;
575 PrintKTVector(&theSecondaryList,
"active particles @ end added to theFinalState");
578 for ( iter =theSecondaryList.begin(); iter != theSecondaryList.end(); ++iter)
580 theFinalState.push_back(*iter);
582 theSecondaryList.clear();
585 while ( theCollisionMgr->
Entries() > 0 )
587#ifdef debug_G4BinaryCascade
588 G4cerr <<
" Warning: remove left over collision(s) " <<
G4endl;
593#ifdef debug_BIC_Propagate_Excitation
595 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
596 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
598 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
600 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
601 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
602 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
608 G4double ExcitationEnergy=GetExcitationEnergy();
610#ifdef debug_BIC_Propagate_finals
611 PrintKTVector(&theFinalState,std::string(
" FinalState be4 corr"));
612 G4cout <<
" Excitation Energy prefinal, #collisions:, out, captured "
613 << ExcitationEnergy <<
" "
614 << collisionCount <<
" "
615 << theFinalState.size() <<
" "
616 << theCapturedList.size()<<
G4endl;
619 if (ExcitationEnergy < 0 )
621 G4int maxtry=5, ntry=0;
624 ExcitationEnergy=GetExcitationEnergy();
625 }
while ( ++ntry < maxtry && ExcitationEnergy < 0 );
629#ifdef debug_BIC_Propagate_finals
630 PrintKTVector(&theFinalState,std::string(
" FinalState corrected"));
631 G4cout <<
" Excitation Energy final, #collisions:, out, captured "
632 << ExcitationEnergy <<
" "
633 << collisionCount <<
" "
634 << theFinalState.size() <<
" "
635 << theCapturedList.size()<<
G4endl;
639 if ( ExcitationEnergy < 0. )
641 #ifdef debug_G4BinaryCascade
642 G4cerr <<
"G4BinaryCascade-Warning: negative excitation energy ";
644 PrintKTVector(&theFinalState,std::string(
"FinalState"));
645 PrintKTVector(&theCapturedList,std::string(
"captured"));
646 G4cout <<
"negative ExE:Final 4Momentum .mag: " << GetFinal4Momentum()
647 <<
" "<< GetFinal4Momentum().
mag()<<
G4endl
648 <<
"negative ExE:FinalNucleusMom .mag: " << GetFinalNucleusMomentum()
649 <<
" "<< GetFinalNucleusMomentum().
mag()<<
G4endl;
651 #ifdef debug_BIC_return
652 G4cout <<
" negative Excitation E return empty products " << products <<
G4endl;
656 ClearAndDestroy(products);
666 products= ProductsAddFinalState(products, theFinalState);
668 products= ProductsAddPrecompound(products, precompoundProducts);
673 thePrimaryEscape =
true;
675 #ifdef debug_BIC_return
684G4double G4BinaryCascade::GetExcitationEnergy()
689#if defined(debug_G4BinaryCascade) || defined(debug_BIC_GetExcitationEnergy)
690 G4int finalA = theTargetList.size()+theCapturedList.size();
691 G4int finalZ = GetTotalCharge(theTargetList)+GetTotalCharge(theCapturedList);
692 if ( (currentA - finalA) != 0 || (currentZ - finalZ) != 0 )
694 G4cerr <<
"G4BIC:GetExcitationEnergy(): Nucleon counting error current/final{A,Z} "
695 <<
"("<< currentA <<
"," << finalA <<
") ("<< currentZ <<
"," << finalZ <<
")" <<
G4endl;
704 nucleusMass = GetIonMass(currentZ,currentA);
706 else if (currentZ==0 )
709 else {nucleusMass = GetFinalNucleusMomentum().
mag() - 3.*MeV*currentA;}
713#ifdef debug_G4BinaryCascade
714 G4cout <<
"G4BinaryCascade::GetExcitationEnergy(): Warning - invalid nucleus (A,Z)=("
715 << currentA <<
"," << currentZ <<
")" <<
G4endl;
720#ifdef debug_BIC_GetExcitationEnergy
721 G4ping debug(
"debug_ExcitationEnergy");
722 debug.push_back(
"====> current A, Z");
723 debug.push_back(currentZ);
724 debug.push_back(currentA);
725 debug.push_back(
"====> final A, Z");
726 debug.push_back(finalZ);
727 debug.push_back(finalA);
728 debug.push_back(nucleusMass);
729 debug.push_back(GetFinalNucleusMomentum().mag());
735 excitationE = GetFinalNucleusMomentum().
mag() - nucleusMass;
741#ifdef debug_BIC_GetExcitationEnergy
743 if ( excitationE < 0 )
745 G4cout <<
"negative ExE final Ion mass " <<nucleusMass<<
G4endl;
747 if(finalZ>.5)
G4cout <<
" Final nuclmom/mass " << Nucl_mom <<
" " << Nucl_mom.
mag()
748 <<
" (A,Z)=("<< finalA <<
","<<finalZ <<
")"
749 <<
" mass " << nucleusMass <<
" "
750 <<
" excitE " << excitationE <<
G4endl;
758 initialExc = theInitial4Mom.
mag()- GetIonMass(Z,
A);
759 G4cout <<
"GetExcitationEnergy: Initial nucleus A Z " <<
A <<
" " << Z <<
" " << initialExc <<
G4endl;
776void G4BinaryCascade::BuildTargetList()
787 ClearAndDestroy(&theTargetList);
796 initial_nuclear_mass=GetIonMass(initialZ,initialA);
805 definition =
nucleon->GetDefinition();
815 theTargetList.push_back(kt);
820#ifdef debug_BIC_BuildTargetList
827 massInNucleus = GetIonMass(currentZ,currentA);
828 }
else if (currentZ==0 && currentA>=1 )
833 G4cerr <<
"G4BinaryCascade::BuildTargetList(): Fatal Error - invalid nucleus (A,Z)=("
834 << currentA <<
"," << currentZ <<
")" <<
G4endl;
837 currentInitialEnergy= theInitial4Mom.
e() + theProjectile4Momentum.
e();
839#ifdef debug_BIC_BuildTargetList
840 G4cout <<
"G4BinaryCascade::BuildTargetList(): nucleus (A,Z)=("
841 << currentA <<
"," << currentZ <<
") mass: " << massInNucleus <<
842 ", theInitial4Mom " << theInitial4Mom <<
843 ", currentInitialEnergy " << currentInitialEnergy <<
G4endl;
853 std::vector<G4KineticTrack *>::iterator iter;
856 projectileA=projectileZ=0;
859 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
861 if((*iter)->GetFormationTime() < StartingTime)
862 StartingTime = (*iter)->GetFormationTime();
867 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
871 G4double FormTime = (*iter)->GetFormationTime() - StartingTime;
872 (*iter)->SetFormationTime(FormTime);
875 FindLateParticleCollision(*iter);
876 lateParticles4Momentum += (*iter)->GetTrackingMomentum();
877 lateA += (*iter)->GetDefinition()->GetBaryonNumber();
878 lateZ +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
882 theSecondaryList.push_back(*iter);
884 theProjectile4Momentum += (*iter)->GetTrackingMomentum();
885 projectileA += (*iter)->GetDefinition()->GetBaryonNumber();
886 projectileZ +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
887#ifdef debug_BIC_Propagate
888 G4cout <<
" Adding initial secondary " << *iter
889 <<
" time" << (*iter)->GetFormationTime()
890 <<
", state " << (*iter)->GetState() <<
G4endl;
899 theProjectile4Momentum += mom;
903 G4double excitation= theProjectile4Momentum.
e() + initial_nuclear_mass - lateParticles4Momentum.e() - massInNucleus;
904#ifdef debug_BIC_GetExcitationEnergy
905 G4cout <<
"BIC: Proj.e, nucl initial, nucl final, lateParticles"
906 << theProjectile4Momentum <<
", "
907 << initial_nuclear_mass<<
", " << massInNucleus <<
", "
908 << lateParticles4Momentum <<
G4endl;
909 G4cout <<
"BIC: Proj.e / initial excitation: " << theProjectile4Momentum.
e() <<
" / " << excitation <<
G4endl;
911 success = excitation > 0;
912#ifdef debug_G4BinaryCascade
914 G4cout <<
"G4BinaryCascade::BuildLateParticleCollisions(): Proj.e / initial excitation: " << theProjectile4Momentum.
e() <<
" / " << excitation <<
G4endl;
924 secondaries->clear();
941 fragment = FindFragments();
953 else if (theExcitationHandler)
955 precompoundProducts=theExcitationHandler->
BreakItUp(*fragment);
960 if (theTargetList.size() + theCapturedList.size() > 1 ) {
964 std::vector<G4KineticTrack *>::iterator i;
965 if ( theTargetList.size() == 1 ) {i=theTargetList.begin();}
966 if ( theCapturedList.size() == 1 ) {i=theCapturedList.begin();}
974 precompoundProducts->push_back(aNew);
982 precompoundProducts = DecayVoidNucleus();
984 #ifdef debug_BIC_DeexcitationProducts
988 if ( precompoundProducts )
990 std::vector<G4ReactionProduct *>::iterator j;
991 for(j = precompoundProducts->begin(); j != precompoundProducts->end(); ++j)
994 Preco_momentum += pProduct;
997 G4cout <<
"finalNuclMom / sum preco products" << fragment_momentum <<
" / " << Preco_momentum
998 <<
" delta E "<< fragment_momentum.
e() - Preco_momentum.
e() <<
G4endl;
1002 return precompoundProducts;
1010 if ( (theTargetList.size()+theCapturedList.size()) > 0 )
1013 std::vector<G4KineticTrack *>::iterator aNuc;
1015 std::vector<G4double> masses;
1018 if ( theTargetList.size() != 0)
1020 for ( aNuc=theTargetList.begin(); aNuc != theTargetList.end(); aNuc++)
1022 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
1023 masses.push_back(mass);
1028 if ( theCapturedList.size() != 0)
1030 for(aNuc = theCapturedList.begin(); aNuc != theCapturedList.end(); aNuc++)
1032 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
1033 masses.push_back(mass);
1044 if ( eCMS < sumMass )
1046 eCMS=sumMass + 2*MeV*masses.size();
1051 std::vector<G4LorentzVector*> * momenta=
decay.Decay(eCMS,masses);
1052 std::vector<G4LorentzVector*>::iterator aMom=momenta->begin();
1055 if ( theTargetList.size() != 0)
1057 for ( aNuc=theTargetList.begin();
1058 (aNuc != theTargetList.end()) && (aMom!=momenta->end());
1067 result->push_back(aNew);
1072 if ( theCapturedList.size() != 0)
1074 for ( aNuc=theCapturedList.begin();
1075 (aNuc != theCapturedList.end()) && (aMom!=momenta->end());
1084 result->push_back(aNew);
1100#ifdef debug_BIC_Propagate_finals
1103 for(i = 0; i< fs.size(); i++)
1113 products->push_back(aNew);
1115#ifdef debug_BIC_Propagate_finals
1125#ifdef debug_BIC_Propagate_finals
1126 G4cout <<
" Final state momentum " << mom_fs <<
G4endl;
1137 if ( precompoundProducts )
1139 std::vector<G4ReactionProduct *>::iterator j;
1140 for(j = precompoundProducts->begin(); j != precompoundProducts->end(); ++j)
1145#ifdef debug_BIC_Propagate_finals
1146 G4cout <<
"BIC: pProduct be4 boost " <<pProduct <<
G4endl;
1148 pProduct *= precompoundLorentzboost;
1149#ifdef debug_BIC_Propagate_finals
1150 G4cout <<
"BIC: pProduct aft boost " <<pProduct <<
G4endl;
1152 pSumPreco += pProduct;
1153 (*j)->SetTotalEnergy(pProduct.e());
1154 (*j)->SetMomentum(pProduct.vect());
1155 (*j)->SetNewlyAdded(
true);
1156 products->push_back(*j);
1160 precompoundProducts->clear();
1161 delete precompoundProducts;
1169 for(std::vector<G4KineticTrack *>::iterator i = secondaries->begin();
1170 i != secondaries->end(); ++i)
1172 for(std::vector<G4BCAction *>::iterator j = theImR.begin();
1173 j!=theImR.end(); j++)
1176 const std::vector<G4CollisionInitialState *> & aCandList
1177 = (*j)->GetCollisions(*i, theTargetList, theCurrentTime);
1178 for(
size_t count=0; count<aCandList.size(); count++)
1190void G4BinaryCascade::FindDecayCollision(
G4KineticTrack * secondary)
1193 const std::vector<G4CollisionInitialState *> & aCandList
1194 = theDecay->
GetCollisions(secondary, theTargetList, theCurrentTime);
1195 for(
size_t count=0; count<aCandList.size(); count++)
1202void G4BinaryCascade::FindLateParticleCollision(
G4KineticTrack * secondary)
1207 if (((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(secondary,tin,tout))
1212 }
else if ( tout > 0 )
1225#ifdef debug_BIC_FindCollision
1226 G4cout <<
"FindLateP Particle, 4-mom, times newState "
1229 <<
" times " << tin <<
" " << tout <<
" "
1233 const std::vector<G4CollisionInitialState *> & aCandList
1234 = theLateParticle->
GetCollisions(secondary, theTargetList, theCurrentTime);
1235 for(
size_t count=0; count<aCandList.size(); count++)
1237#ifdef debug_BIC_FindCollision
1238 G4cout <<
" Adding a late Col : " << aCandList[count] <<
G4endl;
1251#ifdef debug_BIC_ApplyCollision
1252 G4cerr <<
"G4BinaryCascade::ApplyCollision start"<<
G4endl;
1253 theCollisionMgr->
Print();
1258 G4bool haveTarget=target_collection.size()>0;
1261#ifdef debug_G4BinaryCascade
1262 G4cout <<
"G4BinaryCasacde::ApplyCollision(): StateError " << primary <<
G4endl;
1263 PrintKTVector(primary,std::string(
"primay- ..."));
1264 PrintKTVector(&target_collection,std::string(
"... targets"));
1267 theCollisionMgr->
Print();
1284 G4int initialBaryon(0);
1285 G4int initialCharge(0);
1293 G4double initial_Efermi=CorrectShortlivedPrimaryForFermi(primary,target_collection);
1299#ifdef debug_BIC_ApplyCollision
1300 DebugApplyCollisionFail(collision, products);
1306 G4bool lateParticleCollision= (!haveTarget) && products && products->size() == 1;
1307 G4bool decayCollision= (!haveTarget) && products && products->size() > 1;
1311#ifdef debug_G4BinaryCascade
1312 G4int lateBaryon(0), lateCharge(0);
1315 if ( lateParticleCollision )
1319#ifdef debug_G4BinaryCascade
1320 lateBaryon = initialBaryon;
1321 lateCharge = initialCharge;
1323 initialBaryon=initialCharge=0;
1330 if (!lateParticleCollision)
1332 if( !products || products->size()==0 || !CheckPauliPrinciple(products) )
1334#ifdef debug_BIC_ApplyCollision
1335 if (products)
G4cout <<
" ======Failed Pauli =====" <<
G4endl;
1336 G4cerr <<
"G4BinaryCascade::ApplyCollision blocked"<<
G4endl;
1344 if (! CorrectShortlivedFinalsForFermi(products, initial_Efermi)){
1350#ifdef debug_BIC_ApplyCollision
1351 DebugApplyCollision(collision, products);
1355 if (products) ClearAndDestroy(products);
1356 if ( decayCollision ) FindDecayCollision(primary);
1362 G4int finalBaryon(0);
1363 G4int finalCharge(0);
1365 for(std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
1367 if ( ! lateParticleCollision )
1369 (*i)->SetState(primary->
GetState());
1371 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber();
1372 finalCharge+=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
1375 if (((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes((*i),tin,tout) &&
1376 tin < 0 && tout > 0 )
1378 PrintKTVector((*i),
"particle inside marked not-inside");
1379 G4cout <<
"tin tout: " << tin <<
" " << tout <<
G4endl;
1384 if (((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes((*i),tin,tout))
1391 else if ( tout > 0 )
1394 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber();
1395 finalCharge+=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
1400 toFinalState.push_back((*i));
1406 toFinalState.push_back((*i));
1411 if(!toFinalState.empty())
1413 theFinalState.insert(theFinalState.end(),
1414 toFinalState.begin(),toFinalState.end());
1415 std::vector<G4KineticTrack *>::iterator iter1, iter2;
1416 for(iter1 = toFinalState.begin(); iter1 != toFinalState.end();
1419 iter2 = std::find(products->begin(), products->end(),
1421 if ( iter2 != products->end() ) products->erase(iter2);
1427 currentA += finalBaryon-initialBaryon;
1428 currentZ += finalCharge-initialCharge;
1432 oldSecondaries.push_back(primary);
1435#ifdef debug_G4BinaryCascade
1436 if ( (finalBaryon-initialBaryon-lateBaryon) != 0 || (finalCharge-initialCharge-lateCharge) != 0 )
1438 G4cout <<
"G4BinaryCascade: Error in Balancing: " <<
G4endl;
1439 G4cout <<
"initial/final baryon number, initial/final Charge "
1440 << initialBaryon <<
" "<< finalBaryon <<
" "
1441 << initialCharge <<
" "<< finalCharge <<
" "
1442 <<
" in Collision type: "<<
typeid(*collision->
GetGenerator()).name()
1443 <<
", with number of products: "<< products->size() <<
G4endl;
1457 for(
size_t ii=0; ii< oldTarget.size(); ii++)
1459 oldTarget[ii]->Hit();
1462 UpdateTracksAndCollisions(&oldSecondaries, &oldTarget, products);
1472G4bool G4BinaryCascade::Absorb()
1480 std::vector<G4KineticTrack *>::iterator iter;
1482 for(iter = theSecondaryList.begin();
1483 iter != theSecondaryList.end(); ++iter)
1488 if(absorber.WillBeAbsorbed(*kt))
1490 absorbList.push_back(kt);
1495 if(absorbList.empty())
1499 for(iter = absorbList.begin(); iter != absorbList.end(); ++iter)
1502 if(!absorber.FindAbsorbers(*kt, theTargetList))
1503 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1505 if(!absorber.FindProducts(*kt))
1506 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1509 G4int maxLoopCount = 1000;
1510 while(!CheckPauliPrinciple(products) && --maxLoopCount>0)
1512 ClearAndDestroy(products);
1513 if(!absorber.FindProducts(*kt))
1515 "G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1517 if ( --maxLoopCount < 0 )
throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1522 toRemove.push_back(kt);
1523 toDelete.push_back(kt);
1525 UpdateTracksAndCollisions(&toRemove, absorbers, products);
1526 ClearAndDestroy(absorbers);
1528 ClearAndDestroy(&toDelete);
1541 std::vector<G4KineticTrack *>::iterator i;
1546 G4int particlesAboveCut=0;
1547 G4int particlesBelowCut=0;
1548 if ( verbose )
G4cout <<
" Capture: secondaries " << theSecondaryList.size() <<
G4endl;
1549 for(i = theSecondaryList.begin(); i != theSecondaryList.end(); ++i)
1566 ++particlesBelowCut;
1574 if (verbose)
G4cout <<
"Capture particlesAboveCut,particlesBelowCut, capturedEnergy,capturedEnergy/particlesBelowCut <? 0.2*theCutOnP "
1575 << particlesAboveCut <<
" " << particlesBelowCut <<
" " << capturedEnergy
1579 if(particlesBelowCut>0 && capturedEnergy/particlesBelowCut<0.2*theCutOnP)
1582 for(i = theSecondaryList.begin(); i != theSecondaryList.end(); ++i)
1590 captured.push_back(kt);
1592 theCapturedList.push_back(kt);
1596 UpdateTracksAndCollisions(&captured,
nullptr,
nullptr);
1611 fermiMom.
Init(
A, Z);
1615 G4KineticTrackVector::iterator i;
1622 for(i = products->begin(); i != products->end(); ++i)
1624 definition = (*i)->GetDefinition();
1650 if(mom.
e() < eFermi )
1659#ifdef debug_BIC_CheckPauli
1662 for(i = products->begin(); i != products->end(); ++i)
1664 definition = (*i)->GetDefinition();
1673 if ( mom.
e()-mom.
mag()+field > 160*MeV )
1675 G4cout <<
"momentum problem pFermi=" << pFermi
1676 <<
" mom, mom.m " << mom <<
" " << mom.
mag()
1677 <<
" field " << field <<
G4endl;
1688void G4BinaryCascade::StepParticlesOut()
1695 while( theSecondaryList.size() > 0 )
1700 std::vector<G4KineticTrack *>::iterator i;
1701 for(i = theSecondaryList.begin(); i != theSecondaryList.end(); ++i)
1708 ((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(kt,tdummy,tStep);
1709#ifdef debug_BIC_StepParticlesOut
1710 G4cout <<
" minTimeStep, tStep Particle " <<minTimeStep <<
" " <<tStep
1715 PrintKTVector(&theSecondaryList, std::string(
" state ERROR....."));
1716 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::StepParticlesOut() particle not in nucleus");
1719 if(intersect && tStep<minTimeStep && tStep> 0 )
1721 minTimeStep = tStep;
1724 PrintKTVector(&theSecondaryList, std::string(
" state ERROR....."));
1725 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::StepParticlesOut() particle not in nucleus");
1731 if(theCollisionMgr->
Entries() > 0)
1737 if ( timeToCollision > minTimeStep )
1739 DoTimeStep(minTimeStep);
1743 if (!DoTimeStep(timeToCollision) )
1755 if ( ApplyCollision(nextCollision))
1767#ifdef debug_G4BinaryCascade
1768 G4cerr <<
"G4BinaryCascade.cc: Warning - aborting looping particle(s)" <<
G4endl;
1769 PrintKTVector(&theSecondaryList,
" looping particles added to theFinalState");
1773 std::vector<G4KineticTrack *>::iterator iter;
1774 for ( iter =theSecondaryList.begin(); iter != theSecondaryList.end(); ++iter)
1776 theFinalState.push_back(*iter);
1778 theSecondaryList.clear();
1792#ifdef debug_BIC_StepParticlesOut
1796 if ( counter > 100 && theCollisionMgr->
Entries() == 0)
1798#ifdef debug_BIC_StepParticlesOut
1799 PrintKTVector(&theSecondaryList,std::string(
"stepping 100 steps"));
1801 FindCollisions(&theSecondaryList);
1809 #ifdef debug_BIC_return
1810 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
1811 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
1812 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
1813 PrintKTVector(&theTargetList,std::string(
" theTargetList"));
1814 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
1816 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
1817 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
1818 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
1834G4double G4BinaryCascade::CorrectShortlivedPrimaryForFermi(
1843 if ( std::abs(PDGcode) > 1000 && PDGcode != 2112 && PDGcode != 2212 )
1850 std::vector<G4KineticTrack *>::iterator titer;
1851 for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer)
1869 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
1871 G4int PDGcode=(*i)->GetDefinition()->GetPDGEncoding();
1873 final_Efermi+=((
G4RKPropagation *)thePropagator)->GetField(PDGcode,(*i)->GetPosition());
1874 if ( std::abs(PDGcode) > 1000 && PDGcode != 2112 && PDGcode != 2212 )
1876 resonances.push_back(*i);
1879 if ( resonances.size() > 0 )
1881 G4double delta_Fermi= (initial_Efermi-final_Efermi)/resonances.size();
1882 for (std::vector<G4KineticTrack *>::iterator res=resonances.begin(); res != resonances.end(); res++)
1886 G4double newEnergy=mom.
e() + delta_Fermi;
1887 G4double newEnergy2= newEnergy*newEnergy;
1889 if ( newEnergy2 < mass2 )
1903void G4BinaryCascade::CorrectFinalPandE()
1911#ifdef debug_BIC_CorrectFinalPandE
1915 if ( theFinalState.size() == 0 )
return;
1917 G4KineticTrackVector::iterator i;
1919 if ( pNucleus.
e() == 0 )
return;
1920#ifdef debug_BIC_CorrectFinalPandE
1924 for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
1926 pFinals += (*i)->Get4Momentum();
1927#ifdef debug_BIC_CorrectFinalPandE
1928 G4cout <<
"CorrectFinalPandE a final " << (*i)->GetDefinition()->GetParticleName()
1929 <<
" 4mom " << (*i)->Get4Momentum()<<
G4endl;
1932#ifdef debug_BIC_CorrectFinalPandE
1933 G4cout <<
"CorrectFinalPandE pN pF: " <<pNucleus <<
" " <<pFinals <<
G4endl;
1939#ifdef debug_BIC_CorrectFinalPandE
1940 G4cout <<
"CorrectFinalPandE pCM, CMS pCM " << pCM <<
" " <<toCMS*pCM<<
G4endl;
1941 G4cout <<
"CorrectFinal CMS pN pF " <<toCMS*pNucleus <<
" "
1943 <<
" nucleus initial mass : " <<GetFinal4Momentum().
mag()
1944 <<
" massInNucleus m(nucleus) m(finals) std::sqrt(s): " << massInNucleus <<
" " <<pNucleus.
mag()<<
" "
1945 << pFinals.mag() <<
" " << pCM.
mag() <<
G4endl;
1951 G4double m10 = GetIonMass(currentZ,currentA);
1953 if( s0-(m10+m20)*(m10+m20) < 0 )
1955#ifdef debug_BIC_CorrectFinalPandE
1956 G4cout <<
"G4BinaryCascade::CorrectFinalPandE() : error! " <<
G4endl;
1958 G4cout <<
"not enough mass to correct: mass^2, A,Z, mass(nucl), mass(finals) "
1959 << (
s0-(m10+m20)*(m10+m20)) <<
" "
1960 << currentA <<
" " << currentZ <<
" "
1961 << m10 <<
" " << m20
1965 PrintKTVector(&theFinalState,
" mass problem");
1971 G4double pInCM = std::sqrt((s0-(m10+m20)*(m10+m20))*(s0-(m10-m20)*(m10-m20))/(4.*s0));
1972#ifdef debug_BIC_CorrectFinalPandE
1973 G4cout <<
" CorrectFinalPandE pInCM new, CURRENT, ratio : " << pInCM
1974 <<
" " << (pFinals).vect().mag()<<
" " << pInCM/(pFinals).vect().mag() <<
G4endl;
1976 if ( pFinals.vect().mag() > pInCM )
1980 G4double factor=std::max(0.98,pInCM/pFinals.vect().mag());
1982 for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
1985 G4ThreeVector p3(factor*(toCMS*(*i)->Get4Momentum()).vect());
1986 G4LorentzVector p(p3,std::sqrt((*i)->Get4Momentum().mag2() + p3.mag2()));
1989#ifdef debug_BIC_CorrectFinalPandE
1992 (*i)->Set4Momentum(p);
1994#ifdef debug_BIC_CorrectFinalPandE
1995 G4cout <<
"CorrectFinalPandE nucleus corrected mass : " << GetFinal4Momentum() <<
" "
1997 <<
" CMS pFinals , mag, 3.mag : " << qFinals <<
" " << qFinals.mag() <<
" " << qFinals.vect().mag()<<
G4endl;
1998 G4cerr <<
" -CorrectFinalPandE 5 " << factor <<
G4endl;
2001#ifdef debug_BIC_CorrectFinalPandE
2002 else {
G4cerr <<
" -CorrectFinalPandE 6 - no correction done" <<
G4endl; }
2008void G4BinaryCascade::UpdateTracksAndCollisions(
2014 std::vector<G4KineticTrack *>::iterator iter1, iter2;
2019 if(!oldSecondaries->empty())
2021 for(iter1 = oldSecondaries->begin(); iter1 != oldSecondaries->end();
2024 iter2 = std::find(theSecondaryList.begin(), theSecondaryList.end(),
2026 if ( iter2 != theSecondaryList.end() ) theSecondaryList.erase(iter2);
2036 if(oldTarget->size()!=0)
2040 for(iter1 = oldTarget->begin(); iter1 != oldTarget->end(); ++iter1)
2042 iter2 = std::find(theTargetList.begin(), theTargetList.end(),
2044 theTargetList.erase(iter2);
2052 if(!newSecondaries->empty())
2055 for(iter1 = newSecondaries->begin(); iter1 != newSecondaries->end();
2058 theSecondaryList.push_back(*iter1);
2061 PrintKTVector(*iter1,
"undefined in FindCollisions");
2067 FindCollisions(newSecondaries);
2082 ktv(out), wanted_state(astate)
2086 if ( (kt)->GetState() == wanted_state ) ktv->push_back(kt);
2097#ifdef debug_BIC_DoTimeStep
2098 G4ping debug(
"debug_G4BinaryCascade");
2099 debug.push_back(
"======> DoTimeStep 1"); debug.dump();
2100 G4cerr <<
"G4BinaryCascade::DoTimeStep: enter step="<< theTimeStep
2101 <<
" , time="<<theCurrentTime <<
G4endl;
2102 PrintKTVector(&theSecondaryList, std::string(
"DoTimeStep - theSecondaryList"));
2107 std::vector<G4KineticTrack *>::iterator iter;
2110 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2115 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2120#ifdef debug_BIC_DoTimeStep
2126 thePropagator->
Transport(theSecondaryList, dummy, theTimeStep);
2133#ifdef debug_BIC_DoTimeStep
2134 G4cout <<
"DoTimeStep : theMomentumTransfer = " << theMomentumTransfer <<
G4endl;
2135 PrintKTVector(&theSecondaryList, std::string(
"DoTimeStep - secondaries aft trsprt"));
2143 std::for_each( kt_outside->begin(),kt_outside->end(),
2150 std::for_each( kt_inside->begin(),kt_inside->end(),
2160 kt_gone_in->clear();
2161 std::for_each( kt_outside->begin(),kt_outside->end(),
2164 kt_gone_out->clear();
2165 std::for_each( kt_inside->begin(),kt_inside->end(),
2168#ifdef debug_BIC_DoTimeStep
2169 PrintKTVector(fail,std::string(
" Failed to go in/out -> miss_nucleus/captured"));
2170 PrintKTVector(kt_gone_in, std::string(
"recreated kt_gone_in"));
2171 PrintKTVector(kt_gone_out, std::string(
"recreated kt_gone_out"));
2177 std::for_each( kt_outside->begin(),kt_outside->end(),
2180 std::for_each( kt_outside->begin(),kt_outside->end(),
2183#ifdef debug_BIC_DoTimeStep
2184 PrintKTVector(kt_gone_out, std::string(
"append gone_outs to final state.. theFinalState"));
2187 theFinalState.insert(theFinalState.end(),
2188 kt_gone_out->begin(),kt_gone_out->end());
2192 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2198 if ( theCollisionMgr->
Entries()> 0 )
2200 if (kt_gone_out->size() )
2203 iter = std::find(kt_gone_out->begin(),kt_gone_out->end(),nextPrimary);
2204 if ( iter != kt_gone_out->end() )
2207#ifdef debug_BIC_DoTimeStep
2208 G4cout <<
" DoTimeStep - WARNING: deleting current collision!" <<
G4endl;
2212 if ( kt_captured->size() )
2215 iter = std::find(kt_captured->begin(),kt_captured->end(),nextPrimary);
2216 if ( iter != kt_captured->end() )
2219#ifdef debug_BIC_DoTimeStep
2220 G4cout <<
" DoTimeStep - WARNING: deleting current collision!" <<
G4endl;
2227 UpdateTracksAndCollisions(kt_gone_out,0 ,0);
2230 if ( kt_captured->size() )
2232 theCapturedList.insert(theCapturedList.end(),
2233 kt_captured->begin(),kt_captured->end());
2237 std::vector<G4KineticTrack *>::iterator i_captured;
2238 for(i_captured=kt_captured->begin();i_captured!=kt_captured->end();i_captured++)
2240 (*i_captured)->Hit();
2243 UpdateTracksAndCollisions(kt_captured,
nullptr,
nullptr);
2246#ifdef debug_G4BinaryCascade
2249 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2251 if ( currentZ != (GetTotalCharge(theTargetList)
2252 + GetTotalCharge(theCapturedList)
2253 + GetTotalCharge(*kt_inside)) )
2255 G4cout <<
" error-DoTimeStep aft, A, Z: " << currentA <<
" " << currentZ
2256 <<
" sum(tgt,capt,active) "
2257 << GetTotalCharge(theTargetList) + GetTotalCharge(theCapturedList) + GetTotalCharge(*kt_inside)
2258 <<
" targets: " << GetTotalCharge(theTargetList)
2259 <<
" captured: " << GetTotalCharge(theCapturedList)
2260 <<
" active: " << GetTotalCharge(*kt_inside)
2272 theCurrentTime += theTimeStep;
2286 std::vector<G4KineticTrack *>::iterator iter;
2291 G4int secondaries_in(0);
2292 G4int secondaryBarions_in(0);
2293 G4int secondaryCharge_in(0);
2296 for ( iter =in->begin(); iter != in->end(); ++iter)
2299 secondaryCharge_in +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2300 if ((*iter)->GetDefinition()->GetBaryonNumber()!=0 )
2302 secondaryBarions_in += (*iter)->GetDefinition()->GetBaryonNumber();
2306 secondaryMass_in += (*iter)->GetDefinition()->GetPDGMass();
2312 G4double mass_initial= GetIonMass(currentZ,currentA);
2314 currentZ += secondaryCharge_in;
2315 currentA += secondaryBarions_in;
2320 G4double mass_final= GetIonMass(currentZ,currentA);
2322 G4double correction= secondaryMass_in + mass_initial - mass_final;
2323 if (secondaries_in>1)
2324 {correction /= secondaries_in;}
2326#ifdef debug_BIC_CorrectBarionsOnBoundary
2327 G4cout <<
"CorrectBarionsOnBoundary,currentZ,currentA,"
2328 <<
"secondaryCharge_in,secondaryBarions_in,"
2329 <<
"energy correction,m_secondry,m_nucl_init,m_nucl_final "
2330 << currentZ <<
" "<< currentA <<
" "
2331 << secondaryCharge_in<<
" "<<secondaryBarions_in<<
" "
2332 << correction <<
" "
2333 << secondaryMass_in <<
" "
2334 << mass_initial <<
" "
2335 << mass_final <<
" "
2337 PrintKTVector(in,std::string(
"in be4 correction"));
2339 for ( iter = in->begin(); iter != in->end(); ++iter)
2341 if ((*iter)->GetTrackingMomentum().e()+correction > (*iter)->GetActualMass())
2343 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + correction);
2350 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + barrier);
2352 kt_fail->push_back(*iter);
2353 currentZ -=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2354 currentA -= (*iter)->GetDefinition()->GetBaryonNumber();
2359#ifdef debug_BIC_CorrectBarionsOnBoundary
2360 G4cout <<
" CorrectBarionsOnBoundary, aft, Z, A, sec-Z,A,m,m_in_nucleus "
2361 << currentZ <<
" " << currentA <<
" "
2362 << secondaryCharge_in <<
" " << secondaryBarions_in <<
" "
2363 << secondaryMass_in <<
" "
2365 PrintKTVector(in,std::string(
"in AFT correction"));
2372 G4int secondaries_out(0);
2373 G4int secondaryBarions_out(0);
2374 G4int secondaryCharge_out(0);
2377 for ( iter =out->begin(); iter != out->end(); ++iter)
2380 secondaryCharge_out +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2381 if ((*iter)->GetDefinition()->GetBaryonNumber() !=0 )
2383 secondaryBarions_out += (*iter)->GetDefinition()->GetBaryonNumber();
2387 secondaryMass_out += (*iter)->GetDefinition()->GetPDGMass();
2394 G4double mass_initial= GetIonMass(currentZ,currentA);
2395 currentA -=secondaryBarions_out;
2396 currentZ -=secondaryCharge_out;
2405 G4cerr <<
"G4BinaryCascade - secondaryBarions_out,secondaryCharge_out " <<
2406 secondaryBarions_out <<
" " << secondaryCharge_out <<
G4endl;
2407 PrintKTVector(&theTargetList,
"CorrectBarionsOnBoundary Target");
2408 PrintKTVector(&theCapturedList,
"CorrectBarionsOnBoundary Captured");
2409 PrintKTVector(&theSecondaryList,
"CorrectBarionsOnBoundary Secondaries");
2410 G4cerr <<
"G4BinaryCascade - currentA, currentZ " << currentA <<
" " << currentZ <<
G4endl;
2411 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::CorrectBarionsOnBoundary() - fatal error");
2413 G4double mass_final=GetIonMass(currentZ,currentA);
2414 G4double correction= mass_initial - mass_final - secondaryMass_out;
2417 if (secondaries_out>1) correction /= secondaries_out;
2418#ifdef debug_BIC_CorrectBarionsOnBoundary
2419 G4cout <<
"DoTimeStep,(current Z,A),"
2420 <<
"(secondaries out,Charge,Barions),"
2421 <<
"* energy correction,(m_secondry,m_nucl_init,m_nucl_final) "
2422 <<
"("<< currentZ <<
","<< currentA <<
") ("
2423 << secondaries_out <<
","
2424 << secondaryCharge_out<<
","<<secondaryBarions_out<<
") * "
2425 << correction <<
" ("
2426 << secondaryMass_out <<
", "
2427 << mass_initial <<
", "
2428 << mass_final <<
")"
2430 PrintKTVector(out,std::string(
"out be4 correction"));
2433 for ( iter = out->begin(); iter != out->end(); ++iter)
2435 if ((*iter)->GetTrackingMomentum().e()+correction > (*iter)->GetActualMass())
2437 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + correction);
2448 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() - barrier);
2450 kt_fail->push_back(*iter);
2451 currentZ +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2452 currentA += (*iter)->GetDefinition()->GetBaryonNumber();
2454#ifdef debug_BIC_CorrectBarionsOnBoundary
2457 G4cout <<
"Not correcting outgoing " << *iter <<
" "
2458 << (*iter)->GetDefinition()->GetPDGEncoding() <<
" "
2459 << (*iter)->GetDefinition()->GetParticleName() <<
G4endl;
2460 PrintKTVector(out,std::string(
"outgoing, one not corrected"));
2466#ifdef debug_BIC_CorrectBarionsOnBoundary
2467 PrintKTVector(out,std::string(
"out AFTER correction"));
2468 G4cout <<
" DoTimeStep, nucl-update, A, Z, sec-Z,A,m,m_in_nucleus, table-mass, delta "
2469 << currentA <<
" "<< currentZ <<
" "
2470 << secondaryCharge_out <<
" "<< secondaryBarions_out <<
" "<<
2471 secondaryMass_out <<
" "
2472 << massInNucleus <<
" "
2473 << GetIonMass(currentZ,currentA)
2474 <<
" " << massInNucleus - GetIonMass(currentZ,currentA)
2489#ifdef debug_BIC_FindFragments
2490 G4cout <<
"target, captured, secondary: "
2491 << theTargetList.size() <<
" "
2492 << theCapturedList.size()<<
" "
2493 << theSecondaryList.size()
2497 G4int a =
G4int(theTargetList.size()+theCapturedList.size());
2499 G4KineticTrackVector::iterator i;
2500 for(i = theTargetList.begin(); i != theTargetList.end(); ++i)
2502 if(
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus) == 1 )
2508 G4int zCaptured = 0;
2510 for(i = theCapturedList.begin(); i != theCapturedList.end(); ++i)
2512 CapturedMomentum += (*i)->Get4Momentum();
2513 if(
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus) == 1 )
2519 G4int z = zTarget+zCaptured;
2521#ifdef debug_G4BinaryCascade
2522 if ( z != (GetTotalCharge(theTargetList) + GetTotalCharge(theCapturedList)) )
2524 G4cout <<
" FindFragment Counting error z a " << z <<
" " <<a <<
" "
2525 << GetTotalCharge(theTargetList) <<
" " << GetTotalCharge(theCapturedList)<<
2527 PrintKTVector(&theTargetList, std::string(
"theTargetList"));
2528 PrintKTVector(&theCapturedList, std::string(
"theCapturedList"));
2542 if ( z < 1 )
return 0;
2545 G4int excitons = (
G4int)theCapturedList.size();
2546#ifdef debug_BIC_FindFragments
2547 G4cout <<
"Fragment: a= " << a <<
" z= " << z <<
" particles= " << excitons
2548 <<
" Charged= " << zCaptured <<
" holes= " << holes
2549 <<
" excitE= " <<GetExcitationEnergy()
2550 <<
" Final4Momentum= " << GetFinalNucleusMomentum() <<
" capturMomentum= " << CapturedMomentum
2572 G4LorentzVector final4Momentum = theInitial4Mom + theProjectile4Momentum;
2574 for(G4KineticTrackVector::iterator i = theFinalState.begin(); i != theFinalState.end(); ++i)
2576 final4Momentum -= (*i)->Get4Momentum();
2577 finals += (*i)->Get4Momentum();
2580 if(final4Momentum.
e()> 0 && (final4Momentum.
vect()/final4Momentum.
e()).mag()>1.0 && currentA > 0)
2582#ifdef debug_BIC_Final4Momentum
2584 G4cerr <<
"G4BinaryCascade::GetFinal4Momentum - Fatal"<<
G4endl;
2585 G4KineticTrackVector::iterator i;
2586 G4cerr <<
"Total initial 4-momentum " << theProjectile4Momentum <<
G4endl;
2587 G4cerr <<
" GetFinal4Momentum: Initial nucleus "<<theInitial4Mom<<
G4endl;
2588 for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
2590 G4cerr <<
" Final state: "<<(*i)->Get4Momentum()<<(*i)->GetDefinition()->GetParticleName()<<
G4endl;
2593 G4cerr<<
" Final4Momentum = "<<final4Momentum <<
" "<<final4Momentum.
m()<<
G4endl;
2594 G4cerr <<
" current A, Z = "<< currentA<<
", "<<currentZ<<
G4endl;
2600 return final4Momentum;
2611 G4KineticTrackVector::iterator i;
2613 for(i = theCapturedList.begin(); i != theCapturedList.end(); ++i)
2615 CapturedMomentum += (*i)->Get4Momentum();
2621 if ( NucleusMomentum.
e() > 0 )
2625 G4ThreeVector boost= (NucleusMomentum.
vect() -CapturedMomentum.vect())/NucleusMomentum.
e();
2626 if(boost.
mag2()>1.0)
2628# ifdef debug_BIC_FinalNucleusMomentum
2629 G4cerr <<
"G4BinaryCascade::GetFinalNucleusMomentum - Fatal"<<
G4endl;
2631 G4cerr <<
"it 01"<<NucleusMomentum<<
" "<<CapturedMomentum<<
" "<<
G4endl;
2638 precompoundLorentzboost.
set( boost );
2639#ifdef debug_debug_BIC_FinalNucleusMomentum
2640 G4cout <<
"GetFinalNucleusMomentum be4 boostNucleusMomentum, CapturedMomentum"<<NucleusMomentum<<
" "<<CapturedMomentum<<
" "<<
G4endl;
2642 NucleusMomentum *= nucleusBoost;
2643#ifdef debug_BIC_FinalNucleusMomentum
2644 G4cout <<
"GetFinalNucleusMomentum aft boost GetFinal4Momentum= " <<NucleusMomentum <<
G4endl;
2647 return NucleusMomentum;
2664 std::vector<G4KineticTrack *>::iterator iter, jter;
2669 while(!done && tryCount++ <200)
2676 secs = theH1Scatterer->
Scatter(*(*secondaries).front(), aTarget);
2677#ifdef debug_H1_BinaryCascade
2678 PrintKTVector(secs,
" From Scatter");
2680 for(
size_t ss=0; secs && ss<secs->size(); ss++)
2683 if((*secs)[ss]->GetDefinition()->IsShortLived()) done =
true;
2687 ClearAndDestroy(&theFinalState);
2688 ClearAndDestroy(secondaries);
2691 for(
size_t current=0; secs && current<secs->size(); current++)
2693 if((*secs)[current]->GetDefinition()->IsShortLived())
2697 for(jter=dec->begin(); jter != dec->end(); jter++)
2700 secs->push_back(*jter);
2703 delete (*secs)[current];
2710 theFinalState.push_back((*secs)[current]);
2715#ifdef debug_H1_BinaryCascade
2716 PrintKTVector(&theFinalState,
" FinalState");
2718 for(iter = theFinalState.begin(); iter != theFinalState.end(); ++iter)
2727 products->push_back(aNew);
2728#ifdef debug_H1_BinaryCascade
2733 G4cout <<
"final shortlived : ";
2736 G4cout <<
"final un stable : ";
2743 theFinalState.clear();
2768 }
while (
sqr(x1) +
sqr(x2) > 1.);
2794 std::vector<G4KineticTrack *>::iterator i;
2795 for(i = ktv->begin(); i != ktv->end(); ++i)
2804 std::vector<G4ReactionProduct *>::iterator i;
2805 for(i = rpv->begin(); i != rpv->end(); ++i)
2814 if (comment.size() > 0 )
G4cout <<
"G4BinaryCascade::PrintKTVector() " << comment <<
G4endl;
2816 G4cout <<
" vector: " << ktv <<
", number of tracks: " << ktv->size()
2818 std::vector<G4KineticTrack *>::iterator i;
2821 for(count = 0, i = ktv->begin(); i != ktv->end(); ++i, ++count)
2824 G4cout <<
" track n. " << count;
2828 G4cout <<
"G4BinaryCascade::PrintKTVector():No KineticTrackVector given " <<
G4endl;
2832void G4BinaryCascade::PrintKTVector(
G4KineticTrack * kt, std::string comment)
2835 if (comment.size() > 0 )
G4cout <<
"G4BinaryCascade::PrintKTVector() "<< comment <<
G4endl;
2843 << 1/fermi*
pos <<
" R: " << 1/fermi*
pos.mag() <<
" 4mom: "
2844 << 1/MeV*mom <<
"Tr_mom" << 1/MeV*tmom <<
" P: " << 1/MeV*mom.
vect().
mag()
2848 G4cout <<
"G4BinaryCascade::PrintKTVector(): No Kinetictrack given" <<
G4endl;
2858 if ( Z > 0 &&
A >= Z )
2862 }
else if (
A > 0 && Z>0 )
2867 }
else if (
A >= 0 && Z<=0 )
2872 }
else if (
A == 0 )
2879 G4cerr <<
"G4BinaryCascade::GetIonMass() - invalid (A,Z) = ("
2880 <<
A <<
"," << Z <<
")" <<
G4endl;
2881 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::GetIonMass() - giving up");
2892 std::vector<G4KineticTrack *>::const_iterator iter;
2893 std::vector<G4ReactionProduct *>::const_iterator rpiter;
2894 decayKTV.
Decay(&theFinalState);
2896 for(iter = theFinalState.cbegin(); iter != theFinalState.cend(); ++iter)
2899 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2904 Esecondaries +=(*iter)->Get4Momentum().e();
2905 psecondaries +=(*iter)->Get4Momentum();
2908 products->push_back(aNew);
2913 while(theCollisionMgr->
Entries() > 0)
2920 if ( lates->size() == 1 ) {
2933 products->push_back(aNew);
2943 decayKTV.
Decay(&theSecondaryList);
2947 if ( (theSecondaryList.size() + theCapturedList.size()) > 0)
2949 transferCorrection= theMomentumTransfer /(theSecondaryList.size() + theCapturedList.size());
2952 for(iter = theSecondaryList.cbegin(); iter != theSecondaryList.cend(); ++iter)
2955 (*iter)->Update4Momentum((*iter)->Get4Momentum().vect()+transferCorrection);
2956 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2961 Esecondaries +=(*iter)->Get4Momentum().e();
2962 psecondaries +=(*iter)->Get4Momentum();
2964 products->push_back(aNew);
2967 for(iter = theCapturedList.cbegin(); iter != theCapturedList.cend(); ++iter)
2970 (*iter)->Update4Momentum((*iter)->Get4Momentum().vect()+transferCorrection);
2971 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2976 Esecondaries +=(*iter)->Get4Momentum().e();
2977 psecondaries +=(*iter)->Get4Momentum();
2979 products->push_back(aNew);
2984 for(iter = theTargetList.cbegin(); iter != theTargetList.cend(); ++iter)
2986 SumMassNucleons += (*iter)->GetDefinition()->GetPDGMass();
2987 pNucleons += (*iter)->Get4Momentum();
2990 G4double Ekinetic=theProjectile4Momentum.e() + initial_nuclear_mass - Esecondaries - SumMassNucleons;
2991 #ifdef debug_BIC_FillVoidnucleus
2993 psecondaries - pNucleons;
2997 if (Ekinetic > 0. && theTargetList.size()){
2998 Ekinetic /= theTargetList.size();
3001 if (theTargetList.size()) Ekineticrdm = ( 0.1 +
G4UniformRand()*5.) * MeV;
3003 for (rpiter=products->cbegin(); rpiter!=products->cend(); ++rpiter){
3004 TotalEkin+=(*rpiter)->GetKineticEnergy();
3007 if ( std::abs(Ekinetic) < 20*perCent * TotalEkin ){
3008 correction=1. + (Ekinetic-Ekineticrdm)/TotalEkin;
3010 #ifdef debug_G4BinaryCascade
3012 G4cout <<
"BLIC::FillVoidNucleus() fail correction, Ekinetic, TotalEkin " << Ekinetic <<
""<< TotalEkin <<
G4endl;
3016 for (rpiter=products->cbegin(); rpiter!=products->cend(); ++rpiter){
3017 (*rpiter)->SetKineticEnergy((*rpiter)->GetKineticEnergy()*correction);
3018 (*rpiter)->SetMomentum((*rpiter)->GetTotalMomentum() * (*rpiter)->GetMomentum().unit());
3022 Ekinetic=Ekineticrdm*correction;
3023 if (theTargetList.size())Ekinetic /= theTargetList.size();
3027 for(iter = theTargetList.cbegin(); iter != theTargetList.cend(); ++iter) {
3037 products->push_back(aNew);
3042 for (rpiter=products->cbegin(); rpiter!=products->cend(); ++rpiter){
3043 psecondaries +=
G4LorentzVector((*rpiter)->GetMomentum(),(*rpiter)->GetTotalEnergy() );
3053 SumMom=initial4Mom.
vect()-SumMom;
3057 while ( SumMom.
mag() > 0.1*MeV && loopcount++ < 10)
3060 for (
auto reverse=products->crbegin(); reverse!=products->crend(); ++reverse, --index){
3061 SumMom=initial4Mom.
vect();
3062 for (rpiter=products->cbegin(); rpiter!=products->cend(); ++rpiter){
3063 SumMom-=(*rpiter)->GetMomentum();
3066 (*reverse)->SetMomentum( p*(((*reverse)->GetMomentum()+SumMom).unit()));
3075 std::vector<G4KineticTrack *>::iterator iter;
3076 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
3079 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
3086 products->push_back(aNew);
3089 if (currentA == 1 && currentZ == 0) {
3091 }
else if (currentA == 1 && currentZ == 1) {
3093 }
else if (currentA == 2 && currentZ == 1) {
3095 }
else if (currentA == 3 && currentZ == 1) {
3097 }
else if (currentA == 3 && currentZ == 2) {
3099 }
else if (currentA == 4 && currentZ == 2) {
3105 if (fragment != 0) {
3112 products->push_back(theNew);
3117void G4BinaryCascade::PrintWelcomeMessage()
3119 G4cout <<
"Thank you for using G4BinaryCascade. "<<
G4endl;
3129 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
3131 G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding());
3132 if (std::abs(PDGcode)==211 || PDGcode==111 ) havePion=
true;
3135 if ( !products || havePion)
3138 G4cout <<
" Collision " << collision <<
", type: "<<
typeid(action).
name()
3139 <<
", with NO products! " <<
G4endl;
3156G4bool G4BinaryCascade::CheckChargeAndBaryonNumber(
G4String where)
3158 static G4int lastdA(0), lastdZ(0);
3165 std::vector<G4KineticTrack *>::iterator i;
3166 G4int CapturedA(0), CapturedZ(0);
3167 G4int secsA(0), secsZ(0);
3168 for ( i=theCapturedList.begin(); i!=theCapturedList.end(); ++i) {
3169 CapturedA += (*i)->GetDefinition()->GetBaryonNumber();
3170 CapturedZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
3173 for ( i=theSecondaryList.begin(); i!=theSecondaryList.end(); ++i) {
3175 secsA += (*i)->GetDefinition()->GetBaryonNumber();
3176 secsZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
3180 for ( i=theFinalState.begin(); i!=theFinalState.end(); ++i) {
3181 fStateA += (*i)->GetDefinition()->GetBaryonNumber();
3182 fStateZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
3185 G4int deltaA= iStateA - secsA - fStateA -currentA - lateA;
3186 G4int deltaZ= iStateZ - secsZ - fStateZ -currentZ - lateZ;
3188#ifdef debugCheckChargeAndBaryonNumberverbose
3189 G4cout << where <<
" A: iState= "<< iStateA<<
", secs= "<< secsA<<
", fState= "<< fStateA<<
", current= "<<currentA<<
", late= " <<lateA <<
G4endl;
3190 G4cout << where <<
" Z: iState= "<< iStateZ<<
", secs= "<< secsZ<<
", fState= "<< fStateZ<<
", current= "<<currentZ<<
", late= " <<lateZ <<
G4endl;
3193 if (deltaA != 0 || deltaZ!=0 ) {
3194 if (deltaA != lastdA || deltaZ != lastdZ ) {
3195 G4cout <<
"baryon/charge imbalance - " << where <<
G4endl
3196 <<
"deltaA " <<deltaA<<
", iStateA "<<iStateA<<
", CapturedA "<<CapturedA <<
", secsA "<<secsA
3197 <<
", fStateA "<<fStateA <<
", currentA "<<currentA <<
", lateA "<<lateA <<
G4endl
3198 <<
"deltaZ "<<deltaZ<<
", iStateZ "<<iStateZ<<
", CapturedZ "<<CapturedZ <<
", secsZ "<<secsZ
3199 <<
", fStateZ "<<fStateZ <<
", currentZ "<<currentZ <<
", lateZ "<<lateZ <<
G4endl<<
G4endl;
3203 }
else { lastdA=lastdZ=0;}
3212 PrintKTVector(collision->
GetPrimary(),std::string(
" Primary particle"));
3214 PrintKTVector(products,std::string(
" Scatterer products"));
3234 for (
unsigned int it=0; it < ktv.size(); it++)
3252 G4int product_barions(0);
3255 for (
unsigned int it=0; it < products->size(); it++)
3267 <<
" " <<
final <<
G4endl;;
3272 G4int finalA = currentA;
3273 G4int finalZ = currentZ;
3276 finalA -= product_barions;
3277 finalZ -= GetTotalCharge(*products);
3279 G4double delta = GetIonMass(currentZ,currentA) - (GetIonMass(finalZ,finalA) + mass_out);
3280 G4cout <<
" current/final a,z " << currentA <<
" " << currentZ <<
" "<< finalA<<
" "<< finalZ
3281 <<
" delta-mass " << delta<<
G4endl;
3283 mass_out = GetIonMass(finalZ,finalA);
3284 G4cout <<
" initE/ E_out/ Mfinal/ Excit " << currentInitialEnergy
3285 <<
" " <<
final <<
" "
3287 << currentInitialEnergy -
final - mass_out
3289 currentInitialEnergy-=
final;
3298 G4ReactionProductVector::iterator iter;
3306 for(iter = products->begin(); iter != products->end(); ++iter)
3309 G4cout <<
" Secondary E - Ekin / p " <<
3310 (*iter)->GetDefinition()->GetParticleName() <<
" " <<
3311 (*iter)->GetTotalEnergy() <<
" - " <<
3312 (*iter)->GetKineticEnergy()<<
" / " <<
3313 (*iter)->GetMomentum().x() <<
" " <<
3314 (*iter)->GetMomentum().y() <<
" " <<
3315 (*iter)->GetMomentum().z() <<
G4endl;
3316 Efinal += (*iter)->GetTotalEnergy();
3317 pFinal += (*iter)->GetMomentum();
3320 G4cout <<
"e outgoing/ total : " << Efinal <<
" " << Efinal+GetFinal4Momentum().
e()<<
G4endl;
3321 G4cout <<
"BIC E/p delta " <<
3322 (aTrack.
Get4Momentum().e()+theInitial4Mom.
e() - Efinal)/MeV <<
3339 std::vector<G4KineticTrack *>::iterator ktiter;
3340 for(ktiter = theSecondaryList.begin(); ktiter != theSecondaryList.end(); ++ktiter)
3343 G4cout <<
" Secondary E - Ekin / p " <<
3344 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3345 (*ktiter)->Get4Momentum().e() <<
" - " <<
3346 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3347 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3348 psecs += (*ktiter)->Get4Momentum();
3351 for(ktiter = theTargetList.begin(); ktiter != theTargetList.end(); ++ktiter)
3354 G4cout <<
" Target E - Ekin / p " <<
3355 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3356 (*ktiter)->Get4Momentum().e() <<
" - " <<
3357 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3358 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3359 ptgts += (*ktiter)->Get4Momentum();
3362 for(ktiter = theCapturedList.begin(); ktiter != theCapturedList.end(); ++ktiter)
3365 G4cout <<
" Captured E - Ekin / p " <<
3366 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3367 (*ktiter)->Get4Momentum().e() <<
" - " <<
3368 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3369 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3370 pcpts += (*ktiter)->Get4Momentum();
3373 for(ktiter = theFinalState.begin(); ktiter != theFinalState.end(); ++ktiter)
3376 G4cout <<
" Finals E - Ekin / p " <<
3377 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3378 (*ktiter)->Get4Momentum().e() <<
" - " <<
3379 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3380 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3381 pfins += (*ktiter)->Get4Momentum();
3384 G4cout <<
" Secondaries " << psecs <<
", Targets " << ptgts <<
G4endl
3385 <<
" Captured " << pcpts <<
", Finals " << pfins <<
G4endl
3386 <<
" Sum " << psecs + ptgts + pcpts + pfins <<
" PTransfer " << theMomentumTransfer
3387 <<
" Sum+PTransfer " << psecs + ptgts + pcpts + pfins + theMomentumTransfer
#define _CheckChargeAndBaryonNumber_(val)
#define _DebugEpConservation(val)
const G4DNABoundingBox initial
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
HepLorentzRotation inverse() const
HepLorentzRotation & set(double bx, double by, double bz)
Hep3Vector boostVector() const
static G4Alpha * AlphaDefinition()
virtual const std::vector< G4CollisionInitialState * > & GetCollisions(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &, G4double theCurrentTime)
virtual const std::vector< G4CollisionInitialState * > & GetCollisions(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &, G4double theCurrentTime)
virtual void PropagateModelDescription(std::ostream &) const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *, G4V3DNucleus *)
G4BinaryCascade(G4VPreCompoundModel *ptr=0)
virtual void ModelDescription(std::ostream &) const
virtual ~G4BinaryCascade()
G4KineticTrackVector & GetTargetCollection(void)
G4KineticTrackVector * GetFinalState()
const G4BCAction * GetGenerator()
G4int GetTargetBaryonNumber()
G4double GetCollisionTime(void)
G4KineticTrack * GetPrimary(void)
void AddCollision(G4double time, G4KineticTrack *proj, G4KineticTrack *target=nullptr)
void RemoveCollision(G4CollisionInitialState *collision)
void RemoveTracksCollisions(G4KineticTrackVector *ktv)
G4CollisionInitialState * GetNextCollision()
void Decay(G4KineticTrackVector *tracks) const
static G4Deuteron * DeuteronDefinition()
void ModelDescription(std::ostream &outFile) const
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState)
G4double GetFermiMomentum(G4double density)
void Init(G4int anA, G4int aZ)
void SetNumberOfCharged(G4int value)
const G4LorentzVector & GetMomentum() const
void SetCreatorModelID(G4int value)
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
void SetNumberOfParticles(G4int value)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
G4double GetWeightChange() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetGlobalTime() const
void SetParentResonanceDef(const G4ParticleDefinition *parentDef)
void SetTime(G4double aT)
void SetCreatorModelID(G4int id)
void SetParentResonanceID(const G4int parentID)
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
G4HadFinalState theParticleChange
void SetMinEnergy(G4double anEnergy)
const G4String & GetModelName() const
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
void SetMaxEnergy(const G4double anEnergy)
static G4HadronicParameters * Instance()
G4bool GetBinaryDebug() const
static G4He3 * He3Definition()
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
CascadeState SetState(const CascadeState new_state)
G4int GetParentResonanceID() const
G4int GetCreatorModelID() const
CascadeState GetState() const
void SetNucleon(G4Nucleon *aN)
void Set4Momentum(const G4LorentzVector &a4Momentum)
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetDefinition() const
G4bool IsParticipant() const
const G4LorentzVector & GetTrackingMomentum() const
void Update4Momentum(G4double aEnergy)
const G4ParticleDefinition * GetParentResonanceDef() const
const G4LorentzVector & Get4Momentum() const
G4double GetActualMass() const
static G4Neutron * NeutronDefinition()
static G4Neutron * Neutron()
G4bool GetPDGStable() const
G4bool IsShortLived() const
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
static G4int GetModelID(const G4int modelIndex)
static G4PionMinus * PionMinusDefinition()
static G4PionPlus * PionPlusDefinition()
static G4Proton * ProtonDefinition()
static G4Proton * Proton()
G4double GetField(G4int encoding, G4ThreeVector pos)
G4double GetBarrier(G4int encoding)
virtual void Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep)
G4ThreeVector GetMomentumTransfer() const
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
void SetParentResonanceDef(const G4ParticleDefinition *parentDef)
G4double GetTotalMomentum() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
void SetCreatorModelID(const G4int mod)
void SetNewlyAdded(const G4bool f)
G4ThreeVector GetMomentum() const
void SetKineticEnergy(const G4double en)
void SetParentResonanceID(const G4int parentID)
virtual G4KineticTrackVector * Scatter(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
static void ConstructParticle()
static G4Triton * TritonDefinition()
virtual G4double CoulombBarrier()=0
virtual G4double GetOuterRadius()=0
virtual const G4VNuclearDensity * GetNuclearDensity() const =0
virtual G4Nucleon * GetNextNucleon()=0
virtual G4int GetCharge()=0
virtual G4bool StartLoop()=0
virtual G4double GetMass()=0
virtual void Init(G4int theA, G4int theZ, G4int numberOfLambdas=0)=0
virtual G4int GetMassNumber()=0
virtual void Init(G4V3DNucleus *theNucleus)=0
G4VPreCompoundModel * theDeExcitation
G4V3DNucleus * the3DNucleus
G4VPreCompoundModel * GetDeExcitation() const
const G4HadProjectile * GetPrimaryProjectile() const
void SetDeExcitation(G4VPreCompoundModel *ptr)
G4double GetDensity(const G4ThreeVector &aPosition) const
virtual void DeExciteModelDescription(std::ostream &outFile) const =0
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
G4ExcitationHandler * GetExcitationHandler() const
SelectFromKTV(G4KineticTrackVector *out, G4KineticTrack::CascadeState astate)
void operator()(G4KineticTrack *&kt) const
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
G4double energy(const ThreeVector &p, const G4double m)
const char * name(G4int ptype)
G4bool nucleon(G4int ityp)