99 #define _CheckChargeAndBaryonNumber_(val) CheckChargeAndBaryonNumber(val)
102 #define _CheckChargeAndBaryonNumber_(val)
106 #define _DebugEpConservation(val) DebugEpConservation(val)
109 #define _DebugEpConservation(val)
112#ifdef G4MULTITHREADED
115 G4int 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.;
168 if ( theBIC_ID == -1 ) {
169#ifdef G4MULTITHREADED
171 if ( theBIC_ID == -1 ) {
174#ifdef G4MULTITHREADED
184 ClearAndDestroy(&theTargetList);
185 ClearAndDestroy(&theSecondaryList);
186 ClearAndDestroy(&theCapturedList);
187 delete thePropagator;
188 delete theCollisionMgr;
189 for(
auto & ptr : theImR) {
delete ptr; }
191 delete theLateParticle;
192 delete theH1Scatterer;
197 outFile <<
"G4BinaryCascade is an intra-nuclear cascade model in which\n"
198 <<
"an incident hadron collides with a nucleon, forming two\n"
199 <<
"final-state particles, one or both of which may be resonances.\n"
200 <<
"The resonances then decay hadronically and the decay products\n"
201 <<
"are then propagated through the nuclear potential along curved\n"
202 <<
"trajectories until they re-interact or leave the nucleus.\n"
203 <<
"This model is valid for incident pions up to 1.5 GeV and\n"
204 <<
"nucleons up to 10 GeV.\n"
205 <<
"The remaining excited nucleus is handed on to ";
211 else if (theExcitationHandler)
213 outFile <<
"G4ExcitationHandler";
218 outFile <<
"void.\n";
224 outFile <<
"G4BinaryCascade propagtes secondaries produced by a high\n"
225 <<
"energy model through the wounded nucleus.\n"
226 <<
"Secondaries are followed after the formation time and if\n"
227 <<
"within the nucleus are propagated through the nuclear\n"
228 <<
"potential along curved trajectories until they interact\n"
229 <<
"with a nucleon, decay, or leave the nucleus.\n"
230 <<
"An interaction of a secondary with a nucleon produces two\n"
231 <<
"final-state particles, one or both of which may be resonances.\n"
232 <<
"Resonances decay hadronically and the decay products\n"
233 <<
"are in turn propagated through the nuclear potential along curved\n"
234 <<
"trajectories until they re-interact or leave the nucleus.\n"
235 <<
"This model is valid for pions up to 1.5 GeV and\n"
236 <<
"nucleons up to about 3.5 GeV.\n"
237 <<
"The remaining excited nucleus is handed on to ";
243 else if (theExcitationHandler)
245 outFile <<
"G4ExcitationHandler";
250 outFile <<
"void.\n";
267 if(std::getenv(
"BCDEBUG") )
G4cerr <<
" ######### Binary Cascade Reaction starts ######### "<<
G4endl;
272 if(initial4Momentum.
e()-initial4Momentum.
m()<theBCminP &&
286 if(!std::getenv(
"I_Am_G4BinaryCascade_Developer") )
294 G4cerr <<
"G4BinaryCascade should not be used for projectiles other than nucleons or pions."<<
G4endl;
295 G4cerr <<
"If you want to continue, please switch on the developer environment: "<<
G4endl;
297 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade - used for unvalid particle type - Fatal");
302 thePrimaryType = definition;
303 thePrimaryEscape =
false;
309 G4int interactionCounter = 0,collisionLoopMaxCount;
317 ClearAndDestroy(products);
326 collisionLoopMaxCount = 200;
331 initialPosition=GetSpherePoint(1.1*radius, initial4Momentum);
332 kt =
new G4KineticTrack(definition, 0., initialPosition, initial4Momentum);
336 secondaries->push_back(kt);
344 }
while(! products && --collisionLoopMaxCount>0);
346 if(++interactionCounter>99)
break;
348 }
while(products && products->size() == 0);
350 if(products && products->size()>0)
356 G4ReactionProductVector::iterator iter;
358 for(iter = products->begin(); iter != products->end(); ++iter)
362 (*iter)->GetTotalEnergy(),
363 (*iter)->GetMomentum());
365 G4double time=(*iter)->GetFormationTime();
366 if(time < 0.0) { time = 0.0; }
367 aNew.
SetTime(timePrimary + time);
376 if(std::getenv(
"BCDEBUG") )
G4cerr <<
" ######### Binary Cascade Reaction void, return initial state ######### "<<
G4endl;
384 ClearAndDestroy(products);
391 if(std::getenv(
"BCDEBUG") )
G4cerr <<
" ######### Binary Cascade Reaction ends ######### "<<
G4endl;
400 G4ping debug(
"debug_G4BinaryCascade");
401#ifdef debug_BIC_Propagate
402 G4cout <<
"G4BinaryCascade Propagate starting -------------------------------------------------------" <<
G4endl;
412 ClearAndDestroy(&theCapturedList);
413 ClearAndDestroy(&theSecondaryList);
414 theSecondaryList.clear();
415 ClearAndDestroy(&theFinalState);
416 std::vector<G4KineticTrack *>::iterator iter;
427#ifdef debug_BIC_GetExcitationEnergy
428 G4cout <<
"ExcitationEnergy0 " << GetExcitationEnergy() <<
G4endl;
433 G4bool success = BuildLateParticleCollisions(secondaries);
436 products=HighEnergyModelFSProducts(products, secondaries);
437 ClearAndDestroy(secondaries);
440#ifdef debug_G4BinaryCascade
441 G4cout <<
"G4BinaryCascade::Propagate: warning - high energy model failed energy conservation, returning unchanged high energy final state" <<
G4endl;
452 FindCollisions(&theSecondaryList);
455 if(theCollisionMgr->
Entries() == 0 )
459#ifdef debug_BIC_return
469 G4bool haveProducts =
false;
470 G4int collisionCount=0;
471 G4int collisionLoopMaxCount=1000000;
472 while(theCollisionMgr->
Entries() > 0 && currentZ && --collisionLoopMaxCount>0)
483 if(theCollisionMgr->
Entries() > 0)
487#ifdef debug_BIC_Propagate_Collisions
488 G4cout <<
" NextCollision * , Time, curtime = " << nextCollision <<
" "
504 if (ApplyCollision(nextCollision))
523 for(iter = theTargetList.begin(); iter != theTargetList.end(); ++iter)
527 if ( ! theTargetList.size() || ! nProtons ){
529 products = FillVoidNucleusProducts(products);
530#ifdef debug_BIC_return
531 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
532 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
533 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
534 PrintKTVector(&theTargetList,std::string(
" theTargetList"));
535 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
537 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
538 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
539 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
540 G4cout <<
"returned products: " << products->size() <<
G4endl;
561#ifdef debug_BIC_return
568#ifdef debug_BIC_Propagate
569 G4cout <<
" Momentum transfer to Nucleus " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
577 if ( theSecondaryList.size() > 0 )
579#ifdef debug_G4BinaryCascade
580 G4cerr <<
"G4BinaryCascade: Warning, have active particles at end" <<
G4endl;
581 PrintKTVector(&theSecondaryList,
"active particles @ end added to theFinalState");
584 for ( iter =theSecondaryList.begin(); iter != theSecondaryList.end(); ++iter)
586 theFinalState.push_back(*iter);
588 theSecondaryList.clear();
591 while ( theCollisionMgr->
Entries() > 0 )
593#ifdef debug_G4BinaryCascade
594 G4cerr <<
" Warning: remove left over collision(s) " <<
G4endl;
599#ifdef debug_BIC_Propagate_Excitation
601 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
602 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
604 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
606 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
607 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
608 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
614 G4double ExcitationEnergy=GetExcitationEnergy();
616#ifdef debug_BIC_Propagate_finals
617 PrintKTVector(&theFinalState,std::string(
" FinalState be4 corr"));
618 G4cout <<
" Excitation Energy prefinal, #collisions:, out, captured "
619 << ExcitationEnergy <<
" "
620 << collisionCount <<
" "
621 << theFinalState.size() <<
" "
622 << theCapturedList.size()<<
G4endl;
625 if (ExcitationEnergy < 0 )
627 G4int maxtry=5, ntry=0;
630 ExcitationEnergy=GetExcitationEnergy();
631 }
while ( ++ntry < maxtry && ExcitationEnergy < 0 );
635#ifdef debug_BIC_Propagate_finals
636 PrintKTVector(&theFinalState,std::string(
" FinalState corrected"));
637 G4cout <<
" Excitation Energy final, #collisions:, out, captured "
638 << ExcitationEnergy <<
" "
639 << collisionCount <<
" "
640 << theFinalState.size() <<
" "
641 << theCapturedList.size()<<
G4endl;
645 if ( ExcitationEnergy < 0. )
647 #ifdef debug_G4BinaryCascade
648 G4cerr <<
"G4BinaryCascade-Warning: negative excitation energy ";
650 PrintKTVector(&theFinalState,std::string(
"FinalState"));
651 PrintKTVector(&theCapturedList,std::string(
"captured"));
652 G4cout <<
"negative ExE:Final 4Momentum .mag: " << GetFinal4Momentum()
653 <<
" "<< GetFinal4Momentum().
mag()<<
G4endl
654 <<
"negative ExE:FinalNucleusMom .mag: " << GetFinalNucleusMomentum()
655 <<
" "<< GetFinalNucleusMomentum().
mag()<<
G4endl;
657 #ifdef debug_BIC_return
658 G4cout <<
" negative Excitation E return empty products " << products <<
G4endl;
662 ClearAndDestroy(products);
672 products= ProductsAddFinalState(products, theFinalState);
674 products= ProductsAddPrecompound(products, precompoundProducts);
679 thePrimaryEscape =
true;
681 #ifdef debug_BIC_return
690G4double G4BinaryCascade::GetExcitationEnergy()
695#if defined(debug_G4BinaryCascade) || defined(debug_BIC_GetExcitationEnergy)
696 G4int finalA = theTargetList.size()+theCapturedList.size();
697 G4int finalZ = GetTotalCharge(theTargetList)+GetTotalCharge(theCapturedList);
698 if ( (currentA - finalA) != 0 || (currentZ - finalZ) != 0 )
700 G4cerr <<
"G4BIC:GetExcitationEnergy(): Nucleon counting error current/final{A,Z} "
701 <<
"("<< currentA <<
"," << finalA <<
") ("<< currentZ <<
"," << finalZ <<
")" <<
G4endl;
710 nucleusMass = GetIonMass(currentZ,currentA);
712 else if (currentZ==0 )
715 else {nucleusMass = GetFinalNucleusMomentum().
mag()
720#ifdef debug_G4BinaryCascade
721 G4cout <<
"G4BinaryCascade::GetExcitationEnergy(): Warning - invalid nucleus (A,Z)=("
722 << currentA <<
"," << currentZ <<
")" <<
G4endl;
727#ifdef debug_BIC_GetExcitationEnergy
728 G4ping debug(
"debug_ExcitationEnergy");
729 debug.push_back(
"====> current A, Z");
730 debug.push_back(currentZ);
731 debug.push_back(currentA);
732 debug.push_back(
"====> final A, Z");
733 debug.push_back(finalZ);
734 debug.push_back(finalA);
735 debug.push_back(nucleusMass);
736 debug.push_back(GetFinalNucleusMomentum().mag());
742 excitationE = GetFinalNucleusMomentum().
mag() - nucleusMass;
748#ifdef debug_BIC_GetExcitationEnergy
750 if ( excitationE < 0 )
752 G4cout <<
"negative ExE final Ion mass " <<nucleusMass<<
G4endl;
754 if(finalZ>.5)
G4cout <<
" Final nuclmom/mass " << Nucl_mom <<
" " << Nucl_mom.
mag()
755 <<
" (A,Z)=("<< finalA <<
","<<finalZ <<
")"
756 <<
" mass " << nucleusMass <<
" "
757 <<
" excitE " << excitationE <<
G4endl;
765 initialExc = theInitial4Mom.
mag()- GetIonMass(Z, A);
766 G4cout <<
"GetExcitationEnergy: Initial nucleus A Z " <<
A <<
" " << Z <<
" " << initialExc <<
G4endl;
783void G4BinaryCascade::BuildTargetList()
794 ClearAndDestroy(&theTargetList);
803 initial_nuclear_mass=GetIonMass(initialZ,initialA);
812 definition =
nucleon->GetDefinition();
822 theTargetList.push_back(kt);
827#ifdef debug_BIC_BuildTargetList
834 massInNucleus = GetIonMass(currentZ,currentA);
835 }
else if (currentZ==0 && currentA>=1 )
840 G4cerr <<
"G4BinaryCascade::BuildTargetList(): Fatal Error - invalid nucleus (A,Z)=("
841 << currentA <<
"," << currentZ <<
")" <<
G4endl;
844 currentInitialEnergy= theInitial4Mom.
e() + theProjectile4Momentum.
e();
846#ifdef debug_BIC_BuildTargetList
847 G4cout <<
"G4BinaryCascade::BuildTargetList(): nucleus (A,Z)=("
848 << currentA <<
"," << currentZ <<
") mass: " << massInNucleus <<
849 ", theInitial4Mom " << theInitial4Mom <<
850 ", currentInitialEnergy " << currentInitialEnergy <<
G4endl;
860 std::vector<G4KineticTrack *>::iterator iter;
863 projectileA=projectileZ=0;
866 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
868 if((*iter)->GetFormationTime() < StartingTime)
869 StartingTime = (*iter)->GetFormationTime();
874 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
878 G4double FormTime = (*iter)->GetFormationTime() - StartingTime;
879 (*iter)->SetFormationTime(FormTime);
882 FindLateParticleCollision(*iter);
883 lateParticles4Momentum += (*iter)->GetTrackingMomentum();
884 lateA += (*iter)->GetDefinition()->GetBaryonNumber();
885 lateZ +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
889 theSecondaryList.push_back(*iter);
891 theProjectile4Momentum += (*iter)->GetTrackingMomentum();
892 projectileA += (*iter)->GetDefinition()->GetBaryonNumber();
893 projectileZ +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
894#ifdef debug_BIC_Propagate
895 G4cout <<
" Adding initial secondary " << *iter
896 <<
" time" << (*iter)->GetFormationTime()
897 <<
", state " << (*iter)->GetState() <<
G4endl;
906 theProjectile4Momentum += mom;
910 G4double excitation= theProjectile4Momentum.
e() + initial_nuclear_mass - lateParticles4Momentum.e() - massInNucleus;
911#ifdef debug_BIC_GetExcitationEnergy
912 G4cout <<
"BIC: Proj.e, nucl initial, nucl final, lateParticles"
913 << theProjectile4Momentum <<
", "
914 << initial_nuclear_mass<<
", " << massInNucleus <<
", "
915 << lateParticles4Momentum <<
G4endl;
916 G4cout <<
"BIC: Proj.e / initial excitation: " << theProjectile4Momentum.
e() <<
" / " << excitation <<
G4endl;
918 success = excitation > 0;
919#ifdef debug_G4BinaryCascade
921 G4cout <<
"G4BinaryCascade::BuildLateParticleCollisions(): Proj.e / initial excitation: " << theProjectile4Momentum.
e() <<
" / " << excitation <<
G4endl;
931 secondaries->clear();
950 fragment = FindFragments();
963 else if (theExcitationHandler)
965 precompoundProducts=theExcitationHandler->
BreakItUp(*fragment);
970 if (theTargetList.size() + theCapturedList.size() > 1 ) {
974 std::vector<G4KineticTrack *>::iterator i;
975 if ( theTargetList.size() == 1 ) {i=theTargetList.begin();}
976 if ( theCapturedList.size() == 1 ) {i=theCapturedList.begin();}
982 precompoundProducts->push_back(aNew);
990 precompoundProducts = DecayVoidNucleus();
992 #ifdef debug_BIC_DeexcitationProducts
996 if ( precompoundProducts )
998 std::vector<G4ReactionProduct *>::iterator j;
999 for(j = precompoundProducts->begin(); j != precompoundProducts->end(); ++j)
1002 Preco_momentum += pProduct;
1005 G4cout <<
"finalNuclMom / sum preco products" << fragment_momentum <<
" / " << Preco_momentum
1006 <<
" delta E "<< fragment_momentum.
e() - Preco_momentum.
e() <<
G4endl;
1010 return precompoundProducts;
1018 if ( (theTargetList.size()+theCapturedList.size()) > 0 )
1021 std::vector<G4KineticTrack *>::iterator aNuc;
1023 std::vector<G4double> masses;
1026 if ( theTargetList.size() != 0)
1028 for ( aNuc=theTargetList.begin(); aNuc != theTargetList.end(); aNuc++)
1030 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
1031 masses.push_back(mass);
1036 if ( theCapturedList.size() != 0)
1038 for(aNuc = theCapturedList.begin();
1039 aNuc != theCapturedList.end(); aNuc++)
1041 G4double mass=(*aNuc)->GetDefinition()->GetPDGMass();
1042 masses.push_back(mass);
1053 if ( eCMS < sumMass )
1055 eCMS=sumMass + 2*MeV*masses.size();
1060 std::vector<G4LorentzVector*> * momenta=
decay.Decay(eCMS,masses);
1061 std::vector<G4LorentzVector*>::iterator aMom=momenta->begin();
1064 if ( theTargetList.size() != 0)
1066 for ( aNuc=theTargetList.begin();
1067 (aNuc != theTargetList.end()) && (aMom!=momenta->end());
1074 result->push_back(aNew);
1080 if ( theCapturedList.size() != 0)
1082 for ( aNuc=theCapturedList.begin();
1083 (aNuc != theCapturedList.end()) && (aMom!=momenta->end());
1087 (*aNuc)->GetDefinition());
1091 result->push_back(aNew);
1107#ifdef debug_BIC_Propagate_finals
1110 for(i = 0; i< fs.size(); i++)
1118 products->push_back(aNew);
1120#ifdef debug_BIC_Propagate_finals
1130#ifdef debug_BIC_Propagate_finals
1131 G4cout <<
" Final state momentum " << mom_fs <<
G4endl;
1142 if ( precompoundProducts )
1144 std::vector<G4ReactionProduct *>::iterator j;
1145 for(j = precompoundProducts->begin(); j != precompoundProducts->end(); ++j)
1150#ifdef debug_BIC_Propagate_finals
1151 G4cout <<
"BIC: pProduct be4 boost " <<pProduct <<
G4endl;
1153 pProduct *= precompoundLorentzboost;
1154#ifdef debug_BIC_Propagate_finals
1155 G4cout <<
"BIC: pProduct aft boost " <<pProduct <<
G4endl;
1157 pSumPreco += pProduct;
1158 (*j)->SetTotalEnergy(pProduct.e());
1159 (*j)->SetMomentum(pProduct.vect());
1160 (*j)->SetNewlyAdded(
true);
1161 products->push_back(*j);
1165 precompoundProducts->clear();
1166 delete precompoundProducts;
1174 for(std::vector<G4KineticTrack *>::iterator i = secondaries->begin();
1175 i != secondaries->end(); ++i)
1177 for(std::vector<G4BCAction *>::iterator j = theImR.begin();
1178 j!=theImR.end(); j++)
1181 const std::vector<G4CollisionInitialState *> & aCandList
1182 = (*j)->GetCollisions(*i, theTargetList, theCurrentTime);
1183 for(
size_t count=0; count<aCandList.size(); count++)
1195void G4BinaryCascade::FindDecayCollision(
G4KineticTrack * secondary)
1198 const std::vector<G4CollisionInitialState *> & aCandList
1199 = theDecay->
GetCollisions(secondary, theTargetList, theCurrentTime);
1200 for(
size_t count=0; count<aCandList.size(); count++)
1207void G4BinaryCascade::FindLateParticleCollision(
G4KineticTrack * secondary)
1212 if (((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(secondary,tin,tout))
1217 }
else if ( tout > 0 )
1230#ifdef debug_BIC_FindCollision
1231 G4cout <<
"FindLateP Particle, 4-mom, times newState "
1234 <<
" times " << tin <<
" " << tout <<
" "
1238 const std::vector<G4CollisionInitialState *> & aCandList
1239 = theLateParticle->
GetCollisions(secondary, theTargetList, theCurrentTime);
1240 for(
size_t count=0; count<aCandList.size(); count++)
1242#ifdef debug_BIC_FindCollision
1243 G4cout <<
" Adding a late Col : " << aCandList[count] <<
G4endl;
1256#ifdef debug_BIC_ApplyCollision
1257 G4cerr <<
"G4BinaryCascade::ApplyCollision start"<<
G4endl;
1258 theCollisionMgr->
Print();
1263 G4bool haveTarget=target_collection.size()>0;
1266#ifdef debug_G4BinaryCascade
1267 G4cout <<
"G4BinaryCasacde::ApplyCollision(): StateError " << primary <<
G4endl;
1268 PrintKTVector(primary,std::string(
"primay- ..."));
1269 PrintKTVector(&target_collection,std::string(
"... targets"));
1272 theCollisionMgr->
Print();
1289 G4int initialBaryon(0);
1290 G4int initialCharge(0);
1298 G4double initial_Efermi=CorrectShortlivedPrimaryForFermi(primary,target_collection);
1304#ifdef debug_BIC_ApplyCollision
1305 DebugApplyCollisionFail(collision, products);
1311 G4bool lateParticleCollision= (!haveTarget) && products && products->size() == 1;
1312 G4bool decayCollision= (!haveTarget) && products && products->size() > 1;
1316#ifdef debug_G4BinaryCascade
1317 G4int lateBaryon(0), lateCharge(0);
1320 if ( lateParticleCollision )
1324#ifdef debug_G4BinaryCascade
1325 lateBaryon = initialBaryon;
1326 lateCharge = initialCharge;
1328 initialBaryon=initialCharge=0;
1335 if (!lateParticleCollision)
1337 if( !products || products->size()==0 || !CheckPauliPrinciple(products) )
1339#ifdef debug_BIC_ApplyCollision
1340 if (products)
G4cout <<
" ======Failed Pauli =====" <<
G4endl;
1341 G4cerr <<
"G4BinaryCascade::ApplyCollision blocked"<<
G4endl;
1349 if (! CorrectShortlivedFinalsForFermi(products, initial_Efermi)){
1355#ifdef debug_BIC_ApplyCollision
1356 DebugApplyCollision(collision, products);
1360 if (products) ClearAndDestroy(products);
1361 if ( decayCollision ) FindDecayCollision(primary);
1367 G4int finalBaryon(0);
1368 G4int finalCharge(0);
1370 for(std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
1372 if ( ! lateParticleCollision )
1374 (*i)->SetState(primary->
GetState());
1376 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber();
1377 finalCharge+=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
1380 if (((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes((*i),tin,tout) &&
1381 tin < 0 && tout > 0 )
1383 PrintKTVector((*i),
"particle inside marked not-inside");
1384 G4cout <<
"tin tout: " << tin <<
" " << tout <<
G4endl;
1389 if (((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes((*i),tin,tout))
1396 else if ( tout > 0 )
1399 finalBaryon+=(*i)->GetDefinition()->GetBaryonNumber();
1400 finalCharge+=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
1405 toFinalState.push_back((*i));
1411 toFinalState.push_back((*i));
1416 if(!toFinalState.empty())
1418 theFinalState.insert(theFinalState.end(),
1419 toFinalState.begin(),toFinalState.end());
1420 std::vector<G4KineticTrack *>::iterator iter1, iter2;
1421 for(iter1 = toFinalState.begin(); iter1 != toFinalState.end();
1424 iter2 = std::find(products->begin(), products->end(),
1426 if ( iter2 != products->end() ) products->erase(iter2);
1432 currentA += finalBaryon-initialBaryon;
1433 currentZ += finalCharge-initialCharge;
1437 oldSecondaries.push_back(primary);
1440#ifdef debug_G4BinaryCascade
1441 if ( (finalBaryon-initialBaryon-lateBaryon) != 0 || (finalCharge-initialCharge-lateCharge) != 0 )
1443 G4cout <<
"G4BinaryCascade: Error in Balancing: " <<
G4endl;
1444 G4cout <<
"initial/final baryon number, initial/final Charge "
1445 << initialBaryon <<
" "<< finalBaryon <<
" "
1446 << initialCharge <<
" "<< finalCharge <<
" "
1448 <<
", with number of products: "<< products->size() <<
G4endl;
1462 for(
size_t ii=0; ii< oldTarget.size(); ii++)
1464 oldTarget[ii]->Hit();
1467 UpdateTracksAndCollisions(&oldSecondaries, &oldTarget, products);
1477G4bool G4BinaryCascade::Absorb()
1485 std::vector<G4KineticTrack *>::iterator iter;
1487 for(iter = theSecondaryList.begin();
1488 iter != theSecondaryList.end(); ++iter)
1493 if(absorber.WillBeAbsorbed(*kt))
1495 absorbList.push_back(kt);
1500 if(absorbList.empty())
1504 for(iter = absorbList.begin(); iter != absorbList.end(); ++iter)
1507 if(!absorber.FindAbsorbers(*kt, theTargetList))
1508 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1510 if(!absorber.FindProducts(*kt))
1511 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1514 G4int maxLoopCount = 1000;
1515 while(!CheckPauliPrinciple(products) && --maxLoopCount>0)
1517 ClearAndDestroy(products);
1518 if(!absorber.FindProducts(*kt))
1520 "G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1522 if ( --maxLoopCount < 0 )
throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::Absorb(): Cannot absorb a particle.");
1527 toRemove.push_back(kt);
1528 toDelete.push_back(kt);
1530 UpdateTracksAndCollisions(&toRemove, absorbers, products);
1531 ClearAndDestroy(absorbers);
1533 ClearAndDestroy(&toDelete);
1546 std::vector<G4KineticTrack *>::iterator i;
1551 G4int particlesAboveCut=0;
1552 G4int particlesBelowCut=0;
1553 if ( verbose )
G4cout <<
" Capture: secondaries " << theSecondaryList.size() <<
G4endl;
1554 for(i = theSecondaryList.begin(); i != theSecondaryList.end(); ++i)
1571 ++particlesBelowCut;
1579 if (verbose)
G4cout <<
"Capture particlesAboveCut,particlesBelowCut, capturedEnergy,capturedEnergy/particlesBelowCut <? 0.2*theCutOnP "
1580 << particlesAboveCut <<
" " << particlesBelowCut <<
" " << capturedEnergy
1584 if(particlesBelowCut>0 && capturedEnergy/particlesBelowCut<0.2*theCutOnP)
1587 for(i = theSecondaryList.begin(); i != theSecondaryList.end(); ++i)
1595 captured.push_back(kt);
1597 theCapturedList.push_back(kt);
1601 UpdateTracksAndCollisions(&captured, NULL, NULL);
1616 fermiMom.
Init(A, Z);
1620 G4KineticTrackVector::iterator i;
1627 for(i = products->begin(); i != products->end(); ++i)
1629 definition = (*i)->GetDefinition();
1655 if(mom.
e() < eFermi )
1664#ifdef debug_BIC_CheckPauli
1667 for(i = products->begin(); i != products->end(); ++i)
1669 definition = (*i)->GetDefinition();
1678 if ( mom.
e()-mom.
mag()+field > 160*MeV )
1680 G4cout <<
"momentum problem pFermi=" << pFermi
1681 <<
" mom, mom.m " << mom <<
" " << mom.
mag()
1682 <<
" field " << field <<
G4endl;
1693void G4BinaryCascade::StepParticlesOut()
1700 while( theSecondaryList.size() > 0 )
1706 std::vector<G4KineticTrack *>::iterator i;
1707 for(i = theSecondaryList.begin(); i != theSecondaryList.end(); ++i)
1715 ((
G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(kt,tdummy,tStep);
1716#ifdef debug_BIC_StepParticlesOut
1717 G4cout <<
" minTimeStep, tStep Particle " <<minTimeStep <<
" " <<tStep
1722 PrintKTVector(&theSecondaryList, std::string(
" state ERROR....."));
1723 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::StepParticlesOut() particle not in nucleus");
1726 if(intersect && tStep<minTimeStep && tStep> 0 )
1728 minTimeStep = tStep;
1731 PrintKTVector(&theSecondaryList, std::string(
" state ERROR....."));
1732 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::StepParticlesOut() particle not in nucleus");
1739 if(theCollisionMgr->
Entries() > 0)
1745 if ( timeToCollision > minTimeStep )
1747 DoTimeStep(minTimeStep);
1751 if (!DoTimeStep(timeToCollision) )
1763 if ( ApplyCollision(nextCollision))
1775#ifdef debug_G4BinaryCascade
1776 G4cerr <<
"G4BinaryCascade.cc: Warning - aborting looping particle(s)" <<
G4endl;
1777 PrintKTVector(&theSecondaryList,
" looping particles added to theFinalState");
1781 std::vector<G4KineticTrack *>::iterator iter;
1782 for ( iter =theSecondaryList.begin(); iter != theSecondaryList.end(); ++iter)
1784 theFinalState.push_back(*iter);
1786 theSecondaryList.clear();
1800#ifdef debug_BIC_StepParticlesOut
1804 if ( counter > 100 && theCollisionMgr->
Entries() == 0)
1806#ifdef debug_BIC_StepParticlesOut
1807 PrintKTVector(&theSecondaryList,std::string(
"stepping 100 steps"));
1809 FindCollisions(&theSecondaryList);
1817 #ifdef debug_BIC_return
1818 G4cout <<
"return @ Z=0 after collision loop "<<
G4endl;
1819 PrintKTVector(&theSecondaryList,std::string(
" theSecondaryList"));
1820 G4cout <<
"theTargetList size: " << theTargetList.size() <<
G4endl;
1821 PrintKTVector(&theTargetList,std::string(
" theTargetList"));
1822 PrintKTVector(&theCapturedList,std::string(
" theCapturedList"));
1824 G4cout <<
" ExcitE be4 Correct : " <<GetExcitationEnergy() <<
G4endl;
1825 G4cout <<
" Mom Transfered to nucleus : " << theMomentumTransfer <<
" " << theMomentumTransfer.
mag() <<
G4endl;
1826 PrintKTVector(&theFinalState,std::string(
" FinalState uncorrected"));
1842G4double G4BinaryCascade::CorrectShortlivedPrimaryForFermi(
1851 if ( std::abs(PDGcode) > 1000 && PDGcode != 2112 && PDGcode != 2212 )
1858 std::vector<G4KineticTrack *>::iterator titer;
1859 for ( titer=target_collection.begin() ; titer!=target_collection.end(); ++titer)
1877 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
1879 G4int PDGcode=(*i)->GetDefinition()->GetPDGEncoding();
1881 final_Efermi+=((
G4RKPropagation *)thePropagator)->GetField(PDGcode,(*i)->GetPosition());
1882 if ( std::abs(PDGcode) > 1000 && PDGcode != 2112 && PDGcode != 2212 )
1884 resonances.push_back(*i);
1887 if ( resonances.size() > 0 )
1889 G4double delta_Fermi= (initial_Efermi-final_Efermi)/resonances.size();
1890 for (std::vector<G4KineticTrack *>::iterator res=resonances.begin(); res != resonances.end(); res++)
1894 G4double newEnergy=mom.
e() + delta_Fermi;
1895 G4double newEnergy2= newEnergy*newEnergy;
1897 if ( newEnergy2 < mass2 )
1911void G4BinaryCascade::CorrectFinalPandE()
1919#ifdef debug_BIC_CorrectFinalPandE
1923 if ( theFinalState.size() == 0 )
return;
1925 G4KineticTrackVector::iterator i;
1927 if ( pNucleus.
e() == 0 )
return;
1928#ifdef debug_BIC_CorrectFinalPandE
1933 for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
1935 pFinals += (*i)->Get4Momentum();
1937#ifdef debug_BIC_CorrectFinalPandE
1938 G4cout <<
"CorrectFinalPandE a final " << (*i)->GetDefinition()->GetParticleName()
1939 <<
" 4mom " << (*i)->Get4Momentum()<<
G4endl;
1942#ifdef debug_BIC_CorrectFinalPandE
1943 G4cout <<
"CorrectFinalPandE pN pF: " <<pNucleus <<
" " <<pFinals <<
G4endl;
1949#ifdef debug_BIC_CorrectFinalPandE
1950 G4cout <<
"CorrectFinalPandE pCM, CMS pCM " << pCM <<
" " <<toCMS*pCM<<
G4endl;
1951 G4cout <<
"CorrectFinal CMS pN pF " <<toCMS*pNucleus <<
" "
1953 <<
" nucleus initial mass : " <<GetFinal4Momentum().
mag()
1954 <<
" massInNucleus m(nucleus) m(finals) std::sqrt(s): " << massInNucleus <<
" " <<pNucleus.
mag()<<
" "
1955 << pFinals.mag() <<
" " << pCM.
mag() <<
G4endl;
1961 G4double m10 = GetIonMass(currentZ,currentA);
1963 if( s0-(m10+m20)*(m10+m20) < 0 )
1965#ifdef debug_BIC_CorrectFinalPandE
1966 G4cout <<
"G4BinaryCascade::CorrectFinalPandE() : error! " <<
G4endl;
1968 G4cout <<
"not enough mass to correct: mass^2, A,Z, mass(nucl), mass(finals) "
1969 << (
s0-(m10+m20)*(m10+m20)) <<
" "
1970 << currentA <<
" " << currentZ <<
" "
1971 << m10 <<
" " << m20
1975 PrintKTVector(&theFinalState,
" mass problem");
1981 G4double pInCM = std::sqrt((s0-(m10+m20)*(m10+m20))*(s0-(m10-m20)*(m10-m20))/(4.*s0));
1982#ifdef debug_BIC_CorrectFinalPandE
1983 G4cout <<
" CorrectFinalPandE pInCM new, CURRENT, ratio : " << pInCM
1984 <<
" " << (pFinals).vect().mag()<<
" " << pInCM/(pFinals).vect().mag() <<
G4endl;
1986 if ( pFinals.vect().mag() > pInCM )
1991 G4double factor=std::max(0.98,pInCM/pFinals.vect().mag());
1993 for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
1996 G4ThreeVector p3(factor*(toCMS*(*i)->Get4Momentum()).vect());
1997 G4LorentzVector p(p3,std::sqrt((*i)->Get4Momentum().mag2() + p3.mag2()));
2000#ifdef debug_BIC_CorrectFinalPandE
2003 (*i)->Set4Momentum(p);
2005#ifdef debug_BIC_CorrectFinalPandE
2006 G4cout <<
"CorrectFinalPandE nucleus corrected mass : " << GetFinal4Momentum() <<
" "
2008 <<
" CMS pFinals , mag, 3.mag : " << qFinals <<
" " << qFinals.mag() <<
" " << qFinals.vect().mag()<<
G4endl;
2009 G4cerr <<
" -CorrectFinalPandE 5 " << factor <<
G4endl;
2012#ifdef debug_BIC_CorrectFinalPandE
2013 else {
G4cerr <<
" -CorrectFinalPandE 6 - no correction done" <<
G4endl; }
2019void G4BinaryCascade::UpdateTracksAndCollisions(
2025 std::vector<G4KineticTrack *>::iterator iter1, iter2;
2030 if(!oldSecondaries->empty())
2032 for(iter1 = oldSecondaries->begin(); iter1 != oldSecondaries->end();
2035 iter2 = std::find(theSecondaryList.begin(), theSecondaryList.end(),
2037 if ( iter2 != theSecondaryList.end() ) theSecondaryList.erase(iter2);
2047 if(oldTarget->size()!=0)
2051 for(iter1 = oldTarget->begin(); iter1 != oldTarget->end(); ++iter1)
2053 iter2 = std::find(theTargetList.begin(), theTargetList.end(),
2055 theTargetList.erase(iter2);
2063 if(!newSecondaries->empty())
2066 for(iter1 = newSecondaries->begin(); iter1 != newSecondaries->end();
2069 theSecondaryList.push_back(*iter1);
2072 PrintKTVector(*iter1,
"undefined in FindCollisions");
2078 FindCollisions(newSecondaries);
2093 ktv(out), wanted_state(astate)
2097 if ( (kt)->GetState() == wanted_state ) ktv->push_back(kt);
2108#ifdef debug_BIC_DoTimeStep
2109 G4ping debug(
"debug_G4BinaryCascade");
2110 debug.push_back(
"======> DoTimeStep 1"); debug.dump();
2111 G4cerr <<
"G4BinaryCascade::DoTimeStep: enter step="<< theTimeStep
2112 <<
" , time="<<theCurrentTime <<
G4endl;
2113 PrintKTVector(&theSecondaryList, std::string(
"DoTimeStep - theSecondaryList"));
2118 std::vector<G4KineticTrack *>::iterator iter;
2121 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2126 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2131#ifdef debug_BIC_DoTimeStep
2137 thePropagator->
Transport(theSecondaryList, dummy, theTimeStep);
2144#ifdef debug_BIC_DoTimeStep
2145 G4cout <<
"DoTimeStep : theMomentumTransfer = " << theMomentumTransfer <<
G4endl;
2146 PrintKTVector(&theSecondaryList, std::string(
"DoTimeStep - secondaries aft trsprt"));
2154 std::for_each( kt_outside->begin(),kt_outside->end(),
2161 std::for_each( kt_inside->begin(),kt_inside->end(),
2171 kt_gone_in->clear();
2172 std::for_each( kt_outside->begin(),kt_outside->end(),
2175 kt_gone_out->clear();
2176 std::for_each( kt_inside->begin(),kt_inside->end(),
2179#ifdef debug_BIC_DoTimeStep
2180 PrintKTVector(fail,std::string(
" Failed to go in/out -> miss_nucleus/captured"));
2181 PrintKTVector(kt_gone_in, std::string(
"recreated kt_gone_in"));
2182 PrintKTVector(kt_gone_out, std::string(
"recreated kt_gone_out"));
2188 std::for_each( kt_outside->begin(),kt_outside->end(),
2191 std::for_each( kt_outside->begin(),kt_outside->end(),
2194#ifdef debug_BIC_DoTimeStep
2195 PrintKTVector(kt_gone_out, std::string(
"append gone_outs to final state.. theFinalState"));
2198 theFinalState.insert(theFinalState.end(),
2199 kt_gone_out->begin(),kt_gone_out->end());
2203 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2209 if ( theCollisionMgr->
Entries()> 0 )
2211 if (kt_gone_out->size() )
2214 iter = std::find(kt_gone_out->begin(),kt_gone_out->end(),nextPrimary);
2215 if ( iter != kt_gone_out->end() )
2218#ifdef debug_BIC_DoTimeStep
2219 G4cout <<
" DoTimeStep - WARNING: deleting current collision!" <<
G4endl;
2223 if ( kt_captured->size() )
2226 iter = std::find(kt_captured->begin(),kt_captured->end(),nextPrimary);
2227 if ( iter != kt_captured->end() )
2230#ifdef debug_BIC_DoTimeStep
2231 G4cout <<
" DoTimeStep - WARNING: deleting current collision!" <<
G4endl;
2238 UpdateTracksAndCollisions(kt_gone_out,0 ,0);
2241 if ( kt_captured->size() )
2243 theCapturedList.insert(theCapturedList.end(),
2244 kt_captured->begin(),kt_captured->end());
2248 std::vector<G4KineticTrack *>::iterator i_captured;
2249 for(i_captured=kt_captured->begin();i_captured!=kt_captured->end();i_captured++)
2251 (*i_captured)->Hit();
2254 UpdateTracksAndCollisions(kt_captured, NULL, NULL);
2257#ifdef debug_G4BinaryCascade
2260 std::for_each( theSecondaryList.begin(),theSecondaryList.end(),
2262 if ( currentZ != (GetTotalCharge(theTargetList)
2263 + GetTotalCharge(theCapturedList)
2264 + GetTotalCharge(*kt_inside)) )
2266 G4cout <<
" error-DoTimeStep aft, A, Z: " << currentA <<
" " << currentZ
2267 <<
" sum(tgt,capt,active) "
2268 << GetTotalCharge(theTargetList) + GetTotalCharge(theCapturedList) + GetTotalCharge(*kt_inside)
2269 <<
" targets: " << GetTotalCharge(theTargetList)
2270 <<
" captured: " << GetTotalCharge(theCapturedList)
2271 <<
" active: " << GetTotalCharge(*kt_inside)
2283 theCurrentTime += theTimeStep;
2297 std::vector<G4KineticTrack *>::iterator iter;
2302 G4int secondaries_in(0);
2303 G4int secondaryBarions_in(0);
2304 G4int secondaryCharge_in(0);
2307 for ( iter =in->begin(); iter != in->end(); ++iter)
2310 secondaryCharge_in +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2311 if ((*iter)->GetDefinition()->GetBaryonNumber()!=0 )
2313 secondaryBarions_in += (*iter)->GetDefinition()->GetBaryonNumber();
2317 secondaryMass_in += (*iter)->GetDefinition()->GetPDGMass();
2323 G4double mass_initial= GetIonMass(currentZ,currentA);
2325 currentZ += secondaryCharge_in;
2326 currentA += secondaryBarions_in;
2331 G4double mass_final= GetIonMass(currentZ,currentA);
2333 G4double correction= secondaryMass_in + mass_initial - mass_final;
2334 if (secondaries_in>1)
2335 {correction /= secondaries_in;}
2337#ifdef debug_BIC_CorrectBarionsOnBoundary
2338 G4cout <<
"CorrectBarionsOnBoundary,currentZ,currentA,"
2339 <<
"secondaryCharge_in,secondaryBarions_in,"
2340 <<
"energy correction,m_secondry,m_nucl_init,m_nucl_final "
2341 << currentZ <<
" "<< currentA <<
" "
2342 << secondaryCharge_in<<
" "<<secondaryBarions_in<<
" "
2343 << correction <<
" "
2344 << secondaryMass_in <<
" "
2345 << mass_initial <<
" "
2346 << mass_final <<
" "
2348 PrintKTVector(in,std::string(
"in be4 correction"));
2350 for ( iter = in->begin(); iter != in->end(); ++iter)
2352 if ((*iter)->GetTrackingMomentum().e()+correction > (*iter)->GetActualMass())
2354 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + correction);
2361 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + barrier);
2363 kt_fail->push_back(*iter);
2364 currentZ -=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2365 currentA -= (*iter)->GetDefinition()->GetBaryonNumber();
2370#ifdef debug_BIC_CorrectBarionsOnBoundary
2371 G4cout <<
" CorrectBarionsOnBoundary, aft, Z, A, sec-Z,A,m,m_in_nucleus "
2372 << currentZ <<
" " << currentA <<
" "
2373 << secondaryCharge_in <<
" " << secondaryBarions_in <<
" "
2374 << secondaryMass_in <<
" "
2376 PrintKTVector(in,std::string(
"in AFT correction"));
2383 G4int secondaries_out(0);
2384 G4int secondaryBarions_out(0);
2385 G4int secondaryCharge_out(0);
2388 for ( iter =out->begin(); iter != out->end(); ++iter)
2391 secondaryCharge_out +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2392 if ((*iter)->GetDefinition()->GetBaryonNumber() !=0 )
2394 secondaryBarions_out += (*iter)->GetDefinition()->GetBaryonNumber();
2398 secondaryMass_out += (*iter)->GetDefinition()->GetPDGMass();
2405 G4double mass_initial= GetIonMass(currentZ,currentA);
2406 currentA -=secondaryBarions_out;
2407 currentZ -=secondaryCharge_out;
2416 G4cerr <<
"G4BinaryCascade - secondaryBarions_out,secondaryCharge_out " <<
2417 secondaryBarions_out <<
" " << secondaryCharge_out <<
G4endl;
2418 PrintKTVector(&theTargetList,
"CorrectBarionsOnBoundary Target");
2419 PrintKTVector(&theCapturedList,
"CorrectBarionsOnBoundary Captured");
2420 PrintKTVector(&theSecondaryList,
"CorrectBarionsOnBoundary Secondaries");
2421 G4cerr <<
"G4BinaryCascade - currentA, currentZ " << currentA <<
" " << currentZ <<
G4endl;
2422 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::CorrectBarionsOnBoundary() - fatal error");
2424 G4double mass_final=GetIonMass(currentZ,currentA);
2425 G4double correction= mass_initial - mass_final - secondaryMass_out;
2428 if (secondaries_out>1) correction /= secondaries_out;
2429#ifdef debug_BIC_CorrectBarionsOnBoundary
2430 G4cout <<
"DoTimeStep,(current Z,A),"
2431 <<
"(secondaries out,Charge,Barions),"
2432 <<
"* energy correction,(m_secondry,m_nucl_init,m_nucl_final) "
2433 <<
"("<< currentZ <<
","<< currentA <<
") ("
2434 << secondaries_out <<
","
2435 << secondaryCharge_out<<
","<<secondaryBarions_out<<
") * "
2436 << correction <<
" ("
2437 << secondaryMass_out <<
", "
2438 << mass_initial <<
", "
2439 << mass_final <<
")"
2441 PrintKTVector(out,std::string(
"out be4 correction"));
2444 for ( iter = out->begin(); iter != out->end(); ++iter)
2446 if ((*iter)->GetTrackingMomentum().e()+correction > (*iter)->GetActualMass())
2448 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() + correction);
2459 (*iter)->UpdateTrackingMomentum((*iter)->GetTrackingMomentum().e() - barrier);
2461 kt_fail->push_back(*iter);
2462 currentZ +=
G4lrint((*iter)->GetDefinition()->GetPDGCharge()/eplus);
2463 currentA += (*iter)->GetDefinition()->GetBaryonNumber();
2465#ifdef debug_BIC_CorrectBarionsOnBoundary
2468 G4cout <<
"Not correcting outgoing " << *iter <<
" "
2469 << (*iter)->GetDefinition()->GetPDGEncoding() <<
" "
2470 << (*iter)->GetDefinition()->GetParticleName() <<
G4endl;
2471 PrintKTVector(out,std::string(
"outgoing, one not corrected"));
2477#ifdef debug_BIC_CorrectBarionsOnBoundary
2478 PrintKTVector(out,std::string(
"out AFTER correction"));
2479 G4cout <<
" DoTimeStep, nucl-update, A, Z, sec-Z,A,m,m_in_nucleus, table-mass, delta "
2480 << currentA <<
" "<< currentZ <<
" "
2481 << secondaryCharge_out <<
" "<< secondaryBarions_out <<
" "<<
2482 secondaryMass_out <<
" "
2483 << massInNucleus <<
" "
2484 << GetIonMass(currentZ,currentA)
2485 <<
" " << massInNucleus - GetIonMass(currentZ,currentA)
2500#ifdef debug_BIC_FindFragments
2501 G4cout <<
"target, captured, secondary: "
2502 << theTargetList.size() <<
" "
2503 << theCapturedList.size()<<
" "
2504 << theSecondaryList.size()
2508 G4int a = theTargetList.size()+theCapturedList.size();
2510 G4KineticTrackVector::iterator i;
2511 for(i = theTargetList.begin(); i != theTargetList.end(); ++i)
2513 if(
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus) == 1 )
2519 G4int zCaptured = 0;
2521 for(i = theCapturedList.begin(); i != theCapturedList.end(); ++i)
2523 CapturedMomentum += (*i)->Get4Momentum();
2524 if(
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus) == 1 )
2530 G4int z = zTarget+zCaptured;
2532#ifdef debug_G4BinaryCascade
2533 if ( z != (GetTotalCharge(theTargetList) + GetTotalCharge(theCapturedList)) )
2535 G4cout <<
" FindFragment Counting error z a " << z <<
" " <<a <<
" "
2536 << GetTotalCharge(theTargetList) <<
" " << GetTotalCharge(theCapturedList)<<
2538 PrintKTVector(&theTargetList, std::string(
"theTargetList"));
2539 PrintKTVector(&theCapturedList, std::string(
"theCapturedList"));
2553 if ( z < 1 )
return 0;
2556 G4int excitons = theCapturedList.size();
2557#ifdef debug_BIC_FindFragments
2558 G4cout <<
"Fragment: a= " << a <<
" z= " << z <<
" particles= " << excitons
2559 <<
" Charged= " << zCaptured <<
" holes= " << holes
2560 <<
" excitE= " <<GetExcitationEnergy()
2561 <<
" Final4Momentum= " << GetFinalNucleusMomentum() <<
" capturMomentum= " << CapturedMomentum
2582 G4LorentzVector final4Momentum = theInitial4Mom + theProjectile4Momentum;
2584 for(G4KineticTrackVector::iterator i = theFinalState.begin(); i != theFinalState.end(); ++i)
2586 final4Momentum -= (*i)->Get4Momentum();
2587 finals += (*i)->Get4Momentum();
2590 if(final4Momentum.
e()> 0 && (final4Momentum.
vect()/final4Momentum.
e()).mag()>1.0 && currentA > 0)
2592#ifdef debug_BIC_Final4Momentum
2594 G4cerr <<
"G4BinaryCascade::GetFinal4Momentum - Fatal"<<
G4endl;
2595 G4KineticTrackVector::iterator i;
2596 G4cerr <<
"Total initial 4-momentum " << theProjectile4Momentum <<
G4endl;
2597 G4cerr <<
" GetFinal4Momentum: Initial nucleus "<<theInitial4Mom<<
G4endl;
2598 for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
2600 G4cerr <<
" Final state: "<<(*i)->Get4Momentum()<<(*i)->GetDefinition()->GetParticleName()<<
G4endl;
2603 G4cerr<<
" Final4Momentum = "<<final4Momentum <<
" "<<final4Momentum.
m()<<
G4endl;
2604 G4cerr <<
" current A, Z = "<< currentA<<
", "<<currentZ<<
G4endl;
2610 return final4Momentum;
2621 G4KineticTrackVector::iterator i;
2623 for(i = theCapturedList.begin(); i != theCapturedList.end(); ++i)
2625 CapturedMomentum += (*i)->Get4Momentum();
2631 if ( NucleusMomentum.
e() > 0 )
2635 G4ThreeVector boost= (NucleusMomentum.
vect() -CapturedMomentum.vect())/NucleusMomentum.
e();
2636 if(boost.
mag2()>1.0)
2638# ifdef debug_BIC_FinalNucleusMomentum
2639 G4cerr <<
"G4BinaryCascade::GetFinalNucleusMomentum - Fatal"<<
G4endl;
2641 G4cerr <<
"it 01"<<NucleusMomentum<<
" "<<CapturedMomentum<<
" "<<
G4endl;
2648 precompoundLorentzboost.
set( boost );
2649#ifdef debug_debug_BIC_FinalNucleusMomentum
2650 G4cout <<
"GetFinalNucleusMomentum be4 boostNucleusMomentum, CapturedMomentum"<<NucleusMomentum<<
" "<<CapturedMomentum<<
" "<<
G4endl;
2652 NucleusMomentum *= nucleusBoost;
2653#ifdef debug_BIC_FinalNucleusMomentum
2654 G4cout <<
"GetFinalNucleusMomentum aft boost GetFinal4Momentum= " <<NucleusMomentum <<
G4endl;
2657 return NucleusMomentum;
2674 std::vector<G4KineticTrack *>::iterator iter, jter;
2679 while(!done && tryCount++ <200)
2686 secs = theH1Scatterer->
Scatter(*(*secondaries).front(), aTarget);
2687#ifdef debug_H1_BinaryCascade
2688 PrintKTVector(secs,
" From Scatter");
2690 for(
size_t ss=0; secs && ss<secs->size(); ss++)
2693 if((*secs)[ss]->GetDefinition()->IsShortLived()) done =
true;
2697 ClearAndDestroy(&theFinalState);
2698 ClearAndDestroy(secondaries);
2701 for(
size_t current=0; secs && current<secs->size(); current++)
2703 if((*secs)[current]->GetDefinition()->IsShortLived())
2707 for(jter=dec->begin(); jter != dec->end(); jter++)
2710 secs->push_back(*jter);
2713 delete (*secs)[current];
2720 theFinalState.push_back((*secs)[current]);
2725#ifdef debug_H1_BinaryCascade
2726 PrintKTVector(&theFinalState,
" FinalState");
2728 for(iter = theFinalState.begin(); iter != theFinalState.end(); ++iter)
2735 products->push_back(aNew);
2736#ifdef debug_H1_BinaryCascade
2741 G4cout <<
"final shortlived : ";
2744 G4cout <<
"final un stable : ";
2751 theFinalState.clear();
2776 }
while (
sqr(x1) +
sqr(x2) > 1.);
2802 std::vector<G4KineticTrack *>::iterator i;
2803 for(i = ktv->begin(); i != ktv->end(); ++i)
2812 std::vector<G4ReactionProduct *>::iterator i;
2813 for(i = rpv->begin(); i != rpv->end(); ++i)
2822 if (comment.size() > 0 )
G4cout <<
"G4BinaryCascade::PrintKTVector() " << comment <<
G4endl;
2824 G4cout <<
" vector: " << ktv <<
", number of tracks: " << ktv->size()
2826 std::vector<G4KineticTrack *>::iterator i;
2829 for(count = 0, i = ktv->begin(); i != ktv->end(); ++i, ++count)
2832 G4cout <<
" track n. " << count;
2836 G4cout <<
"G4BinaryCascade::PrintKTVector():No KineticTrackVector given " <<
G4endl;
2840void G4BinaryCascade::PrintKTVector(
G4KineticTrack * kt, std::string comment)
2843 if (comment.size() > 0 )
G4cout <<
"G4BinaryCascade::PrintKTVector() "<< comment <<
G4endl;
2851 << 1/fermi*
pos <<
" R: " << 1/fermi*
pos.mag() <<
" 4mom: "
2852 << 1/MeV*mom <<
"Tr_mom" << 1/MeV*tmom <<
" P: " << 1/MeV*mom.
vect().
mag()
2856 G4cout <<
"G4BinaryCascade::PrintKTVector(): No Kinetictrack given" <<
G4endl;
2866 if ( Z > 0 && A >= Z )
2870 }
else if ( A > 0 && Z>0 )
2875 }
else if ( A >= 0 && Z<=0 )
2880 }
else if ( A == 0 )
2887 G4cerr <<
"G4BinaryCascade::GetIonMass() - invalid (A,Z) = ("
2888 <<
A <<
"," << Z <<
")" <<
G4endl;
2889 throw G4HadronicException(__FILE__, __LINE__,
"G4BinaryCascade::GetIonMass() - giving up");
2900 std::vector<G4KineticTrack *>::iterator iter;
2901 std::vector<G4ReactionProduct *>::iterator rpiter;
2902 decayKTV.
Decay(&theFinalState);
2904 for(iter = theFinalState.begin(); iter != theFinalState.end(); ++iter)
2907 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2910 Esecondaries +=(*iter)->Get4Momentum().e();
2911 psecondaries +=(*iter)->Get4Momentum();
2914 products->push_back(aNew);
2919 while(theCollisionMgr->
Entries() > 0)
2926 if ( lates->size() == 1 ) {
2938 products->push_back(aNew);
2948 decayKTV.
Decay(&theSecondaryList);
2952 if ( (theSecondaryList.size() + theCapturedList.size()) > 0)
2954 transferCorrection= theMomentumTransfer /(theSecondaryList.size() + theCapturedList.size());
2957 for(iter = theSecondaryList.begin(); iter != theSecondaryList.end(); ++iter)
2960 (*iter)->Update4Momentum((*iter)->Get4Momentum().vect()+transferCorrection);
2961 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2964 Esecondaries +=(*iter)->Get4Momentum().e();
2965 psecondaries +=(*iter)->Get4Momentum();
2967 products->push_back(aNew);
2971 for(iter = theCapturedList.begin(); iter != theCapturedList.end(); ++iter)
2974 (*iter)->Update4Momentum((*iter)->Get4Momentum().vect()+transferCorrection);
2975 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
2978 Esecondaries +=(*iter)->Get4Momentum().e();
2979 psecondaries +=(*iter)->Get4Momentum();
2981 products->push_back(aNew);
2986 for(iter = theTargetList.begin(); iter != theTargetList.end(); ++iter)
2988 SumMassNucleons += (*iter)->GetDefinition()->GetPDGMass();
2989 pNucleons += (*iter)->Get4Momentum();
2992 G4double Ekinetic=theProjectile4Momentum.e() + initial_nuclear_mass - Esecondaries - SumMassNucleons;
2993 #ifdef debug_BIC_FillVoidnucleus
2995 psecondaries - pNucleons;
2999 if (Ekinetic > 0. && theTargetList.size()){
3000 Ekinetic /= theTargetList.size();
3003 if (theTargetList.size()) Ekineticrdm = ( 0.1 +
G4UniformRand()*5.) * MeV;
3005 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
3006 TotalEkin+=(*rpiter)->GetKineticEnergy();
3009 if ( std::abs(Ekinetic) < 20*perCent * TotalEkin ){
3010 correction=1. + (Ekinetic-Ekineticrdm)/TotalEkin;
3012 #ifdef debug_G4BinaryCascade
3014 G4cout <<
"BLIC::FillVoidNucleus() fail correction, Ekinetic, TotalEkin " << Ekinetic <<
""<< TotalEkin <<
G4endl;
3018 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
3019 (*rpiter)->SetKineticEnergy((*rpiter)->GetKineticEnergy()*correction);
3020 (*rpiter)->SetMomentum((*rpiter)->GetTotalMomentum() * (*rpiter)->GetMomentum().unit());
3024 Ekinetic=Ekineticrdm*correction;
3025 if (theTargetList.size())Ekinetic /= theTargetList.size();
3029 for(iter = theTargetList.begin(); iter != theTargetList.end(); ++iter) {
3037 products->push_back(aNew);
3042 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
3043 psecondaries +=
G4LorentzVector((*rpiter)->GetMomentum(),(*rpiter)->GetTotalEnergy() );
3055 SumMom=initial4Mom.
vect()-SumMom;
3058 std::vector<G4ReactionProduct *>::reverse_iterator reverse;
3059 while ( SumMom.
mag() > 0.1*MeV && loopcount++ < 10)
3061 G4int index=products->size();
3062 for (reverse=products->rbegin(); reverse!=products->rend(); ++reverse, --index){
3063 SumMom=initial4Mom.
vect();
3064 for (rpiter=products->begin(); rpiter!=products->end(); ++rpiter){
3065 SumMom-=(*rpiter)->GetMomentum();
3068 G4double p=((*reverse)->GetMomentum()).mag();
3069 (*reverse)->SetMomentum( p*(((*reverse)->GetMomentum()+SumMom).unit()));
3080 std::vector<G4KineticTrack *>::iterator iter;
3081 for(iter = secondaries->begin(); iter != secondaries->end(); ++iter)
3084 aNew->
SetMomentum((*iter)->Get4Momentum().vect());
3091 products->push_back(aNew);
3094 if (currentA == 1 && currentZ == 0) {
3096 }
else if (currentA == 1 && currentZ == 1) {
3098 }
else if (currentA == 2 && currentZ == 1) {
3100 }
else if (currentA == 3 && currentZ == 1) {
3102 }
else if (currentA == 3 && currentZ == 2) {
3104 }
else if (currentA == 4 && currentZ == 2) {
3110 if (fragment != 0) {
3118 products->push_back(theNew);
3123void G4BinaryCascade::PrintWelcomeMessage()
3125 G4cout <<
"Thank you for using G4BinaryCascade. "<<
G4endl;
3135 for ( std::vector<G4KineticTrack *>::iterator i =products->begin(); i != products->end(); i++)
3137 G4int PDGcode=std::abs((*i)->GetDefinition()->GetPDGEncoding());
3138 if (std::abs(PDGcode)==211 || PDGcode==111 ) havePion=
true;
3141 if ( !products || havePion)
3144 G4cout <<
" Collision " << collision <<
", type: "<<
typeid(action).
name()
3145 <<
", with NO products! " <<
G4endl;
3162G4bool G4BinaryCascade::CheckChargeAndBaryonNumber(
G4String where)
3164 static G4int lastdA(0), lastdZ(0);
3171 std::vector<G4KineticTrack *>::iterator i;
3172 G4int CapturedA(0), CapturedZ(0);
3173 G4int secsA(0), secsZ(0);
3174 for ( i=theCapturedList.begin(); i!=theCapturedList.end(); ++i) {
3175 CapturedA += (*i)->GetDefinition()->GetBaryonNumber();
3176 CapturedZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
3179 for ( i=theSecondaryList.begin(); i!=theSecondaryList.end(); ++i) {
3181 secsA += (*i)->GetDefinition()->GetBaryonNumber();
3182 secsZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
3186 for ( i=theFinalState.begin(); i!=theFinalState.end(); ++i) {
3187 fStateA += (*i)->GetDefinition()->GetBaryonNumber();
3188 fStateZ +=
G4lrint((*i)->GetDefinition()->GetPDGCharge()/eplus);
3191 G4int deltaA= iStateA - secsA - fStateA -currentA - lateA;
3192 G4int deltaZ= iStateZ - secsZ - fStateZ -currentZ - lateZ;
3194#ifdef debugCheckChargeAndBaryonNumberverbose
3195 G4cout << where <<
" A: iState= "<< iStateA<<
", secs= "<< secsA<<
", fState= "<< fStateA<<
", current= "<<currentA<<
", late= " <<lateA <<
G4endl;
3196 G4cout << where <<
" Z: iState= "<< iStateZ<<
", secs= "<< secsZ<<
", fState= "<< fStateZ<<
", current= "<<currentZ<<
", late= " <<lateZ <<
G4endl;
3199 if (deltaA != 0 || deltaZ!=0 ) {
3200 if (deltaA != lastdA || deltaZ != lastdZ ) {
3201 G4cout <<
"baryon/charge imbalance - " << where <<
G4endl
3202 <<
"deltaA " <<deltaA<<
", iStateA "<<iStateA<<
", CapturedA "<<CapturedA <<
", secsA "<<secsA
3203 <<
", fStateA "<<fStateA <<
", currentA "<<currentA <<
", lateA "<<lateA <<
G4endl
3204 <<
"deltaZ "<<deltaZ<<
", iStateZ "<<iStateZ<<
", CapturedZ "<<CapturedZ <<
", secsZ "<<secsZ
3205 <<
", fStateZ "<<fStateZ <<
", currentZ "<<currentZ <<
", lateZ "<<lateZ <<
G4endl<<
G4endl;
3209 }
else { lastdA=lastdZ=0;}
3218 PrintKTVector(collision->
GetPrimary(),std::string(
" Primary particle"));
3220 PrintKTVector(products,std::string(
" Scatterer products"));
3237 <<
" " << initial <<
G4endl;;
3240 for (
unsigned int it=0; it < ktv.size(); it++)
3253 <<
" " << initial <<
" Excit " << thisExcitation <<
G4endl;;
3258 G4int product_barions(0);
3261 for (
unsigned int it=0; it < products->size(); it++)
3273 <<
" " <<
final <<
G4endl;;
3278 G4int finalA = currentA;
3279 G4int finalZ = currentZ;
3282 finalA -= product_barions;
3283 finalZ -= GetTotalCharge(*products);
3285 G4double delta = GetIonMass(currentZ,currentA) - (GetIonMass(finalZ,finalA) + mass_out);
3286 G4cout <<
" current/final a,z " << currentA <<
" " << currentZ <<
" "<< finalA<<
" "<< finalZ
3287 <<
" delta-mass " << delta<<
G4endl;
3289 mass_out = GetIonMass(finalZ,finalA);
3290 G4cout <<
" initE/ E_out/ Mfinal/ Excit " << currentInitialEnergy
3291 <<
" " <<
final <<
" "
3293 << currentInitialEnergy -
final - mass_out
3295 currentInitialEnergy-=
final;
3304 G4ReactionProductVector::iterator iter;
3312 for(iter = products->begin(); iter != products->end(); ++iter)
3315 G4cout <<
" Secondary E - Ekin / p " <<
3316 (*iter)->GetDefinition()->GetParticleName() <<
" " <<
3317 (*iter)->GetTotalEnergy() <<
" - " <<
3318 (*iter)->GetKineticEnergy()<<
" / " <<
3319 (*iter)->GetMomentum().x() <<
" " <<
3320 (*iter)->GetMomentum().y() <<
" " <<
3321 (*iter)->GetMomentum().z() <<
G4endl;
3322 Efinal += (*iter)->GetTotalEnergy();
3323 pFinal += (*iter)->GetMomentum();
3326 G4cout <<
"e outgoing/ total : " << Efinal <<
" " << Efinal+GetFinal4Momentum().
e()<<
G4endl;
3327 G4cout <<
"BIC E/p delta " <<
3345 std::vector<G4KineticTrack *>::iterator ktiter;
3346 for(ktiter = theSecondaryList.begin(); ktiter != theSecondaryList.end(); ++ktiter)
3349 G4cout <<
" Secondary E - Ekin / p " <<
3350 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3351 (*ktiter)->Get4Momentum().e() <<
" - " <<
3352 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3353 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3354 psecs += (*ktiter)->Get4Momentum();
3357 for(ktiter = theTargetList.begin(); ktiter != theTargetList.end(); ++ktiter)
3360 G4cout <<
" Target E - Ekin / p " <<
3361 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3362 (*ktiter)->Get4Momentum().e() <<
" - " <<
3363 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3364 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3365 ptgts += (*ktiter)->Get4Momentum();
3368 for(ktiter = theCapturedList.begin(); ktiter != theCapturedList.end(); ++ktiter)
3371 G4cout <<
" Captured E - Ekin / p " <<
3372 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3373 (*ktiter)->Get4Momentum().e() <<
" - " <<
3374 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3375 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3376 pcpts += (*ktiter)->Get4Momentum();
3379 for(ktiter = theFinalState.begin(); ktiter != theFinalState.end(); ++ktiter)
3382 G4cout <<
" Finals E - Ekin / p " <<
3383 (*ktiter)->GetDefinition()->GetParticleName() <<
" " <<
3384 (*ktiter)->Get4Momentum().e() <<
" - " <<
3385 (*ktiter)->Get4Momentum().e() - (*ktiter)->Get4Momentum().mag() <<
" / " <<
3386 (*ktiter)->Get4Momentum().vect() <<
G4endl;
3387 pfins += (*ktiter)->Get4Momentum();
3390 G4cout <<
" Secondaries " << psecs <<
", Targets " << ptgts <<
G4endl
3391 <<
" Captured " << pcpts <<
", Finals " << pfins <<
G4endl
3392 <<
" Sum " << psecs + ptgts + pcpts + pfins <<
" PTransfer " << theMomentumTransfer
3393 <<
" Sum+PTransfer " << psecs + ptgts + pcpts + pfins + theMomentumTransfer
#define _CheckChargeAndBaryonNumber_(val)
#define _DebugEpConservation(val)
double A(double temperature)
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
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 RemoveCollision(G4CollisionInitialState *collision)
void RemoveTracksCollisions(G4KineticTrackVector *ktv)
void AddCollision(G4double time, G4KineticTrack *proj, G4KineticTrack *target=NULL)
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 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 SetTime(G4double aT)
void SetCreatorModelType(G4int idx)
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 G4He3 * He3Definition()
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
CascadeState SetState(const CascadeState new_state)
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 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 Register(const G4String &)
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)
G4double GetTotalMomentum() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
void SetNewlyAdded(const G4bool f)
G4ThreeVector GetMomentum() const
void SetCreatorModel(const G4int mod)
void SetKineticEnergy(const G4double en)
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 void Init(G4int theA, G4int theZ)=0
virtual G4double GetMass()=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)