81  for ( 
G4int i = 0; i < 250; ++i ) {
 
  146       if ( aNucleon ) 
delete aNucleon;
 
  154       if ( aNucleon ) 
delete aNucleon;
 
  174         << 
"FTF init Target A Z " << aNucleus.
GetA_asInt() 
 
  323    G4cout << 
"FTF PutOnMassShell Success?  " << Success << 
G4endl;
 
  335  G4cout << 
"FTF ExciteParticipants Success? " << Success << 
G4endl;
 
  341    G4cout << 
"FTF BuildStrings ";
 
  347    G4cout << 
"FTF BuildStrings " << theStrings << 
" OK" << 
G4endl 
  348           << 
"FTF GetResiduals of Nuclei " << 
G4endl;
 
  361    std::vector< G4VSplitableHadron* > primaries;
 
  366      if ( primaries.end() == 
 
  367           std::find( primaries.begin(), primaries.end(), interaction.
GetProjectile() ) ) {
 
  381    if ( aNucleon ) 
delete aNucleon;
 
  388    if ( aNucleon ) 
delete aNucleon;
 
  394         << 
"To continue - enter 1, to stop - ^C" << 
G4endl;
 
  422  G4cout << 
"G4FTFModel::StoreInvolvedNucleon -------------" << 
G4endl;
 
  438  while ( ( aProjectileNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {  
 
  459  #ifdef debugReggeonCascade 
  460  G4cout << 
"G4FTFModel::ReggeonCascade -----------" << 
G4endl 
  469  for ( 
G4int InvTN = 0; InvTN < InitNINt; InvTN++ ) { 
 
  496          Neighbour->
Hit( targetSplitable );
 
  504  #ifdef debugReggeonCascade 
  505  G4cout << 
"Final NumberOfInvolvedNucleonsOfTarget "  
  515  for ( 
G4int InvPN = 0; InvPN < InitNINp; InvPN++ ) { 
 
  527    while ( ( Neighbour = theProjectileNucleus->
GetNextNucleon() ) ) {  
 
  542          Neighbour->
Hit( projectileSplitable );
 
  550  #ifdef debugReggeonCascade 
  551  G4cout << 
"NumberOfInvolvedNucleonsOfProjectile " 
  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 
  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 : ";
 
  608    if ( ! isOk ) 
return false;
 
  615  #ifdef debugPutOnMassShell 
  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() );
 
  629                            + PprojResidual.
perp2() ); 
 
  631  SumMasses -= std::sqrt( 
sqr( TargetResidualMass ) + PtargetResidual.
perp2() );
 
  633                          + PtargetResidual.
perp2() );
 
  635  if ( SqrtS < SumMasses ) {
 
  636    SumMasses = savedSumMasses;
 
  644  #ifdef debugPutOnMassShell 
  645  if ( isProjectileNucleus ) {
 
  646    G4cout << 
"PrResidualMass ProjResidualExcitationEnergy " << PrResidualMass/
GeV << 
" " 
  649  G4cout << 
"TargetResidualMass TargetResidualExcitationEnergy " << TargetResidualMass/
GeV << 
" "  
  651         << 
"Sum masses " << SumMasses/
GeV << 
G4endl;
 
  655  if ( isProjectileNucleus  &&  thePrNucleus->
GetMassNumber() != 1 ) {
 
  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 ) {
 
  730                                          thePrNucleus, PprojResidual, 
 
  737                                                  theTargetNucleus, PtargetResidual, 
 
  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, 
 
  759                              WminusTarget, WplusProjectile, OuterSuccess );
 
  761    isOk = isOk  &&  
CheckKinematics( 
S, SqrtS, M2proj, M2target, YtargetNucleus, 
false, 
 
  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;
 
  800    #ifdef debugPutOnMassShell 
  810    #ifdef debugPutOnMassShell 
  814    if ( ! isOk ) 
return false;
 
  818    #ifdef debugPutOnMassShell 
  828  #ifdef debugPutOnMassShell 
  832  if ( ! isOk ) 
return false;
 
  836  #ifdef debugPutOnMassShell 
  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 );
 
  872    CurrentInteraction++;
 
  879    #ifdef debugBuildString 
  880    G4cout << 
G4endl << 
"Interaction # Status    " << CurrentInteraction << 
" "  
  882           << target << 
G4endl << 
"projectile->GetStatus target->GetStatus " 
  892        #ifdef debugBuildString 
  897          G4bool Annihilation = 
false;
 
  899                                          TargetNucleon, Annihilation );
 
  900          if ( ! Result ) 
continue;
 
  906        #ifdef debugBuildString 
  908               << 
"MaxNumOfInelCollisions per hadron/nucleon " << MaxNumOfInelCollisions << 
G4endl;
 
  912          G4bool Annihilation = 
false;
 
  914                                          TargetNucleon, Annihilation );
 
  915          if ( ! Result ) 
continue;
 
  929            #ifdef debugBuildString 
  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;
 
  957        #ifdef debugBuildString 
  968          if ( projectile == NextProjectileNucleon  ||  target == NextTargetNucleon ) {
 
  979          G4bool Annihilation = 
true;
 
  981                                          TargetNucleon, Annihilation );
 
  982          if ( ! Result ) 
continue;
 
  987          #ifdef debugBuildString 
  988          G4cout << 
"Annihilation successfull. " << 
"*AdditionalString "  
  989                 << AdditionalString << 
G4endl;
 
 1014    if( InnerSuccess ) Success = 
true;
 
 1016    #ifdef debugBuildString 
 1017    G4cout << 
"----------------------------- Final properties " << 
G4endl 
 1018           << 
"projectile->GetStatus target->GetStatus " << projectile->
GetStatus() 
 
 1019           << 
" " << target->
GetStatus() << 
G4endl << 
"projectile->GetSoftC  target->GetSoftC  " 
 1021           << 
G4endl << 
"ExciteParticipants() Success? " << Success << 
G4endl;
 
 1039  G4cout << 
"AdjustNucleons ---------------------------------------" << 
G4endl 
 1043         << 
"Pr ResidualMassNumber Pr ResidualCharge Pr ResidualExcitationEnergy " 
 1046         << 
"Tr ResidualMassNumber Tr ResidualCharge Tr ResidualExcitationEnergy  " 
 1058  G4int interactionCase = 0;
 
 1068    interactionCase = 1;
 
 1070    G4cout << 
"case 1, hA prcol=0 trcol=0, AA prcol#0 trcol=0" << 
G4endl;
 
 1089    interactionCase = 2;
 
 1109    interactionCase = 3;
 
 1119           << 
"ProjectileResidualMassNumber ProjectileResidualCharge (ProjectileResidualLambdaNumber)"  
 1129                                                             ProjectileNucleon, SelectedTargetNucleon,
 
 1130                                                             TargetNucleon, Annihilation, 
common );
 
 1131  G4bool returnResult = 
false;
 
 1132  if ( returnCode == 0 ) {
 
 1133    returnResult = 
true;  
 
 1134  } 
else if ( returnCode == 1 ) {
 
 1137    if ( returnResult ) {  
 
 1139                                             SelectedTargetNucleon, 
common ); 
 
 1143  return returnResult;
 
 1160  G4int returnCode = 99;
 
 1165  if ( interactionCase == 1 ) {
 
 1171  } 
else if ( interactionCase == 2 ) {
 
 1174  } 
else if ( interactionCase == 3 ) {
 
 1191  if ( interactionCase == 1 ) {
 
 1197    if ( 
common.TResidualMassNumber <= 1 ) {
 
 1198      common.TResidualExcitationEnergy = 0.0;
 
 1200    if ( 
common.TResidualMassNumber != 0 ) {
 
 1210  } 
else if ( interactionCase == 2 ) {
 
 1217    if ( 
common.TResidualMassNumber <= 1 ) {
 
 1218      common.TResidualExcitationEnergy = 0.0;
 
 1220    if ( 
common.TResidualMassNumber != 0 ) {
 
 1228    G4cout << 
"SelectedTN.mag() PNMass + PResidualMass "  
 1232  } 
else if ( interactionCase == 3 ) {
 
 1240      --
common.PResidualLambdaNumber;  
 
 1244    if ( 
common.PResidualMassNumber <= 1 ) {
 
 1245      common.PResidualExcitationEnergy = 0.0;
 
 1247    if ( 
common.PResidualMassNumber != 0 ) {
 
 1248      if ( 
common.PResidualLambdaNumber > 0 ) {
 
 1251                                    common.PResidualLambdaNumber );
 
 1263    if ( 
common.TResidualMassNumber <= 1 ) {
 
 1264      common.TResidualExcitationEnergy = 0.0;
 
 1266    if ( 
common.TResidualMassNumber != 0 ) {
 
 1274    G4cout << 
"PNucleonMass PResidualMass TNucleonMass TResidualMass " << 
common.PNucleonMass 
 
 1275           << 
" " << 
common.PResidualMass << 
" " << 
common.TNucleonMass << 
" "  
 1277           << 
"PResidualExcitationEnergy " << 
common.PResidualExcitationEnergy << 
G4endl 
 1278           << 
"TResidualExcitationEnergy " << 
common.TResidualExcitationEnergy << 
G4endl;
 
 1282  if ( ! Annihilation ) {
 
 1289    if ( interactionCase == 1  ||  interactionCase == 2 ) {
 
 1292        G4cout << 
"TResidualExcitationEnergy : before " << 
common.TResidualExcitationEnergy << 
G4endl;
 
 1296        G4cout << 
"TResidualExcitationEnergy : after " << 
common.TResidualExcitationEnergy << 
G4endl;
 
 1301    } 
else if ( interactionCase == 3 ) {
 
 1303      G4cout << 
"SqrtS < SumMasses + PResidualExcitationEnergy + TResidualExcitationEnergy " 
 1308                          + 
common.TResidualExcitationEnergy ) { 
 
 1310        if ( 
common.PResidualExcitationEnergy <= 0.0 ) {
 
 1312        } 
else if ( 
common.TResidualExcitationEnergy <= 0.0 ) {
 
 1316            /  ( 
common.PResidualExcitationEnergy + 
common.TResidualExcitationEnergy );
 
 1317          common.PResidualExcitationEnergy *= Fraction;
 
 1318          common.TResidualExcitationEnergy *= Fraction;
 
 1324  if ( Annihilation ) {
 
 1326    G4cout << 
"SqrtS < SumMasses - TNucleonMass " << 
common.SqrtS << 
" "  
 1336      if ( interactionCase == 2  ||  interactionCase == 3 ) {
 
 1337        common.TResidualExcitationEnergy = 0.0;
 
 1340                            - 
common.TResidualExcitationEnergy;  
 
 1350    if ( interactionCase == 1  ||  interactionCase == 2 ) {
 
 1355    } 
else if ( interactionCase == 3 ) {
 
 1357                          + 
common.TResidualExcitationEnergy ) {
 
 1359        if ( 
common.PResidualExcitationEnergy <= 0.0 ) {
 
 1361        } 
else if ( 
common.TResidualExcitationEnergy <= 0.0 ) {
 
 1365            ( 
common.PResidualExcitationEnergy + 
common.TResidualExcitationEnergy );
 
 1366          common.PResidualExcitationEnergy *= Fraction;
 
 1367          common.TResidualExcitationEnergy *= Fraction;
 
 1381    if ( interactionCase == 1 ) {
 
 1383    } 
else if ( interactionCase == 2 ) {
 
 1385    } 
else if ( interactionCase == 3 ) {
 
 1400    if ( interactionCase == 1  ||  interactionCase == 3 ) {
 
 1402    } 
else if ( interactionCase == 2 ) {
 
 1417    if ( interactionCase == 1  ||  interactionCase == 3 ) {
 
 1426      common.Ptmp.setPx( -saveSelectedTargetNucleon4Momentum.
x() ); 
 
 1427      common.Ptmp.setPy( -saveSelectedTargetNucleon4Momentum.
y() ); 
 
 1428      common.Ptmp.setPz( -saveSelectedTargetNucleon4Momentum.
z() );
 
 1438    if ( interactionCase == 2  ||  interactionCase == 3 ) {
 
 1440      if ( interactionCase == 2 ) {
 
 1455        common.Ptmp.setPx( -saveSelectedAntiBaryon4Momentum.
x() ); 
 
 1456        common.Ptmp.setPy( -saveSelectedAntiBaryon4Momentum.
y() ); 
 
 1457        common.Ptmp.setPz( -saveSelectedAntiBaryon4Momentum.
z() );
 
 1467    return returnCode = 0;  
 
 1471  if ( interactionCase == 1 ) {
 
 1475    common.YtargetNucleus = 
common.TResidual4Momentum.rapidity();
 
 1476    common.TResidualMass += 
common.TResidualExcitationEnergy;
 
 1477  } 
else if ( interactionCase == 2 ) {
 
 1481    common.YprojectileNucleus = 
common.TResidual4Momentum.rapidity();
 
 1482    common.TResidualMass += 
common.TResidualExcitationEnergy;
 
 1483  } 
else if ( interactionCase == 3 ) {
 
 1485    common.YprojectileNucleus = 
common.PResidual4Momentum.rapidity();
 
 1487    common.YtargetNucleus = 
common.TResidual4Momentum.rapidity();
 
 1488    common.PResidualMass += 
common.PResidualExcitationEnergy;
 
 1489    common.TResidualMass += 
common.TResidualExcitationEnergy;
 
 1495  return returnCode = 1;  
 
 1515  G4bool OuterSuccess = 
true;
 
 1516  const G4int maxNumberOfLoops = 1000;
 
 1517  const G4int maxNumberOfTries = 10000;
 
 1518  G4int loopCounter = 0;
 
 1519  G4int NumberOfTries = 0;
 
 1521    OuterSuccess = 
true;
 
 1522    G4bool loopCondition = 
false;
 
 1524      if ( NumberOfTries == 100*(NumberOfTries/100) ) { 
 
 1527        DcorP      *= ScaleFactor;
 
 1528        DcorT      *= ScaleFactor;
 
 1529        AveragePt2 *= ScaleFactor;
 
 1536      if ( interactionCase == 1 ) {
 
 1537      } 
else if ( interactionCase == 2 ) {
 
 1548                             + std::sqrt( 
sqr( 
common.TResidualMass ) + 
common.PtResidual.mag2() );
 
 1555          OuterSuccess = 
false; 
 
 1556          loopCondition = 
true;
 
 1559      } 
else if ( interactionCase == 3 ) {
 
 1573                             + std::sqrt( 
sqr( 
common.PResidualMass ) + 
common.PtResidualP.mag2() );
 
 1576                         + std::sqrt( 
sqr( 
common.TResidualMass ) + 
common.PtResidualT.mag2() );
 
 1579          OuterSuccess = 
false; 
 
 1580          loopCondition = 
true;
 
 1585      G4int numberOfTimesExecuteInnerLoop = 1;
 
 1586      if ( interactionCase == 3 ) numberOfTimesExecuteInnerLoop = 2;
 
 1587      for ( 
G4int iExecute = 0; iExecute < numberOfTimesExecuteInnerLoop; iExecute++ ) {
 
 1589        G4bool InnerSuccess = 
true;
 
 1590        G4bool isTargetToBeHandled = ( interactionCase == 1 || 
 
 1591                                       ( interactionCase == 3 && iExecute == 1 ) );
 
 1593        if ( isTargetToBeHandled ) {
 
 1599          const G4int maxNumberOfInnerLoops = 1000;
 
 1600          G4int innerLoopCounter = 0;
 
 1602            InnerSuccess = 
true;
 
 1603            if ( isTargetToBeHandled ) {
 
 1605              if ( interactionCase == 1 ) {
 
 1609                                 + std::sqrt( 
sqr( 
common.TResidualMass ) + 
common.PtResidual.mag2() );
 
 1611                  InnerSuccess = 
false; 
 
 1614                Xcenter = std::sqrt( 
sqr( 
common.TNucleonMass ) + 
common.PtNucleon.mag2() ) 
 
 1617                Xcenter = std::sqrt( 
sqr( 
common.TNucleonMass ) + 
common.PtNucleonT.mag2() ) 
 
 1621              common.XminusNucleon = Xcenter + tmpX.
x();
 
 1622              if ( 
common.XminusNucleon <= 0.0  ||  
common.XminusNucleon >= 1.0 ) {
 
 1623                InnerSuccess = 
false; 
 
 1630              if ( interactionCase == 2 ) {
 
 1631                Xcenter = std::sqrt( 
sqr( 
common.TNucleonMass ) + 
common.PtNucleon.mag2() ) 
 
 1634                Xcenter = std::sqrt( 
sqr( 
common.PNucleonMass ) + 
common.PtNucleonP.mag2() ) 
 
 1637              common.XplusNucleon = Xcenter + tmpX.
x();
 
 1638              if ( 
common.XplusNucleon <= 0.0  ||  
common.XplusNucleon >= 1.0 ) {
 
 1639                InnerSuccess = 
false; 
 
 1644          } 
while ( ( ! InnerSuccess ) &&                            
 
 1645                      ++innerLoopCounter < maxNumberOfInnerLoops );   
 
 1646          if ( innerLoopCounter >= maxNumberOfInnerLoops ) {
 
 1648            G4cout << 
"BAD situation: forced exit of the inner while loop!" << 
G4endl;
 
 1653          if ( isTargetToBeHandled ) {
 
 1654            common.XminusNucleon  = 1.0;
 
 1655            common.XminusResidual = 1.0;  
 
 1657            common.XplusNucleon  = 1.0;
 
 1658            common.XplusResidual = 1.0;   
 
 1664      if ( interactionCase == 1 ) {
 
 1669        loopCondition = ( 
common.SqrtS < 
common.Mprojectile + std::sqrt( 
common.M2target ) );
 
 1670      } 
else if ( interactionCase == 2 ) {
 
 1672        G4cout << 
"TNucleonMass PtNucleon XplusNucleon " << 
common.TNucleonMass << 
" "  
 1674               << 
"TResidualMass PtResidual XplusResidual " << 
common.TResidualMass << 
" "  
 1682        G4cout << 
"SqrtS < Mtarget + std::sqrt(M2projectile) " << 
common.SqrtS << 
"  "  
 1683               << 
common.Mtarget << 
" " << std::sqrt( 
common.M2projectile ) << 
" " 
 1686        loopCondition = ( 
common.SqrtS < 
common.Mtarget + std::sqrt( 
common.M2projectile ) );
 
 1687      } 
else if ( interactionCase == 3 ) {
 
 1690               << 
"XplusNucleon XplusResidual " << 
common.XplusNucleon 
 
 1693               << 
"XminusNucleon XminusResidual " << 
common.XminusNucleon 
 
 1704        loopCondition = ( 
common.SqrtS < (   std::sqrt( 
common.M2projectile ) 
 
 1705                       + std::sqrt( 
common.M2target ) ) );
 
 1708    } 
while ( loopCondition &&                       
 
 1709              ++NumberOfTries < maxNumberOfTries );  
 
 1710    if ( NumberOfTries >= maxNumberOfTries ) { 
 
 1712      G4cout << 
"BAD situation: forced exit of the intermediate while loop!" << 
G4endl;
 
 1718    G4double Yprojectile = 0.0, YprojectileNucleon = 0.0, Ytarget = 0.0, YtargetNucleon = 0.0;
 
 1722    if ( interactionCase == 1 ) {
 
 1724                              + std::sqrt( DecayMomentum2 ) ) / 2.0 / 
common.SqrtS;
 
 1733      G4cout << 
"DecayMomentum2 " << DecayMomentum2 << 
G4endl 
 1734             << 
"WminusTarget WplusProjectile " << 
common.WminusTarget 
 
 1736             << 
"Yprojectile " << Yprojectile << 
G4endl;
 
 1740                               + 
common.Mt2targetNucleon 
 
 1741                                 / ( 2.0 * 
common.WminusTarget * 
common.XminusNucleon );
 
 1743                              + 
common.Mt2targetNucleon
 
 1744                                / ( 2.0 * 
common.WminusTarget * 
common.XminusNucleon );
 
 1745      YtargetNucleon = 0.5 * 
G4Log(   ( 
common.EtargetNucleon + 
common.PztargetNucleon )
 
 1746                                    / ( 
common.EtargetNucleon - 
common.PztargetNucleon ) );
 
 1748      G4cout << 
"YtN Ytr YtN-Ytr " << 
" " << YtargetNucleon << 
" " << 
common.YtargetNucleus 
 
 1749             << 
" " << YtargetNucleon - 
common.YtargetNucleus << 
G4endl 
 1750             << 
"YtN Ypr YtN-Ypr " << 
" " << YtargetNucleon << 
" " << Yprojectile
 
 1751             << 
" " << YtargetNucleon - Yprojectile << 
G4endl;
 
 1753      if ( std::abs( YtargetNucleon - 
common.YtargetNucleus ) > 2  ||
 
 1754           Yprojectile < YtargetNucleon ) {
 
 1755        OuterSuccess = 
false; 
 
 1758    } 
else if ( interactionCase == 2 ) {
 
 1760                                 + std::sqrt( DecayMomentum2 ) ) / 2.0 / 
common.SqrtS;
 
 1767      G4cout << 
"DecayMomentum2 " << DecayMomentum2 << 
G4endl 
 1768             << 
"WminusTarget WplusProjectile " << 
common.WminusTarget 
 
 1770             << 
"Ytarget " << Ytarget << 
G4endl;
 
 1774                                   - 
common.Mt2projectileNucleon
 
 1775                                     / ( 2.0 * 
common.WplusProjectile * 
common.XplusNucleon );
 
 1777                                   + 
common.Mt2projectileNucleon
 
 1778                                     / ( 2.0 * 
common.WplusProjectile * 
common.XplusNucleon );
 
 1779      YprojectileNucleon = 0.5 * 
G4Log(   ( 
common.EprojectileNucleon + 
common.PzprojectileNucleon )
 
 1780                                        / ( 
common.EprojectileNucleon - 
common.PzprojectileNucleon) );
 
 1782      G4cout << 
"YpN Ypr YpN-Ypr " << 
" " << YprojectileNucleon << 
" " << 
common.YprojectileNucleus
 
 1783             << 
" " << YprojectileNucleon - 
common.YprojectileNucleus << 
G4endl 
 1784             << 
"YpN Ytr YpN-Ytr " << 
" " << YprojectileNucleon << 
" " << Ytarget
 
 1785             << 
" " << YprojectileNucleon - Ytarget << 
G4endl;
 
 1787      if ( std::abs( YprojectileNucleon - 
common.YprojectileNucleus ) > 2  ||
 
 1788           Ytarget > YprojectileNucleon ) {
 
 1789        OuterSuccess = 
false; 
 
 1792    } 
else if ( interactionCase == 3 ) {
 
 1794                                 + std::sqrt( DecayMomentum2 ) ) / 2.0 / 
common.SqrtS;
 
 1798                                   - 
common.Mt2projectileNucleon
 
 1799                                     / ( 2.0 * 
common.WplusProjectile * 
common.XplusNucleon );
 
 1801                                   + 
common.Mt2projectileNucleon
 
 1802                                     / ( 2.0 * 
common.WplusProjectile * 
common.XplusNucleon );
 
 1803      YprojectileNucleon = 0.5 * 
G4Log(   ( 
common.EprojectileNucleon + 
common.PzprojectileNucleon )
 
 1804                                        / ( 
common.EprojectileNucleon - 
common.PzprojectileNucleon ) );
 
 1807                               + 
common.Mt2targetNucleon
 
 1808                                 / ( 2.0 * 
common.WminusTarget * 
common.XminusNucleon );
 
 1810                               + 
common.Mt2targetNucleon
 
 1811                                 / ( 2.0 * 
common.WminusTarget * 
common.XminusNucleon );
 
 1812      YtargetNucleon = 0.5 * 
G4Log(   ( 
common.EtargetNucleon + 
common.PztargetNucleon )
 
 1813                                    / ( 
common.EtargetNucleon - 
common.PztargetNucleon ) ); 
 
 1814      if ( std::abs( YtargetNucleon - 
common.YtargetNucleus ) > 2          ||
 
 1815           std::abs( YprojectileNucleon - 
common.YprojectileNucleus ) > 2  ||
 
 1816           YprojectileNucleon < YtargetNucleon ) {
 
 1817        OuterSuccess = 
false;
 
 1822  } 
while ( ( ! OuterSuccess ) &&                
 
 1823            ++loopCounter < maxNumberOfLoops );  
 
 1824  if ( loopCounter >= maxNumberOfLoops ) {
 
 1826    G4cout << 
"BAD situation: forced exit of the while loop!" << 
G4endl;
 
 1844  if ( interactionCase == 1 ) {
 
 1847  } 
else if ( interactionCase == 2 ) {
 
 1850    common.Pprojectile.setPz( 
common.PzprojectileNucleon );
 
 1852  } 
else if ( interactionCase == 3 ) {
 
 1855    common.Pprojectile.setPz( 
common.PzprojectileNucleon );
 
 1868  if ( interactionCase == 1 ) {
 
 1873  } 
else if ( interactionCase == 2 ) {
 
 1876  } 
else if ( interactionCase == 3 ) {
 
 1892  if ( interactionCase == 1  ||  interactionCase == 3 ) {
 
 1897    G4cout << 
"TargetResidualMassNumber TargetResidualCharge TargetResidualExcitationEnergy " 
 1903      if ( interactionCase == 1 ) {
 
 1913                    + Mt2 / ( 2.0 * 
common.WminusTarget * 
common.XminusResidual );
 
 1915                    + Mt2 / ( 2.0 * 
common.WminusTarget * 
common.XminusResidual );
 
 1928  if ( interactionCase == 2  ||  interactionCase == 3 ) {
 
 1929    if ( interactionCase == 2 ) {
 
 1939    G4cout << 
"ProjectileResidualMassNumber ProjectileResidualCharge ProjectileResidualExcitationEnergy " 
 1945      if ( interactionCase == 2 ) {
 
 1955                    - Mt2 / ( 2.0 * 
common.WplusProjectile * 
common.XplusResidual );
 
 1957                    + Mt2 / ( 2.0 * 
common.WplusProjectile * 
common.XplusResidual );
 
 1984    std::vector< G4VSplitableHadron* > primaries;
 
 1990        if ( primaries.end() == std::find( primaries.begin(), primaries.end(), 
 
 1997    #ifdef debugBuildString 
 1999           << 
"Number of projectile strings " << primaries.size() << 
G4endl;
 
 2002    for ( 
unsigned int ahadron = 0; ahadron < primaries.size(); ahadron++ ) {
 
 2003      G4bool isProjectile( 
true );
 
 2006      FirstString = 0; SecondString = 0;
 
 2007      if ( primaries[ahadron]->GetStatus() == 0 ) {
 
 2011      } 
else if ( primaries[ahadron]->GetStatus() == 1  
 
 2012               && primaries[ahadron]->GetSoftCollisionCount() != 0 ) {
 
 2016      } 
else if ( primaries[ahadron]->GetStatus() == 1  
 
 2017               && primaries[ahadron]->GetSoftCollisionCount() == 0 ) {
 
 2020                                                    primaries[ahadron]->GetTimeOfCreation(),
 
 2021                                                    primaries[ahadron]->GetPosition(),
 
 2024      } 
else if (primaries[ahadron]->GetStatus() == 2) {
 
 2027                                                    primaries[ahadron]->GetTimeOfCreation(),
 
 2028                                                    primaries[ahadron]->GetPosition(),
 
 2033        G4cout << 
"Something wrong in FTF Model Build String" << 
G4endl;
 
 2036      if ( FirstString  != 0 ) strings->push_back( FirstString );
 
 2037      if ( SecondString != 0 ) strings->push_back( SecondString );
 
 2039      #ifdef debugBuildString 
 2040      G4cout << 
"FirstString & SecondString? " << FirstString << 
" " << SecondString << 
G4endl;
 
 2051    #ifdef debugBuildString 
 2053      G4cout << 
"Check 1 string " << strings->operator[](0)->GetRightParton()->GetPDGcode() 
 
 2054             << 
" " << strings->operator[](0)->GetLeftParton()->GetPDGcode() << 
G4endl << 
G4endl;
 
 2063    #ifdef debugBuildString 
 2064    G4cout << 
"Building of projectile-like strings" << 
G4endl;
 
 2067    G4bool isProjectile = 
true;
 
 2070      #ifdef debugBuildString 
 2071      G4cout << 
"Nucleon #, status, intCount " << ahadron << 
" " 
 2080      #ifdef debugBuildString 
 2081      G4cout << 
G4endl << 
"ahadron aProjectile Status " << ahadron << 
" " << aProjectile
 
 2085      FirstString = 0; SecondString = 0;
 
 2088        #ifdef debugBuildString 
 2089        G4cout << 
"Case1 aProjectile->GetStatus() == 0 " << 
G4endl;
 
 2099        #ifdef debugBuildString 
 2100        G4cout << 
"Case2 aProjectile->GetStatus() !=0 St==1 SoftCol!=0" << 
G4endl;
 
 2113        #ifdef debugBuildString 
 2114        G4cout << 
"Case3 aProjectile->GetStatus() !=0 St==1 SoftCol==0" << 
G4endl;
 
 2124        #ifdef debugBuildString 
 2125        G4cout << 
" Strings are built for nucleon marked for an interaction, but" 
 2126               << 
" the interaction was skipped." << 
G4endl;
 
 2132        #ifdef debugBuildString 
 2133        G4cout << 
"Case4 aProjectile->GetStatus() !=0 St==2 " << 
G4endl;
 
 2143        #ifdef debugBuildString 
 2144        G4cout << 
" Strings are build for involved nucleon." << 
G4endl;
 
 2150        #ifdef debugBuildString 
 2157        #ifdef debugBuildString 
 2163      if ( FirstString  != 0 ) strings->push_back( FirstString );
 
 2164      if ( SecondString != 0 ) strings->push_back( SecondString );
 
 2168  #ifdef debugBuildString 
 2172  G4bool isProjectile = 
false;
 
 2176    #ifdef debugBuildString 
 2177    G4cout << 
"Nucleon #, status, intCount " << aNucleon << 
" " << ahadron << 
" " 
 2181    FirstString = 0 ; SecondString = 0;
 
 2188      #ifdef debugBuildString 
 2197      #ifdef debugBuildString 
 2198      G4cout << 
" 2 case A string is build, nucleon was excited." << 
G4endl;
 
 2217      #ifdef debugBuildString 
 2229      #ifdef debugBuildString 
 2233    } 
else if ( aNucleon->
GetStatus() == 2  ||   
 
 2242      #ifdef debugBuildString 
 2250      #ifdef debugBuildString 
 2256    if ( FirstString  != 0 ) strings->push_back( FirstString );
 
 2257    if ( SecondString != 0 ) strings->push_back( SecondString );
 
 2261  #ifdef debugBuildString 
 2266  isProjectile = 
true;
 
 2270      FirstString = 0; SecondString = 0;
 
 2273      if ( FirstString  != 0 ) strings->push_back( FirstString );
 
 2274      if ( SecondString != 0 ) strings->push_back( SecondString );
 
 2293  #ifdef debugFTFmodel 
 2294  G4cout << 
"GetResiduals(): HighEnergyInter? GetProjectileNucleus()?" 
 2300    #ifdef debugFTFmodel 
 2312      #ifdef debugFTFmodel 
 2334          residualMomentum += tmp;
 
 2356      const G4int maxNumberOfLoops = 1000;
 
 2357      G4int loopCounter = 0;
 
 2359        C = ( Chigh + Clow ) / 2.0;
 
 2372        if ( SumMasses > Mass ) Chigh = 
C;
 
 2375      } 
while ( Chigh - Clow > 0.01  &&
 
 2376                ++loopCounter < maxNumberOfLoops );  
 
 2377      if ( loopCounter >= maxNumberOfLoops ) {
 
 2378        #ifdef debugFTFmodel 
 2379        G4cout << 
"BAD situation: forced exit of the first while loop in G4FTFModel::GetResidual" << 
G4endl 
 2380               << 
"\t return immediately from the method!" << 
G4endl;
 
 2400    #ifdef debugFTFmodel 
 2402           << 
G4endl << 
"ProjectileResidualExcitationEnergy ProjectileResidual4Momentum " 
 2414      #ifdef debugFTFmodel 
 2432      while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {  
 
 2436          residualMomentum += tmp;
 
 2447      while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {  
 
 2458      const G4int maxNumberOfLoops = 1000;
 
 2459      G4int loopCounter = 0;
 
 2461        C = ( Chigh + Clow ) / 2.0;
 
 2466        while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {  
 
 2475        if ( SumMasses > Mass) Chigh = 
C;
 
 2478      } 
while ( Chigh - Clow > 0.01  &&
 
 2479                ++loopCounter < maxNumberOfLoops );  
 
 2480      if ( loopCounter >= maxNumberOfLoops ) {
 
 2481        #ifdef debugFTFmodel 
 2482        G4cout << 
"BAD situation: forced exit of the second while loop in G4FTFModel::GetResidual" << 
G4endl 
 2483               << 
"\t return immediately from the method!" << 
G4endl;
 
 2490      while ( ( aNucleon = theProjectileNucleus->
GetNextNucleon() ) ) {  
 
 2501    #ifdef debugFTFmodel 
 2507    #ifdef debugFTFmodel 
 2508    G4cout << 
"Low energy interaction: Target nucleus --------------" << 
G4endl 
 2509           << 
"Tr ResidualMassNumber Tr ResidualCharge Tr ResidualExcitationEnergy  " 
 2514    G4int NumberOfTargetParticipant( 0 );
 
 2524    if ( NumberOfTargetParticipant != 0 ) {
 
 2537        delete targetSplitable;  
 
 2538        targetSplitable = 0; 
 
 2539        aNucleon->
Hit( targetSplitable );
 
 2544    #ifdef debugFTFmodel 
 2545    G4cout << 
"NumberOfTargetParticipant " << NumberOfTargetParticipant << 
G4endl 
 2551    #ifdef debugFTFmodel 
 2552    G4cout << 
"Low energy interaction: Projectile nucleus --------------" << 
G4endl 
 2553           << 
"Pr ResidualMassNumber Pr ResidualCharge Pr ResidualExcitationEnergy " 
 2558    G4int NumberOfProjectileParticipant( 0 );
 
 2565    #ifdef debugFTFmodel 
 2569    DeltaExcitationE = 0.0;
 
 2572    if ( NumberOfProjectileParticipant != 0 ) {
 
 2586        delete projectileSplitable;  
 
 2587        projectileSplitable = 0; 
 
 2588        aNucleon->
Hit( projectileSplitable );
 
 2593    #ifdef debugFTFmodel 
 2594    G4cout << 
"NumberOfProjectileParticipant " << NumberOfProjectileParticipant << 
G4endl 
 2600  #ifdef debugFTFmodel 
 2601  G4cout << 
"End GetResiduals -----------------" << 
G4endl;
 
 2613  if (AveragePt2 > 0.0) {
 
 2614    const G4double ymax = maxPtSquare/AveragePt2;
 
 2615    if ( ymax < 200. ) {
 
 2620    Pt = std::sqrt( Pt2 );
 
 2625  return G4ThreeVector( Pt*std::cos(phi), Pt*std::sin(phi), 0.0 );    
 
 2635                          G4double& residualExcitationEnergy,  
 
 2637                          G4int& residualMassNumber,           
 
 2638                          G4int& residualCharge ) {            
 
 2650  if ( ! nucleus ) 
return false;
 
 2652  G4double ExcitationEnergyPerWoundedNucleon = 
 
 2666  G4int residualNumberOfLambdas = 0;  
 
 2676      sumMasses += 20.0*
MeV;  
 
 2679      residualExcitationEnergy += -ExcitationEnergyPerWoundedNucleon*
G4Log( 
G4UniformRand() );
 
 2681      residualMassNumber--;
 
 2688    ++residualNumberOfLambdas;
 
 2692  #ifdef debugPutOnMassShell 
 2693  G4cout << 
"ExcitationEnergyPerWoundedNucleon " << ExcitationEnergyPerWoundedNucleon << 
G4endl 
 2694         << 
"\t Residual Charge, MassNumber (LambdaNumber" << residualCharge << 
" " 
 2695     << residualMassNumber << 
" (" << residualNumberOfLambdas << 
") " 
 2696         << 
G4endl << 
"\t Initial Momentum " << nucleusMomentum
 
 2697         << 
G4endl << 
"\t Residual Momentum   " << residualMomentum << 
G4endl;
 
 2699  residualMomentum.
setPz( 0.0 ); 
 
 2700  residualMomentum.
setE( 0.0 );
 
 2701  if ( residualMassNumber == 0 ) {
 
 2703    residualExcitationEnergy = 0.0;
 
 2705    if ( residualNumberOfLambdas > 0 ) {
 
 2707                                  residualNumberOfLambdas );
 
 2710                   GetIonMass( residualCharge, residualMassNumber );
 
 2712    if ( residualMassNumber == 1 ) {
 
 2713      residualExcitationEnergy = 0.0;
 
 2715    residualMass += residualExcitationEnergy;
 
 2717  sumMasses += std::sqrt( 
sqr( residualMass ) + residualMomentum.
perp2() );
 
 2726                     const G4int numberOfInvolvedNucleons,  
 
 2744  if ( sqrtS < 0.0  ||  numberOfInvolvedNucleons <= 0  ||  sumMasses < 0.0 ) 
return false;
 
 2746  const G4double probDeltaIsobar = 0.05;
 
 2748  G4int maxNumberOfDeltas = 
G4int( (sqrtS - sumMasses)/(400.0*
MeV) );
 
 2749  G4int numberOfDeltas = 0;
 
 2751  for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 2753    if ( 
G4UniformRand() < probDeltaIsobar  &&  numberOfDeltas < maxNumberOfDeltas ) {
 
 2755      if ( ! involvedNucleons[i] ) 
continue;
 
 2765      G4int newPdgCode = pdgCode/10; newPdgCode = newPdgCode*10 + 4; 
 
 2774      if ( sqrtS < sumMasses + massDelta - massNuc ) {  
 
 2778        sumMasses += ( massDelta - massNuc );
 
 2796                           const G4int residualMassNumber,        
 
 2797                           const G4int numberOfInvolvedNucleons,  
 
 2810#ifdef debugPutOnMassShell 
 2811  G4cout << 
"G4FTFModel::SamplingNucleonKinematics:" << 
G4endl;
 
 2812  G4cout << 
" averagePt2= " << averagePt2 << 
" maxPt2= " << maxPt2
 
 2813     << 
" dCor= " << dCor << 
" resMass(GeV)= " << residualMass/
GeV 
 2814     << 
" resMassN= " << residualMassNumber 
 
 2815         << 
" nNuc= " << numberOfInvolvedNucleons
 
 2816     << 
" lv= " << pResidual << 
G4endl;   
 
 2819  if ( ! nucleus  ||  numberOfInvolvedNucleons < 1 ) 
return false;
 
 2821  if ( residualMassNumber == 0  &&  numberOfInvolvedNucleons == 1 ) {
 
 2833  const G4int maxNumberOfLoops = 1000;
 
 2834  G4int loopCounter = 0;
 
 2841    if( averagePt2 > 0.0 ) {
 
 2842      for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 2843    G4Nucleon* aNucleon = involvedNucleons[i];
 
 2844    if ( ! aNucleon ) 
continue;
 
 2852    G4double deltaPx = ( ptSum.
x() - pResidual.
x() )*invN;
 
 2853    G4double deltaPy = ( ptSum.
y() - pResidual.
y() )*invN;
 
 2855    SumMasses = residualMass;
 
 2856    for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 2857      G4Nucleon* aNucleon = involvedNucleons[i];
 
 2858      if ( ! aNucleon ) 
continue;
 
 2862                                + 
sqr( px ) + 
sqr( py ) );
 
 2871    for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 2872      G4Nucleon* aNucleon = involvedNucleons[i];
 
 2873      if ( ! aNucleon ) 
continue;
 
 2881      if ( x < -eps  ||  x > 1.0 + 
eps ) { 
 
 2895    if ( xSum < -eps || xSum > 1.0 + 
eps ) success = 
false;
 
 2896    if ( ! success ) 
continue;
 
 2898    G4double delta = ( residualMassNumber == 0 ) ? 
std::min( xSum - 1.0, 0.0 )*invN : 0.0;
 
 2902    for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 2903      G4Nucleon* aNucleon = involvedNucleons[i];
 
 2904      if ( ! aNucleon ) 
continue;
 
 2908      if ( residualMassNumber == 0 ) {
 
 2909        if ( x <= -eps || x > 1.0 + 
eps ) {
 
 2914        if ( x <= -eps || x > 1.0 + 
eps || xSum <= -eps || xSum > 1.0 + 
eps ) {
 
 2927    if ( ! success ) 
continue;
 
 2930    if ( residualMassNumber > 0 ) mass2 += ( 
sqr( residualMass ) + pResidual.
perp2() ) / xSum;
 
 2932    #ifdef debugPutOnMassShell 
 2933    G4cout << 
"success: " << success << 
" Mt(GeV)= "  
 2937  } 
while ( ( ! success ) &&
 
 2938            ++loopCounter < maxNumberOfLoops );  
 
 2939  return ( loopCounter < maxNumberOfLoops );
 
 2951                 const G4bool isProjectileNucleus,      
 
 2952                 const G4int numberOfInvolvedNucleons,  
 
 2967  G4double decayMomentum2 = 
sqr( sValue ) + 
sqr( projectileMass2 ) + 
sqr( targetMass2 )
 
 2968                            - 2.0*( sValue*( projectileMass2 + targetMass2 ) 
 
 2969                                    + projectileMass2*targetMass2 );
 
 2970  targetWminus = ( sValue - projectileMass2 + targetMass2 + std::sqrt( decayMomentum2 ) )
 
 2972  projectileWplus = sqrtS - targetMass2/targetWminus;
 
 2973  G4double projectilePz = projectileWplus/2.0 - projectileMass2/2.0/projectileWplus;
 
 2974  G4double projectileE  = projectileWplus/2.0 + projectileMass2/2.0/projectileWplus;
 
 2975  G4double projectileY  = 0.5 * 
G4Log( (projectileE + projectilePz)/
 
 2976                                       (projectileE - projectilePz) );
 
 2977  G4double targetPz = -targetWminus/2.0 + targetMass2/2.0/targetWminus;
 
 2978  G4double targetE  =  targetWminus/2.0 + targetMass2/2.0/targetWminus;
 
 2979  G4double targetY  = 0.5 * 
G4Log( (targetE + targetPz)/(targetE - targetPz) );
 
 2981  #ifdef debugPutOnMassShell 
 2982  G4cout << 
"decayMomentum2 " << decayMomentum2 << 
G4endl  
 2983         << 
"\t targetWminus projectileWplus " << targetWminus << 
" " << projectileWplus << 
G4endl 
 2984         << 
"\t projectileY targetY " << projectileY << 
" " << targetY << 
G4endl;
 
 2987  for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 2988    G4Nucleon* aNucleon = involvedNucleons[i];
 
 2989    if ( ! aNucleon ) 
continue;
 
 2994    G4double pz = -targetWminus*x/2.0 + mt2/(2.0*targetWminus*x);
 
 2995    G4double e =   targetWminus*x/2.0 + mt2/(2.0*targetWminus*x);
 
 2996    if ( isProjectileNucleus ) {
 
 2997      pz = projectileWplus*x/2.0 - mt2/(2.0*projectileWplus*x);
 
 2998      e =  projectileWplus*x/2.0 + mt2/(2.0*projectileWplus*x);
 
 3002    #ifdef debugPutOnMassShell 
 3003    G4cout << 
"i nY pY nY-AY AY " << i << 
" " << nucleonY << 
" " << projectileY <<
G4endl;
 
 3006    if ( std::abs( nucleonY - nucleusY ) > 2  ||  
 
 3007         ( isProjectileNucleus  &&  targetY > nucleonY )  ||
 
 3008         ( ! isProjectileNucleus  &&  projectileY < nucleonY ) ) {
 
 3021                    const G4bool isProjectileNucleus,            
 
 3024                    const G4int residualMassNumber,              
 
 3025                    const G4int numberOfInvolvedNucleons,        
 
 3043  for ( 
G4int i = 0; i < numberOfInvolvedNucleons; ++i ) {
 
 3044    G4Nucleon* aNucleon = involvedNucleons[i];
 
 3045    if ( ! aNucleon ) 
continue;
 
 3047    residual3Momentum -= tmp.
vect();
 
 3051    G4double pz = -w * x / 2.0  +  mt2 / ( 2.0 * w * x );
 
 3052    G4double e  =  w * x / 2.0  +  mt2 / ( 2.0 * w * x );
 
 3054    if ( isProjectileNucleus ) pz *= -1.0;
 
 3063  G4double residualMt2 = 
sqr( residualMass ) + 
sqr( residual3Momentum.
x() )
 
 3064                       + 
sqr( residual3Momentum.
y() );
 
 3066  #ifdef debugPutOnMassShell 
 3067  G4cout << 
"w residual3Momentum.z() " << w << 
" " << residual3Momentum.
z() << 
G4endl;
 
 3072  if ( residualMassNumber != 0 ) {
 
 3073    residualPz = -w * residual3Momentum.
z() / 2.0 + 
 
 3074                  residualMt2 / ( 2.0 * w * residual3Momentum.
z() );
 
 3075    residualE  =  w * residual3Momentum.
z() / 2.0 + 
 
 3076                  residualMt2 / ( 2.0 * w * residual3Momentum.
z() );
 
 3078    if ( isProjectileNucleus ) residualPz *= -1.0;
 
 3081  residual4Momentum.
setPx( residual3Momentum.
x() );
 
 3082  residual4Momentum.
setPy( residual3Momentum.
y() );
 
 3083  residual4Momentum.
setPz( residualPz ); 
 
 3084  residual4Momentum.
setE( residualE );
 
 3093  desc << 
"                 FTF (Fritiof) Model               \n"  
 3094       << 
"The FTF model is based on the well-known FRITIOF   \n" 
 3095       << 
"model (B. Andersson et al., Nucl. Phys. B281, 289  \n" 
 3096       << 
"(1987)). Its first program implementation was given\n" 
 3097       << 
"by B. Nilsson-Almquist and E. Stenlund (Comp. Phys.\n" 
 3098       << 
"Comm. 43, 387 (1987)). The Fritiof model assumes   \n" 
 3099       << 
"that all hadron-hadron interactions are binary     \n" 
 3100       << 
"reactions, h_1+h_2->h_1'+h_2' where h_1' and h_2'  \n" 
 3101       << 
"are excited states of the hadrons with continuous  \n" 
 3102       << 
"mass spectra. The excited hadrons are considered as\n" 
 3103       << 
"QCD-strings, and the corresponding LUND-string     \n" 
 3104       << 
"fragmentation model is applied for a simulation of \n" 
 3105       << 
"their decays.                                      \n" 
 3106       << 
"   The Fritiof model assumes that in the course of \n" 
 3107       << 
"a hadron-nucleus interaction a string originated   \n" 
 3108       << 
"from the projectile can interact with various intra\n" 
 3109       << 
"nuclear nucleons and becomes into highly excited   \n" 
 3110       << 
"states. The probability of multiple interactions is\n" 
 3111       << 
"calculated in the Glauber approximation. A cascading\n" 
 3112       << 
"of secondary particles was neglected as a rule. Due\n" 
 3113       << 
"to these, the original Fritiof model fails to des- \n" 
 3114       << 
"cribe a nuclear destruction and slow particle spectra.\n" 
 3115       << 
"   In order to overcome the difficulties we enlarge\n" 
 3116       << 
"the model by the reggeon theory inspired model of  \n" 
 3117       << 
"nuclear desctruction (Kh. Abdel-Waged and V.V. Uzhi-\n" 
 3118       << 
"nsky, Phys. Atom. Nucl. 60, 828 (1997); Yad. Fiz. 60, 925\n" 
 3119       << 
"(1997)). Momenta of the nucleons ejected from a nuc-\n" 
 3120       << 
"leus in the reggeon cascading are sampled according\n" 
 3121       << 
"to a Fermi motion algorithm presented in (EMU-01   \n" 
 3122       << 
"Collaboration (M.I. Adamovich et al.) Zeit. fur Phys.\n" 
 3123       << 
"A358, 337 (1997)).                                 \n" 
 3124       << 
"   New features were also added to the Fritiof model\n" 
 3125       << 
"implemented in Geant4: a simulation of elastic had-\n" 
 3126       << 
"ron-nucleon scatterings, a simulation of binary \n" 
 3127       << 
"reactions like NN>NN* in hadron-nucleon interactions,\n" 
 3128       << 
"a separate simulation of single diffractive and non-\n" 
 3129       << 
" diffractive events. These allowed to describe after\n" 
 3130       << 
"model parameter tuning a wide set of experimental  \n" 
G4double C(G4double temp)
G4double S(G4double temp)
static const G4double eps
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
static constexpr double perCent
static constexpr double twopi
static constexpr double GeV
static constexpr double MeV
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation inverse() const
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
G4Parton * GetRightParton(void) const
G4Parton * GetLeftParton(void) const
virtual G4bool Annihilate(G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4VSplitableHadron *&AdditionalString, G4FTFParameters *theParameters) const
G4bool FinalizeKinematics(const G4double w, const G4bool isProjectileNucleus, const G4LorentzRotation &boostFromCmsToLab, const G4double residualMass, const G4int residualMassNumber, const G4int numberOfInvolvedNucleons, G4Nucleon *involvedNucleons[], G4LorentzVector &residual4Momentum)
G4bool SamplingNucleonKinematics(G4double averagePt2, const G4double maxPt2, G4double dCor, G4V3DNucleus *nucleus, const G4LorentzVector &pResidual, const G4double residualMass, const G4int residualMassNumber, const G4int numberOfInvolvedNucleons, G4Nucleon *involvedNucleons[], G4double &mass2)
G4bool SampleBinInterval() const
G4DiffractiveExcitation * theExcitation
G4Nucleon * TheInvolvedNucleonsOfProjectile[250]
G4ElasticHNScattering * theElastic
G4bool ComputeNucleusProperties(G4V3DNucleus *nucleus, G4LorentzVector &nucleusMomentum, G4LorentzVector &residualMomentum, G4double &sumMasses, G4double &residualExcitationEnergy, G4double &residualMass, G4int &residualMassNumber, G4int &residualCharge)
void SetImpactParameter(const G4double b_value)
G4bool GenerateDeltaIsobar(const G4double sqrtS, const G4int numberOfInvolvedNucleons, G4Nucleon *involvedNucleons[], G4double &sumMasses)
G4V3DNucleus * GetTargetNucleus() const
std::vector< G4VSplitableHadron * > theAdditionalString
G4int NumberOfTargetSpectatorNucleons
G4int NumberOfInvolvedNucleonsOfProjectile
G4double ProjectileResidualExcitationEnergy
G4FTFModel(const G4String &modelName="FTF")
G4LorentzVector TargetResidual4Momentum
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
G4int NumberOfNNcollisions
G4int ProjectileResidualCharge
G4Nucleon * TheInvolvedNucleonsOfTarget[250]
G4ExcitedStringVector * GetStrings() override
G4ReactionProduct theProjectile
G4int ProjectileResidualMassNumber
void BuildStrings(G4ExcitedStringVector *strings)
G4int AdjustNucleonsAlgorithm_beforeSampling(G4int interactionCase, G4VSplitableHadron *SelectedAntiBaryon, G4Nucleon *ProjectileNucleon, G4VSplitableHadron *SelectedTargetNucleon, G4Nucleon *TargetNucleon, G4bool Annihilation, CommonVariables &common)
G4FTFAnnihilation * theAnnihilation
G4int NumberOfInvolvedNucleonsOfTarget
G4bool ExciteParticipants()
G4FTFParameters * theParameters
G4int TargetResidualMassNumber
void StoreInvolvedNucleon()
G4FTFParticipants theParticipants
G4V3DNucleus * GetProjectileNucleus() const override
void Init(const G4Nucleus &aNucleus, const G4DynamicParticle &aProjectile) override
G4int ProjectileResidualLambdaNumber
G4bool CheckKinematics(const G4double sValue, const G4double sqrtS, const G4double projectileMass2, const G4double targetMass2, const G4double nucleusY, const G4bool isProjectileNucleus, const G4int numberOfInvolvedNucleons, G4Nucleon *involvedNucleons[], G4double &targetWminus, G4double &projectileWplus, G4bool &success)
void ModelDescription(std::ostream &) const override
G4bool AdjustNucleonsAlgorithm_Sampling(G4int interactionCase, CommonVariables &common)
G4LorentzVector ProjectileResidual4Momentum
G4double TargetResidualExcitationEnergy
void AdjustNucleonsAlgorithm_afterSampling(G4int interactionCase, G4VSplitableHadron *SelectedAntiBaryon, G4VSplitableHadron *SelectedTargetNucleon, CommonVariables &common)
G4int TargetResidualCharge
G4int NumberOfProjectileSpectatorNucleons
G4bool AdjustNucleons(G4VSplitableHadron *SelectedAntiBaryon, G4Nucleon *ProjectileNucleon, G4VSplitableHadron *SelectedTargetNucleon, G4Nucleon *TargetNucleon, G4bool Annihilation)
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()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void operator()(G4VSplitableHadron *aH)
static int FASTCALL common(PROLOG_STATE *state, int tok)