99 #define _CheckChargeAndBaryonNumber_(val) CheckChargeAndBaryonNumber(val)
102 #define _CheckChargeAndBaryonNumber_(val)
106 #define _DebugEpConservation(val) DebugEpConservation(val)
109 #define _DebugEpConservation(val)
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 ";
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 ";
235 outFile <<
"G4ExcitationHandler";
240 outFile <<
"void.\n";
257 if(getenv(
"BCDEBUG") )
G4cerr <<
" ######### Binary Cascade Reaction starts ######### "<<
G4endl;
262 if(initial4Momentum.e()-initial4Momentum.m()<
theBCminP &&
276 if(!getenv(
"I_Am_G4BinaryCascade_Developer") )
283 G4cerr <<
"You are trying to use G4BinaryCascade with " <<definition->GetParticleName()<<
" as projectile."<<
G4endl;
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;
286 G4cerr <<
"setenv I_Am_G4BinaryCascade_Developer 1 "<<G4endl<<
G4endl;
287 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade - used for unvalid particle type - Fatal");
297 G4int interactionCounter = 0,collisionLoopMaxCount;
314 collisionLoopMaxCount = 200;
320 kt =
new G4KineticTrack(definition, 0., initialPosition, initial4Momentum);
324 secondaries->push_back(kt);
332 }
while(! products && --collisionLoopMaxCount>0);
334 if(++interactionCounter>99)
break;
336 }
while(products && products->size() == 0);
338 if(products && products->size()>0)
344 G4ReactionProductVector::iterator iter;
346 for(iter = products->begin(); iter != products->end(); ++iter)
350 (*iter)->GetTotalEnergy(),
351 (*iter)->GetMomentum());
359 if(getenv(
"BCDEBUG") )
G4cerr <<
" ######### Binary Cascade Reaction void, return intial state ######### "<<
G4endl;
374 if(getenv(
"BCDEBUG") )
G4cerr <<
" ######### Binary Cascade Reaction ends ######### "<<
G4endl;
384 #ifdef debug_BIC_Propagate
385 G4cout <<
"G4BinaryCascade Propagate starting -------------------------------------------------------" <<
G4endl;
399 std::vector<G4KineticTrack *>::iterator iter;
410 #ifdef debug_BIC_GetExcitationEnergy
423 #ifdef debug_G4BinaryCascade
424 G4cout <<
"G4BinaryCascade::Propagate: warning - high energy model failed energy conservation, returning unchanged high energy final state" <<
G4endl;
442 #ifdef debug_BIC_return
452 G4bool haveProducts =
false;
453 G4int collisionCount=0;
454 G4int collisionLoopMaxCount=1000000;
470 #ifdef debug_BIC_Propagate_Collisions
471 G4cout <<
" NextCollision * , Time, curtime = " << nextCollision <<
" "
513 #ifdef debug_BIC_return
514 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
523 G4cout <<
"returned products: " << products->size() <<
G4endl;
544 #ifdef debug_BIC_return
551 #ifdef debug_BIC_Propagate
562 #ifdef debug_G4BinaryCascade
563 G4cerr <<
"G4BinaryCascade: Warning, have active particles at end" <<
G4endl;
576 #ifdef debug_G4BinaryCascade
577 G4cerr <<
" Warning: remove left over collision(s) " <<
G4endl;
582 #ifdef debug_BIC_Propagate_Excitation
599 #ifdef debug_BIC_Propagate_finals
601 G4cout <<
" Excitation Energy prefinal, #collisions:, out, captured "
602 << ExcitationEnergy <<
" "
603 << collisionCount <<
" "
608 if (ExcitationEnergy < 0 )
610 G4int maxtry=5, ntry=0;
614 }
while ( ++ntry < maxtry && ExcitationEnergy < 0 );
618 #ifdef debug_BIC_Propagate_finals
620 G4cout <<
" Excitation Energy final, #collisions:, out, captured "
621 << ExcitationEnergy <<
" "
622 << collisionCount <<
" "
628 if ( ExcitationEnergy < 0. )
630 #ifdef debug_G4BinaryCascade
631 G4cerr <<
"G4BinaryCascade-Warning: negative excitation energy ";
640 #ifdef debug_BIC_return
641 G4cout <<
" negative Excitation E return empty products " << products <<
G4endl;
664 #ifdef debug_BIC_return
678 #if defined(debug_G4BinaryCascade) || defined(debug_BIC_GetExcitationEnergy)
683 G4cerr <<
"G4BIC:GetExcitationEnergy(): Nucleon counting error current/final{A,Z} "
703 #ifdef debug_G4BinaryCascade
704 G4cout <<
"G4BinaryCascade::GetExcitationEnergy(): Warning - invalid nucleus (A,Z)=("
710 #ifdef debug_BIC_GetExcitationEnergy
731 #ifdef debug_BIC_GetExcitationEnergy
733 if ( excitationE < 0 )
735 G4cout <<
"negative ExE final Ion mass " <<nucleusMass<<
G4endl;
737 if(finalZ>.5)
G4cout <<
" Final nuclmom/mass " << Nucl_mom <<
" " << Nucl_mom.mag()
738 <<
" (A,Z)=("<< finalA <<
","<<finalZ <<
")"
739 <<
" mass " << nucleusMass <<
" "
740 <<
" excitE " << excitationE <<
G4endl;
749 G4cout <<
"GetExcitationEnergy: Initial nucleus A Z " << A <<
" " << Z <<
" " << initialExc <<
G4endl;
801 mom.setE( std::sqrt( mom.vect().mag2() +
sqr(definition->
GetPDGMass()) ) );
810 #ifdef debug_BIC_BuildTargetList
811 else {
G4cout <<
"nucleon is hit" << nucleon <<
G4endl;}
823 G4cerr <<
"G4BinaryCascade::BuildTargetList(): Fatal Error - invalid nucleus (A,Z)=("
829 #ifdef debug_BIC_BuildTargetList
830 G4cout <<
"G4BinaryCascade::BuildTargetList(): nucleus (A,Z)=("
843 std::vector<G4KineticTrack *>::iterator iter;
849 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
851 if((*iter)->GetFormationTime() < StartingTime)
852 StartingTime = (*iter)->GetFormationTime();
857 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
861 G4double FormTime = (*iter)->GetFormationTime() - StartingTime;
862 (*iter)->SetFormationTime(FormTime);
866 lateParticles4Momentum += (*iter)->GetTrackingMomentum();
867 lateA += (*iter)->GetDefinition()->GetBaryonNumber();
875 projectileA += (*iter)->GetDefinition()->GetBaryonNumber();
877 #ifdef debug_BIC_Propagate
878 G4cout <<
" Adding initial secondary " << *iter
879 <<
" time" << (*iter)->GetFormationTime()
880 <<
", state " << (*iter)->GetState() <<
G4endl;
894 #ifdef debug_BIC_GetExcitationEnergy
895 G4cout <<
"BIC: Proj.e, nucl initial, nucl final, lateParticles"
898 << lateParticles4Momentum <<
G4endl;
901 success = excitation > 0;
902 #ifdef debug_G4BinaryCascade
914 secondaries->clear();
957 std::vector<G4KineticTrack *>::iterator i;
964 precompoundProducts->push_back(aNew);
974 #ifdef debug_BIC_DeexcitationProducts
978 if ( precompoundProducts )
980 std::vector<G4ReactionProduct *>::iterator j;
981 for(j = precompoundProducts->begin(); j != precompoundProducts->end(); ++j)
984 Preco_momentum += pProduct;
987 G4cout <<
"finalNuclMom / sum preco products" << fragment_momentum <<
" / " << Preco_momentum
988 <<
" delta E "<< fragment_momentum.e() - Preco_momentum.e() <<
G4endl;
992 return precompoundProducts;
1003 std::vector<G4KineticTrack *>::iterator aNuc;
1005 std::vector<G4double> masses;
1012 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
1013 masses.push_back(mass);
1023 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
1024 masses.push_back(mass);
1035 if ( eCMS < sumMass )
1037 eCMS=sumMass + 2*
MeV*masses.size();
1038 finalP.setE(std::sqrt(finalP.vect().mag2() +
sqr(eCMS)));
1042 std::vector<G4LorentzVector*> * momenta=decay.
Decay(eCMS,masses);
1043 std::vector<G4LorentzVector*>::iterator aMom=momenta->begin();
1055 result->push_back(aNew);
1068 (*aNuc)->GetDefinition());
1071 result->push_back(aNew);
1087 #ifdef debug_BIC_Propagate_finals
1090 for(i = 0; i< fs.size(); i++)
1097 products->push_back(aNew);
1099 #ifdef debug_BIC_Propagate_finals
1109 #ifdef debug_BIC_Propagate_finals
1110 G4cout <<
" Final state momentum " << mom_fs <<
G4endl;
1121 if ( precompoundProducts )
1123 std::vector<G4ReactionProduct *>::iterator j;
1124 for(j = precompoundProducts->begin(); j != precompoundProducts->end(); ++j)
1129 #ifdef debug_BIC_Propagate_finals
1130 G4cout <<
"BIC: pProduct be4 boost " <<pProduct <<
G4endl;
1133 #ifdef debug_BIC_Propagate_finals
1134 G4cout <<
"BIC: pProduct aft boost " <<pProduct <<
G4endl;
1136 pSumPreco += pProduct;
1137 (*j)->SetTotalEnergy(pProduct.e());
1138 (*j)->SetMomentum(pProduct.vect());
1139 (*j)->SetNewlyAdded(
true);
1140 products->push_back(*j);
1144 precompoundProducts->clear();
1145 delete precompoundProducts;
1153 for(std::vector<G4KineticTrack *>::iterator i = secondaries->begin();
1154 i != secondaries->end(); ++i)
1156 for(std::vector<G4BCAction *>::iterator j =
theImR.begin();
1160 const std::vector<G4CollisionInitialState *> & aCandList
1162 for(
size_t count=0; count<aCandList.size(); count++)
1177 const std::vector<G4CollisionInitialState *> & aCandList
1179 for(
size_t count=0; count<aCandList.size(); count++)
1196 }
else if ( tout > 0 )
1209 #ifdef debug_BIC_FindCollision
1210 G4cout <<
"FindLateP Particle, 4-mom, times newState "
1213 <<
" times " << tin <<
" " << tout <<
" "
1217 const std::vector<G4CollisionInitialState *> & aCandList
1219 for(
size_t count=0; count<aCandList.size(); count++)
1221 #ifdef debug_BIC_FindCollision
1222 G4cout <<
" Adding a late Col : " << aCandList[count] <<
G4endl;
1235 #ifdef debug_BIC_ApplyCollision
1236 G4cerr <<
"G4BinaryCascade::ApplyCollision start"<<
G4endl;
1242 G4bool haveTarget=target_collection.size()>0;
1245 #ifdef debug_G4BinaryCascade
1246 G4cout <<
"G4BinaryCasacde::ApplyCollision(): StateError " << primary <<
G4endl;
1248 PrintKTVector(&target_collection,std::string(
"... targets"));
1268 G4int initialBaryon(0);
1269 G4int initialCharge(0);
1283 #ifdef debug_BIC_ApplyCollision
1290 G4bool lateParticleCollision= (!haveTarget) && products && products->size() == 1;
1291 G4bool decayCollision= (!haveTarget) && products && products->size() > 1;
1295 #ifdef debug_G4BinaryCascade
1296 G4int lateBaryon(0), lateCharge(0);
1299 if ( lateParticleCollision )
1303 #ifdef debug_G4BinaryCascade
1304 lateBaryon = initialBaryon;
1305 lateCharge = initialCharge;
1307 initialBaryon=initialCharge=0;
1314 if (!lateParticleCollision)
1318 #ifdef debug_BIC_ApplyCollision
1319 if (products)
G4cout <<
" ======Failed Pauli =====" <<
G4endl;
1320 G4cerr <<
"G4BinaryCascade::ApplyCollision blocked"<<
G4endl;
1334 #ifdef debug_BIC_ApplyCollision
1346 G4int finalBaryon(0);
1347 G4int finalCharge(0);
1349 for(std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
1351 if ( ! lateParticleCollision )
1353 (*i)->SetState(primary->
GetState());
1355 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber();
1356 finalCharge+=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus);
1360 tin < 0 && tout > 0 )
1363 G4cout <<
"tin tout: " << tin <<
" " << tout <<
G4endl;
1375 else if ( tout > 0 )
1378 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber();
1379 finalCharge+=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus);
1384 toFinalState.push_back((*i));
1390 toFinalState.push_back((*i));
1395 if(!toFinalState.empty())
1398 toFinalState.begin(),toFinalState.end());
1399 std::vector<G4KineticTrack *>::iterator iter1, iter2;
1400 for(iter1 = toFinalState.begin(); iter1 != toFinalState.end();
1403 iter2 = std::find(products->begin(), products->end(),
1405 if ( iter2 != products->end() ) products->erase(iter2);
1411 currentA += finalBaryon-initialBaryon;
1412 currentZ += finalCharge-initialCharge;
1416 oldSecondaries.push_back(primary);
1419 #ifdef debug_G4BinaryCascade
1420 if ( (finalBaryon-initialBaryon-lateBaryon) != 0 || (finalCharge-initialCharge-lateCharge) != 0 )
1422 G4cout <<
"G4BinaryCascade: Error in Balancing: " <<
G4endl;
1423 G4cout <<
"initial/final baryon number, initial/final Charge "
1424 << initialBaryon <<
" "<< finalBaryon <<
" "
1425 << initialCharge <<
" "<< finalCharge <<
" "
1427 <<
", with number of products: "<< products->size() <<
G4endl;
1428 G4cout << G4endl<<
"Initial condition are these:"<<
G4endl;
1441 for(
size_t ii=0; ii< oldTarget.size(); ii++)
1443 oldTarget[ii]->Hit();
1464 std::vector<G4KineticTrack *>::iterator iter;
1474 absorbList.push_back(kt);
1479 if(absorbList.empty())
1483 for(iter = absorbList.begin(); iter != absorbList.end(); ++iter)
1487 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1490 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1493 G4int maxLoopCount = 1000;
1499 "G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1501 if ( --maxLoopCount < 0 )
throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1506 toRemove.push_back(kt);
1507 toDelete.push_back(kt);
1525 std::vector<G4KineticTrack *>::iterator i;
1530 G4int particlesAboveCut=0;
1531 G4int particlesBelowCut=0;
1550 ++particlesBelowCut;
1558 if (verbose)
G4cout <<
"Capture particlesAboveCut,particlesBelowCut, capturedEnergy,capturedEnergy/particlesBelowCut <? 0.2*theCutOnP "
1559 << particlesAboveCut <<
" " << particlesBelowCut <<
" " << capturedEnergy
1563 if(particlesBelowCut>0 && capturedEnergy/particlesBelowCut<0.2*
theCutOnP)
1574 captured.push_back(kt);
1595 fermiMom.
Init(A, Z);
1599 G4KineticTrackVector::iterator i;
1606 for(i = products->begin(); i != products->end(); ++i)
1608 definition = (*i)->GetDefinition();
1634 if(mom.e() < eFermi )
1643 #ifdef debug_BIC_CheckPauli
1646 for(i = products->begin(); i != products->end(); ++i)
1648 definition = (*i)->GetDefinition();
1657 if ( mom.e()-mom.mag()+field > 160*
MeV )
1659 G4cout <<
"momentum problem pFermi=" << pFermi
1660 <<
" mom, mom.m " << mom <<
" " << mom.mag()
1661 <<
" field " << field <<
G4endl;
1685 std::vector<G4KineticTrack *>::iterator i;
1695 #ifdef debug_BIC_StepParticlesOut
1696 G4cout <<
" minTimeStep, tStep Particle " <<minTimeStep <<
" " <<tStep
1702 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::StepParticlesOut() particle not in nucleus");
1705 if(intersect && tStep<minTimeStep && tStep> 0 )
1707 minTimeStep = tStep;
1711 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::StepParticlesOut() particle not in nucleus");
1724 if ( timeToCollision > minTimeStep )
1754 #ifdef debug_G4BinaryCascade
1755 G4cerr <<
"G4BinaryCascade.cc: Warning - aborting looping particle(s)" <<
G4endl;
1760 std::vector<G4KineticTrack *>::iterator iter;
1779 #ifdef debug_BIC_StepParticlesOut
1785 #ifdef debug_BIC_StepParticlesOut
1796 #ifdef debug_BIC_return
1797 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
1830 if ( std::abs(PDGcode) > 1000 && PDGcode != 2112 && PDGcode != 2212 )
1837 std::vector<G4KineticTrack *>::iterator titer;
1838 for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer)
1856 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
1858 G4int PDGcode=(*i)->GetDefinition()->GetPDGEncoding();
1861 if ( std::abs(PDGcode) > 1000 && PDGcode != 2112 && PDGcode != 2212 )
1863 resonances.push_back(*i);
1866 if ( resonances.size() > 0 )
1868 G4double delta_Fermi= (initial_Efermi-final_Efermi)/resonances.size();
1869 for (std::vector<G4KineticTrack *>::iterator res=resonances.begin(); res != resonances.end(); res++)
1873 G4double newEnergy=mom.e() + delta_Fermi;
1874 G4double newEnergy2= newEnergy*newEnergy;
1876 if ( newEnergy2 < mass2 )
1880 G4ThreeVector mom3=std::sqrt(newEnergy2 - mass2) * mom.vect().unit();
1898 #ifdef debug_BIC_CorrectFinalPandE
1904 G4KineticTrackVector::iterator i;
1906 if ( pNucleus.e() == 0 )
return;
1907 #ifdef debug_BIC_CorrectFinalPandE
1914 pFinals += (*i)->Get4Momentum();
1916 #ifdef debug_BIC_CorrectFinalPandE
1917 G4cout <<
"CorrectFinalPandE a final " << (*i)->GetDefinition()->GetParticleName()
1918 <<
" 4mom " << (*i)->Get4Momentum()<<
G4endl;
1921 #ifdef debug_BIC_CorrectFinalPandE
1922 G4cout <<
"CorrectFinalPandE pN pF: " <<pNucleus <<
" " <<pFinals <<
G4endl;
1928 #ifdef debug_BIC_CorrectFinalPandE
1929 G4cout <<
"CorrectFinalPandE pCM, CMS pCM " << pCM <<
" " <<toCMS*pCM<<
G4endl;
1930 G4cout <<
"CorrectFinal CMS pN pF " <<toCMS*pNucleus <<
" "
1933 <<
" massInNucleus m(nucleus) m(finals) std::sqrt(s): " <<
massInNucleus <<
" " <<pNucleus.mag()<<
" "
1934 << pFinals.mag() <<
" " << pCM.mag() <<
G4endl;
1942 if( s0-(m10+m20)*(m10+m20) < 0 )
1944 #ifdef debug_BIC_CorrectFinalPandE
1945 G4cout <<
"G4BinaryCascade::CorrectFinalPandE() : error! " <<
G4endl;
1947 G4cout <<
"not enough mass to correct: mass^2, A,Z, mass(nucl), mass(finals) "
1948 << (s0-(m10+m20)*(m10+m20)) <<
" "
1950 << m10 <<
" " << m20
1960 G4double pInCM = std::sqrt((s0-(m10+m20)*(m10+m20))*(s0-(m10-m20)*(m10-m20))/(4.*s0));
1961 #ifdef debug_BIC_CorrectFinalPandE
1962 G4cout <<
" CorrectFinalPandE pInCM new, CURRENT, ratio : " << pInCM
1963 <<
" " << (pFinals).vect().mag()<<
" " << pInCM/(pFinals).vect().mag() <<
G4endl;
1965 if ( pFinals.vect().mag() > pInCM )
1975 G4ThreeVector p3(factor*(toCMS*(*i)->Get4Momentum()).vect());
1976 G4LorentzVector p(p3,std::sqrt((*i)->Get4Momentum().mag2() + p3.mag2()));
1979 #ifdef debug_BIC_CorrectFinalPandE
1982 (*i)->Set4Momentum(p);
1984 #ifdef debug_BIC_CorrectFinalPandE
1987 <<
" CMS pFinals , mag, 3.mag : " << qFinals <<
" " << qFinals.mag() <<
" " << qFinals.vect().mag()<<
G4endl;
1988 G4cerr <<
" -CorrectFinalPandE 5 " << factor <<
G4endl;
1991 #ifdef debug_BIC_CorrectFinalPandE
1992 else {
G4cerr <<
" -CorrectFinalPandE 6 - no correction done" <<
G4endl; }
2004 std::vector<G4KineticTrack *>::iterator iter1, iter2;
2009 if(!oldSecondaries->empty())
2011 for(iter1 = oldSecondaries->begin(); iter1 != oldSecondaries->end();
2026 if(oldTarget->size()!=0)
2030 for(iter1 = oldTarget->begin(); iter1 != oldTarget->end(); ++iter1)
2042 if(!newSecondaries->empty())
2045 for(iter1 = newSecondaries->begin(); iter1 != newSecondaries->end();
2072 ktv(out), wanted_state(astate)
2076 if ( (kt)->GetState() == wanted_state ) ktv->push_back(kt);
2087 #ifdef debug_BIC_DoTimeStep
2090 G4cerr <<
"G4BinaryCascade::DoTimeStep: enter step="<< theTimeStep
2097 std::vector<G4KineticTrack *>::iterator iter;
2110 #ifdef debug_BIC_DoTimeStep
2123 #ifdef debug_BIC_DoTimeStep
2133 std::for_each( kt_outside->begin(),kt_outside->end(),
2140 std::for_each( kt_inside->begin(),kt_inside->end(),
2150 kt_gone_in->clear();
2151 std::for_each( kt_outside->begin(),kt_outside->end(),
2154 kt_gone_out->clear();
2155 std::for_each( kt_inside->begin(),kt_inside->end(),
2158 #ifdef debug_BIC_DoTimeStep
2159 PrintKTVector(fail,std::string(
" Failed to go in/out -> miss_nucleus/captured"));
2160 PrintKTVector(kt_gone_in, std::string(
"recreated kt_gone_in"));
2161 PrintKTVector(kt_gone_out, std::string(
"recreated kt_gone_out"));
2167 std::for_each( kt_outside->begin(),kt_outside->end(),
2170 std::for_each( kt_outside->begin(),kt_outside->end(),
2173 #ifdef debug_BIC_DoTimeStep
2174 PrintKTVector(kt_gone_out, std::string(
"append gone_outs to final state.. theFinalState"));
2178 kt_gone_out->begin(),kt_gone_out->end());
2190 if (kt_gone_out->size() )
2193 iter = std::find(kt_gone_out->begin(),kt_gone_out->end(),nextPrimary);
2194 if ( iter != kt_gone_out->end() )
2197 #ifdef debug_BIC_DoTimeStep
2198 G4cout <<
" DoTimeStep - WARNING: deleting current collision!" <<
G4endl;
2202 if ( kt_captured->size() )
2205 iter = std::find(kt_captured->begin(),kt_captured->end(),nextPrimary);
2206 if ( iter != kt_captured->end() )
2209 #ifdef debug_BIC_DoTimeStep
2210 G4cout <<
" DoTimeStep - WARNING: deleting current collision!" <<
G4endl;
2220 if ( kt_captured->size() )
2223 kt_captured->begin(),kt_captured->end());
2227 std::vector<G4KineticTrack *>::iterator i_captured;
2228 for(i_captured=kt_captured->begin();i_captured!=kt_captured->end();i_captured++)
2230 (*i_captured)->Hit();
2236 #ifdef debug_G4BinaryCascade
2246 <<
" sum(tgt,capt,active) "
2276 std::vector<G4KineticTrack *>::iterator iter;
2281 G4int secondaries_in(0);
2282 G4int secondaryBarions_in(0);
2283 G4int secondaryCharge_in(0);
2286 for ( iter =in->begin(); iter != in->end(); ++iter)
2289 secondaryCharge_in +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/
eplus);
2290 if ((*iter)->GetDefinition()->GetBaryonNumber()!=0 )
2292 secondaryBarions_in += (*iter)->GetDefinition()->GetBaryonNumber();
2296 secondaryMass_in += (*iter)->GetDefinition()->GetPDGMass();
2312 G4double correction= secondaryMass_in + mass_initial - mass_final;
2313 if (secondaries_in>1)
2314 {correction /= secondaries_in;}
2316 #ifdef debug_BIC_CorrectBarionsOnBoundary
2317 G4cout <<
"CorrectBarionsOnBoundary,currentZ,currentA,"
2318 <<
"secondaryCharge_in,secondaryBarions_in,"
2319 <<
"energy correction,m_secondry,m_nucl_init,m_nucl_final "
2321 << secondaryCharge_in<<
" "<<secondaryBarions_in<<
" "
2322 << correction <<
" "
2323 << secondaryMass_in <<
" "
2324 << mass_initial <<
" "
2325 << mass_final <<
" "
2329 for ( iter = in->begin(); iter != in->end(); ++iter)
2331 if ((*iter)->GetTrackingMomentum().e()+correction > (*iter)->GetActualMass())
2333 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + correction);
2340 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + barrier);
2342 kt_fail->push_back(*iter);
2344 currentA -= (*iter)->GetDefinition()->GetBaryonNumber();
2349 #ifdef debug_BIC_CorrectBarionsOnBoundary
2350 G4cout <<
" CorrectBarionsOnBoundary, aft, Z, A, sec-Z,A,m,m_in_nucleus "
2352 << secondaryCharge_in <<
" " << secondaryBarions_in <<
" "
2353 << secondaryMass_in <<
" "
2362 G4int secondaries_out(0);
2363 G4int secondaryBarions_out(0);
2364 G4int secondaryCharge_out(0);
2367 for ( iter =out->begin(); iter != out->end(); ++iter)
2370 secondaryCharge_out +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/
eplus);
2371 if ((*iter)->GetDefinition()->GetBaryonNumber() !=0 )
2373 secondaryBarions_out += (*iter)->GetDefinition()->GetBaryonNumber();
2377 secondaryMass_out += (*iter)->GetDefinition()->GetPDGMass();
2395 G4cerr <<
"G4BinaryCascade - secondaryBarions_out,secondaryCharge_out " <<
2396 secondaryBarions_out <<
" " << secondaryCharge_out <<
G4endl;
2401 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::CorrectBarionsOnBoundary() - fatal error");
2404 G4double correction= mass_initial - mass_final - secondaryMass_out;
2407 if (secondaries_out>1) correction /= secondaries_out;
2408 #ifdef debug_BIC_CorrectBarionsOnBoundary
2409 G4cout <<
"DoTimeStep,(current Z,A),"
2410 <<
"(secondaries out,Charge,Barions),"
2411 <<
"* energy correction,(m_secondry,m_nucl_init,m_nucl_final) "
2413 << secondaries_out <<
","
2414 << secondaryCharge_out<<
","<<secondaryBarions_out<<
") * "
2415 << correction <<
" ("
2416 << secondaryMass_out <<
", "
2417 << mass_initial <<
", "
2418 << mass_final <<
")"
2423 for ( iter = out->begin(); iter != out->end(); ++iter)
2425 if ((*iter)->GetTrackingMomentum().e()+correction > (*iter)->GetActualMass())
2427 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + correction);
2438 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() - barrier);
2440 kt_fail->push_back(*iter);
2442 currentA += (*iter)->GetDefinition()->GetBaryonNumber();
2444 #ifdef debug_BIC_CorrectBarionsOnBoundary
2447 G4cout <<
"Not correcting outgoing " << *iter <<
" "
2448 << (*iter)->GetDefinition()->GetPDGEncoding() <<
" "
2449 << (*iter)->GetDefinition()->GetParticleName() <<
G4endl;
2450 PrintKTVector(out,std::string(
"outgoing, one not corrected"));
2456 #ifdef debug_BIC_CorrectBarionsOnBoundary
2458 G4cout <<
" DoTimeStep, nucl-update, A, Z, sec-Z,A,m,m_in_nucleus, table-mass, delta "
2460 << secondaryCharge_out <<
" "<< secondaryBarions_out <<
" "<<
2461 secondaryMass_out <<
" "
2479 #ifdef debug_BIC_FindFragments
2480 G4cout <<
"target, captured, secondary: "
2489 G4KineticTrackVector::iterator i;
2492 if(
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus) == 1 )
2498 G4int zCaptured = 0;
2502 CapturedMomentum += (*i)->Get4Momentum();
2503 if(
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus) == 1 )
2509 G4int z = zTarget+zCaptured;
2511 #ifdef debug_G4BinaryCascade
2514 G4cout <<
" FindFragment Counting error z a " << z <<
" " <<a <<
" "
2532 if ( z < 1 )
return 0;
2536 #ifdef debug_BIC_FindFragments
2537 G4cout <<
"Fragment: a= " << a <<
" z= " << z <<
" particles= " << excitons
2538 <<
" Charged= " << zCaptured <<
" holes= " << holes
2565 final4Momentum -= (*i)->Get4Momentum();
2566 finals += (*i)->Get4Momentum();
2569 if(final4Momentum.e()> 0 && (final4Momentum.vect()/final4Momentum.e()).mag()>1.0 &&
currentA > 0)
2571 #ifdef debug_BIC_Final4Momentum
2573 G4cerr <<
"G4BinaryCascade::GetFinal4Momentum - Fatal"<<
G4endl;
2574 G4KineticTrackVector::iterator i;
2575 G4cerr <<
"Total initial 4-momentum " << theProjectile4Momentum <<
G4endl;
2579 G4cerr <<
" Final state: "<<(*i)->Get4Momentum()<<(*i)->GetDefinition()->GetParticleName()<<
G4endl;
2582 G4cerr<<
" Final4Momentum = "<<final4Momentum <<
" "<<final4Momentum.m()<<
G4endl;
2589 return final4Momentum;
2600 G4KineticTrackVector::iterator i;
2604 CapturedMomentum += (*i)->Get4Momentum();
2610 if ( NucleusMomentum.e() > 0 )
2614 G4ThreeVector boost= (NucleusMomentum.vect() -CapturedMomentum.vect())/NucleusMomentum.e();
2615 if(boost.mag2()>1.0)
2617 # ifdef debug_BIC_FinalNucleusMomentum
2618 G4cerr <<
"G4BinaryCascade::GetFinalNucleusMomentum - Fatal"<<
G4endl;
2620 G4cerr <<
"it 01"<<NucleusMomentum<<
" "<<CapturedMomentum<<
" "<<
G4endl;
2621 G4cout <<
" testing boost "<<boost<<
" "<<boost.mag()<<
G4endl;
2628 #ifdef debug_debug_BIC_FinalNucleusMomentum
2629 G4cout <<
"GetFinalNucleusMomentum be4 boostNucleusMomentum, CapturedMomentum"<<NucleusMomentum<<
" "<<CapturedMomentum<<
" "<<
G4endl;
2631 NucleusMomentum *= nucleusBoost;
2632 #ifdef debug_BIC_FinalNucleusMomentum
2633 G4cout <<
"GetFinalNucleusMomentum aft boost GetFinal4Momentum= " <<NucleusMomentum <<
G4endl;
2636 return NucleusMomentum;
2653 std::vector<G4KineticTrack *>::iterator iter, jter;
2658 while(!done && tryCount++ <200)
2666 #ifdef debug_H1_BinaryCascade
2669 for(
size_t ss=0; secs && ss<secs->size(); ss++)
2672 if((*secs)[ss]->GetDefinition()->IsShortLived()) done =
true;
2680 for(
size_t current=0; secs && current<secs->size(); current++)
2682 if((*secs)[current]->GetDefinition()->IsShortLived())
2686 for(jter=dec->begin(); jter != dec->end(); jter++)
2689 secs->push_back(*jter);
2692 delete (*secs)[current];
2704 #ifdef debug_H1_BinaryCascade
2713 products->push_back(aNew);
2714 #ifdef debug_H1_BinaryCascade
2719 G4cout <<
"final shortlived : ";
2722 G4cout <<
"final un stable : ";
2745 o1= mom.orthogonal();
2754 }
while (
sqr(x1) +
sqr(x2) > 1.);
2756 return G4ThreeVector(r*(x1*o1.unit() + x2*o2.unit() - 1.5* mom.unit()));
2780 std::vector<G4KineticTrack *>::iterator i;
2781 for(i = ktv->begin(); i != ktv->end(); ++i)
2790 std::vector<G4ReactionProduct *>::iterator i;
2791 for(i = rpv->begin(); i != rpv->end(); ++i)
2800 if (comment.size() > 0 )
G4cout <<
"G4BinaryCascade::PrintKTVector() " << comment <<
G4endl;
2802 G4cout <<
" vector: " << ktv <<
", number of tracks: " << ktv->size()
2804 std::vector<G4KineticTrack *>::iterator i;
2807 for(count = 0, i = ktv->begin(); i != ktv->end(); ++i, ++count)
2810 G4cout <<
" track n. " << count;
2814 G4cout <<
"G4BinaryCascade::PrintKTVector():No KineticTrackVector given " <<
G4endl;
2821 if (comment.size() > 0 )
G4cout <<
"G4BinaryCascade::PrintKTVector() "<< comment <<
G4endl;
2829 << 1/
fermi*pos <<
" R: " << 1/
fermi*pos.mag() <<
" 4mom: "
2830 << 1/
MeV*mom <<
"Tr_mom" << 1/
MeV*tmom <<
" P: " << 1/
MeV*mom.vect().mag()
2834 G4cout <<
"G4BinaryCascade::PrintKTVector(): No Kinetictrack given" <<
G4endl;
2844 if ( Z > 0 && A >= Z )
2848 }
else if ( A > 0 && Z>0 )
2853 }
else if ( A >= 0 && Z<=0 )
2858 }
else if ( A == 0 )
2865 G4cerr <<
"G4BinaryCascade::GetIonMass() - invalid (A,Z) = ("
2866 << A <<
"," << Z <<
")" <<
G4endl;
2867 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::GetIonMass() - giving up");
2878 std::vector<G4KineticTrack *>::iterator iter;
2879 std::vector<G4ReactionProduct *>::iterator rpiter;
2885 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2887 Esecondaries +=(*iter)->Get4Momentum().e();
2888 psecondaries +=(*iter)->Get4Momentum();
2891 products->push_back(aNew);
2903 if ( lates->size() == 1 ) {
2913 products->push_back(aNew);
2935 (*iter)->Update4Momentum((*iter)->Get4Momentum().vect()+transferCorrection);
2936 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2938 Esecondaries +=(*iter)->Get4Momentum().e();
2939 psecondaries +=(*iter)->Get4Momentum();
2941 products->push_back(aNew);
2948 (*iter)->Update4Momentum((*iter)->Get4Momentum().vect()+transferCorrection);
2949 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2951 Esecondaries +=(*iter)->Get4Momentum().e();
2952 psecondaries +=(*iter)->Get4Momentum();
2954 products->push_back(aNew);
2961 SumMassNucleons += (*iter)->GetDefinition()->GetPDGMass();
2962 pNucleons += (*iter)->Get4Momentum();
2966 #ifdef debug_BIC_FillVoidnucleus
2968 psecondaries - pNucleons;
2978 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
2979 TotalEkin+=(*rpiter)->GetKineticEnergy();
2982 if ( std::abs(Ekinetic) < 20*
perCent * TotalEkin ){
2983 correction=1. + (Ekinetic-Ekineticrdm)/TotalEkin;
2985 #ifdef debug_G4BinaryCascade
2987 G4cout <<
"BLIC::FillVoidNucleus() fail correction, Ekinetic, TotalEkin " << Ekinetic <<
""<< TotalEkin <<
G4endl;
2991 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
2992 (*rpiter)->SetKineticEnergy((*rpiter)->GetKineticEnergy()*correction);
2993 (*rpiter)->SetMomentum((*rpiter)->GetTotalMomentum() * (*rpiter)->GetMomentum().unit());
2997 Ekinetic=Ekineticrdm*correction;
3009 products->push_back(aNew);
3014 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
3015 psecondaries +=
G4LorentzVector((*rpiter)->GetMomentum(),(*rpiter)->GetTotalEnergy() );
3027 SumMom=initial4Mom.vect()-SumMom;
3030 std::vector<G4ReactionProduct *>::reverse_iterator
reverse;
3031 while ( SumMom.mag() > 0.1*
MeV && loopcount++ < 10)
3033 G4int index=products->size();
3034 for (reverse=products->rbegin(); reverse!=products->rend(); ++
reverse, --index){
3035 SumMom=initial4Mom.vect();
3036 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
3037 SumMom-=(*rpiter)->GetMomentum();
3040 G4double p=((*reverse)->GetMomentum()).mag();
3041 (*reverse)->SetMomentum( p*(((*reverse)->GetMomentum()+SumMom).unit()));
3052 std::vector<G4KineticTrack *>::iterator iter;
3053 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
3056 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
3060 products->push_back(aNew);
3079 if (fragment != 0) {
3085 products->push_back(theNew);
3092 G4cout <<
"Thank you for using G4BinaryCascade. "<<
G4endl;
3102 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
3104 G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding());
3105 if (std::abs(PDGcode)==211 || PDGcode==111 ) havePion=
true;
3108 if ( !products || havePion)
3111 G4cout <<
" Collision " << collision <<
", type: "<<
typeid(action).
name()
3112 <<
", with NO products! " <<
G4endl;
3113 G4cout << G4endl<<
"Initial condition are these:"<<
G4endl;
3131 static G4int lastdA(0), lastdZ(0);
3138 std::vector<G4KineticTrack *>::iterator i;
3139 G4int CapturedA(0), CapturedZ(0);
3140 G4int secsA(0), secsZ(0);
3142 CapturedA += (*i)->GetDefinition()->GetBaryonNumber();
3143 CapturedZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus);
3148 secsA += (*i)->GetDefinition()->GetBaryonNumber();
3149 secsZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus);
3154 fStateA += (*i)->GetDefinition()->GetBaryonNumber();
3155 fStateZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/
eplus);
3161 #ifdef debugCheckChargeAndBaryonNumberverbose
3162 G4cout << where <<
" A: iState= "<< iStateA<<
", secs= "<< secsA<<
", fState= "<< fStateA<<
", current= "<<
currentA<<
", late= " <<lateA <<
G4endl;
3163 G4cout << where <<
" Z: iState= "<< iStateZ<<
", secs= "<< secsZ<<
", fState= "<< fStateZ<<
", current= "<<
currentZ<<
", late= " <<lateZ <<
G4endl;
3166 if (deltaA != 0 || deltaZ!=0 ) {
3167 if (deltaA != lastdA || deltaZ != lastdZ ) {
3168 G4cout <<
"baryon/charge imbalance - " << where << G4endl
3169 <<
"deltaA " <<deltaA<<
", iStateA "<<iStateA<<
", CapturedA "<<CapturedA <<
", secsA "<<secsA
3170 <<
", fStateA "<<fStateA <<
", currentA "<<
currentA <<
", lateA "<<lateA << G4endl
3171 <<
"deltaZ "<<deltaZ<<
", iStateZ "<<iStateZ<<
", CapturedZ "<<CapturedZ <<
", secsZ "<<secsZ
3172 <<
", fStateZ "<<fStateZ <<
", currentZ "<<
currentZ <<
", lateZ "<<lateZ << G4endl<<
G4endl;
3176 }
else { lastdA=lastdZ=0;}
3204 <<
" " << initial <<
G4endl;;
3207 for (
unsigned int it=0; it < ktv.size(); it++)
3220 <<
" " << initial <<
" Excit " << thisExcitation <<
G4endl;;
3225 G4int product_barions(0);
3228 for (
unsigned int it=0; it < products->size(); it++)
3240 <<
" " <<
final <<
G4endl;;
3249 finalA -= product_barions;
3254 <<
" delta-mass " << delta<<
G4endl;
3258 <<
" " <<
final <<
" "
3271 G4ReactionProductVector::iterator iter;
3279 for(iter = products->begin(); iter != products->end(); ++iter)
3282 G4cout <<
" Secondary E - Ekin / p " <<
3283 (*iter)->GetDefinition()->GetParticleName() <<
" " <<
3284 (*iter)->GetTotalEnergy() <<
" - " <<
3285 (*iter)->GetKineticEnergy()<<
" / " <<
3286 (*iter)->GetMomentum().x() <<
" " <<
3287 (*iter)->GetMomentum().y() <<
" " <<
3288 (*iter)->GetMomentum().z() <<
G4endl;
3289 Efinal += (*iter)->GetTotalEnergy();
3290 pFinal += (*iter)->GetMomentum();
3294 G4cout <<
"BIC E/p delta " <<
3312 std::vector<G4KineticTrack *>::iterator ktiter;
3316 G4cout <<
" Secondary E - Ekin / p " <<
3317 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3318 (*ktiter)->Get4Momentum().e() <<
" - " <<
3319 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3320 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3321 psecs += (*ktiter)->Get4Momentum();
3327 G4cout <<
" Target E - Ekin / p " <<
3328 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3329 (*ktiter)->Get4Momentum().e() <<
" - " <<
3330 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3331 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3332 ptgts += (*ktiter)->Get4Momentum();
3338 G4cout <<
" Captured E - Ekin / p " <<
3339 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3340 (*ktiter)->Get4Momentum().e() <<
" - " <<
3341 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3342 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3343 pcpts += (*ktiter)->Get4Momentum();
3349 G4cout <<
" Finals E - Ekin / p " <<
3350 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3351 (*ktiter)->Get4Momentum().e() <<
" - " <<
3352 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3353 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3354 pfins += (*ktiter)->Get4Momentum();
3357 G4cout <<
" Secondaries " << psecs <<
", Targets " << ptgts << G4endl
3358 <<
" Captured " << pcpts <<
", Finals " << pfins << G4endl
G4double GetWeightChange() const
void FindDecayCollision(G4KineticTrack *)
G4VFieldPropagation * thePropagator
G4bool IsParticipant() const
static G4Triton * TritonDefinition()
G4bool Capture(G4bool verbose=false)
void DebugApplyCollisionFail(G4CollisionInitialState *collision, G4KineticTrackVector *products)
void Update4Momentum(G4double aEnergy)
G4KineticTrackVector theFinalState
static G4He3 * He3Definition()
void ModelDescription(std::ostream &outFile) const
CascadeState GetState() const
G4double GetTotalMomentum() const
const G4LorentzVector & GetMomentum() const
G4double initial_nuclear_mass
virtual G4int GetCharge()=0
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepLorentzRotation G4LorentzRotation
const G4HadProjectile * GetPrimaryProjectile() const
virtual G4ReactionProductVector * DeExcite(G4Fragment &aFragment)=0
G4ReactionProductVector * ProductsAddFinalState(G4ReactionProductVector *products, G4KineticTrackVector &finalState)
const G4ThreeVector & GetPosition() const
virtual G4bool StartLoop()=0
G4LorentzVector theInitial4Mom
G4VPreCompoundModel * GetDeExcitation() const
std::vector< ExP01TrackerHit * > a
virtual void Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep)=0
void SetKineticEnergy(const G4double en)
void RemoveCollision(G4CollisionInitialState *collision)
virtual const G4VNuclearDensity * GetNuclearDensity() const =0
G4LorentzRotation precompoundLorentzboost
G4KineticTrackVector * ktv
G4KineticTrack * GetPrimary(void)
static constexpr double perCent
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4bool GetPDGStable() const
G4CollisionInitialState * GetNextCollision()
void ClearAndDestroy(G4KineticTrackVector *ktv)
G4ExcitationHandler * theExcitationHandler
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
virtual G4int GetMassNumber()=0
static G4Proton * ProtonDefinition()
G4ThreeVector GetSpherePoint(G4double r, const G4LorentzVector &momentumdirection)
virtual G4ThreeVector GetMomentumTransfer() const =0
#define _DebugEpConservation(val)
virtual const std::vector< G4CollisionInitialState * > & GetCollisions(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &, G4double theCurrentTime)
G4ReactionProductVector * Propagate1H1(G4KineticTrackVector *, G4V3DNucleus *)
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
G4double currentInitialEnergy
G4int GetPDGEncoding() const
G4double GetActualMass() const
void PrintWelcomeMessage()
G4ReactionProductVector * DecayVoidNucleus()
G4Fragment * FindFragments()
const char * name(G4int ptype)
G4LorentzVector GetFinal4Momentum()
const G4String & GetModelName() const
virtual const G4ThreeVector & GetPosition() const
G4bool BuildLateParticleCollisions(G4KineticTrackVector *secondaries)
static void ConstructParticle()
#define _CheckChargeAndBaryonNumber_(val)
virtual void PropagateModelDescription(std::ostream &) const
G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState)
virtual G4double CoulombBarrier()=0
const G4String & GetParticleName() const
void RemoveTracksCollisions(G4KineticTrackVector *ktv)
G4LorentzVector theProjectile4Momentum
std::vector< G4BCAction * > theImR
G4KineticTrack::CascadeState wanted_state
virtual const G4ParticleDefinition * GetDefinition() const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
void SetNewlyAdded(const G4bool f)
G4double GetBarrier(G4int encoding)
void SetStatusChange(G4HadFinalStateStatus aS)
G4int GetTotalCharge(std::vector< G4KineticTrack * > &aV)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void push_back(G4String aS)
virtual G4double GetOuterRadius()=0
G4double GetExcitationEnergy()
G4KineticTrackVector * GetFinalState()
void SetMinEnergy(G4double anEnergy)
G4double GetIonMass(G4int Z, G4int A)
virtual ~G4BinaryCascade()
G4ExcitationHandler * GetExcitationHandler() const
G4IonTable * GetIonTable() const
G4bool DebugEpConservation(const G4String where)
G4GLOB_DLL std::ostream G4cout
G4bool FindAbsorbers(G4KineticTrack &kt, G4KineticTrackVector &tgt)
double A(double temperature)
CascadeState SetState(const CascadeState new_state)
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
const G4ParticleDefinition * GetDefinition() const
G4LorentzVector GetFinalNucleusMomentum()
virtual void Init(G4int theA, G4int theZ)=0
void UpdateTracksAndCollisions(G4KineticTrackVector *oldSecondaries, G4KineticTrackVector *oldTarget, G4KineticTrackVector *newSecondaries)
G4bool nucleon(G4int ityp)
static G4PionMinus * PionMinusDefinition()
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
const G4LorentzVector & GetMomentum() const
void SetNucleon(G4Nucleon *aN)
G4double GetKineticEnergy() const
void SetTotalEnergy(const G4double en)
static constexpr double eplus
G4ThreeVector theMomentumTransfer
G4CollisionManager * theCollisionMgr
G4double GetFermiMomentum(G4double density)
G4bool CheckPauliPrinciple(G4KineticTrackVector *)
static G4PionPlus * PionPlusDefinition()
static G4Proton * Proton()
virtual void Init(G4V3DNucleus *theNucleus)=0
G4KineticTrackVector theCapturedList
G4ReactionProductVector * ProductsAddPrecompound(G4ReactionProductVector *products, G4ReactionProductVector *preco)
G4Scatterer * theH1Scatterer
G4int GetTargetBaryonNumber()
static G4Neutron * Neutron()
void Set4Momentum(const G4LorentzVector &a4Momentum)
void SetNumberOfParticles(G4int value)
G4KineticTrackVector & GetTargetCollection(void)
void PrintKTVector(G4KineticTrackVector *ktv, std::string comment=std::string(""))
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *, G4V3DNucleus *)
G4KineticTrackVector * GetAbsorbers()
const G4LorentzVector & Get4Momentum() const
G4bool WillBeAbsorbed(const G4KineticTrack &kt)
G4bool ApplyCollision(G4CollisionInitialState *)
virtual const std::vector< G4CollisionInitialState * > & GetCollisions(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &, G4double theCurrentTime)
G4ReactionProductVector * HighEnergyModelFSProducts(G4ReactionProductVector *, G4KineticTrackVector *secondaries)
G4BinaryCascade(G4VPreCompoundModel *ptr=0)
void AddCollision(G4double time, G4KineticTrack *proj, G4KineticTrack *target=NULL)
G4bool CorrectShortlivedFinalsForFermi(G4KineticTrackVector *products, G4double initial_Efermi)
G4double GetKineticEnergy() const
G4HadronicInteraction * FindModel(const G4String &name)
void DebugApplyCollision(G4CollisionInitialState *collision, G4KineticTrackVector *products)
G4bool DoTimeStep(G4double timeStep)
void operator()(G4KineticTrack *&kt) const
G4bool IsShortLived() const
void SetEnergyChange(G4double anEnergy)
virtual void ModelDescription(std::ostream &) const
G4double GetTotalEnergy() const
std::vector< G4LorentzVector * > * Decay(G4double parent_mass, const std::vector< G4double > &fragment_masses) const
void Init(G4int anA, G4int aZ)
void Decay(G4KineticTrackVector *tracks) const
G4double GetPDGMass() const
G4double GetDensity(const G4ThreeVector &aPosition) const
static G4ParticleTable * GetParticleTable()
G4bool FindProducts(G4KineticTrack &kt)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
virtual G4KineticTrackVector * Scatter(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
G4double energy(const ThreeVector &p, const G4double m)
const G4LorentzVector & GetTrackingMomentum() const
void FindLateParticleCollision(G4KineticTrack *)
G4DecayKineticTracks decayKTV
static G4HadronicInteractionRegistry * Instance()
G4KineticTrackVector theTargetList
G4ReactionProductVector * FillVoidNucleusProducts(G4ReactionProductVector *)
G4ReactionProductVector * ProductsAddFakeGamma(G4ReactionProductVector *products)
G4KineticTrackVector * GetProducts()
G4bool CheckChargeAndBaryonNumber(G4String where)
G4VPreCompoundModel * theDeExcitation
static constexpr double GeV
G4double GetField(G4int encoding, G4ThreeVector pos)
G4bool DebugFinalEpConservation(const G4HadProjectile &aTrack, G4ReactionProductVector *products)
void SetMaxEnergy(const G4double anEnergy)
G4ThreeVector GetMomentum() const
void SetDeExcitation(G4VPreCompoundModel *ptr)
G4HadFinalState theParticleChange
virtual G4double GetMass()=0
G4BCLateParticle * theLateParticle
static constexpr double MeV
G4ReactionProductVector * DeExcite()
const G4ParticleDefinition * thePrimaryType
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
G4V3DNucleus * the3DNucleus
virtual G4Nucleon * GetNextNucleon()=0
void SetNumberOfCharged(G4int value)
virtual void DeExciteModelDescription(std::ostream &outFile) const =0
G4double GetCollisionTime(void)
static constexpr double fermi
const G4LorentzVector & Get4Momentum() const
G4double GetPDGCharge() const
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
const G4ParticleDefinition * GetDefinition() const
static G4Deuteron * DeuteronDefinition()
static G4Alpha * AlphaDefinition()
static G4Neutron * NeutronDefinition()
void SetMomentumChange(const G4ThreeVector &aV)
G4KineticTrackVector theSecondaryList
const G4BCAction * GetGenerator()
SelectFromKTV(G4KineticTrackVector *out, G4KineticTrack::CascadeState astate)
static const G4double pos
virtual G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
G4KineticTrackVector * CorrectBarionsOnBoundary(G4KineticTrackVector *in, G4KineticTrackVector *out)
G4double CorrectShortlivedPrimaryForFermi(G4KineticTrack *primary, G4KineticTrackVector target_collection)
G4GLOB_DLL std::ostream G4cerr
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector
void FindCollisions(G4KineticTrackVector *)