63     NumberOfInvolvedNucleon=0;
 
   64         NumberOfInvolvedNucleonOfProjectile=0;
 
   75    if( theParameters   != 0 ) 
delete theParameters; 
 
   76    if( theExcitation   != 0 ) 
delete theExcitation;
 
   77    if( theElastic      != 0 ) 
delete theElastic; 
 
   78    if( theAnnihilation != 0 ) 
delete theAnnihilation;
 
   81    if(theAdditionalString.size() != 0)
 
   83     std::for_each(theAdditionalString.begin(), theAdditionalString.end(), 
 
   86    theAdditionalString.clear();
 
   89    if( NumberOfInvolvedNucleon != 0)
 
   91     for(
G4int i=0; i < NumberOfInvolvedNucleon; i++)
 
   94      if(aNucleon) 
delete aNucleon;
 
  114     theProjectile = aProjectile;  
 
  185       if( theParameters != 0 ) 
delete theParameters;
 
  196    if(theAdditionalString.size() != 0)
 
  198     std::for_each(theAdditionalString.begin(), theAdditionalString.end(), 
 
  201    theAdditionalString.clear();
 
  210     theParticipants.
GetList(theProjectile,theParameters);
 
  221          Success=PutOnMassShell(); 
 
  223          GetResidualNucleus();
 
  230          StoreInvolvedNucleon();
 
  232          Success=PutOnMassShell(); 
 
  233          GetResidualNucleus();
 
  241          StoreInvolvedNucleon();
 
  249           Success=PutOnMassShell(); 
 
  251           GetResidualNucleus();
 
  261         Success=Success && ExciteParticipants();
 
  267       theStrings = BuildStrings();
 
  269           if( theParameters != 0 )
 
  271            delete theParameters;
 
  299      std::vector<G4VSplitableHadron *> primaries;
 
  302          while ( theParticipants.
Next() ) 
 
  307         if ( primaries.end() == std::find(primaries.begin(), primaries.end(),
 
  330         for(
G4int i=0; i < NumberOfInvolvedNucleon; i++)
 
  333            if(aNucleon) 
delete aNucleon;
 
  336         NumberOfInvolvedNucleon=0;
 
  343 void G4FTFModel::StoreInvolvedNucleon()                             
 
  348         NumberOfInvolvedNucleon=0;
 
  352     while (theParticipants.
Next())
 
  360            TheInvolvedNucleon[NumberOfInvolvedNucleon]=TargetNucleon;
 
  361            NumberOfInvolvedNucleon++;
 
  365         NumberOfInvolvedTargetNucleon=NumberOfInvolvedNucleon;
 
  370         theParticipants.
Next();
 
  380         G4double ZcoordinateOfPreviousCollision(0.);
 
  381         G4double ZcoordinateOfCurrentInteraction(0.);
 
  382         G4double TimeOfPreviousCollision(0.);
 
  387         G4bool theFirstInvolvedNucleon(
true);
 
  393             if(theFirstInvolvedNucleon)
 
  395               ZcoordinateOfPreviousCollision=aNucleon->
GetPosition().
z();
 
  397               theFirstInvolvedNucleon=
false;
 
  400             ZcoordinateOfCurrentInteraction=aNucleon->
GetPosition().
z();
 
  406         if ( betta_z > 1.0
e-10 ) {
 
  407               TimeOfCurrentCollision=TimeOfPreviousCollision+ 
 
  408               (ZcoordinateOfCurrentInteraction-ZcoordinateOfPreviousCollision)/betta_z;
 
  410               TimeOfCurrentCollision=TimeOfPreviousCollision;
 
  417             ZcoordinateOfPreviousCollision=ZcoordinateOfCurrentInteraction;
 
  418             TimeOfPreviousCollision=TimeOfCurrentCollision;
 
  427         NumberOfInvolvedNucleonOfProjectile=0;
 
  437            TheInvolvedNucleonOfProjectile[NumberOfInvolvedNucleonOfProjectile]=
 
  439            NumberOfInvolvedNucleonOfProjectile++;
 
  444         NumberOfInvolvedNucleon=0;
 
  454            TheInvolvedNucleon[NumberOfInvolvedNucleon]=TargetNucleon;
 
  455            NumberOfInvolvedNucleon++;
 
  460         NumberOfInvolvedTargetNucleon=NumberOfInvolvedNucleon;
 
  465 void G4FTFModel::ReggeonCascade()                             
 
  473         NumberOfInvolvedNucleon=0;
 
  476     while (theParticipants.
Next())
 
  482            TheInvolvedNucleon[NumberOfInvolvedNucleon]=TargetNucleon;
 
  483            NumberOfInvolvedNucleon++;
 
  493             if(!Neighbour->AreYouHit())
 
  495              G4double impact2= 
sqr(XofWoundedNucleon - Neighbour->GetPosition().x()) +
 
  496                                sqr(YofWoundedNucleon - Neighbour->GetPosition().y());
 
  502               TheInvolvedNucleon[NumberOfInvolvedNucleon]=Neighbour;
 
  503               NumberOfInvolvedNucleon++;
 
  509               Neighbour->Hit(targetSplitable);
 
  516         NumberOfInvolvedTargetNucleon=NumberOfInvolvedNucleon;
 
  520         theParticipants.
Next();
 
  525         G4double ZcoordinateOfPreviousCollision(0.);
 
  526         G4double ZcoordinateOfCurrentInteraction(0.);
 
  527         G4double TimeOfPreviousCollision(0.);
 
  532         G4bool theFirstInvolvedNucleon(
true);
 
  537             if(theFirstInvolvedNucleon)
 
  539               ZcoordinateOfPreviousCollision=aNucleon->
GetPosition().
z();
 
  540               theFirstInvolvedNucleon=
false;
 
  543             ZcoordinateOfCurrentInteraction=aNucleon->
GetPosition().
z();
 
  544             TimeOfCurrentCollision=TimeOfPreviousCollision+ 
 
  545             (ZcoordinateOfCurrentInteraction-ZcoordinateOfPreviousCollision)/betta_z; 
 
  549             ZcoordinateOfPreviousCollision=ZcoordinateOfCurrentInteraction;
 
  550             TimeOfPreviousCollision=TimeOfCurrentCollision;
 
  559 G4bool G4FTFModel::PutOnMassShell()
 
  568          G4int MultiplicityOfParticipants(0);
 
  579            MultiplicityOfParticipants++;
 
  585          G4int ResidualMassNumber(0);
 
  586          G4int ResidualCharge(0);
 
  587          ResidualExcitationEnergy=0.;
 
  590          G4double ExcitationEnergyPerWoundedNucleon=
 
  602            MultiplicityOfParticipants++;
 
  604            ResidualExcitationEnergy+=ExcitationEnergyPerWoundedNucleon; 
 
  608            ResidualMassNumber+=1;
 
  615          if(ResidualMassNumber == 0)
 
  618           ResidualExcitationEnergy=0.;
 
  623                               GetIonMass(ResidualCharge ,ResidualMassNumber);
 
  624           if(ResidualMassNumber == 1) {ResidualExcitationEnergy=0.;}
 
  639           G4double MassOfParticipants=P_participants.mag();
 
  640           G4double MassOfParticipants2=
sqr(MassOfParticipants);
 
  643           if(SqrtS < ResidualMass + MassOfParticipants) {
return false;}
 
  645           if(SqrtS < ResidualMass+ResidualExcitationEnergy + MassOfParticipants)
 
  646           {ResidualExcitationEnergy=0.;}
 
  648           ResidualMass +=ResidualExcitationEnergy; 
 
  658           if ( Pcms.pz() <= 0. )                                
 
  665           toCms.
rotateY(-1*Pcms.theta());            
 
  671                       sqr(S)+
sqr(MassOfParticipants2)+ 
sqr(ResidualMass2) -
 
  672                           2.*S*MassOfParticipants2 - 2.*S*ResidualMass2 
 
  673                               -2.*MassOfParticipants2*ResidualMass2;
 
  675           if(DecayMomentum2 < 0.) 
return false;
 
  677           DecayMomentum2/=(4.*S);
 
  678           G4double DecayMomentum = std::sqrt(DecayMomentum2);
 
  682                                              std::sqrt(DecayMomentum2+MassOfParticipants2));
 
  684                                              std::sqrt(DecayMomentum2+ResidualMass2));
 
  688           New_P_participants.transform(toLab);
 
  689           New_PnuclearResidual.transform(toLab);
 
  694           G4LorentzVector DeltaP_participants=(New_P_participants - P_participants)/
 
  695                                               ((
G4double) MultiplicityOfParticipants);
 
  721           Residual4Momentum = New_PnuclearResidual;        
 
  731         theParticipants.
Next();
 
  740         if(Pprojectile.
z() < 0.){
return false;}
 
  756         ResidualExcitationEnergy=0.;
 
  760         G4double ExcitationEnergyPerWoundedNucleon=
 
  779            SumMasses += 20.*
MeV;   
 
  780            ResidualExcitationEnergy+=ExcitationEnergyPerWoundedNucleon;
 
  791           ResidualMassNumber--;
 
  801         PnuclearResidual.
setPz(0.); PnuclearResidual.setE(0.);   
 
  805         if(ResidualMassNumber == 0)
 
  808          ResidualExcitationEnergy=0.;
 
  813                               GetIonMass(ResidualCharge ,ResidualMassNumber);
 
  814          if(ResidualMassNumber == 1) {ResidualExcitationEnergy=0.;}
 
  819         SumMasses += std::sqrt(
sqr(ResidualMass)+PnuclearResidual.perp2()); 
 
  829         if(SqrtS < SumMasses)      {
return false;} 
 
  833         SumMasses -= std::sqrt(
sqr(ResidualMass)+PnuclearResidual.perp2()); 
 
  834         SumMasses += std::sqrt(
sqr(ResidualMass+ResidualExcitationEnergy)
 
  835                     +PnuclearResidual.perp2());                             
 
  836         if(SqrtS < SumMasses)                                              
 
  838          SumMasses -= std::sqrt(
sqr(ResidualMass+ResidualExcitationEnergy)
 
  839                      +PnuclearResidual.perp2());                            
 
  840          SumMasses += std::sqrt(
sqr(ResidualMass)+PnuclearResidual.perp2());
 
  841          ResidualExcitationEnergy=0.;
 
  844         ResidualMass +=ResidualExcitationEnergy;
 
  849         G4int MaxNumberOfDeltas = (
int)((SqrtS - SumMasses)/(400.*
MeV));
 
  850         G4int NumberOfDeltas(0);
 
  856       for(
G4int i=0; i < NumberOfInvolvedNucleon; i++ )
 
  858             if((
G4UniformRand() < ProbDeltaIsobar)&&(NumberOfDeltas < MaxNumberOfDeltas))
 
  868               G4int newPDGcode = PDGcode/10; newPDGcode=newPDGcode*10+4; 
 
  874               if(SqrtS < SumMasses + MassInc - MassDec)                    
 
  877                ProbDeltaIsobar = 0.;
 
  880                SumMasses += (MassInc - MassDec);
 
  890         if ( Ptmp.pz() <= 0. )                                
 
  899         G4double YtargetNucleus=Ptmp.rapidity();
 
  913         G4int    NumberOfTries(0);
 
  915         G4bool OuterSuccess(
true);
 
  925             if(NumberOfTries == 100*(NumberOfTries/100))   
 
  929               AveragePt2 *=ScaleFactor;
 
  944          for(
G4int i=0; i < NumberOfInvolvedNucleon; i++ )
 
  946                G4Nucleon * aNucleon = TheInvolvedNucleon[i];
 
  962              G4double DeltaX = (PtSum.x()-PnuclearResidual.x())/NumberOfInvolvedNucleon;
 
  963              G4double DeltaY = (PtSum.y()-PnuclearResidual.y())/NumberOfInvolvedNucleon;
 
  966              if(ResidualMassNumber == 0)
 
  968               DeltaXminus = (XminusSum-1.)/NumberOfInvolvedNucleon;
 
  978          for(
G4int i=0; i < NumberOfInvolvedNucleon; i++ )
 
  980                G4Nucleon * aNucleon = TheInvolvedNucleon[i];
 
  985                if(ResidualMassNumber == 0)               
 
  987                 if((Xminus <= 0.)   || (Xminus > 1.))    {InerSuccess=
false; 
break;}
 
  990                 if((Xminus <= 0.)   || (Xminus > 1.) || 
 
  991                    (XminusSum <=0.) || (XminusSum > 1.)) {InerSuccess=
false; 
break;}
 
 1001                             Px*Px + Py*Py)/Xminus;
 
 1014              if(InerSuccess && (ResidualMassNumber != 0))
 
 1016               M2target +=(
sqr(ResidualMass) + PnuclearResidual.perp2())/XminusSum; 
 
 1020             } 
while(!InerSuccess);
 
 1021           } 
while (SqrtS < Mprojectile + std::sqrt(M2target));
 
 1023           G4double DecayMomentum2= S*S+M2projectile*M2projectile+M2target*M2target
 
 1024                                     -2.*S*M2projectile - 2.*S*M2target 
 
 1025                                          -2.*M2projectile*M2target;
 
 1027           WminusTarget=(S-M2projectile+M2target+std::sqrt(DecayMomentum2))/2./SqrtS;
 
 1028           WplusProjectile=SqrtS - M2target/WminusTarget;
 
 1030           G4double Pzprojectile=WplusProjectile/2. - M2projectile/2./WplusProjectile;
 
 1031           G4double Eprojectile =WplusProjectile/2. + M2projectile/2./WplusProjectile;
 
 1032           G4double Yprojectile=0.5*std::log((Eprojectile+Pzprojectile)/
 
 1033                                             (Eprojectile-Pzprojectile));            
 
 1043       for(
G4int i=0; i < NumberOfInvolvedNucleon; i++ )
 
 1045            G4Nucleon * aNucleon = TheInvolvedNucleon[i];
 
 1063            G4double Pz=-WminusTarget*Xminus/2. + Mt2/(2.*WminusTarget*Xminus);
 
 1064            G4double E = WminusTarget*Xminus/2. + Mt2/(2.*WminusTarget*Xminus);
 
 1065            G4double YtargetNucleon=0.5*std::log((E+Pz)/(E-Pz));   
 
 1070 if((std::abs(YtargetNucleon-YtargetNucleus) > 2) || 
 
 1071             (Yprojectile  < YtargetNucleon))        {OuterSuccess=
false; 
break;} 
 
 1075         } 
while(!OuterSuccess);
 
 1078         G4double Pzprojectile=WplusProjectile/2. - M2projectile/2./WplusProjectile;
 
 1079         G4double Eprojectile =WplusProjectile/2. + M2projectile/2./WplusProjectile;
 
 1080         Pprojectile.setPz(Pzprojectile);  Pprojectile.setE(Eprojectile);
 
 1083         Pprojectile.transform(toLab);       
 
 1090     for(
G4int i=0; i < NumberOfInvolvedNucleon; i++ )
 
 1092            G4Nucleon * aNucleon = TheInvolvedNucleon[i];
 
 1095            Residual3Momentum-=tmp.
vect();
 
 1112            G4double Pz=-WminusTarget*Xminus/2. + Mt2/(2.*WminusTarget*Xminus);
 
 1113            G4double E = WminusTarget*Xminus/2. + Mt2/(2.*WminusTarget*Xminus);
 
 1129                                  sqr(Residual3Momentum.x())+
sqr(Residual3Momentum.y());
 
 1134         if(ResidualMassNumber != 0)
 
 1136          PzResidual=-WminusTarget*Residual3Momentum.z()/2. + 
 
 1137                              Mt2Residual/(2.*WminusTarget*Residual3Momentum.z());
 
 1138          EResidual = WminusTarget*Residual3Momentum.z()/2. + 
 
 1139                              Mt2Residual/(2.*WminusTarget*Residual3Momentum.z());
 
 1142         Residual4Momentum.
setPx(Residual3Momentum.x());
 
 1143         Residual4Momentum.
setPy(Residual3Momentum.y());
 
 1144         Residual4Momentum.
setPz(PzResidual); 
 
 1145         Residual4Momentum.
setE(EResidual);
 
 1156 G4bool G4FTFModel::ExciteParticipants()
 
 1159         G4bool Successfull(
true);  
 
 1162         G4int CurrentInteraction(0);   
 
 1168         if(MaxNumOfInelCollisions > 0)  
 
 1171                                                   MaxNumOfInelCollisions;
 
 1172          if(
G4UniformRand() < ProbMaxNumber) {MaxNumOfInelCollisions++;}
 
 1173          NumberOfInel=MaxNumOfInelCollisions;
 
 1181           MaxNumOfInelCollisions = 1;
 
 1185           MaxNumOfInelCollisions = 1;
 
 1192     while (theParticipants.
Next())
 
 1194            CurrentInteraction++;
 
 1235                                                  theParameters, theElastic))
 
 1288             while (theParticipants.
Next())
 
 1294              if((projectile == NextProjectileNucleon) ||
 
 1295                 (target     == NextTargetNucleon        )) acollision.
SetStatus(0);
 
 1300             for(
G4int I=0; I < CurrentInteraction; I++) theParticipants.
Next();
 
 1309             if(theAnnihilation->
Annihilate(projectile, target, AdditionalString, theParameters))
 
 1311              Successfull = Successfull || 
true;
 
 1316              if(AdditionalString != 0) theAdditionalString.push_back(AdditionalString);
 
 1341 void G4FTFModel::AjustTargetNucleonForAnnihilation(
G4VSplitableHadron *SelectedAntiBaryon,
 
 1350         ResidualExcitationEnergy=0.;
 
 1358         G4double ExcitationEnergyPerWoundedNucleon=
 
 1363         G4int NumberOfHoles(0);
 
 1367          G4int CurrentStatus=0;
 
 1376            else {CurrentStatus=1;}
 
 1380          if(CurrentStatus != 0)
 
 1384           ResidualExcitationEnergy+=ExcitationEnergyPerWoundedNucleon;
 
 1386           ResidualMassNumber--;
 
 1404         toCms.
rotateY(-1*Ptmp.theta());
 
 1413         if(ResidualMassNumber != 0) 
 
 1416                                                    ResidualCharge,ResidualMassNumber);
 
 1421         if(ResidualMass > SqrtS) {
return;}
 
 1424          if(ResidualMass+ResidualExcitationEnergy > SqrtS)
 
 1425            ResidualExcitationEnergy = SqrtS-ResidualMass;
 
 1428         ResidualMass+=ResidualExcitationEnergy;
 
 1436         if(ResidualMass + ParticipantMass > SqrtS) ParticipantMass=SqrtS-ResidualMass;
 
 1442                       sqr(S)+
sqr(ParticipantMass2)+ 
sqr(ResidualMass2) -
 
 1443                           2.*S*ParticipantMass2 - 2.*S*ResidualMass2 
 
 1444                               -2.*ParticipantMass2*ResidualMass2;
 
 1446         if(DecayMomentum2 < 0.) 
return;
 
 1448         DecayMomentum2/=(4.*S);
 
 1449         G4double DecayMomentum = std::sqrt(DecayMomentum2);
 
 1453                                 std::sqrt(DecayMomentum2+ParticipantMass2));
 
 1456                                 std::sqrt(DecayMomentum2+ResidualMass2));
 
 1461         New_Pparticipants.transform(toLab);
 
 1462         New_PnuclearResidual.transform(toLab);
 
 1466         G4LorentzVector DeltaP_participants=(Pparticipants - New_Pparticipants)/2.;
 
 1467         G4LorentzVector DeltaP_nuclearResidual=(PnuclearResidual - New_PnuclearResidual)/
 
 1471         Ptmp=SelectedAntiBaryon->
Get4Momentum() - DeltaP_participants;
 
 1474         Ptmp=SelectedTargetNucleon->
Get4Momentum() - DeltaP_participants;
 
 1480         G4double DeltaExcitationEnergy = 0.0;
 
 1481         if ( NumberOfHoles != 0 ) {
 
 1482           DeltaExcitationEnergy = ResidualExcitationEnergy / ((
G4double) NumberOfHoles);
 
 1489          G4int CurrentStatus=0;
 
 1498            else {CurrentStatus=1;}
 
 1502          if(CurrentStatus != 0)
 
 1509           Ptmp=aNucleon->
Get4Momentum() - DeltaP_nuclearResidual;
 
 1527     std::vector<G4VSplitableHadron *> primaries;
 
 1534     while ( theParticipants.
Next() ) 
 
 1540         if ( primaries.end() == std::find(primaries.begin(), primaries.end(),
 
 1547     for (
unsigned int ahadron=0; ahadron < primaries.size() ; ahadron++)
 
 1551             if(primaries[ahadron]->GetStatus() <= 1) {isProjectile=
true; } 
 
 1554             FirstString=0; SecondString=0;
 
 1555             theExcitation->
CreateStrings(primaries[ahadron], isProjectile,
 
 1556                                          FirstString, SecondString,
 
 1559         if(FirstString  != 0) strings->push_back(FirstString);
 
 1560             if(SecondString != 0) strings->push_back(SecondString);
 
 1570         if(ProjectileNucleus)
 
 1575          while ( (ProjectileNucleon=ProjectileNucleus->
GetNextNucleon()) )
 
 1582            ProjectileNucleon->
Hit(0);
 
 1584        G4bool isProjectile=
true;
 
 1585            FirstString=0; SecondString=0;
 
 1588                                         FirstString, SecondString,
 
 1590            if(FirstString  != 0) strings->push_back(FirstString);
 
 1591            if(SecondString != 0) strings->push_back(SecondString);
 
 1593            delete  ProjectileSplitable;     
 
 1599         if(theAdditionalString.size() != 0)
 
 1601      for (
unsigned int  ahadron=0; ahadron < theAdditionalString.size() ; ahadron++)
 
 1605             if(theAdditionalString[ahadron]->GetStatus() <= 1) {isProjectile=
true; } 
 
 1608             FirstString=0; SecondString=0;
 
 1609             theExcitation->
CreateStrings(theAdditionalString[ahadron], isProjectile,
 
 1610                                          FirstString, SecondString,
 
 1613         if(FirstString  != 0) strings->push_back(FirstString);
 
 1614             if(SecondString != 0) strings->push_back(SecondString);
 
 1623     for (
G4int ahadron=0; ahadron < NumberOfInvolvedNucleon ; ahadron++)
 
 1626             if(TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetStatus() ==4)
 
 1631              TheInvolvedNucleon[ahadron]->
Hit(aHit);
 
 1633             else if((TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetStatus() <=1)  && 
 
 1634             (TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetSoftCollisionCount() ==0))
 
 1640              TheInvolvedNucleon[ahadron]->
Hit(aHit);
 
 1642             else if((TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetStatus() <=1)  && 
 
 1643             (TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetSoftCollisionCount() !=0))
 
 1646          G4bool isProjectile=
false;
 
 1647              FirstString=0; SecondString=0;
 
 1649                             TheInvolvedNucleon[ahadron]->GetSplitableHadron(),
 
 1651                                           FirstString, SecondString,
 
 1653          if(FirstString  != 0) strings->push_back(FirstString);
 
 1654              if(SecondString != 0) strings->push_back(SecondString);
 
 1656             else if(TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetStatus() ==2)
 
 1659          G4bool isProjectile=
false;
 
 1660              FirstString=0; SecondString=0;
 
 1662                             TheInvolvedNucleon[ahadron]->GetSplitableHadron(),
 
 1664                                           FirstString, SecondString,
 
 1666          if(FirstString  != 0) strings->push_back(FirstString);
 
 1667              if(SecondString != 0) strings->push_back(SecondString);
 
 1670             else if(TheInvolvedNucleon[ahadron]->GetSplitableHadron()->GetStatus() ==3)
 
 1710 void G4FTFModel::GetResidualNucleus()
 
 1712         G4double DeltaExcitationE=ResidualExcitationEnergy/
 
 1713                                   (
G4double) NumberOfInvolvedNucleon;
 
 1715                                   (
G4double) NumberOfInvolvedNucleon;
 
 1717     for(
G4int i=0; i < NumberOfInvolvedNucleon; i++ )
 
 1719          G4Nucleon * aNucleon = TheInvolvedNucleon[i];
 
 1733         if(AveragePt2 <= 0.) {Pt2=0.;}
 
 1737                 (std::exp(-maxPtSquare/AveragePt2)-1.)); 
 
 1742     return G4ThreeVector (Pt*std::cos(phi), Pt*std::sin(phi), 0.);    
 
 1747     desc << 
"please add description here" << 
G4endl;