79 NumberOfInvolvedNucleonsOfTarget = 0;
80 NumberOfInvolvedNucleonsOfProjectile= 0;
81 for (
G4int i = 0; i < 250; ++i ) {
82 TheInvolvedNucleonsOfTarget[i] = 0;
83 TheInvolvedNucleonsOfProjectile[i] = 0;
87 LowEnergyLimit = 1000.0*MeV;
89 HighEnergyInter =
true;
92 ProjectileResidual4Momentum = tmp;
93 ProjectileResidualMassNumber = 0;
94 ProjectileResidualCharge = 0;
95 ProjectileResidualLambdaNumber = 0;
96 ProjectileResidualExcitationEnergy = 0.0;
98 TargetResidual4Momentum = tmp;
99 TargetResidualMassNumber = 0;
100 TargetResidualCharge = 0;
101 TargetResidualExcitationEnergy = 0.0;
107 NumberOfProjectileSpectatorNucleons = 0;
108 NumberOfTargetSpectatorNucleons = 0;
109 NumberOfNNcollisions = 0;
130 if ( theParameters != 0 )
delete theParameters;
131 if ( theExcitation != 0 )
delete theExcitation;
132 if ( theElastic != 0 )
delete theElastic;
133 if ( theAnnihilation != 0 )
delete theAnnihilation;
136 if ( theAdditionalString.size() != 0 ) {
137 std::for_each( theAdditionalString.begin(), theAdditionalString.end(),
140 theAdditionalString.clear();
143 if ( NumberOfInvolvedNucleonsOfTarget != 0 ) {
144 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfTarget; ++i ) {
146 if ( aNucleon )
delete aNucleon;
151 if ( NumberOfInvolvedNucleonsOfProjectile != 0 ) {
152 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfProjectile; ++i ) {
154 if ( aNucleon )
delete aNucleon;
164 theProjectile = aProjectile;
170 <<
"FTF init Proj Mass " << theProjectile.
GetMass()
174 <<
"FTF init Target A Z " << aNucleus.
GetA_asInt()
178 theParticipants.
Clean();
183 ProjectileResidualMassNumber = 0;
184 ProjectileResidualCharge = 0;
185 ProjectileResidualLambdaNumber = 0;
186 ProjectileResidualExcitationEnergy = 0.0;
187 ProjectileResidual4Momentum = tmp;
189 TargetResidualMassNumber = aNucleus.
GetA_asInt();
191 TargetResidualExcitationEnergy = 0.0;
192 TargetResidual4Momentum = tmp;
194 ->
GetIonMass( TargetResidualCharge, TargetResidualMassNumber );
196 TargetResidual4Momentum.
setE( TargetResidualMass );
203 ProjectileResidualExcitationEnergy = 0.0;
207 if ( PlabPerParticle < LowEnergyLimit ) {
208 HighEnergyInter =
false;
210 HighEnergyInter =
true;
218 PlabPerParticle = theProjectile.
GetMomentum().
z() / ProjectileResidualMassNumber;
219 if ( PlabPerParticle < LowEnergyLimit ) {
220 HighEnergyInter =
false;
222 HighEnergyInter =
true;
225 ProjectileResidualLambdaNumber );
231 PlabPerParticle = theProjectile.
GetMomentum().
z() / ProjectileResidualMassNumber;
232 if ( PlabPerParticle < LowEnergyLimit ) {
233 HighEnergyInter =
false;
235 HighEnergyInter =
true;
238 ProjectileResidualLambdaNumber );
255 ProjectileResidualExcitationEnergy = 0.0;
265 NumberOfTargetSpectatorNucleons = aNucleus.
GetA_asInt();
266 NumberOfNNcollisions = 0;
272 if ( theAdditionalString.size() != 0 ) {
273 std::for_each( theAdditionalString.begin(), theAdditionalString.end(),
276 theAdditionalString.clear();
305 theParticipants.
GetList( theProjectile, theParameters );
309 StoreInvolvedNucleon();
313 if ( HighEnergyInter ) {
320 Success = PutOnMassShell();
323 G4cout <<
"FTF PutOnMassShell Success? " << Success <<
G4endl;
332 if ( Success ) Success = ExciteParticipants();
335 G4cout <<
"FTF ExciteParticipants Success? " << Success <<
G4endl;
341 G4cout <<
"FTF BuildStrings ";
344 BuildStrings( theStrings );
347 G4cout <<
"FTF BuildStrings " << theStrings <<
" OK" <<
G4endl
348 <<
"FTF GetResiduals of Nuclei " <<
G4endl;
361 std::vector< G4VSplitableHadron* > primaries;
363 while ( theParticipants.
Next() ) {
366 if ( primaries.end() ==
367 std::find( primaries.begin(), primaries.end(), interaction.
GetProjectile() ) ) {
379 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfProjectile; ++i ) {
381 if ( aNucleon )
delete aNucleon;
383 NumberOfInvolvedNucleonsOfProjectile = 0;
386 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfTarget; ++i ) {
388 if ( aNucleon )
delete aNucleon;
390 NumberOfInvolvedNucleonsOfTarget = 0;
394 <<
"To continue - enter 1, to stop - ^C" <<
G4endl;
397 theParticipants.
Clean();
405void G4FTFModel::StoreInvolvedNucleon() {
408 NumberOfInvolvedNucleonsOfTarget = 0;
416 TheInvolvedNucleonsOfTarget[NumberOfInvolvedNucleonsOfTarget] = aNucleon;
417 NumberOfInvolvedNucleonsOfTarget++;
422 G4cout <<
"G4FTFModel::StoreInvolvedNucleon -------------" <<
G4endl;
423 G4cout <<
"NumberOfInvolvedNucleonsOfTarget " << NumberOfInvolvedNucleonsOfTarget
432 NumberOfInvolvedNucleonsOfProjectile = 0;
438 while ( ( aProjectileNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {
441 TheInvolvedNucleonsOfProjectile[NumberOfInvolvedNucleonsOfProjectile] = aProjectileNucleon;
442 NumberOfInvolvedNucleonsOfProjectile++;
447 G4cout <<
"NumberOfInvolvedNucleonsOfProjectile " << NumberOfInvolvedNucleonsOfProjectile
456void G4FTFModel::ReggeonCascade() {
459 #ifdef debugReggeonCascade
460 G4cout <<
"G4FTFModel::ReggeonCascade -----------" <<
G4endl
466 G4int InitNINt = NumberOfInvolvedNucleonsOfTarget;
469 for (
G4int InvTN = 0; InvTN < InitNINt; InvTN++ ) {
470 G4Nucleon* aTargetNucleon = TheInvolvedNucleonsOfTarget[ InvTN ];
482 if ( ! Neighbour->AreYouHit() ) {
483 G4double impact2 =
sqr( XofWoundedNucleon - Neighbour->GetPosition().x() ) +
484 sqr( YofWoundedNucleon - Neighbour->GetPosition().y() );
490 TheInvolvedNucleonsOfTarget[ NumberOfInvolvedNucleonsOfTarget ] = Neighbour;
491 NumberOfInvolvedNucleonsOfTarget++;
496 Neighbour->Hit( targetSplitable );
504 #ifdef debugReggeonCascade
505 G4cout <<
"Final NumberOfInvolvedNucleonsOfTarget "
506 << NumberOfInvolvedNucleonsOfTarget <<
G4endl <<
G4endl;
512 G4int InitNINp = NumberOfInvolvedNucleonsOfProjectile;
515 for (
G4int InvPN = 0; InvPN < InitNINp; InvPN++ ) {
516 G4Nucleon* aProjectileNucleon = TheInvolvedNucleonsOfProjectile[ InvPN ];
527 while ( ( Neighbour = theProjectileNucleus->
GetNextNucleon() ) ) {
528 if ( ! Neighbour->AreYouHit() ) {
529 G4double impact2=
sqr( XofWoundedNucleon - Neighbour->GetPosition().x() ) +
530 sqr( YofWoundedNucleon - Neighbour->GetPosition().y() );
536 TheInvolvedNucleonsOfProjectile[ NumberOfInvolvedNucleonsOfProjectile ] = Neighbour;
537 NumberOfInvolvedNucleonsOfProjectile++;
542 Neighbour->Hit( projectileSplitable );
550 #ifdef debugReggeonCascade
551 G4cout <<
"NumberOfInvolvedNucleonsOfProjectile "
552 << NumberOfInvolvedNucleonsOfProjectile <<
G4endl <<
G4endl;
559G4bool G4FTFModel::PutOnMassShell() {
561 G4bool isProjectileNucleus =
false;
564 #ifdef debugPutOnMassShell
566 if ( isProjectileNucleus ) {
567 G4cout <<
"PutOnMassShell for Nucleus_Nucleus " <<
G4endl;
572 if ( Pprojectile.z() < 0.0 )
return false;
582 #ifdef debugPutOnMassShell
585 isOk = ComputeNucleusProperties( theTargetNucleus, Ptarget, PtargetResidual, SumMasses,
586 TargetResidualExcitationEnergy, TargetResidualMass,
587 TargetResidualMassNumber, TargetResidualCharge );
588 if ( ! isOk )
return false;
597 if ( ! isProjectileNucleus ) {
598 Mprojectile = Pprojectile.mag();
599 M2projectile = Pprojectile.mag2();
600 SumMasses += Mprojectile + 20.0*MeV;
602 #ifdef debugPutOnMassShell
603 G4cout <<
"Projectile : ";
605 isOk = ComputeNucleusProperties( thePrNucleus, Pproj, PprojResidual, SumMasses,
606 ProjectileResidualExcitationEnergy, PrResidualMass,
607 ProjectileResidualMassNumber, ProjectileResidualCharge );
608 if ( ! isOk )
return false;
615 #ifdef debugPutOnMassShell
616 G4cout <<
"Psum " << Psum/GeV <<
" GeV" <<
G4endl <<
"SqrtS " << SqrtS/GeV <<
" GeV" <<
G4endl
617 <<
"SumMasses, PrResidualMass and TargetResidualMass " << SumMasses/GeV <<
" "
618 << PrResidualMass/GeV <<
" " << TargetResidualMass/GeV <<
" GeV" <<
G4endl;
621 if ( SqrtS < SumMasses )
return false;
625 G4double savedSumMasses = SumMasses;
626 if ( isProjectileNucleus ) {
627 SumMasses -= std::sqrt(
sqr( PrResidualMass ) + PprojResidual.perp2() );
628 SumMasses += std::sqrt(
sqr( PrResidualMass + ProjectileResidualExcitationEnergy )
629 + PprojResidual.perp2() );
631 SumMasses -= std::sqrt(
sqr( TargetResidualMass ) + PtargetResidual.perp2() );
632 SumMasses += std::sqrt(
sqr( TargetResidualMass + TargetResidualExcitationEnergy )
633 + PtargetResidual.perp2() );
635 if ( SqrtS < SumMasses ) {
636 SumMasses = savedSumMasses;
637 if ( isProjectileNucleus ) ProjectileResidualExcitationEnergy = 0.0;
638 TargetResidualExcitationEnergy = 0.0;
641 TargetResidualMass += TargetResidualExcitationEnergy;
642 if ( isProjectileNucleus ) PrResidualMass += ProjectileResidualExcitationEnergy;
644 #ifdef debugPutOnMassShell
645 if ( isProjectileNucleus ) {
646 G4cout <<
"PrResidualMass ProjResidualExcitationEnergy " << PrResidualMass/GeV <<
" "
647 << ProjectileResidualExcitationEnergy <<
" MeV" <<
G4endl;
649 G4cout <<
"TargetResidualMass TargetResidualExcitationEnergy " << TargetResidualMass/GeV <<
" "
650 << TargetResidualExcitationEnergy <<
" MeV" <<
G4endl
651 <<
"Sum masses " << SumMasses/GeV <<
G4endl;
655 if ( isProjectileNucleus && thePrNucleus->
GetMassNumber() != 1 ) {
656 isOk = GenerateDeltaIsobar( SqrtS, NumberOfInvolvedNucleonsOfProjectile,
657 TheInvolvedNucleonsOfProjectile, SumMasses );
660 isOk = isOk && GenerateDeltaIsobar( SqrtS, NumberOfInvolvedNucleonsOfTarget,
661 TheInvolvedNucleonsOfTarget, SumMasses );
663 if ( ! isOk )
return false;
674 if ( Ptmp.
pz() <= 0.0 )
return false;
679 if ( isProjectileNucleus ) {
681 YprojectileNucleus = Ptmp.
rapidity();
683 Ptmp = toCms*Ptarget;
693 #ifdef debugPutOnMassShell
694 if ( isProjectileNucleus ) {
695 G4cout <<
"Y projectileNucleus " << YprojectileNucleus <<
G4endl;
697 G4cout <<
"Y targetNucleus " << YtargetNucleus <<
G4endl
699 <<
" DcorP DcorT " << DcorP <<
" " << DcorT <<
" AveragePt2 " << AveragePt2 <<
G4endl;
706 G4int NumberOfTries = 0;
708 G4bool OuterSuccess =
true;
710 const G4int maxNumberOfLoops = 1000;
711 G4int loopCounter = 0;
714 const G4int maxNumberOfInnerLoops = 10000;
717 if ( NumberOfTries == 100*(NumberOfTries/100) ) {
723 DcorP *= ScaleFactor;
724 DcorT *= ScaleFactor;
725 AveragePt2 *= ScaleFactor;
727 if ( isProjectileNucleus ) {
729 isOk = SamplingNucleonKinematics( AveragePt2, maxPtSquare, DcorP,
730 thePrNucleus, PprojResidual,
731 PrResidualMass, ProjectileResidualMassNumber,
732 NumberOfInvolvedNucleonsOfProjectile,
733 TheInvolvedNucleonsOfProjectile, M2proj );
736 isOk = isOk && SamplingNucleonKinematics( AveragePt2, maxPtSquare, DcorT,
737 theTargetNucleus, PtargetResidual,
738 TargetResidualMass, TargetResidualMassNumber,
739 NumberOfInvolvedNucleonsOfTarget,
740 TheInvolvedNucleonsOfTarget, M2target );
741 #ifdef debugPutOnMassShell
742 G4cout <<
"SqrtS, Mp+Mt, Mp, Mt " << SqrtS/GeV <<
" "
743 << ( std::sqrt( M2proj ) + std::sqrt( M2target) )/GeV <<
" "
744 << std::sqrt( M2proj )/GeV <<
" " << std::sqrt( M2target )/GeV <<
G4endl;
746 if ( ! isOk )
return false;
747 }
while ( ( SqrtS < std::sqrt( M2proj ) + std::sqrt( M2target ) ) &&
748 NumberOfTries < maxNumberOfInnerLoops );
749 if ( NumberOfTries >= maxNumberOfInnerLoops ) {
750 #ifdef debugPutOnMassShell
751 G4cout <<
"BAD situation: forced exit of the inner while loop!" <<
G4endl;
755 if ( isProjectileNucleus ) {
756 isOk = CheckKinematics(
S, SqrtS, M2proj, M2target, YprojectileNucleus,
true,
757 NumberOfInvolvedNucleonsOfProjectile,
758 TheInvolvedNucleonsOfProjectile,
759 WminusTarget, WplusProjectile, OuterSuccess );
761 isOk = isOk && CheckKinematics(
S, SqrtS, M2proj, M2target, YtargetNucleus,
false,
762 NumberOfInvolvedNucleonsOfTarget, TheInvolvedNucleonsOfTarget,
763 WminusTarget, WplusProjectile, OuterSuccess );
764 if ( ! isOk )
return false;
765 }
while ( ( ! OuterSuccess ) &&
766 ++loopCounter < maxNumberOfLoops );
767 if ( loopCounter >= maxNumberOfLoops ) {
768 #ifdef debugPutOnMassShell
769 G4cout <<
"BAD situation: forced exit of the while loop!" <<
G4endl;
780 if ( ! isProjectileNucleus ) {
782 G4double Pzprojectile = WplusProjectile/2.0 - M2projectile/2.0/WplusProjectile;
783 G4double Eprojectile = WplusProjectile/2.0 + M2projectile/2.0/WplusProjectile;
784 Pprojectile.setPz( Pzprojectile );
785 Pprojectile.setE( Eprojectile );
787 #ifdef debugPutOnMassShell
788 G4cout <<
"Proj after in CMS " << Pprojectile <<
G4endl;
791 Pprojectile.transform( toLab );
796 theParticipants.
Next();
800 #ifdef debugPutOnMassShell
806 isOk = FinalizeKinematics( WplusProjectile,
true, toLab, PrResidualMass,
807 ProjectileResidualMassNumber, NumberOfInvolvedNucleonsOfProjectile,
808 TheInvolvedNucleonsOfProjectile, ProjectileResidual4Momentum );
810 #ifdef debugPutOnMassShell
811 G4cout <<
"Projectile Residual4Momentum in CMS " << ProjectileResidual4Momentum <<
G4endl;
814 if ( ! isOk )
return false;
816 ProjectileResidual4Momentum.
transform( toLab );
818 #ifdef debugPutOnMassShell
819 G4cout <<
"Projectile Residual4Momentum in Lab " << ProjectileResidual4Momentum <<
G4endl;
824 isOk = FinalizeKinematics( WminusTarget,
false, toLab, TargetResidualMass,
825 TargetResidualMassNumber, NumberOfInvolvedNucleonsOfTarget,
826 TheInvolvedNucleonsOfTarget, TargetResidual4Momentum );
828 #ifdef debugPutOnMassShell
829 G4cout <<
"Target Residual4Momentum in CMS " << TargetResidual4Momentum <<
G4endl;
832 if ( ! isOk )
return false;
834 TargetResidual4Momentum.
transform( toLab );
836 #ifdef debugPutOnMassShell
837 G4cout <<
"Target Residual4Momentum in Lab " << TargetResidual4Momentum <<
G4endl;
847G4bool G4FTFModel::ExciteParticipants() {
849 #ifdef debugBuildString
850 G4cout <<
"G4FTFModel::ExciteParticipants() " <<
G4endl;
855 if ( MaxNumOfInelCollisions > 0 ) {
857 if (
G4UniformRand() < ProbMaxNumber ) MaxNumOfInelCollisions++;
860 MaxNumOfInelCollisions = 1;
863 #ifdef debugBuildString
864 G4cout <<
"MaxNumOfInelCollisions per hadron/nucleon " << MaxNumOfInelCollisions <<
G4endl;
867 G4int CurrentInteraction( 0 );
870 G4bool InnerSuccess(
true );
871 while ( theParticipants.
Next() ) {
872 CurrentInteraction++;
879 #ifdef debugBuildString
880 G4cout <<
G4endl <<
"Interaction # Status " << CurrentInteraction <<
" "
882 << target <<
G4endl <<
"projectile->GetStatus target->GetStatus "
892 #ifdef debugBuildString
896 if ( ! HighEnergyInter ) {
897 G4bool Annihilation =
false;
898 G4bool Result = AdjustNucleons( projectile, ProjectileNucleon, target,
899 TargetNucleon, Annihilation );
900 if ( ! Result )
continue;
902 InnerSuccess = theElastic->
ElasticScattering( projectile, target, theParameters );
906 #ifdef debugBuildString
908 <<
"MaxNumOfInelCollisions per hadron/nucleon " << MaxNumOfInelCollisions <<
G4endl;
911 if ( ! HighEnergyInter ) {
912 G4bool Annihilation =
false;
913 G4bool Result = AdjustNucleons( projectile, ProjectileNucleon, target,
914 TargetNucleon, Annihilation );
915 if ( ! Result )
continue;
926 if ( theExcitation->
ExciteParticipants( projectile, target, theParameters, theElastic ) ) {
928 NumberOfNNcollisions++;
929 #ifdef debugBuildString
937 InnerSuccess = theElastic->
ElasticScattering( projectile, target, theParameters );
938 #ifdef debugBuildString
939 G4cout <<
"FTF excitation Non InnerSuccess of Elastic scattering "
940 << InnerSuccess <<
G4endl;
944 #ifdef debugBuildString
945 G4cout <<
"Elastic scat. at rejection inelastic scattering" <<
G4endl;
953 InnerSuccess = theElastic->
ElasticScattering( projectile, target, theParameters );
957 #ifdef debugBuildString
962 if ( ! HighEnergyInter ) {
963 G4bool Annihilation =
true;
964 G4bool Result = AdjustNucleons( projectile, ProjectileNucleon, target,
965 TargetNucleon, Annihilation );
966 if ( ! Result )
continue;
970 if ( theAnnihilation->
Annihilate( projectile, target, AdditionalString, theParameters ) ) {
972 #ifdef debugBuildString
973 G4cout <<
"Annihilation successfull. " <<
"*AdditionalString "
974 << AdditionalString <<
G4endl;
979 if ( AdditionalString != 0 ) theAdditionalString.push_back( AdditionalString );
981 NumberOfNNcollisions++;
984 while ( theParticipants.
Next() ) {
988 if ( projectile == NextProjectileNucleon || target == NextTargetNucleon ) {
995 for (
G4int i = 0; i < CurrentInteraction; ++i ) theParticipants.
Next();
1015 if( InnerSuccess ) Success =
true;
1017 #ifdef debugBuildString
1018 G4cout <<
"----------------------------- Final properties " <<
G4endl
1019 <<
"projectile->GetStatus target->GetStatus " << projectile->
GetStatus()
1020 <<
" " << target->
GetStatus() <<
G4endl <<
"projectile->GetSoftC target->GetSoftC "
1022 <<
G4endl <<
"ExciteParticipants() Success? " << Success <<
G4endl;
1040 G4cout <<
"AdjustNucleons ---------------------------------------" <<
G4endl
1044 <<
"Pr ResidualMassNumber Pr ResidualCharge Pr ResidualExcitationEnergy "
1045 << ProjectileResidualMassNumber <<
" " << ProjectileResidualCharge <<
" "
1046 << ProjectileResidualExcitationEnergy <<
G4endl
1047 <<
"Tr ResidualMassNumber Tr ResidualCharge Tr ResidualExcitationEnergy "
1048 << TargetResidualMassNumber <<
" " << TargetResidualCharge <<
" "
1049 << TargetResidualExcitationEnergy <<
G4endl
1059 G4int interactionCase = 0;
1069 interactionCase = 1;
1071 G4cout <<
"case 1, hA prcol=0 trcol=0, AA prcol#0 trcol=0" <<
G4endl;
1073 if ( TargetResidualMassNumber < 1 ) {
1079 if ( TargetResidualMassNumber == 1 ) {
1080 TargetResidualMassNumber = 0;
1081 TargetResidualCharge = 0;
1082 TargetResidualExcitationEnergy = 0.0;
1083 SelectedTargetNucleon->
Set4Momentum( TargetResidual4Momentum );
1090 interactionCase = 2;
1094 if ( ProjectileResidualMassNumber < 1 ) {
1097 if ( ProjectileResidual4Momentum.
rapidity() <=
1101 if ( ProjectileResidualMassNumber == 1 ) {
1102 ProjectileResidualMassNumber = 0;
1103 ProjectileResidualCharge = 0;
1104 ProjectileResidualExcitationEnergy = 0.0;
1105 SelectedAntiBaryon->
Set4Momentum( ProjectileResidual4Momentum );
1110 interactionCase = 3;
1118 G4cout <<
"Proj res Init " << ProjectileResidual4Momentum <<
G4endl
1119 <<
"Targ res Init " << TargetResidual4Momentum <<
G4endl
1120 <<
"ProjectileResidualMassNumber ProjectileResidualCharge (ProjectileResidualLambdaNumber)"
1121 << ProjectileResidualMassNumber <<
" " << ProjectileResidualCharge
1122 <<
" (" << ProjectileResidualLambdaNumber <<
") " <<
G4endl
1123 <<
"TargetResidualMassNumber TargetResidualCharge " << TargetResidualMassNumber
1124 <<
" " << TargetResidualCharge <<
G4endl;
1128 CommonVariables common;
1129 G4int returnCode = AdjustNucleonsAlgorithm_beforeSampling( interactionCase, SelectedAntiBaryon,
1130 ProjectileNucleon, SelectedTargetNucleon,
1131 TargetNucleon, Annihilation, common );
1132 G4bool returnResult =
false;
1133 if ( returnCode == 0 ) {
1134 returnResult =
true;
1135 }
else if ( returnCode == 1 ) {
1137 returnResult = AdjustNucleonsAlgorithm_Sampling( interactionCase, common );
1138 if ( returnResult ) {
1139 AdjustNucleonsAlgorithm_afterSampling( interactionCase, SelectedAntiBaryon,
1140 SelectedTargetNucleon, common );
1144 return returnResult;
1149G4int G4FTFModel::AdjustNucleonsAlgorithm_beforeSampling(
G4int interactionCase,
1155 G4FTFModel::CommonVariables& common ) {
1161 G4int returnCode = 99;
1166 if ( interactionCase == 1 ) {
1167 common.Psum = SelectedAntiBaryon->
Get4Momentum() + TargetResidual4Momentum;
1169 G4cout <<
"Targ res Init " << TargetResidual4Momentum <<
G4endl;
1171 common.Pprojectile = SelectedAntiBaryon->
Get4Momentum();
1172 }
else if ( interactionCase == 2 ) {
1173 common.Psum = ProjectileResidual4Momentum + SelectedTargetNucleon->
Get4Momentum();
1174 common.Pprojectile = ProjectileResidual4Momentum;
1175 }
else if ( interactionCase == 3 ) {
1176 common.Psum = ProjectileResidual4Momentum + TargetResidual4Momentum;
1177 common.Pprojectile = ProjectileResidual4Momentum;
1182 common.Ptmp = common.toCms * common.Pprojectile;
1183 common.toCms.rotateZ( -1*common.Ptmp.phi() );
1184 common.toCms.rotateY( -1*common.Ptmp.theta() );
1185 common.Pprojectile.transform( common.toCms );
1186 common.toLab = common.toCms.inverse();
1187 common.SqrtS = common.Psum.mag();
1188 common.S =
sqr( common.SqrtS );
1192 if ( interactionCase == 1 ) {
1193 common.TResidualMassNumber = TargetResidualMassNumber - 1;
1194 common.TResidualCharge = TargetResidualCharge
1196 common.TResidualExcitationEnergy = TargetResidualExcitationEnergy
1198 if ( common.TResidualMassNumber <= 1 ) {
1199 common.TResidualExcitationEnergy = 0.0;
1201 if ( common.TResidualMassNumber != 0 ) {
1203 ->
GetIonMass( common.TResidualCharge, common.TResidualMassNumber );
1206 common.SumMasses = SelectedAntiBaryon->
Get4Momentum().
mag() + common.TNucleonMass
1207 + common.TResidualMass;
1211 }
else if ( interactionCase == 2 ) {
1212 common.Ptarget = common.toCms * SelectedTargetNucleon->
Get4Momentum();
1213 common.TResidualMassNumber = ProjectileResidualMassNumber - 1;
1214 common.TResidualCharge = ProjectileResidualCharge
1216 common.TResidualExcitationEnergy = ProjectileResidualExcitationEnergy
1218 if ( common.TResidualMassNumber <= 1 ) {
1219 common.TResidualExcitationEnergy = 0.0;
1221 if ( common.TResidualMassNumber != 0 ) {
1223 ->
GetIonMass( common.TResidualCharge, common.TResidualMassNumber );
1226 common.SumMasses = SelectedTargetNucleon->
Get4Momentum().
mag() + common.TNucleonMass
1227 + common.TResidualMass;
1229 G4cout <<
"SelectedTN.mag() PNMass + PResidualMass "
1231 << common.TNucleonMass <<
" " << common.TResidualMass <<
G4endl;
1233 }
else if ( interactionCase == 3 ) {
1234 common.Ptarget = common.toCms * TargetResidual4Momentum;
1235 common.PResidualMassNumber = ProjectileResidualMassNumber - 1;
1236 common.PResidualCharge = ProjectileResidualCharge
1238 common.PResidualLambdaNumber = ProjectileResidualLambdaNumber;
1241 --common.PResidualLambdaNumber;
1243 common.PResidualExcitationEnergy = ProjectileResidualExcitationEnergy
1245 if ( common.PResidualMassNumber <= 1 ) {
1246 common.PResidualExcitationEnergy = 0.0;
1248 if ( common.PResidualMassNumber != 0 ) {
1249 if ( common.PResidualMassNumber == 1 ) {
1250 if ( std::abs( common.PResidualCharge ) == 1 ) {
1252 }
else if ( common.PResidualLambdaNumber == 1 ) {
1258 if ( common.PResidualLambdaNumber > 0 ) {
1259 if ( common.PResidualMassNumber == 2 ) {
1261 if ( std::abs( common.PResidualCharge ) == 1 ) {
1263 }
else if ( common.PResidualLambdaNumber == 1 ) {
1270 std::abs( common.PResidualCharge ),
1271 common.PResidualLambdaNumber );
1275 GetIonMass( std::abs( common.PResidualCharge ), common.PResidualMassNumber );
1280 common.TResidualMassNumber = TargetResidualMassNumber - 1;
1281 common.TResidualCharge = TargetResidualCharge
1283 common.TResidualExcitationEnergy = TargetResidualExcitationEnergy
1285 if ( common.TResidualMassNumber <= 1 ) {
1286 common.TResidualExcitationEnergy = 0.0;
1288 if ( common.TResidualMassNumber != 0 ) {
1290 GetIonMass( common.TResidualCharge, common.TResidualMassNumber );
1293 common.SumMasses = common.PNucleonMass + common.PResidualMass + common.TNucleonMass
1294 + common.TResidualMass;
1296 G4cout <<
"PNucleonMass PResidualMass TNucleonMass TResidualMass " << common.PNucleonMass
1297 <<
" " << common.PResidualMass <<
" " << common.TNucleonMass <<
" "
1298 << common.TResidualMass <<
G4endl
1299 <<
"PResidualExcitationEnergy " << common.PResidualExcitationEnergy <<
G4endl
1300 <<
"TResidualExcitationEnergy " << common.TResidualExcitationEnergy <<
G4endl;
1304 if ( ! Annihilation ) {
1305 if ( common.SqrtS < common.SumMasses ) {
1307 G4cout <<
"SqrtS < SumMasses " << common.SqrtS <<
" " << common.SumMasses <<
G4endl;
1311 if ( interactionCase == 1 || interactionCase == 2 ) {
1312 if ( common.SqrtS < common.SumMasses + common.TResidualExcitationEnergy ) {
1314 G4cout <<
"TResidualExcitationEnergy : before " << common.TResidualExcitationEnergy <<
G4endl;
1316 common.TResidualExcitationEnergy = common.SqrtS - common.SumMasses;
1318 G4cout <<
"TResidualExcitationEnergy : after " << common.TResidualExcitationEnergy <<
G4endl;
1323 }
else if ( interactionCase == 3 ) {
1325 G4cout <<
"SqrtS < SumMasses + PResidualExcitationEnergy + TResidualExcitationEnergy "
1326 << common.SqrtS <<
" " << common.SumMasses + common.PResidualExcitationEnergy + common.TResidualExcitationEnergy
1329 if ( common.SqrtS < common.SumMasses + common.PResidualExcitationEnergy
1330 + common.TResidualExcitationEnergy ) {
1332 if ( common.PResidualExcitationEnergy <= 0.0 ) {
1333 common.TResidualExcitationEnergy = common.SqrtS - common.SumMasses;
1334 }
else if ( common.TResidualExcitationEnergy <= 0.0 ) {
1335 common.PResidualExcitationEnergy = common.SqrtS - common.SumMasses;
1337 G4double Fraction = ( common.SqrtS - common.SumMasses )
1338 / ( common.PResidualExcitationEnergy + common.TResidualExcitationEnergy );
1339 common.PResidualExcitationEnergy *= Fraction;
1340 common.TResidualExcitationEnergy *= Fraction;
1346 if ( Annihilation ) {
1348 G4cout <<
"SqrtS < SumMasses - TNucleonMass " << common.SqrtS <<
" "
1349 << common.SumMasses - common.TNucleonMass <<
G4endl;
1351 if ( common.SqrtS < common.SumMasses - common.TNucleonMass ) {
1355 G4cout <<
"SqrtS < SumMasses " << common.SqrtS <<
" " << common.SumMasses <<
G4endl;
1357 if ( common.SqrtS < common.SumMasses ) {
1358 if ( interactionCase == 2 || interactionCase == 3 ) {
1359 common.TResidualExcitationEnergy = 0.0;
1361 common.TNucleonMass = common.SqrtS - ( common.SumMasses - common.TNucleonMass )
1362 - common.TResidualExcitationEnergy;
1364 G4cout <<
"TNucleonMass " << common.TNucleonMass <<
G4endl;
1366 common.SumMasses = common.SqrtS - common.TResidualExcitationEnergy;
1369 G4cout <<
"SqrtS < SumMasses " << common.SqrtS <<
" " << common.SumMasses <<
G4endl;
1372 if ( interactionCase == 1 || interactionCase == 2 ) {
1373 if ( common.SqrtS < common.SumMasses + common.TResidualExcitationEnergy ) {
1374 common.TResidualExcitationEnergy = common.SqrtS - common.SumMasses;
1377 }
else if ( interactionCase == 3 ) {
1378 if ( common.SqrtS < common.SumMasses + common.PResidualExcitationEnergy
1379 + common.TResidualExcitationEnergy ) {
1381 if ( common.PResidualExcitationEnergy <= 0.0 ) {
1382 common.TResidualExcitationEnergy = common.SqrtS - common.SumMasses;
1383 }
else if ( common.TResidualExcitationEnergy <= 0.0 ) {
1384 common.PResidualExcitationEnergy = common.SqrtS - common.SumMasses;
1386 G4double Fraction = ( common.SqrtS - common.SumMasses ) /
1387 ( common.PResidualExcitationEnergy + common.TResidualExcitationEnergy );
1388 common.PResidualExcitationEnergy *= Fraction;
1389 common.TResidualExcitationEnergy *= Fraction;
1401 common.Ptmp.setPx( 0.0 ); common.Ptmp.setPy( 0.0 ); common.Ptmp.setPz( 0.0 );
1403 if ( interactionCase == 1 ) {
1405 }
else if ( interactionCase == 2 ) {
1406 common.Ptmp.setE( common.TNucleonMass );
1407 }
else if ( interactionCase == 3 ) {
1408 common.Ptmp.setE( common.PNucleonMass );
1413 common.Pprojectile = common.Ptmp;
1414 common.Pprojectile.transform( common.toLab );
1418 saveSelectedAntiBaryon4Momentum.
transform( common.toCms );
1420 SelectedAntiBaryon->
Set4Momentum( common.Pprojectile );
1422 if ( interactionCase == 1 || interactionCase == 3 ) {
1423 common.Ptmp.setE( common.TNucleonMass );
1424 }
else if ( interactionCase == 2 ) {
1430 common.Ptarget = common.Ptmp;
1431 common.Ptarget.transform( common.toLab );
1435 saveSelectedTargetNucleon4Momentum.
transform( common.toCms );
1439 if ( interactionCase == 1 || interactionCase == 3 ) {
1440 common.Ptmp.setPx( 0.0 ); common.Ptmp.setPy( 0.0 ); common.Ptmp.setPz( 0.0 );
1441 TargetResidualMassNumber = common.TResidualMassNumber;
1442 TargetResidualCharge = common.TResidualCharge;
1443 TargetResidualExcitationEnergy = common.TResidualExcitationEnergy;
1448 common.Ptmp.setPx( -saveSelectedTargetNucleon4Momentum.
x() );
1449 common.Ptmp.setPy( -saveSelectedTargetNucleon4Momentum.
y() );
1450 common.Ptmp.setPz( -saveSelectedTargetNucleon4Momentum.
z() );
1451 common.Ptmp.setE( std::sqrt(
sqr( common.TResidualMass + TargetResidualExcitationEnergy ) + common.Ptmp.vect().mag2() ) );
1456 common.Ptmp.transform( common.toLab );
1457 TargetResidual4Momentum = common.Ptmp;
1460 if ( interactionCase == 2 || interactionCase == 3 ) {
1461 common.Ptmp.
setPx( 0.0 ); common.Ptmp.setPy( 0.0 ); common.Ptmp.setPz( 0.0 );
1462 if ( interactionCase == 2 ) {
1463 ProjectileResidualMassNumber = common.TResidualMassNumber;
1464 ProjectileResidualCharge = common.TResidualCharge;
1465 ProjectileResidualLambdaNumber = 0;
1466 ProjectileResidualExcitationEnergy = common.TResidualExcitationEnergy;
1467 common.Ptmp.setE( common.TResidualMass + ProjectileResidualExcitationEnergy );
1469 ProjectileResidualMassNumber = common.PResidualMassNumber;
1470 ProjectileResidualCharge = common.PResidualCharge;
1471 ProjectileResidualLambdaNumber = common.PResidualLambdaNumber;
1472 ProjectileResidualExcitationEnergy = common.PResidualExcitationEnergy;
1477 common.Ptmp.setPx( -saveSelectedAntiBaryon4Momentum.
x() );
1478 common.Ptmp.setPy( -saveSelectedAntiBaryon4Momentum.
y() );
1479 common.Ptmp.setPz( -saveSelectedAntiBaryon4Momentum.
z() );
1480 common.Ptmp.setE( std::sqrt(
sqr( common.PResidualMass + ProjectileResidualExcitationEnergy ) + common.Ptmp.vect().mag2() ) );
1486 common.Ptmp.transform( common.toLab );
1487 ProjectileResidual4Momentum = common.Ptmp;
1489 return returnCode = 0;
1493 if ( interactionCase == 1 ) {
1494 common.Mprojectile = common.Pprojectile.
mag();
1495 common.M2projectile = common.Pprojectile.mag2();
1496 common.TResidual4Momentum = common.toCms * TargetResidual4Momentum;
1497 common.YtargetNucleus = common.TResidual4Momentum.
rapidity();
1498 common.TResidualMass += common.TResidualExcitationEnergy;
1499 }
else if ( interactionCase == 2 ) {
1500 common.Mtarget = common.Ptarget.mag();
1501 common.M2target = common.Ptarget.mag2();
1502 common.TResidual4Momentum = common.toCms * ProjectileResidual4Momentum;
1503 common.YprojectileNucleus = common.TResidual4Momentum.
rapidity();
1504 common.TResidualMass += common.TResidualExcitationEnergy;
1505 }
else if ( interactionCase == 3 ) {
1506 common.PResidual4Momentum = common.toCms * ProjectileResidual4Momentum;
1507 common.YprojectileNucleus = common.PResidual4Momentum.
rapidity();
1508 common.TResidual4Momentum = common.toCms*TargetResidual4Momentum;
1509 common.YtargetNucleus = common.TResidual4Momentum.
rapidity();
1510 common.PResidualMass += common.PResidualExcitationEnergy;
1511 common.TResidualMass += common.TResidualExcitationEnergy;
1514 G4cout <<
"YprojectileNucleus " << common.YprojectileNucleus <<
G4endl;
1517 return returnCode = 1;
1523G4bool G4FTFModel::AdjustNucleonsAlgorithm_Sampling(
G4int interactionCase,
1524 G4FTFModel::CommonVariables& common ) {
1531 if ( ProjectileResidualMassNumber != 0 ) DcorP = Dcor /
G4double(ProjectileResidualMassNumber);
1532 if ( TargetResidualMassNumber != 0 ) DcorT = Dcor /
G4double(TargetResidualMassNumber);
1537 G4bool OuterSuccess =
true;
1538 const G4int maxNumberOfLoops = 1000;
1539 const G4int maxNumberOfTries = 10000;
1540 G4int loopCounter = 0;
1541 G4int NumberOfTries = 0;
1543 OuterSuccess =
true;
1544 G4bool loopCondition =
false;
1546 if ( NumberOfTries == 100*(NumberOfTries/100) ) {
1549 DcorP *= ScaleFactor;
1550 DcorT *= ScaleFactor;
1551 AveragePt2 *= ScaleFactor;
1558 if ( interactionCase == 1 ) {
1559 }
else if ( interactionCase == 2 ) {
1561 G4cout <<
"ProjectileResidualMassNumber " << ProjectileResidualMassNumber <<
G4endl;
1563 if ( ProjectileResidualMassNumber > 1 ) {
1564 common.PtNucleon = GaussianPt( AveragePt2, maxPtSquare );
1568 common.PtResidual = - common.PtNucleon;
1569 common.Mprojectile = std::sqrt(
sqr( common.TNucleonMass ) + common.PtNucleon.mag2() )
1570 + std::sqrt(
sqr( common.TResidualMass ) + common.PtResidual.mag2() );
1572 G4cout <<
"SqrtS < Mtarget + Mprojectile " << common.SqrtS <<
" " << common.Mtarget
1573 <<
" " << common.Mprojectile <<
" " << common.Mtarget + common.Mprojectile <<
G4endl;
1575 common.M2projectile =
sqr( common.Mprojectile );
1576 if ( common.SqrtS < common.Mtarget + common.Mprojectile ) {
1577 OuterSuccess =
false;
1578 loopCondition =
true;
1581 }
else if ( interactionCase == 3 ) {
1582 if ( ProjectileResidualMassNumber > 1 ) {
1583 common.PtNucleonP = GaussianPt( AveragePt2, maxPtSquare );
1587 common.PtResidualP = - common.PtNucleonP;
1588 if ( TargetResidualMassNumber > 1 ) {
1589 common.PtNucleonT = GaussianPt( AveragePt2, maxPtSquare );
1593 common.PtResidualT = - common.PtNucleonT;
1594 common.Mprojectile = std::sqrt(
sqr( common.PNucleonMass ) + common.PtNucleonP.mag2() )
1595 + std::sqrt(
sqr( common.PResidualMass ) + common.PtResidualP.mag2() );
1596 common.M2projectile =
sqr( common.Mprojectile );
1597 common.Mtarget = std::sqrt(
sqr( common.TNucleonMass ) + common.PtNucleonT.mag2() )
1598 + std::sqrt(
sqr( common.TResidualMass ) + common.PtResidualT.mag2() );
1599 common.M2target =
sqr( common.Mtarget );
1600 if ( common.SqrtS < common.Mprojectile + common.Mtarget ) {
1601 OuterSuccess =
false;
1602 loopCondition =
true;
1607 G4int numberOfTimesExecuteInnerLoop = 1;
1608 if ( interactionCase == 3 ) numberOfTimesExecuteInnerLoop = 2;
1609 for (
G4int iExecute = 0; iExecute < numberOfTimesExecuteInnerLoop; iExecute++ ) {
1611 G4bool InnerSuccess =
true;
1612 G4bool isTargetToBeHandled = ( interactionCase == 1 ||
1613 ( interactionCase == 3 && iExecute == 1 ) );
1615 if ( isTargetToBeHandled ) {
1616 condition = ( TargetResidualMassNumber > 1 );
1618 condition = ( ProjectileResidualMassNumber > 1 );
1621 const G4int maxNumberOfInnerLoops = 1000;
1622 G4int innerLoopCounter = 0;
1624 InnerSuccess =
true;
1625 if ( isTargetToBeHandled ) {
1627 if ( interactionCase == 1 ) {
1628 common.PtNucleon = GaussianPt( AveragePt2, maxPtSquare );
1629 common.PtResidual = - common.PtNucleon;
1630 common.Mtarget = std::sqrt(
sqr( common.TNucleonMass ) + common.PtNucleon.mag2() )
1631 + std::sqrt(
sqr( common.TResidualMass ) + common.PtResidual.mag2() );
1632 if ( common.SqrtS < common.Mprojectile + common.Mtarget ) {
1633 InnerSuccess =
false;
1636 Xcenter = std::sqrt(
sqr( common.TNucleonMass ) + common.PtNucleon.mag2() )
1639 Xcenter = std::sqrt(
sqr( common.TNucleonMass ) + common.PtNucleonT.mag2() )
1643 common.XminusNucleon = Xcenter + tmpX.
x();
1644 if ( common.XminusNucleon <= 0.0 || common.XminusNucleon >= 1.0 ) {
1645 InnerSuccess =
false;
1648 common.XminusResidual = 1.0 - common.XminusNucleon;
1652 if ( interactionCase == 2 ) {
1653 Xcenter = std::sqrt(
sqr( common.TNucleonMass ) + common.PtNucleon.mag2() )
1654 / common.Mprojectile;
1656 Xcenter = std::sqrt(
sqr( common.PNucleonMass ) + common.PtNucleonP.mag2() )
1657 / common.Mprojectile;
1659 common.XplusNucleon = Xcenter + tmpX.
x();
1660 if ( common.XplusNucleon <= 0.0 || common.XplusNucleon >= 1.0 ) {
1661 InnerSuccess =
false;
1664 common.XplusResidual = 1.0 - common.XplusNucleon;
1666 }
while ( ( ! InnerSuccess ) &&
1667 ++innerLoopCounter < maxNumberOfInnerLoops );
1668 if ( innerLoopCounter >= maxNumberOfInnerLoops ) {
1670 G4cout <<
"BAD situation: forced exit of the inner while loop!" <<
G4endl;
1675 if ( isTargetToBeHandled ) {
1676 common.XminusNucleon = 1.0;
1677 common.XminusResidual = 1.0;
1679 common.XplusNucleon = 1.0;
1680 common.XplusResidual = 1.0;
1686 if ( interactionCase == 1 ) {
1687 common.M2target = (
sqr( common.TNucleonMass ) + common.PtNucleon.mag2() )
1688 / common.XminusNucleon
1689 + (
sqr( common.TResidualMass ) + common.PtResidual.mag2() )
1690 / common.XminusResidual;
1691 loopCondition = ( common.SqrtS < common.Mprojectile + std::sqrt( common.M2target ) );
1692 }
else if ( interactionCase == 2 ) {
1694 G4cout <<
"TNucleonMass PtNucleon XplusNucleon " << common.TNucleonMass <<
" "
1695 << common.PtNucleon <<
" " << common.XplusNucleon <<
G4endl
1696 <<
"TResidualMass PtResidual XplusResidual " << common.TResidualMass <<
" "
1697 << common.PtResidual <<
" " << common.XplusResidual <<
G4endl;
1699 common.M2projectile = (
sqr( common.TNucleonMass ) + common.PtNucleon.mag2() )
1700 / common.XplusNucleon
1701 + (
sqr( common.TResidualMass ) + common.PtResidual.mag2() )
1702 / common.XplusResidual;
1704 G4cout <<
"SqrtS < Mtarget + std::sqrt(M2projectile) " << common.SqrtS <<
" "
1705 << common.Mtarget <<
" " << std::sqrt( common.M2projectile ) <<
" "
1706 << common.Mtarget + std::sqrt( common.M2projectile ) <<
G4endl;
1708 loopCondition = ( common.SqrtS < common.Mtarget + std::sqrt( common.M2projectile ) );
1709 }
else if ( interactionCase == 3 ) {
1711 G4cout <<
"PtNucleonP " << common.PtNucleonP <<
" " << common.PtResidualP <<
G4endl
1712 <<
"XplusNucleon XplusResidual " << common.XplusNucleon
1713 <<
" " << common.XplusResidual <<
G4endl
1714 <<
"PtNucleonT " << common.PtNucleonT <<
" " << common.PtResidualT <<
G4endl
1715 <<
"XminusNucleon XminusResidual " << common.XminusNucleon
1716 <<
" " << common.XminusResidual <<
G4endl;
1718 common.M2projectile = (
sqr( common.PNucleonMass ) + common.PtNucleonP.mag2() )
1719 / common.XplusNucleon
1720 + (
sqr( common.PResidualMass) + common.PtResidualP.mag2() )
1721 / common.XplusResidual;
1722 common.M2target = (
sqr( common.TNucleonMass ) + common.PtNucleonT.mag2() )
1723 / common.XminusNucleon
1724 + (
sqr( common.TResidualMass ) + common.PtResidualT.mag2() )
1725 / common.XminusResidual;
1726 loopCondition = ( common.SqrtS < ( std::sqrt( common.M2projectile )
1727 + std::sqrt( common.M2target ) ) );
1730 }
while ( loopCondition &&
1731 ++NumberOfTries < maxNumberOfTries );
1732 if ( NumberOfTries >= maxNumberOfTries ) {
1734 G4cout <<
"BAD situation: forced exit of the intermediate while loop!" <<
G4endl;
1740 G4double Yprojectile = 0.0, YprojectileNucleon = 0.0, Ytarget = 0.0, YtargetNucleon = 0.0;
1741 G4double DecayMomentum2 =
sqr( common.S ) +
sqr( common.M2projectile ) +
sqr( common.M2target )
1742 - 2.0 * ( common.S * ( common.M2projectile + common.M2target )
1743 + common.M2projectile * common.M2target );
1744 if ( interactionCase == 1 ) {
1745 common.WminusTarget = ( common.S - common.M2projectile + common.M2target
1746 + std::sqrt( DecayMomentum2 ) ) / 2.0 / common.SqrtS;
1747 common.WplusProjectile = common.SqrtS - common.M2target / common.WminusTarget;
1748 common.Pzprojectile = common.WplusProjectile / 2.0
1749 - common.M2projectile / 2.0 / common.WplusProjectile;
1750 common.Eprojectile = common.WplusProjectile / 2.0
1751 + common.M2projectile / 2.0 / common.WplusProjectile;
1752 Yprojectile = 0.5 *
G4Log( ( common.Eprojectile + common.Pzprojectile )
1753 / ( common.Eprojectile - common.Pzprojectile ) );
1755 G4cout <<
"DecayMomentum2 " << DecayMomentum2 <<
G4endl
1756 <<
"WminusTarget WplusProjectile " << common.WminusTarget
1757 <<
" " << common.WplusProjectile <<
G4endl
1758 <<
"Yprojectile " << Yprojectile <<
G4endl;
1760 common.Mt2targetNucleon =
sqr( common.TNucleonMass ) + common.PtNucleon.mag2();
1761 common.PztargetNucleon = - common.WminusTarget * common.XminusNucleon / 2.0
1762 + common.Mt2targetNucleon
1763 / ( 2.0 * common.WminusTarget * common.XminusNucleon );
1764 common.EtargetNucleon = common.WminusTarget * common.XminusNucleon / 2.0
1765 + common.Mt2targetNucleon
1766 / ( 2.0 * common.WminusTarget * common.XminusNucleon );
1767 YtargetNucleon = 0.5 *
G4Log( ( common.EtargetNucleon + common.PztargetNucleon )
1768 / ( common.EtargetNucleon - common.PztargetNucleon ) );
1770 G4cout <<
"YtN Ytr YtN-Ytr " <<
" " << YtargetNucleon <<
" " << common.YtargetNucleus
1771 <<
" " << YtargetNucleon - common.YtargetNucleus <<
G4endl
1772 <<
"YtN Ypr YtN-Ypr " <<
" " << YtargetNucleon <<
" " << Yprojectile
1773 <<
" " << YtargetNucleon - Yprojectile <<
G4endl;
1775 if ( std::abs( YtargetNucleon - common.YtargetNucleus ) > 2 ||
1776 Yprojectile < YtargetNucleon ) {
1777 OuterSuccess =
false;
1780 }
else if ( interactionCase == 2 ) {
1781 common.WplusProjectile = ( common.S + common.M2projectile - common.M2target
1782 + std::sqrt( DecayMomentum2 ) ) / 2.0 / common.SqrtS;
1783 common.WminusTarget = common.SqrtS - common.M2projectile / common.WplusProjectile;
1784 common.Pztarget = - common.WminusTarget / 2.0 + common.M2target / 2.0 / common.WminusTarget;
1785 common.Etarget = common.WminusTarget / 2.0 + common.M2target / 2.0 / common.WminusTarget;
1786 Ytarget = 0.5 *
G4Log( ( common.Etarget + common.Pztarget )
1787 / ( common.Etarget - common.Pztarget ) );
1789 G4cout <<
"DecayMomentum2 " << DecayMomentum2 <<
G4endl
1790 <<
"WminusTarget WplusProjectile " << common.WminusTarget
1791 <<
" " << common.WplusProjectile <<
G4endl
1792 <<
"Ytarget " << Ytarget <<
G4endl;
1794 common.Mt2projectileNucleon =
sqr( common.TNucleonMass ) + common.PtNucleon.mag2();
1795 common.PzprojectileNucleon = common.WplusProjectile * common.XplusNucleon / 2.0
1796 - common.Mt2projectileNucleon
1797 / ( 2.0 * common.WplusProjectile * common.XplusNucleon );
1798 common.EprojectileNucleon = common.WplusProjectile * common.XplusNucleon / 2.0
1799 + common.Mt2projectileNucleon
1800 / ( 2.0 * common.WplusProjectile * common.XplusNucleon );
1801 YprojectileNucleon = 0.5 *
G4Log( ( common.EprojectileNucleon + common.PzprojectileNucleon )
1802 / ( common.EprojectileNucleon - common.PzprojectileNucleon) );
1804 G4cout <<
"YpN Ypr YpN-Ypr " <<
" " << YprojectileNucleon <<
" " << common.YprojectileNucleus
1805 <<
" " << YprojectileNucleon - common.YprojectileNucleus <<
G4endl
1806 <<
"YpN Ytr YpN-Ytr " <<
" " << YprojectileNucleon <<
" " << Ytarget
1807 <<
" " << YprojectileNucleon - Ytarget <<
G4endl;
1809 if ( std::abs( YprojectileNucleon - common.YprojectileNucleus ) > 2 ||
1810 Ytarget > YprojectileNucleon ) {
1811 OuterSuccess =
false;
1814 }
else if ( interactionCase == 3 ) {
1815 common.WplusProjectile = ( common.S + common.M2projectile - common.M2target
1816 + std::sqrt( DecayMomentum2 ) ) / 2.0 / common.SqrtS;
1817 common.WminusTarget = common.SqrtS - common.M2projectile / common.WplusProjectile;
1818 common.Mt2projectileNucleon =
sqr( common.PNucleonMass ) + common.PtNucleonP.mag2();
1819 common.PzprojectileNucleon = common.WplusProjectile * common.XplusNucleon / 2.0
1820 - common.Mt2projectileNucleon
1821 / ( 2.0 * common.WplusProjectile * common.XplusNucleon );
1822 common.EprojectileNucleon = common.WplusProjectile * common.XplusNucleon / 2.0
1823 + common.Mt2projectileNucleon
1824 / ( 2.0 * common.WplusProjectile * common.XplusNucleon );
1825 YprojectileNucleon = 0.5 *
G4Log( ( common.EprojectileNucleon + common.PzprojectileNucleon )
1826 / ( common.EprojectileNucleon - common.PzprojectileNucleon ) );
1827 common.Mt2targetNucleon =
sqr( common.TNucleonMass ) + common.PtNucleonT.mag2();
1828 common.PztargetNucleon = - common.WminusTarget * common.XminusNucleon / 2.0
1829 + common.Mt2targetNucleon
1830 / ( 2.0 * common.WminusTarget * common.XminusNucleon );
1831 common.EtargetNucleon = common.WminusTarget * common.XminusNucleon / 2.0
1832 + common.Mt2targetNucleon
1833 / ( 2.0 * common.WminusTarget * common.XminusNucleon );
1834 YtargetNucleon = 0.5 *
G4Log( ( common.EtargetNucleon + common.PztargetNucleon )
1835 / ( common.EtargetNucleon - common.PztargetNucleon ) );
1836 if ( std::abs( YtargetNucleon - common.YtargetNucleus ) > 2 ||
1837 std::abs( YprojectileNucleon - common.YprojectileNucleus ) > 2 ||
1838 YprojectileNucleon < YtargetNucleon ) {
1839 OuterSuccess =
false;
1844 }
while ( ( ! OuterSuccess ) &&
1845 ++loopCounter < maxNumberOfLoops );
1846 if ( loopCounter >= maxNumberOfLoops ) {
1848 G4cout <<
"BAD situation: forced exit of the while loop!" <<
G4endl;
1858void G4FTFModel::AdjustNucleonsAlgorithm_afterSampling(
G4int interactionCase,
1861 G4FTFModel::CommonVariables& common ) {
1866 if ( interactionCase == 1 ) {
1867 common.Pprojectile.setPz( common.Pzprojectile );
1868 common.Pprojectile.setE( common.Eprojectile );
1869 }
else if ( interactionCase == 2 ) {
1870 common.Pprojectile.setPx( common.PtNucleon.x() );
1871 common.Pprojectile.setPy( common.PtNucleon.y() );
1872 common.Pprojectile.setPz( common.PzprojectileNucleon );
1873 common.Pprojectile.setE( common.EprojectileNucleon );
1874 }
else if ( interactionCase == 3 ) {
1875 common.Pprojectile.setPx( common.PtNucleonP.x() );
1876 common.Pprojectile.setPy( common.PtNucleonP.y() );
1877 common.Pprojectile.setPz( common.PzprojectileNucleon );
1878 common.Pprojectile.setE( common.EprojectileNucleon );
1881 G4cout <<
"Proj after in CMS " << common.Pprojectile <<
G4endl;
1883 common.Pprojectile.transform( common.toLab );
1884 SelectedAntiBaryon->
Set4Momentum( common.Pprojectile );
1886 G4cout <<
"Proj after in Lab " << common.Pprojectile <<
G4endl;
1890 if ( interactionCase == 1 ) {
1891 common.Ptarget.setPx( common.PtNucleon.x() );
1892 common.Ptarget.setPy( common.PtNucleon.y() );
1893 common.Ptarget.setPz( common.PztargetNucleon );
1894 common.Ptarget.setE( common.EtargetNucleon );
1895 }
else if ( interactionCase == 2 ) {
1896 common.Ptarget.setPz( common.Pztarget );
1897 common.Ptarget.setE( common.Etarget );
1898 }
else if ( interactionCase == 3 ) {
1899 common.Ptarget.setPx( common.PtNucleonT.x() );
1900 common.Ptarget.setPy( common.PtNucleonT.y() );
1901 common.Ptarget.setPz( common.PztargetNucleon );
1902 common.Ptarget.setE( common.EtargetNucleon );
1905 G4cout <<
"Targ after in CMS " << common.Ptarget <<
G4endl;
1907 common.Ptarget.transform( common.toLab );
1910 G4cout <<
"Targ after in Lab " << common.Ptarget <<
G4endl;
1914 if ( interactionCase == 1 || interactionCase == 3 ) {
1915 TargetResidualMassNumber = common.TResidualMassNumber;
1916 TargetResidualCharge = common.TResidualCharge;
1917 TargetResidualExcitationEnergy = common.TResidualExcitationEnergy;
1919 G4cout <<
"TargetResidualMassNumber TargetResidualCharge TargetResidualExcitationEnergy "
1920 << TargetResidualMassNumber <<
" " << TargetResidualCharge <<
" "
1921 << TargetResidualExcitationEnergy <<
G4endl;
1923 if ( TargetResidualMassNumber != 0 ) {
1925 if ( interactionCase == 1 ) {
1926 Mt2 =
sqr( common.TResidualMass ) + common.PtResidual.mag2();
1927 TargetResidual4Momentum.
setPx( common.PtResidual.x() );
1928 TargetResidual4Momentum.
setPy( common.PtResidual.y() );
1930 Mt2 =
sqr( common.TResidualMass ) + common.PtResidualT.mag2();
1931 TargetResidual4Momentum.
setPx( common.PtResidualT.x() );
1932 TargetResidual4Momentum.
setPy( common.PtResidualT.y() );
1934 G4double Pz = - common.WminusTarget * common.XminusResidual / 2.0
1935 + Mt2 / ( 2.0 * common.WminusTarget * common.XminusResidual );
1936 G4double E = common.WminusTarget * common.XminusResidual / 2.0
1937 + Mt2 / ( 2.0 * common.WminusTarget * common.XminusResidual );
1938 TargetResidual4Momentum.
setPz( Pz );
1939 TargetResidual4Momentum.
setE( E ) ;
1940 TargetResidual4Momentum.
transform( common.toLab );
1945 G4cout <<
"Tr N R " << common.Ptarget <<
G4endl <<
" " << TargetResidual4Momentum <<
G4endl;
1950 if ( interactionCase == 2 || interactionCase == 3 ) {
1951 if ( interactionCase == 2 ) {
1952 ProjectileResidualMassNumber = common.TResidualMassNumber;
1953 ProjectileResidualCharge = common.TResidualCharge;
1954 ProjectileResidualExcitationEnergy = common.TResidualExcitationEnergy;
1955 ProjectileResidualLambdaNumber = common.PResidualLambdaNumber;
1957 ProjectileResidualMassNumber = common.PResidualMassNumber;
1958 ProjectileResidualCharge = common.PResidualCharge;
1959 ProjectileResidualExcitationEnergy = common.PResidualExcitationEnergy;
1960 ProjectileResidualLambdaNumber = common.PResidualLambdaNumber;
1963 G4cout <<
"ProjectileResidualMassNumber ProjectileResidualCharge Lambdas ProjectileResidualExcitationEnergy "
1964 << ProjectileResidualMassNumber <<
" " << ProjectileResidualCharge <<
" "
1965 << ProjectileResidualLambdaNumber <<
" "
1966 << ProjectileResidualExcitationEnergy <<
G4endl;
1968 if ( ProjectileResidualMassNumber != 0 ) {
1970 if ( interactionCase == 2 ) {
1971 Mt2 =
sqr( common.TResidualMass ) + common.PtResidual.mag2();
1972 ProjectileResidual4Momentum.
setPx( common.PtResidual.x() );
1973 ProjectileResidual4Momentum.
setPy( common.PtResidual.y() );
1975 Mt2 =
sqr( common.PResidualMass ) + common.PtResidualP.mag2();
1976 ProjectileResidual4Momentum.
setPx( common.PtResidualP.x() );
1977 ProjectileResidual4Momentum.
setPy( common.PtResidualP.y() );
1979 G4double Pz = common.WplusProjectile * common.XplusResidual / 2.0
1980 - Mt2 / ( 2.0 * common.WplusProjectile * common.XplusResidual );
1981 G4double E = common.WplusProjectile * common.XplusResidual / 2.0
1982 + Mt2 / ( 2.0 * common.WplusProjectile * common.XplusResidual );
1983 ProjectileResidual4Momentum.
setPz( Pz );
1984 ProjectileResidual4Momentum.
setE( E );
1985 ProjectileResidual4Momentum.
transform( common.toLab );
1991 <<
" " << ProjectileResidual4Momentum <<
G4endl;
2009 std::vector< G4VSplitableHadron* > primaries;
2011 while ( theParticipants.
Next() ) {
2015 if ( primaries.end() == std::find( primaries.begin(), primaries.end(),
2022 #ifdef debugBuildString
2024 <<
"Number of projectile strings " << primaries.size() <<
G4endl;
2027 for (
unsigned int ahadron = 0; ahadron < primaries.size(); ahadron++ ) {
2028 G4bool isProjectile(
true );
2031 FirstString = 0; SecondString = 0;
2032 if ( primaries[ahadron]->GetStatus() == 0 ) {
2033 theExcitation->
CreateStrings( primaries[ ahadron ], isProjectile,
2034 FirstString, SecondString, theParameters );
2035 NumberOfProjectileSpectatorNucleons--;
2036 }
else if ( primaries[ahadron]->GetStatus() == 1
2037 && primaries[ahadron]->GetSoftCollisionCount() != 0 ) {
2038 theExcitation->
CreateStrings( primaries[ ahadron ], isProjectile,
2039 FirstString, SecondString, theParameters );
2040 NumberOfProjectileSpectatorNucleons--;
2041 }
else if ( primaries[ahadron]->GetStatus() == 1
2042 && primaries[ahadron]->GetSoftCollisionCount() == 0 ) {
2045 primaries[ahadron]->GetTimeOfCreation(),
2046 primaries[ahadron]->GetPosition(),
2049 }
else if (primaries[ahadron]->GetStatus() == 2) {
2052 primaries[ahadron]->GetTimeOfCreation(),
2053 primaries[ahadron]->GetPosition(),
2056 NumberOfProjectileSpectatorNucleons--;
2058 G4cout <<
"Something wrong in FTF Model Build String" <<
G4endl;
2061 if ( FirstString != 0 ) strings->push_back( FirstString );
2062 if ( SecondString != 0 ) strings->push_back( SecondString );
2064 #ifdef debugBuildString
2065 G4cout <<
"FirstString & SecondString? " << FirstString <<
" " << SecondString <<
G4endl;
2066 if ( FirstString->IsExcited() ) {
2067 G4cout <<
"Quarks on the FirstString ends " << FirstString->GetRightParton()->GetPDGcode()
2068 <<
" " << FirstString->GetLeftParton()->GetPDGcode() <<
G4endl;
2076 #ifdef debugBuildString
2077 if ( FirstString->IsExcited() ) {
2078 G4cout <<
"Check 1 string " << strings->operator[](0)->GetRightParton()->GetPDGcode()
2079 <<
" " << strings->operator[](0)->GetLeftParton()->GetPDGcode() <<
G4endl <<
G4endl;
2088 #ifdef debugBuildString
2089 G4cout <<
"Building of projectile-like strings" <<
G4endl;
2092 G4bool isProjectile =
true;
2093 for (
G4int ahadron = 0; ahadron < NumberOfInvolvedNucleonsOfProjectile; ahadron++ ) {
2095 #ifdef debugBuildString
2096 G4cout <<
"Nucleon #, status, intCount " << ahadron <<
" "
2105 #ifdef debugBuildString
2106 G4cout <<
G4endl <<
"ahadron aProjectile Status " << ahadron <<
" " << aProjectile
2110 FirstString = 0; SecondString = 0;
2113 #ifdef debugBuildString
2114 G4cout <<
"Case1 aProjectile->GetStatus() == 0 " <<
G4endl;
2118 TheInvolvedNucleonsOfProjectile[ ahadron ]->GetSplitableHadron(),
2119 isProjectile, FirstString, SecondString, theParameters );
2120 NumberOfProjectileSpectatorNucleons--;
2124 #ifdef debugBuildString
2125 G4cout <<
"Case2 aProjectile->GetStatus() !=0 St==1 SoftCol!=0" <<
G4endl;
2129 TheInvolvedNucleonsOfProjectile[ ahadron ]->GetSplitableHadron(),
2130 isProjectile, FirstString, SecondString, theParameters );
2131 NumberOfProjectileSpectatorNucleons--;
2138 #ifdef debugBuildString
2139 G4cout <<
"Case3 aProjectile->GetStatus() !=0 St==1 SoftCol==0" <<
G4endl;
2149 #ifdef debugBuildString
2150 G4cout <<
" Strings are built for nucleon marked for an interaction, but"
2151 <<
" the interaction was skipped." <<
G4endl;
2157 #ifdef debugBuildString
2158 G4cout <<
"Case4 aProjectile->GetStatus() !=0 St==2 " <<
G4endl;
2168 #ifdef debugBuildString
2169 G4cout <<
" Strings are build for involved nucleon." <<
G4endl;
2172 if ( aProjectile->
GetStatus() == 2 ) NumberOfProjectileSpectatorNucleons--;
2175 #ifdef debugBuildString
2182 #ifdef debugBuildString
2188 if ( FirstString != 0 ) strings->push_back( FirstString );
2189 if ( SecondString != 0 ) strings->push_back( SecondString );
2193 #ifdef debugBuildString
2197 G4bool isProjectile =
false;
2198 for (
G4int ahadron = 0; ahadron < NumberOfInvolvedNucleonsOfTarget; ahadron++ ) {
2201 #ifdef debugBuildString
2202 G4cout <<
"Nucleon #, status, intCount " << aNucleon <<
" " << ahadron <<
" "
2206 FirstString = 0 ; SecondString = 0;
2210 FirstString, SecondString, theParameters );
2211 NumberOfTargetSpectatorNucleons--;
2213 #ifdef debugBuildString
2220 FirstString, SecondString, theParameters );
2222 #ifdef debugBuildString
2223 G4cout <<
" 2 case A string is build, nucleon was excited." <<
G4endl;
2226 NumberOfTargetSpectatorNucleons--;
2242 #ifdef debugBuildString
2247 ! HighEnergyInter ) {
2254 #ifdef debugBuildString
2258 }
else if ( aNucleon->
GetStatus() == 2 ||
2267 #ifdef debugBuildString
2271 if ( aNucleon->
GetStatus() == 2 ) NumberOfTargetSpectatorNucleons--;
2275 #ifdef debugBuildString
2281 if ( FirstString != 0 ) strings->push_back( FirstString );
2282 if ( SecondString != 0 ) strings->push_back( SecondString );
2286 #ifdef debugBuildString
2287 G4cout <<
G4endl <<
"theAdditionalString.size() " << theAdditionalString.size()
2291 isProjectile =
true;
2292 if ( theAdditionalString.size() != 0 ) {
2293 for (
unsigned int ahadron = 0; ahadron < theAdditionalString.size(); ahadron++ ) {
2295 FirstString = 0; SecondString = 0;
2296 theExcitation->
CreateStrings( theAdditionalString[ ahadron ], isProjectile,
2297 FirstString, SecondString, theParameters );
2298 if ( FirstString != 0 ) strings->push_back( FirstString );
2299 if ( SecondString != 0 ) strings->push_back( SecondString );
2315void G4FTFModel::GetResiduals() {
2318 #ifdef debugFTFmodel
2319 G4cout <<
"GetResiduals(): HighEnergyInter? GetProjectileNucleus()?"
2323 if ( HighEnergyInter ) {
2325 #ifdef debugFTFmodel
2326 G4cout <<
"NumberOfInvolvedNucleonsOfTarget "<< NumberOfInvolvedNucleonsOfTarget <<
G4endl;
2329 G4double DeltaExcitationE = TargetResidualExcitationEnergy /
2330 G4double( NumberOfInvolvedNucleonsOfTarget );
2332 G4double( NumberOfInvolvedNucleonsOfTarget );
2334 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfTarget; ++i ) {
2335 G4Nucleon* aNucleon = TheInvolvedNucleonsOfTarget[i];
2337 #ifdef debugFTFmodel
2348 if ( TargetResidualMassNumber != 0 ) {
2359 residualMomentum += tmp;
2363 residualMomentum /= TargetResidualMassNumber;
2381 const G4int maxNumberOfLoops = 1000;
2382 G4int loopCounter = 0;
2384 C = ( Chigh + Clow ) / 2.0;
2397 if ( SumMasses > Mass ) Chigh =
C;
2400 }
while ( Chigh - Clow > 0.01 &&
2401 ++loopCounter < maxNumberOfLoops );
2402 if ( loopCounter >= maxNumberOfLoops ) {
2403 #ifdef debugFTFmodel
2404 G4cout <<
"BAD situation: forced exit of the first while loop in G4FTFModel::GetResidual" <<
G4endl
2405 <<
"\t return immediately from the method!" <<
G4endl;
2425 #ifdef debugFTFmodel
2426 G4cout <<
"NumberOfInvolvedNucleonsOfProjectile " << NumberOfInvolvedNucleonsOfProjectile
2427 <<
G4endl <<
"ProjectileResidualExcitationEnergy ProjectileResidual4Momentum "
2428 << ProjectileResidualExcitationEnergy <<
" " << ProjectileResidual4Momentum <<
G4endl;
2431 DeltaExcitationE = ProjectileResidualExcitationEnergy /
2432 G4double( NumberOfInvolvedNucleonsOfProjectile );
2433 DeltaPResidualNucleus = ProjectileResidual4Momentum /
2434 G4double( NumberOfInvolvedNucleonsOfProjectile );
2436 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfProjectile; ++i ) {
2437 G4Nucleon* aNucleon = TheInvolvedNucleonsOfProjectile[i];
2439 #ifdef debugFTFmodel
2450 if ( ProjectileResidualMassNumber != 0 ) {
2457 while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {
2461 residualMomentum += tmp;
2465 residualMomentum /= ProjectileResidualMassNumber;
2467 G4double Mass = ProjectileResidual4Momentum.
mag();
2472 while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {
2483 const G4int maxNumberOfLoops = 1000;
2484 G4int loopCounter = 0;
2486 C = ( Chigh + Clow ) / 2.0;
2491 while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {
2500 if ( SumMasses > Mass) Chigh =
C;
2503 }
while ( Chigh - Clow > 0.01 &&
2504 ++loopCounter < maxNumberOfLoops );
2505 if ( loopCounter >= maxNumberOfLoops ) {
2506 #ifdef debugFTFmodel
2507 G4cout <<
"BAD situation: forced exit of the second while loop in G4FTFModel::GetResidual" <<
G4endl
2508 <<
"\t return immediately from the method!" <<
G4endl;
2515 while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {
2526 #ifdef debugFTFmodel
2532 #ifdef debugFTFmodel
2533 G4cout <<
"Low energy interaction: Target nucleus --------------" <<
G4endl
2534 <<
"Tr ResidualMassNumber Tr ResidualCharge Tr ResidualExcitationEnergy "
2535 << TargetResidualMassNumber <<
" " << TargetResidualCharge <<
" "
2536 << TargetResidualExcitationEnergy <<
G4endl;
2539 G4int NumberOfTargetParticipant( 0 );
2540 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfTarget; ++i ) {
2541 G4Nucleon* aNucleon = TheInvolvedNucleonsOfTarget[i];
2549 if ( NumberOfTargetParticipant != 0 ) {
2550 DeltaExcitationE = TargetResidualExcitationEnergy /
G4double( NumberOfTargetParticipant );
2551 DeltaPResidualNucleus = TargetResidual4Momentum /
G4double( NumberOfTargetParticipant );
2554 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfTarget; ++i ) {
2555 G4Nucleon* aNucleon = TheInvolvedNucleonsOfTarget[i];
2562 delete targetSplitable;
2563 targetSplitable = 0;
2564 aNucleon->
Hit( targetSplitable );
2569 #ifdef debugFTFmodel
2570 G4cout <<
"NumberOfTargetParticipant " << NumberOfTargetParticipant <<
G4endl
2571 <<
"TargetResidual4Momentum " << TargetResidual4Momentum <<
G4endl;
2576 #ifdef debugFTFmodel
2577 G4cout <<
"Low energy interaction: Projectile nucleus --------------" <<
G4endl
2578 <<
"Pr ResidualMassNumber Pr ResidualCharge Pr ResidualExcitationEnergy "
2579 << ProjectileResidualMassNumber <<
" " << ProjectileResidualCharge <<
" "
2580 << ProjectileResidualExcitationEnergy <<
G4endl;
2583 G4int NumberOfProjectileParticipant( 0 );
2584 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfProjectile; ++i ) {
2585 G4Nucleon* aNucleon = TheInvolvedNucleonsOfProjectile[i];
2590 #ifdef debugFTFmodel
2594 DeltaExcitationE = 0.0;
2597 if ( NumberOfProjectileParticipant != 0 ) {
2598 DeltaExcitationE = ProjectileResidualExcitationEnergy /
G4double( NumberOfProjectileParticipant );
2599 DeltaPResidualNucleus = ProjectileResidual4Momentum /
G4double( NumberOfProjectileParticipant );
2603 for (
G4int i = 0; i < NumberOfInvolvedNucleonsOfProjectile; ++i ) {
2604 G4Nucleon* aNucleon = TheInvolvedNucleonsOfProjectile[i];
2611 delete projectileSplitable;
2612 projectileSplitable = 0;
2613 aNucleon->
Hit( projectileSplitable );
2618 #ifdef debugFTFmodel
2619 G4cout <<
"NumberOfProjectileParticipant " << NumberOfProjectileParticipant <<
G4endl
2620 <<
"ProjectileResidual4Momentum " << ProjectileResidual4Momentum <<
G4endl;
2625 #ifdef debugFTFmodel
2626 G4cout <<
"End GetResiduals -----------------" <<
G4endl;
2638 if (AveragePt2 > 0.0) {
2639 const G4double ymax = maxPtSquare/AveragePt2;
2640 if ( ymax < 200. ) {
2645 Pt = std::sqrt( Pt2 );
2650 return G4ThreeVector( Pt*std::cos(phi), Pt*std::sin(phi), 0.0 );
2660 G4double& residualExcitationEnergy,
2662 G4int& residualMassNumber,
2663 G4int& residualCharge ) {
2675 if ( ! nucleus )
return false;
2677 G4double ExcitationEnergyPerWoundedNucleon =
2691 G4int residualNumberOfLambdas = 0;
2701 sumMasses += 20.0*MeV;
2704 residualExcitationEnergy += -ExcitationEnergyPerWoundedNucleon*
G4Log(
G4UniformRand() );
2706 residualMassNumber--;
2713 ++residualNumberOfLambdas;
2717 #ifdef debugPutOnMassShell
2718 G4cout <<
"ExcitationEnergyPerWoundedNucleon " << ExcitationEnergyPerWoundedNucleon <<
G4endl
2719 <<
"\t Residual Charge, MassNumber (Number of Lambdas)" << residualCharge <<
" "
2720 << residualMassNumber <<
" (" << residualNumberOfLambdas <<
") "
2721 <<
G4endl <<
"\t Initial Momentum " << nucleusMomentum
2722 <<
G4endl <<
"\t Residual Momentum " << residualMomentum <<
G4endl;
2724 residualMomentum.
setPz( 0.0 );
2725 residualMomentum.
setE( 0.0 );
2726 if ( residualMassNumber == 0 ) {
2728 residualExcitationEnergy = 0.0;
2730 if ( residualMassNumber == 1 ) {
2731 if ( std::abs( residualCharge ) == 1 ) {
2733 }
else if ( residualNumberOfLambdas == 1 ) {
2738 residualExcitationEnergy = 0.0;
2740 if ( residualNumberOfLambdas > 0 ) {
2741 if ( residualMassNumber == 2 ) {
2743 if ( std::abs( residualCharge ) == 1 ) {
2745 }
else if ( residualNumberOfLambdas == 1 ) {
2752 residualNumberOfLambdas );
2756 GetIonMass( std::abs( residualCharge ), residualMassNumber );
2759 residualMass += residualExcitationEnergy;
2761 sumMasses += std::sqrt(
sqr( residualMass ) + residualMomentum.
perp2() );
2769GenerateDeltaIsobar(
const G4double sqrtS,
2770 const G4int numberOfInvolvedNucleons,
2788 if ( sqrtS < 0.0 || numberOfInvolvedNucleons <= 0 || sumMasses < 0.0 )
return false;
2790 const G4double probDeltaIsobar = 0.05;
2792 G4int maxNumberOfDeltas =
G4int( (sqrtS - sumMasses)/(400.0*MeV) );
2793 G4int numberOfDeltas = 0;
2795 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
2797 if (
G4UniformRand() < probDeltaIsobar && numberOfDeltas < maxNumberOfDeltas ) {
2799 if ( ! involvedNucleons[i] )
continue;
2809 G4int newPdgCode = pdgCode/10; newPdgCode = newPdgCode*10 + 4;
2818 if ( sqrtS < sumMasses + massDelta - massNuc ) {
2822 sumMasses += ( massDelta - massNuc );
2834SamplingNucleonKinematics(
G4double averagePt2,
2840 const G4int residualMassNumber,
2841 const G4int numberOfInvolvedNucleons,
2854#ifdef debugPutOnMassShell
2855 G4cout <<
"G4FTFModel::SamplingNucleonKinematics:" <<
G4endl;
2856 G4cout <<
" averagePt2= " << averagePt2 <<
" maxPt2= " << maxPt2
2857 <<
" dCor= " << dCor <<
" resMass(GeV)= " << residualMass/GeV
2858 <<
" resMassN= " << residualMassNumber
2859 <<
" nNuc= " << numberOfInvolvedNucleons
2860 <<
" lv= " << pResidual <<
G4endl;
2863 if ( ! nucleus || numberOfInvolvedNucleons < 1 )
return false;
2865 if ( residualMassNumber == 0 && numberOfInvolvedNucleons == 1 ) {
2877 const G4int maxNumberOfLoops = 1000;
2878 G4int loopCounter = 0;
2885 if( averagePt2 > 0.0 ) {
2886 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
2887 G4Nucleon* aNucleon = involvedNucleons[i];
2888 if ( ! aNucleon )
continue;
2896 G4double deltaPx = ( ptSum.x() - pResidual.
x() )*invN;
2897 G4double deltaPy = ( ptSum.y() - pResidual.
y() )*invN;
2899 SumMasses = residualMass;
2900 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
2901 G4Nucleon* aNucleon = involvedNucleons[i];
2902 if ( ! aNucleon )
continue;
2906 +
sqr( px ) +
sqr( py ) );
2915 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
2916 G4Nucleon* aNucleon = involvedNucleons[i];
2917 if ( ! aNucleon )
continue;
2925 if ( x < -eps || x > 1.0 + eps ) {
2929 x = std::min(1.0, std::max(x, 0.0));
2939 if ( xSum < -eps || xSum > 1.0 + eps ) success =
false;
2940 if ( ! success )
continue;
2942 G4double delta = ( residualMassNumber == 0 ) ? std::min( xSum - 1.0, 0.0 )*invN : 0.0;
2946 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
2947 G4Nucleon* aNucleon = involvedNucleons[i];
2948 if ( ! aNucleon )
continue;
2952 if ( residualMassNumber == 0 ) {
2953 if ( x <= -eps || x > 1.0 + eps ) {
2958 if ( x <= -eps || x > 1.0 + eps || xSum <= -eps || xSum > 1.0 + eps ) {
2963 x = std::min( 1.0, std::max(x, eps) );
2971 if ( ! success )
continue;
2972 xSum = std::min( 1.0, std::max(xSum, eps) );
2974 if ( residualMassNumber > 0 ) mass2 += (
sqr( residualMass ) + pResidual.
perp2() ) / xSum;
2976 #ifdef debugPutOnMassShell
2977 G4cout <<
"success: " << success <<
" Mt(GeV)= "
2978 << std::sqrt( mass2 )/GeV <<
G4endl;
2981 }
while ( ( ! success ) &&
2982 ++loopCounter < maxNumberOfLoops );
2983 return ( loopCounter < maxNumberOfLoops );
2990CheckKinematics(
const G4double sValue,
2995 const G4bool isProjectileNucleus,
2996 const G4int numberOfInvolvedNucleons,
3011 G4double decayMomentum2 =
sqr( sValue ) +
sqr( projectileMass2 ) +
sqr( targetMass2 )
3012 - 2.0*( sValue*( projectileMass2 + targetMass2 )
3013 + projectileMass2*targetMass2 );
3014 targetWminus = ( sValue - projectileMass2 + targetMass2 + std::sqrt( decayMomentum2 ) )
3016 projectileWplus = sqrtS - targetMass2/targetWminus;
3017 G4double projectilePz = projectileWplus/2.0 - projectileMass2/2.0/projectileWplus;
3018 G4double projectileE = projectileWplus/2.0 + projectileMass2/2.0/projectileWplus;
3019 G4double projectileY = 0.5 *
G4Log( (projectileE + projectilePz)/
3020 (projectileE - projectilePz) );
3021 G4double targetPz = -targetWminus/2.0 + targetMass2/2.0/targetWminus;
3022 G4double targetE = targetWminus/2.0 + targetMass2/2.0/targetWminus;
3023 G4double targetY = 0.5 *
G4Log( (targetE + targetPz)/(targetE - targetPz) );
3025 #ifdef debugPutOnMassShell
3026 G4cout <<
"decayMomentum2 " << decayMomentum2 <<
G4endl
3027 <<
"\t targetWminus projectileWplus " << targetWminus <<
" " << projectileWplus <<
G4endl
3028 <<
"\t projectileY targetY " << projectileY <<
" " << targetY <<
G4endl;
3029 if ( isProjectileNucleus ) {
3030 G4cout <<
"Order# of Wounded nucleon i, nucleon Y proj Y nuclY - proj Y " <<
G4endl;
3032 G4cout <<
"Order# of Wounded nucleon i, nucleon Y targ Y nuclY - targ Y " <<
G4endl;
3037 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
3038 G4Nucleon* aNucleon = involvedNucleons[i];
3039 if ( ! aNucleon )
continue;
3044 G4double pz = -targetWminus*x/2.0 + mt2/(2.0*targetWminus*x);
3045 G4double e = targetWminus*x/2.0 + mt2/(2.0*targetWminus*x);
3046 if ( isProjectileNucleus ) {
3047 pz = projectileWplus*x/2.0 - mt2/(2.0*projectileWplus*x);
3048 e = projectileWplus*x/2.0 + mt2/(2.0*projectileWplus*x);
3052 #ifdef debugPutOnMassShell
3053 if( isProjectileNucleus ) {
3054 G4cout <<
" " << i <<
" " << nucleonY <<
" " << projectileY <<
" " <<nucleonY - projectileY <<
G4endl;
3056 G4cout <<
" " << i <<
" " << nucleonY <<
" " << targetY <<
" " <<nucleonY - targetY <<
G4endl;
3061 if ( std::abs( nucleonY - nucleusY ) > 2 ||
3062 ( isProjectileNucleus && targetY > nucleonY ) ||
3063 ( ! isProjectileNucleus && projectileY < nucleonY ) ) {
3075FinalizeKinematics(
const G4double w,
3076 const G4bool isProjectileNucleus,
3079 const G4int residualMassNumber,
3080 const G4int numberOfInvolvedNucleons,
3098 for (
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
3099 G4Nucleon* aNucleon = involvedNucleons[i];
3100 if ( ! aNucleon )
continue;
3102 residual3Momentum -= tmp.
vect();
3106 G4double pz = -w * x / 2.0 + mt2 / ( 2.0 * w * x );
3107 G4double e = w * x / 2.0 + mt2 / ( 2.0 * w * x );
3109 if ( isProjectileNucleus ) pz *= -1.0;
3118 G4double residualMt2 =
sqr( residualMass ) +
sqr( residual3Momentum.x() )
3119 +
sqr( residual3Momentum.y() );
3121 #ifdef debugPutOnMassShell
3122 if ( isProjectileNucleus ) {
3123 G4cout <<
"Wminus Proj and residual3Momentum.z() " << w <<
" " << residual3Momentum.z() <<
G4endl;
3125 G4cout <<
"Wplus Targ and residual3Momentum.z() " << w <<
" " << residual3Momentum.z() <<
G4endl;
3131 if ( residualMassNumber != 0 ) {
3132 residualPz = -w * residual3Momentum.z() / 2.0 +
3133 residualMt2 / ( 2.0 * w * residual3Momentum.z() );
3134 residualE = w * residual3Momentum.z() / 2.0 +
3135 residualMt2 / ( 2.0 * w * residual3Momentum.z() );
3137 if ( isProjectileNucleus ) residualPz *= -1.0;
3140 residual4Momentum.
setPx( residual3Momentum.x() );
3141 residual4Momentum.
setPy( residual3Momentum.y() );
3142 residual4Momentum.
setPz( residualPz );
3143 residual4Momentum.
setE( residualE );
3152 desc <<
" FTF (Fritiof) Model \n"
3153 <<
"The FTF model is based on the well-known FRITIOF \n"
3154 <<
"model (B. Andersson et al., Nucl. Phys. B281, 289 \n"
3155 <<
"(1987)). Its first program implementation was given\n"
3156 <<
"by B. Nilsson-Almquist and E. Stenlund (Comp. Phys.\n"
3157 <<
"Comm. 43, 387 (1987)). The Fritiof model assumes \n"
3158 <<
"that all hadron-hadron interactions are binary \n"
3159 <<
"reactions, h_1+h_2->h_1'+h_2' where h_1' and h_2' \n"
3160 <<
"are excited states of the hadrons with continuous \n"
3161 <<
"mass spectra. The excited hadrons are considered as\n"
3162 <<
"QCD-strings, and the corresponding LUND-string \n"
3163 <<
"fragmentation model is applied for a simulation of \n"
3164 <<
"their decays. \n"
3165 <<
" The Fritiof model assumes that in the course of \n"
3166 <<
"a hadron-nucleus interaction a string originated \n"
3167 <<
"from the projectile can interact with various intra\n"
3168 <<
"nuclear nucleons and becomes into highly excited \n"
3169 <<
"states. The probability of multiple interactions is\n"
3170 <<
"calculated in the Glauber approximation. A cascading\n"
3171 <<
"of secondary particles was neglected as a rule. Due\n"
3172 <<
"to these, the original Fritiof model fails to des- \n"
3173 <<
"cribe a nuclear destruction and slow particle spectra.\n"
3174 <<
" In order to overcome the difficulties we enlarge\n"
3175 <<
"the model by the reggeon theory inspired model of \n"
3176 <<
"nuclear desctruction (Kh. Abdel-Waged and V.V. Uzhi-\n"
3177 <<
"nsky, Phys. Atom. Nucl. 60, 828 (1997); Yad. Fiz. 60, 925\n"
3178 <<
"(1997)). Momenta of the nucleons ejected from a nuc-\n"
3179 <<
"leus in the reggeon cascading are sampled according\n"
3180 <<
"to a Fermi motion algorithm presented in (EMU-01 \n"
3181 <<
"Collaboration (M.I. Adamovich et al.) Zeit. fur Phys.\n"
3182 <<
"A358, 337 (1997)). \n"
3183 <<
" New features were also added to the Fritiof model\n"
3184 <<
"implemented in Geant4: a simulation of elastic had-\n"
3185 <<
"ron-nucleon scatterings, a simulation of binary \n"
3186 <<
"reactions like NN>NN* in hadron-nucleon interactions,\n"
3187 <<
"a separate simulation of single diffractive and non-\n"
3188 <<
" diffractive events. These allowed to describe after\n"
3189 <<
"model parameter tuning a wide set of experimental \n"
G4double S(G4double temp)
G4double condition(const G4ErrorSymMatrix &m)
std::vector< G4ExcitedString * > G4ExcitedStringVector
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
CLHEP::HepLorentzRotation G4LorentzRotation
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
void setVect(const Hep3Vector &)
Hep3Vector findBoostToCM() const
HepLorentzVector & transform(const HepRotation &)
static G4AntiLambda * Definition()
static G4AntiNeutron * Definition()
static G4AntiProton * Definition()
virtual G4bool ExciteParticipants(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters, G4ElasticHNScattering *theElastic) const
virtual void CreateStrings(G4VSplitableHadron *aHadron, G4bool isProjectile, G4ExcitedString *&FirstString, G4ExcitedString *&SecondString, G4FTFParameters *theParameters) const
virtual G4bool ElasticScattering(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters) const
virtual G4bool Annihilate(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4VSplitableHadron *&AdditionalString, G4FTFParameters *theParameters) const
G4bool SampleBinInterval() const
void SetImpactParameter(const G4double b_value)
G4V3DNucleus * GetTargetNucleus() const
G4FTFModel(const G4String &modelName="FTF")
G4ExcitedStringVector * GetStrings() override
G4V3DNucleus * GetProjectileNucleus() const override
void Init(const G4Nucleus &aNucleus, const G4DynamicParticle &aProjectile) override
void ModelDescription(std::ostream &) const override
G4double GetCofNuclearDestructionPr()
G4double GetProbabilityOfAnnihilation()
G4double GetMaxNumberOfCollisions()
void SetProbabilityOfElasticScatt(const G4double Xtotal, const G4double Xelastic)
G4double GetPt2ofNuclearDestruction()
G4double GetMaxPt2ofNuclearDestruction()
G4double GetProbabilityOfElasticScatt()
G4double GetExcitationEnergyPerWoundedNucleon()
void InitForInteraction(const G4ParticleDefinition *, G4int theA, G4int theZ, G4double s)
G4double GetDofNuclearDestruction()
G4double GetR2ofNuclearDestruction()
G4double GetCofNuclearDestruction()
void GetList(const G4ReactionProduct &thePrimary, G4FTFParameters *theParameters)
void SetBminBmax(const G4double bmin_value, const G4double bmax_value)
G4double GetImpactParameter() const
G4InteractionContent & GetInteraction()
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
static G4double GetNuclearMass(G4int A, G4int Z, G4int L)
G4Nucleon * GetTargetNucleon() const
G4VSplitableHadron * GetProjectile() const
G4Nucleon * GetProjectileNucleon() const
void SetStatus(G4int aValue)
G4VSplitableHadron * GetTarget() const
G4double GetIonMass(G4int Z, G4int A, G4int nL=0, G4int lvl=0) const
static G4Lambda * Definition()
static G4Neutron * Definition()
const G4ThreeVector & GetPosition() const
void SetMomentum(G4LorentzVector &aMomentum)
G4VSplitableHadron * GetSplitableHadron() const
virtual const G4LorentzVector & Get4Momentum() const
void Hit(G4VSplitableHadron *aHit)
G4double GetBindingEnergy() const
void SetParticleType(G4Proton *aProton)
void SetBindingEnergy(G4double anEnergy)
virtual const G4ParticleDefinition * GetDefinition() const
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4double GetPDGCharge() const
G4int GetNumberOfLambdasInHypernucleus() const
G4int GetBaryonNumber() const
G4int GetNumberOfAntiLambdasInAntiHypernucleus() const
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static G4Proton * Definition()
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetTotalMomentum() const
const G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
virtual G4Nucleon * GetNextNucleon()=0
virtual G4bool StartLoop()=0
virtual void DoLorentzBoost(const G4LorentzVector &theBoost)=0
virtual void DoLorentzContraction(const G4LorentzVector &theBoost)=0
virtual G4int GetMassNumber()=0
virtual void InitProjectileNucleus(G4int theZ, G4int theA, G4int numberOfLambdasOrAntiLambdas=0)
virtual void Init(G4int theZ, G4int theA)
virtual void SetProjectileNucleus(G4V3DNucleus *aNucleus)
virtual G4V3DNucleus * GetProjectileNucleus() const
void SetTimeOfCreation(G4double aTime)
void SetStatus(const G4int aStatus)
const G4ParticleDefinition * GetDefinition() const
G4double GetTimeOfCreation()
void Set4Momentum(const G4LorentzVector &a4Momentum)
void SetDefinition(const G4ParticleDefinition *aDefinition)
const G4LorentzVector & Get4Momentum() const
const G4ThreeVector & GetPosition() const
G4int GetSoftCollisionCount()
void operator()(G4VSplitableHadron *aH)